pub struct InviteCode {
pub store: StoreId,
pub name: String,
pub inviter: String,
pub kind: InviteKind,
pub expires_at: u64,
pub invite: InviteId,
pub member: MemberId,
pub secret: InviteSecret,
pub initial_key: KeyId,
pub inviting_writer: DeviceId,
pub read_through: u64,
pub storage: SecretBytes,
}Expand description
A one-time invitation; the secret permits a join request, not store access.
Fields§
§store: StoreIdThe store’s id.
name: StringThe store’s display name.
inviter: StringThe inviting admin’s name, as their app gave it when it made the invite: the joining device can’t read who is who until it is let in.
kind: InviteKindWhether the invite adds a new person or recovers a member.
expires_at: u64When the invite ends, in seconds since the Unix epoch by the inviting device’s clock: a joining device sends no first request after it.
invite: InviteIdThe invite named by the join request.
member: MemberIdThe member id the admin fixed: fresh for an addition, or an existing active id for a re-binding. The signed request must repeat it (D13).
secret: InviteSecretCrypto owns the one-time secret and its erasure.
initial_key: KeyIdThe store key introduced by the creation entry, even after rotations.
inviting_writer: DeviceIdThe device whose claimed approval supplies binding evidence.
read_through: u64The inviting device’s last applied slot.
storage: SecretBytesStorage settings, including any credentials for the recipient.
Implementations§
Source§impl InviteCode
impl InviteCode
Sourcepub const TEXT_PREFIX: &'static str = "CVI1-"
pub const TEXT_PREFIX: &'static str = "CVI1-"
How an invite code’s text starts: its kind and version.
Sourcepub fn request_path(&self) -> ObjectPath
pub fn request_path(&self) -> ObjectPath
Where the joining device’s request goes: under the device that made the invite, as this code names it (§13.2).
Sourcepub fn to_bytes(&self) -> Result<Zeroizing<Vec<u8>>, Error>
pub fn to_bytes(&self) -> Result<Zeroizing<Vec<u8>>, Error>
Encode a bounded frame into a buffer erased on drop, allocated once.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
Decode a borrowed frame; every owned secret buffer erases on drop.