pub struct InMemoryUserStore { /* private fields */ }Expand description
Reference in-memory implementation.
Implementations§
Source§impl InMemoryUserStore
impl InMemoryUserStore
Sourcepub fn insert_user(
&self,
id: impl Into<String>,
email: impl Into<String>,
webid: impl Into<String>,
name: Option<String>,
password: &str,
) -> Result<User, UserStoreError>
pub fn insert_user( &self, id: impl Into<String>, email: impl Into<String>, webid: impl Into<String>, name: Option<String>, password: &str, ) -> Result<User, UserStoreError>
Create a user with an Argon2id hash of password. Returns
the inserted record. Email is case-normalised (lowercased) on
storage so find_by_email can match case-insensitively.
Passwords shorter than MIN_PASSWORD_LENGTH (8 chars) are
rejected with UserStoreError::PasswordTooShort, matching
JSS commit 1feead2.
Trait Implementations§
Source§impl Default for InMemoryUserStore
impl Default for InMemoryUserStore
Source§fn default() -> InMemoryUserStore
fn default() -> InMemoryUserStore
Returns the “default value” for a type. Read more
Source§impl UserStore for InMemoryUserStore
impl UserStore for InMemoryUserStore
Source§fn find_by_email<'life0, 'life1, 'async_trait>(
&'life0 self,
email: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<User>, UserStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_by_email<'life0, 'life1, 'async_trait>(
&'life0 self,
email: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<User>, UserStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Look up a user by email. Returns
Ok(None) on no-match
(distinct from Err(_) which means the backend failed).Source§fn find_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<User>, UserStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<User>, UserStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Look up a user by internal id.
Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, UserStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, UserStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a user and every record they own (pods, WebID profile,
sessions). Mirrors JSS commit
d9e56d8 (#292). Read moreSource§fn verify_password<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user: &'life1 User,
password: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, UserStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn verify_password<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user: &'life1 User,
password: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, UserStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Verify
password against the user’s stored hash. This lives
on the trait rather than free-function so stores that use
external auth (LDAP, OAuth federation) can override the
verification path.Auto Trait Implementations§
impl !Freeze for InMemoryUserStore
impl !RefUnwindSafe for InMemoryUserStore
impl Send for InMemoryUserStore
impl Sync for InMemoryUserStore
impl Unpin for InMemoryUserStore
impl UnsafeUnpin for InMemoryUserStore
impl UnwindSafe for InMemoryUserStore
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