pub struct InternalClient {
pub(crate) user_id: OnceLock<UserId>,
pub(crate) token_handler: Arc<dyn TokenHandler>,
pub(crate) login_method: Arc<RwLock<Option<Arc<LoginMethod>>>>,
pub(super) flags: RwLock<Flags>,
pub(super) api_configurations: Arc<ApiConfigurations>,
pub(crate) external_http_client: Client,
pub(super) key_store: KeyStore<KeyIds>,
pub(crate) security_state: RwLock<Option<SecurityState>>,
pub(crate) repository_map: StateRegistry,
}Fields§
§user_id: OnceLock<UserId>§token_handler: Arc<dyn TokenHandler>§login_method: Arc<RwLock<Option<Arc<LoginMethod>>>>§flags: RwLock<Flags>§api_configurations: Arc<ApiConfigurations>§external_http_client: ClientReqwest client useable for external integrations like email forwarders, HIBP.
key_store: KeyStore<KeyIds>§security_state: RwLock<Option<SecurityState>>§repository_map: StateRegistryImplementations§
Source§impl InternalClient
impl InternalClient
Sourcepub fn load_flags(&self, flags: HashMap<String, bool>)
pub fn load_flags(&self, flags: HashMap<String, bool>)
Load feature flags. This is intentionally a collection and not the internal Flag enum as
we want to avoid changes in feature flags from being a breaking change.
pub(crate) fn get_login_method(&self) -> Option<Arc<LoginMethod>>
pub(crate) fn set_login_method(&self, login_method: LoginMethod)
pub(crate) fn set_tokens( &self, token: String, refresh_token: Option<String>, expires_in: u64, )
pub fn get_kdf(&self) -> Result<Kdf, NotAuthenticatedError>
pub fn get_key_connector_client(&self, key_connector_url: String) -> ApiClient
Sourcepub fn get_api_configurations(&self) -> Arc<ApiConfigurations>
pub fn get_api_configurations(&self) -> Arc<ApiConfigurations>
Get the ApiConfigurations containing API clients and configurations for making requests to
the Bitwarden services.
pub fn get_http_client(&self) -> &Client
pub fn get_key_store(&self) -> &KeyStore<KeyIds>
Sourcepub fn get_security_version(&self) -> u64
pub fn get_security_version(&self) -> u64
Returns the security version of the user.
1 is returned for V1 users that do not have a signed security state.
2 or greater is returned for V2 users that have a signed security state.
pub fn init_user_id(&self, user_id: UserId) -> Result<(), UserIdAlreadySetError>
pub fn get_user_id(&self) -> Option<UserId>
pub(crate) fn initialize_user_crypto_key_connector_key( &self, master_key: MasterKey, user_key: EncString, account_crypto_state: WrappedAccountCryptographicState, upgrade_token: &Option<V2UpgradeToken>, ) -> Result<(), EncryptionSettingsError>
pub(crate) fn initialize_user_crypto_decrypted_key( &self, user_key: SymmetricCryptoKey, account_crypto_state: WrappedAccountCryptographicState, upgrade_token: &Option<V2UpgradeToken>, ) -> Result<(), EncryptionSettingsError>
pub(crate) fn initialize_user_crypto_pin( &self, pin_key: PinKey, pin_protected_user_key: EncString, account_crypto_state: WrappedAccountCryptographicState, upgrade_token: &Option<V2UpgradeToken>, ) -> Result<(), EncryptionSettingsError>
pub(crate) fn initialize_user_crypto_pin_envelope( &self, pin: String, pin_protected_user_key_envelope: PasswordProtectedKeyEnvelope, account_crypto_state: WrappedAccountCryptographicState, upgrade_token: &Option<V2UpgradeToken>, ) -> Result<(), EncryptionSettingsError>
pub(crate) fn initialize_crypto_single_org_key( &self, organization_id: OrganizationId, key: SymmetricCryptoKey, )
pub fn initialize_org_crypto( &self, org_keys: Vec<(OrganizationId, UnsignedSharedKey)>, ) -> Result<(), EncryptionSettingsError>
pub(crate) fn initialize_user_crypto_master_password_unlock( &self, password: String, master_password_unlock: MasterPasswordUnlockData, account_crypto_state: WrappedAccountCryptographicState, upgrade_token: &Option<V2UpgradeToken>, ) -> Result<(), EncryptionSettingsError>
Sourcepub fn set_user_master_password_unlock(
&self,
master_password_unlock: MasterPasswordUnlockData,
) -> Result<(), NotAuthenticatedError>
pub fn set_user_master_password_unlock( &self, master_password_unlock: MasterPasswordUnlockData, ) -> Result<(), NotAuthenticatedError>
Sets the local KDF state for the master password unlock login method. Salt and user key update is not supported yet.
Auto Trait Implementations§
impl !Freeze for InternalClient
impl !RefUnwindSafe for InternalClient
impl Send for InternalClient
impl Sync for InternalClient
impl Unpin for InternalClient
impl UnsafeUnpin for InternalClient
impl !UnwindSafe for InternalClient
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<> Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more