Skip to content

Commit a40ca8b

Browse files
PM-40520 - Move seal/unseal logic onto SealedOpenOrgInviteData
Per PR review, RegistrationClient methods were orchestrating the crypto and constructing the sealed struct field-by-field, breaking encapsulation of the domain type. Crypto now lives on SealedOpenOrgInviteData::seal / ::unseal; the client methods are thin FFI wrappers. Also splits the module by concern: - open_org_invite.rs — domain types + crypto impls + round-trip tests - serialization.rs — wire encoding + WASM ABI + wire/parse tests - client.rs — FFI pair struct + thin RegistrationClient wrappers SealedOpenOrgInviteData's envelope fields tightened from pub to pub(super) since the client no longer needs field access. Folder renamed to open_org_invite_crypto to satisfy clippy's module_inception check. Wire format unchanged (pinned integration-test vector still passes). Public API surface unchanged.
1 parent e7a936f commit a40ca8b

8 files changed

Lines changed: 499 additions & 536 deletions

File tree

crates/bitwarden-auth/src/registration/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
//! mechanisms to establish their cryptographic state and register with
44
//! the Bitwarden server
55
6-
mod open_org_invite;
6+
mod open_org_invite_crypto;
77
mod post_keys_for_jit_password_registration;
88
mod post_keys_for_key_connector_registration;
99
mod post_keys_for_tde_registration;
1010
mod post_keys_for_user_password_registration;
1111
mod registration_client;
1212

13-
pub use open_org_invite::{
13+
pub use open_org_invite_crypto::{
1414
OpenOrgInvite, SealedOpenOrgInvite, SealedOpenOrgInviteData, SealedOpenOrgInviteDataError,
1515
};
1616
pub use post_keys_for_jit_password_registration::{

crates/bitwarden-auth/src/registration/open_org_invite/seal.rs

Lines changed: 0 additions & 336 deletions
This file was deleted.

0 commit comments

Comments
 (0)