bitwarden_auth/login/api/response/
trusted_device_user_decryption_option_api_response.rs

1use bitwarden_crypto::{EncString, UnsignedSharedKey};
2use serde::{Deserialize, Serialize};
3
4/// Trusted Device User Decryption Option API response.
5/// Contains settings and encrypted keys for trusted device decryption.
6#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7pub(crate) struct TrustedDeviceUserDecryptionOptionApiResponse {
8    /// Whether the user has admin approval for device login.
9    #[serde(rename = "HasAdminApproval")]
10    pub has_admin_approval: bool,
11
12    /// Whether the user has a device that can approve logins.
13    #[serde(rename = "HasLoginApprovingDevice")]
14    pub has_login_approving_device: bool,
15
16    /// Whether the user has permission to manage password reset for other users.
17    #[serde(rename = "HasManageResetPasswordPermission")]
18    pub has_manage_reset_password_permission: bool,
19
20    /// Whether the user is in TDE offboarding.
21    #[serde(rename = "IsTdeOffboarding")]
22    pub is_tde_offboarding: bool,
23
24    /// The device key encrypted device private key. Only present if the device is trusted.
25    #[serde(
26        rename = "EncryptedPrivateKey",
27        skip_serializing_if = "Option::is_none"
28    )]
29    pub encrypted_private_key: Option<EncString>,
30
31    /// The device private key encrypted user key. Only present if the device is trusted.
32    #[serde(rename = "EncryptedUserKey", skip_serializing_if = "Option::is_none")]
33    pub encrypted_user_key: Option<UnsignedSharedKey>,
34}