pub struct AuthClient(pub(crate) Arc<Client>);
Tuple Fields§
§0: Arc<Client>
Implementations§
Source§impl AuthClient
impl AuthClient
Sourcepub fn password_strength(
&self,
password: String,
email: String,
additional_inputs: Vec<String>,
) -> u8
pub fn password_strength( &self, password: String, email: String, additional_inputs: Vec<String>, ) -> u8
API Draft: Calculate Password Strength
Sourcepub fn satisfies_policy(
&self,
password: String,
strength: u8,
policy: MasterPasswordPolicyOptions,
) -> bool
pub fn satisfies_policy( &self, password: String, strength: u8, policy: MasterPasswordPolicyOptions, ) -> bool
Evaluate if the provided password satisfies the provided policy
Sourcepub async fn hash_password(
&self,
email: String,
password: String,
kdf_params: Kdf,
purpose: HashPurpose,
) -> Result<String, BitwardenError>
pub async fn hash_password( &self, email: String, password: String, kdf_params: Kdf, purpose: HashPurpose, ) -> Result<String, BitwardenError>
Hash the user password
Sourcepub fn make_register_keys(
&self,
email: String,
password: String,
kdf: Kdf,
) -> Result<RegisterKeyResponse, BitwardenError>
pub fn make_register_keys( &self, email: String, password: String, kdf: Kdf, ) -> Result<RegisterKeyResponse, BitwardenError>
Generate keys needed for registration process
Sourcepub fn make_register_tde_keys(
&self,
email: String,
org_public_key: String,
remember_device: bool,
) -> Result<RegisterTdeKeyResponse, BitwardenError>
pub fn make_register_tde_keys( &self, email: String, org_public_key: String, remember_device: bool, ) -> Result<RegisterTdeKeyResponse, BitwardenError>
Generate keys needed for TDE process
Sourcepub fn make_key_connector_keys(
&self,
) -> Result<KeyConnectorResponse, BitwardenError>
pub fn make_key_connector_keys( &self, ) -> Result<KeyConnectorResponse, BitwardenError>
Generate keys needed to onboard a new user without master key to key connector
Sourcepub fn validate_password(
&self,
password: String,
password_hash: String,
) -> Result<bool, BitwardenError>
pub fn validate_password( &self, password: String, password_hash: String, ) -> Result<bool, BitwardenError>
Validate the user password
To retrieve the user’s password hash, use AuthClient::hash_password
with
HashPurpose::LocalAuthentication
during login and persist it. If the login method has no
password, use the email OTP.
Sourcepub fn validate_password_user_key(
&self,
password: String,
encrypted_user_key: String,
) -> Result<String, BitwardenError>
pub fn validate_password_user_key( &self, password: String, encrypted_user_key: String, ) -> Result<String, BitwardenError>
Validate the user password without knowing the password hash
Used for accounts that we know have master passwords but that have not logged in with a password. Some example are login with device or TDE.
This works by comparing the provided password against the encrypted user key.
Sourcepub fn validate_pin(
&self,
pin: String,
pin_protected_user_key: EncString,
) -> Result<bool, BitwardenError>
pub fn validate_pin( &self, pin: String, pin_protected_user_key: EncString, ) -> Result<bool, BitwardenError>
Validate the user PIN
To validate the user PIN, you need to have the user’s pin_protected_user_key. This key is
obtained when enabling PIN unlock on the account with the derive_pin_key
method.
This works by comparing the decrypted user key with the current user key, so the client must be unlocked.
Sourcepub fn new_auth_request(
&self,
email: String,
) -> Result<AuthRequestResponse, BitwardenError>
pub fn new_auth_request( &self, email: String, ) -> Result<AuthRequestResponse, BitwardenError>
Initialize a new auth request
Sourcepub fn approve_auth_request(
&self,
public_key: String,
) -> Result<AsymmetricEncString, BitwardenError>
pub fn approve_auth_request( &self, public_key: String, ) -> Result<AsymmetricEncString, BitwardenError>
Approve an auth request
Sourcepub fn trust_device(&self) -> Result<TrustDeviceResponse, BitwardenError>
pub fn trust_device(&self) -> Result<TrustDeviceResponse, BitwardenError>
Trust the current device
Trait Implementations§
Source§impl<UT> LiftRef<UT> for AuthClient
impl<UT> LiftRef<UT> for AuthClient
type LiftType = Arc<AuthClient>
Source§impl<UT> LowerError<UT> for AuthClient
impl<UT> LowerError<UT> for AuthClient
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for AuthClient
impl<UT> LowerReturn<UT> for AuthClient
Source§type ReturnType = <Arc<AuthClient> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<AuthClient> as LowerReturn<UniFfiTag>>::ReturnType
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Source§impl<UT> TypeId<UT> for AuthClient
impl<UT> TypeId<UT> for AuthClient
const TYPE_ID_META: MetadataBuffer = _
Auto Trait Implementations§
impl Freeze for AuthClient
impl !RefUnwindSafe for AuthClient
impl Send for AuthClient
impl Sync for AuthClient
impl Unpin for AuthClient
impl !UnwindSafe for AuthClient
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
§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
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
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>
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>
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