-
Notifications
You must be signed in to change notification settings - Fork 89
[PM-26177] feat: Add base64url Data extensions #2294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Great job! No new security vulnerabilities introduced in this pull request |
|
I need help on this one; this worked in a previous branch, but now the tests won't recognize the extension I created. |
|
Claude finished @iinuwa's task in 3m 6s —— View job Code Review SummaryPR: PM-26177 Add base64url Data extensions Status: Approved - No issues found OverviewThis PR adds Analysis
DetailsImplementation approach:
Regarding the test recognition issue mentioned in PR comments: Reviewed by Claude Code |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2294 +/- ##
==========================================
- Coverage 86.04% 84.77% -1.28%
==========================================
Files 1772 2016 +244
Lines 154058 170099 +16041
==========================================
+ Hits 132566 144196 +11630
- Misses 21492 25903 +4411 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| /// - base64urlEncoded: A base64url-encoded string. | ||
| /// | ||
| init?(base64urlEncoded str: String) throws { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛏️ To match our existing conventions, we should uppercase URL when it's in the middle or end of a variable/function. Applies to the rest of the PR as well.
ios/BitwardenShared/Core/Platform/Services/EnvironmentService.swift
Lines 98 to 99 in 3bc8f51
| var apiURL: URL { | |
| environmentURLs.apiURL |
| /// - base64urlEncoded: A base64url-encoded string. | |
| /// | |
| init?(base64urlEncoded str: String) throws { | |
| /// - base64URLEncoded: A base64URL-encoded string. | |
| /// | |
| init?(base64URLEncoded str: String) throws { |
| // .ignoreUnknownCharacters allows unpadded strings as a side effect. | ||
| try self.init(base64Encoded: str.urlDecoded(), options: .ignoreUnknownCharacters) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 This comment is good context to have.
❓ I assumed that the test test_fromBase64urlString_unpadded() would fail without this ignoreUnknownCharacters option though. Is that not the case? I'm wondering if the comment is accurate or if there's a better example we could use in the tests for why this option is needed?

🎟️ Tracking
PM-26177
📔 Objective
Adds extensions to the Data object for handling base64url, which is used extensively throughout WebAuthn.
⏰ Reminders before review
🦮 Reviewer guidelines
:+1:) or similar for great changes:memo:) or ℹ️ (:information_source:) for notes or general info:question:) for questions:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:) for suggestions / improvements:x:) or:warning:) for more significant problems or concerns needing attention:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt:pick:) for minor or nitpick changes