pub struct InternalClient {
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) encryption_settings: RwLock<Option<Arc<EncryptionSettings>>>,
/* private fields */
}
Fields§
§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.
encryption_settings: RwLock<Option<Arc<EncryptionSettings>>>
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, )
pub fn is_authed(&self) -> bool
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_encryption_settings( &self, ) -> Result<Arc<EncryptionSettings>, VaultLocked>
pub(crate) fn initialize_user_crypto_master_key( &self, master_key: MasterKey, user_key: EncString, private_key: EncString, ) -> Result<(), EncryptionSettingsError>
pub(crate) fn initialize_user_crypto_decrypted_key( &self, user_key: SymmetricCryptoKey, private_key: EncString, ) -> Result<(), EncryptionSettingsError>
pub(crate) fn initialize_user_crypto_pin( &self, pin_key: PinKey, pin_protected_user_key: EncString, private_key: EncString, ) -> Result<(), EncryptionSettingsError>
pub(crate) fn initialize_crypto_single_key(&self, key: SymmetricCryptoKey)
pub fn initialize_org_crypto( &self, org_keys: Vec<(Uuid, AsymmetricEncString)>, ) -> Result<Arc<EncryptionSettings>, 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