Skip to main content

bitwarden_access_token_crypto/
error.rs

1use bitwarden_crypto::CryptoError;
2use thiserror::Error;
3
4/// Errors from minting or opening an access token's key material.
5#[derive(Debug, Error)]
6pub enum AccessTokenError {
7    /// The encrypted payload could not be decoded or decrypted.
8    #[error("payload is invalid")]
9    InvalidPayload,
10    /// The decrypted payload did not contain a valid organization key.
11    #[error("payload does not contain a valid encryption key")]
12    InvalidOrgKey,
13    /// A cryptographic operation failed.
14    #[error(transparent)]
15    Crypto(#[from] CryptoError),
16}