-
Notifications
You must be signed in to change notification settings - Fork 23
Km/data envelope follow up #523
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
Km/data envelope follow up #523
Conversation
# Conflicts: # crates/bitwarden-crypto/src/store/context.rs # crates/bitwarden-crypto/src/traits/key_id.rs
# Conflicts: # crates/bitwarden-crypto/src/store/context.rs # crates/bitwarden-vault/src/cipher/attachment.rs # crates/bitwarden-wasm-internal/src/pure_crypto.rs
# Conflicts: # crates/bitwarden-core/src/key_management/crypto.rs # crates/bitwarden-crypto/src/store/context.rs # crates/bitwarden-vault/src/cipher/cipher.rs # crates/bitwarden-wasm-internal/src/pure_crypto.rs
# Conflicts: # crates/bitwarden-crypto/src/safe/password_protected_key_envelope.rs
## 🎟️ Tracking https://bitwarden.atlassian.net/browse/PM-22591 ## 📔 Objective Currently, all app crates (wasm, uniffi) need to declare all the client managed repositories that they allow clients to implement. This means that all the crates need to be updated when adding more repositories, which adds more steps to implementations and can lead to things being out of sync. This PR unifies the declaration of client managed repositories so that there's only one place where they are defined. While I was at it, I've changed slightly the way we register the repositories. Rather than provide one function for each (`register_cipher_repository`/`register_folder_repository`) I provide a single function that takes an object that contains all the repos. This is easier to generate and should make it easier to know if any of the repos are missing (you should get a compile error). I left the previous ones for backwards-compat Sadly both wasm and uniffi have a lot of compile time type shenanigans and macros which don't make this easy, so this solution contains multiple parts: - In `bitwarden_wasm` and `bitwarden_uniffi` we already have a macro that creates the repository implementations based on a type. This has been expanded to take multiple types and also create the `Repositories` struct which is just a grouping of all of them. Now, instead of manually calling these macros manually for each type, they instead get passed to the `bitwarden_pm::create_client_managed_repositories!` macro. - The `bitwarden_pm::create_client_managed_repositories!` macro's only purpose is to call the passed macro repeatedly with all the types that need to be created. This is the only way I found to lazily define the types in `bitwarden-pm` so that they would be usable in macros in the other crates. The definition is fairly repetitive with the types, because we don't have easy ways to change the case of identifiers or merge them together. We could use the `paste` crate to avoid the repetition but didn't seem worth it at the moment Note that in the past we placed the sdk-managed definitions in a shared `bitwarden-state-migrations` crate, but now that we have the new `bitwarden-pm` crate as a shared crate focused on password manager functionality I don't think `bitwarden-state-migrations` is needed. Instead this PR moves the sdk-managed definitions to `bitwarden-pm` (next to the new client managed repositories macro) and deletes the `bitwarden-state-migrations` crate. ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+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
## 🎟️ Tracking <!-- Paste the link to the Jira or GitHub issue or otherwise describe / point to where this change is coming from. --> ## 📔 Objective Accidentally renamed the artifact causing npm publishing to break ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+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
## 🎟️ Tracking <!-- Paste the link to the Jira or GitHub issue or otherwise describe / point to where this change is coming from. --> ## 📔 Objective Updates the CODEOWNERS replace platform and architecture with @bitwarden/team-sdk-sme as the co-owner of @bitwarden/team-key-management-dev's code. Further, this moves the KM code in core, and PureCrypto into KM co-ownership. ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+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
Updates the API bindings to `d2577f670e1cf9ca32791135d2197cff1fe12096` --------- Co-authored-by: bw-ghapp[bot] <178206702+bw-ghapp[bot]@users.noreply.github.com> Co-authored-by: Daniel García <dani-garcia@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
## 🎟️ Tracking <!-- Paste the link to the Jira or GitHub issue or otherwise describe / point to where this change is coming from. --> ## 📔 Objective Publish a commercial version of the SDK to NPM ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+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
## 🎟️ Tracking <!-- Paste the link to the Jira or GitHub issue or otherwise describe / point to where this change is coming from. --> ## 📔 Objective <!-- Describe what the purpose of this PR is, for example what bug you're fixing or new feature you're adding. --> ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+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
|
Claude finished @quexten's task —— View job Code Review CompleteI've completed a comprehensive review of this PR. Here are my findings: Summary of ChangesThis PR makes significant improvements to the crypto key management system:
Critical Issues
|
|
Great job! No new security vulnerabilities introduced in this pull request |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## km/beeep/safe-data-envelope #523 +/- ##
===============================================================
- Coverage 78.10% 78.00% -0.11%
===============================================================
Files 289 289
Lines 28202 28162 -40
===============================================================
- Hits 22028 21967 -61
- Misses 6174 6195 +21 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|

🎟️ Tracking
📔 Objective
Note: Diff will look weird until #274 is merged.
⏰ 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