-
Notifications
You must be signed in to change notification settings - Fork 16
Add bitwarden-encoding crate with b64 and b64url types #404
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
Conversation
Great job! No new security vulnerabilities introduced in this pull request |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #404 +/- ##
==========================================
+ Coverage 75.88% 76.10% +0.21%
==========================================
Files 259 264 +5
Lines 23732 24045 +313
==========================================
+ Hits 18010 18299 +289
- Misses 5722 5746 +24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Daniel García <[email protected]>
|
||
uniffi::custom_type!(B64, String, { | ||
try_lift: |val| { | ||
B64::try_from(val.as_str()).map_err(|e: NotB64Encoded| e.into()) |
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.
Note that these conversions currently crash the ios app when they fail until #373 is fixed
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.
Nice very handy
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.
@quexten We previously discussed extracting this to a lower level crate, which is done now and we should be able to update crypto to depend on this implementation.
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.
Nice! I've made a ticket for now in the bitwarden-crypto
backlog https://bitwarden.atlassian.net/browse/PM-25107
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.
I added the change to this PR, seemed easier.
|
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.
LGTM, should we now consider this crate the way to go, and migrate all uses of the base64
and data-encoding
crates to it?
I think so. |
🎟️ Tracking
📔 Objective
Provides a generic B64 and B64Url types we can use throughout the sdk.
⏰ Reminders before review
team
🦮 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 confirmedissue 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