pub struct InternalClient {
pub(crate) user_id: OnceLock<Uuid>,
pub(crate) tokens: RwLock<Tokens>,
pub(crate) login_method: RwLock<Option<Arc<LoginMethod>>>,
pub(super) flags: RwLock<Flags>,
pub(crate) external_client: Client,
pub(super) key_store: KeyStore<KeyIds>,
pub(crate) security_state: RwLock<Option<SecurityState>>,
pub(crate) repository_map: StateRegistry,
/* private fields */
}
Fields§
§user_id: OnceLock<Uuid>
§tokens: RwLock<Tokens>
§login_method: RwLock<Option<Arc<LoginMethod>>>
§flags: RwLock<Flags>
§external_client: Client
Reqwest client useable for external integrations like email forwarders, HIBP.
key_store: KeyStore<KeyIds>
§security_state: RwLock<Option<SecurityState>>
§repository_map: StateRegistry
Implementations§
Source§impl InternalClient
impl InternalClient
pub fn load_flags(&self, flags: HashMap<String, bool>)
pub fn get_flags(&self) -> Flags
pub(crate) fn get_login_method(&self) -> Option<Arc<LoginMethod>>
pub fn get_access_token_organization(&self) -> Option<Uuid>
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, )
Sourcepub(crate) fn set_api_tokens_internal(&self, token: String)
pub(crate) fn set_api_tokens_internal(&self, token: String)
Sets api tokens for only internal API clients, use set_tokens
for SdkManagedTokens.
pub fn get_kdf(&self) -> Result<Kdf, NotAuthenticatedError>
pub async fn get_api_configurations(&self) -> Arc<ApiConfigurations>
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: Uuid) -> Result<(), UserIdAlreadySetError>
pub fn get_user_id(&self) -> Option<Uuid>
pub(crate) fn initialize_user_crypto_master_key( &self, master_key: MasterKey, user_key: EncString, key_state: UserKeyState, ) -> Result<(), EncryptionSettingsError>
pub(crate) fn initialize_user_crypto_decrypted_key( &self, user_key: SymmetricCryptoKey, key_state: UserKeyState, ) -> Result<(), EncryptionSettingsError>
pub(crate) fn initialize_user_crypto_pin( &self, pin_key: PinKey, pin_protected_user_key: EncString, key_state: UserKeyState, ) -> Result<(), EncryptionSettingsError>
pub(crate) fn initialize_crypto_single_org_key( &self, organization_id: Uuid, key: SymmetricCryptoKey, )
pub fn initialize_org_crypto( &self, org_keys: Vec<(Uuid, UnsignedSharedKey)>, ) -> Result<(), EncryptionSettingsError>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for InternalClient
impl !RefUnwindSafe for InternalClient
impl Send for InternalClient
impl Sync for InternalClient
impl Unpin for InternalClient
impl !UnwindSafe for InternalClient
Blanket Implementations§
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