Skip to content

Conversation

@mzieniukbw
Copy link
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-27231

📔 Objective

Account registration V2 for key connector.
Added KeyConnectorKey, since we have to migrate from MasterKey for key connector at some point.
Added Key Connector API client, can set the key connector key for the user into the Key Connector server.

Requires autogenerated openapi models from bitwarden/server#6712. For the build sake process, included in the PR, will resolve once in SDK.

Partially based on the approach in #596 for consistency across all V2 account registrations.

Test coverage coming up soon.

🚨 Breaking Changes

No changes to account registration V1.

⏰ 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

  • 👍 (:+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

@github-actions
Copy link
Contributor

github-actions bot commented Dec 12, 2025

Logo
Checkmarx One – Scan Summary & Details295aebbe-5c31-4ce1-9b06-1bf8629e6d16

Great job! No new security vulnerabilities introduced in this pull request

…ector

# Conflicts:
#	crates/bitwarden-core/src/key_management/crypto_client.rs
#	crates/bitwarden-crypto/src/keys/mod.rs
@github-actions
Copy link
Contributor

github-actions bot commented Dec 12, 2025

🔍 SDK Breaking Change Detection Results

SDK Version: km/pm-27231-account-registration-v2-key-connector (a7dc33a)
Completed: 2025-12-12 17:34:38 UTC
Total Time: 244s

Client Status Details
typescript ✅ No breaking changes detected TypeScript compilation passed with new SDK version - View Details

Breaking change detection completed. View SDK workflow

@codecov
Copy link

codecov bot commented Dec 12, 2025

Codecov Report

❌ Patch coverage is 0% with 110 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.28%. Comparing base (bd636a4) to head (a7dc33a).

Files with missing lines Patch % Lines
crates/bitwarden-auth/src/registration.rs 0.00% 48 Missing ⚠️
...bitwarden-core/src/key_management/crypto_client.rs 0.00% 41 Missing ⚠️
...tes/bitwarden-crypto/src/keys/key_connector_key.rs 0.00% 16 Missing ⚠️
...bitwarden-core/src/key_management/key_connector.rs 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #611      +/-   ##
==========================================
- Coverage   78.57%   78.28%   -0.29%     
==========================================
  Files         283      285       +2     
  Lines       29188    29298     +110     
==========================================
+ Hits        22934    22937       +3     
- Misses       6254     6361     +107     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.


/// Initializes a new cryptographic state for a user and posts it to the server; enrolls the
/// user to key connector unlock.
pub async fn post_keys_for_key_connector_registration(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relaying feedback I got on my PR here, we probably want unit tests on this. Vault has some examples for this, but it generally involves moving the impl into a separate function that you pass in the "api client" dependency and other parameters to, then the test can replace that with a mocked api client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants