pub enum ScimTokenStorage {
Plain,
Hashed,
Encrypted,
CustomHash {
hash: ScimTokenTransform,
},
CustomEncryption {
encrypt: ScimTokenTransform,
decrypt: ScimTokenTransform,
},
}Expand description
Built-in SCIM token storage modes.
Variants§
Plain
Store the base token directly.
Hashed
Store a SHA-256 digest of the base token.
Encrypted
Store the base token encrypted with RustAuth secret material.
CustomHash
Store a custom hash of the base token.
Fields
§
hash: ScimTokenTransformCustomEncryption
Store a custom encrypted token and decrypt it during verification.
Implementations§
Source§impl ScimTokenStorage
impl ScimTokenStorage
Sourcepub fn custom_hash(
hash: impl Fn(String) -> ScimTokenStorageFuture + Send + Sync + 'static,
) -> Self
pub fn custom_hash( hash: impl Fn(String) -> ScimTokenStorageFuture + Send + Sync + 'static, ) -> Self
Create a custom hash token storage mode.
use rustauth_scim::ScimTokenStorage;
let storage = ScimTokenStorage::custom_hash(|token| {
Box::pin(async move { Ok(format!("{token}:hashed")) })
});Sourcepub fn custom_encryption(
encrypt: impl Fn(String) -> ScimTokenStorageFuture + Send + Sync + 'static,
decrypt: impl Fn(String) -> ScimTokenStorageFuture + Send + Sync + 'static,
) -> Self
pub fn custom_encryption( encrypt: impl Fn(String) -> ScimTokenStorageFuture + Send + Sync + 'static, decrypt: impl Fn(String) -> ScimTokenStorageFuture + Send + Sync + 'static, ) -> Self
Create a custom encrypt/decrypt token storage mode.
use rustauth_scim::ScimTokenStorage;
let storage = ScimTokenStorage::custom_encryption(
|token| Box::pin(async move { Ok(token.chars().rev().collect()) }),
|token| Box::pin(async move { Ok(token.chars().rev().collect()) }),
);Trait Implementations§
Source§impl Clone for ScimTokenStorage
impl Clone for ScimTokenStorage
Source§fn clone(&self) -> ScimTokenStorage
fn clone(&self) -> ScimTokenStorage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ScimTokenStorage
impl !UnwindSafe for ScimTokenStorage
impl Freeze for ScimTokenStorage
impl Send for ScimTokenStorage
impl Sync for ScimTokenStorage
impl Unpin for ScimTokenStorage
impl UnsafeUnpin for ScimTokenStorage
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