Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/bitwarden-organization-invite-link/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ bitwarden-encoding = { workspace = true }
bitwarden-error = { workspace = true }
bitwarden-organization-crypto = { workspace = true }
chrono = { workspace = true }
http = { workspace = true }
serde = { workspace = true }
thiserror = { workspace = true }
tsify = { workspace = true, optional = true }
Expand Down
34 changes: 34 additions & 0 deletions crates/bitwarden-organization-invite-link/src/error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
use bitwarden_core::{ApiError, MissingFieldError};
use bitwarden_crypto::CryptoError;
use bitwarden_error::bitwarden_error;
use bitwarden_organization_crypto::invite::InviteKeyBundleError;
use thiserror::Error;

/// Errors returned from invite link client operations.
#[bitwarden_error(flat)]
#[derive(Debug, Error)]
pub enum InviteLinkError {
/// A cryptographic invite operation (creating, unsealing, or recovering the invite) failed.
#[error(transparent)]
Invite(#[from] InviteKeyBundleError),
/// A network request to the server failed.
#[error(transparent)]
Api(#[from] ApiError),
/// A low-level cryptographic operation (key wrapping, encapsulation, or public-key parsing)
/// failed.
#[error(transparent)]
Crypto(#[from] CryptoError),
/// A required field was missing from a server response.
#[error(transparent)]
MissingField(#[from] MissingFieldError),
/// A value was present but malformed and could not be parsed.
#[error("Failed to parse `{0}`")]
ParseFailure(&'static str),
/// The account-recovery public key returned by the server does not match the organization
/// public key bound into the invite.
#[error("Account recovery public key does not match the invite's bound organization key")]
RecoveryKeyMismatch,
/// No allowed domains were specified.
#[error("At least one allowed domain is required.")]
NoAllowedDomains,
}
Loading
Loading