bitwarden_auth/registration/open_org_invite_crypto/data_v1.rs
1//! Version 1 of the open-org-invite plaintext payload — the innermost thing sealed by the
2//! [`bitwarden_crypto::safe::DataEnvelope`]. Not to be confused with the sealed opaque blob
3//! ([`super::SealedOpenOrgInviteData`]) or the outbound JSON ([`super::SealedOpenOrgInvite`]);
4//! this file describes only the cleartext shape that gets CBOR-encoded and encrypted.
5//!
6//! Once this shape ships it cannot be broken: any field change means adding a new `V2` struct
7//! and registering both variants on the versioned enum in [`super`], so old sealed payloads
8//! still unseal.
9
10use bitwarden_crypto::safe::SealableData;
11use serde::{Deserialize, Serialize};
12
13#[derive(Serialize, Deserialize, Debug, PartialEq)]
14#[serde(rename_all = "camelCase")]
15pub(super) struct RegistrationOpenOrgInviteDataV1 {
16 pub(super) organization_id: String,
17 pub(super) invite_link_code: String,
18 pub(super) invite_secret: String,
19}
20
21impl SealableData for RegistrationOpenOrgInviteDataV1 {}