bitwarden_core/auth/
mod.rs1use thiserror::Error;
6
7use crate::{NotAuthenticatedError, VaultLockedError, WrongPasswordError};
8
9mod access_token;
10pub(super) mod api;
11pub mod auth_client;
12mod jwt_token;
13pub mod login;
14#[cfg(feature = "internal")]
15pub mod password;
16#[cfg(feature = "internal")]
17pub mod pin;
18pub mod renew;
19pub use access_token::{AccessToken, AccessTokenInvalidError};
20pub use jwt_token::*;
21
22#[cfg(feature = "internal")]
23mod auth_request;
24#[cfg(feature = "internal")]
25pub(crate) use auth_request::{auth_request_decrypt_master_key, auth_request_decrypt_user_key};
26#[cfg(feature = "internal")]
27pub use auth_request::{ApproveAuthRequestError, AuthRequestResponse};
28
29#[cfg(feature = "internal")]
30mod register;
31#[cfg(feature = "internal")]
32pub use register::{RegisterError, RegisterKeyResponse, RegisterRequest};
33
34#[cfg(feature = "internal")]
35mod tde;
36#[cfg(feature = "internal")]
37pub use tde::RegisterTdeKeyResponse;
38#[cfg(feature = "internal")]
39mod key_connector;
40#[cfg(feature = "internal")]
41pub use key_connector::KeyConnectorResponse;
42
43#[allow(missing_docs)]
45#[derive(Debug, Error)]
46pub enum AuthValidateError {
47 #[error(transparent)]
48 NotAuthenticated(#[from] NotAuthenticatedError),
49 #[error(transparent)]
50 WrongPassword(#[from] WrongPasswordError),
51 #[error(transparent)]
52 VaultLocked(#[from] VaultLockedError),
53 #[error("wrong user key")]
54 WrongUserKey,
55 #[error(transparent)]
56 Crypto(#[from] bitwarden_crypto::CryptoError),
57}