pub struct SqlBackend { /* private fields */ }Expand description
SQL authentication backend
Implementations§
Source§impl SqlBackend
impl SqlBackend
Sourcepub async fn init_schema(&self) -> Result<()>
pub async fn init_schema(&self) -> Result<()>
Initialize database schema
Sourcepub async fn get_user_metadata(
&self,
username: &Username,
) -> Result<Option<UserMetadata>>
pub async fn get_user_metadata( &self, username: &Username, ) -> Result<Option<UserMetadata>>
Get user metadata
Trait Implementations§
Source§impl AuthBackend for SqlBackend
impl AuthBackend for SqlBackend
Source§fn authenticate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
username: &'life1 Username,
password: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn authenticate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
username: &'life1 Username,
password: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Authenticate a user with username and password
Source§fn verify_identity<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 Username,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn verify_identity<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 Username,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Verify if a username maps to a valid identity
Source§fn list_users<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Username>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_users<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Username>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all users (for admin CLI)
Source§fn create_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
username: &'life1 Username,
password: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
username: &'life1 Username,
password: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Create a new user with the given password
Source§fn delete_user<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 Username,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_user<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 Username,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a user
Source§fn change_password<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
username: &'life1 Username,
new_password: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn change_password<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
username: &'life1 Username,
new_password: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Change a user’s password
Source§fn get_scram_params<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(Vec<u8>, u32)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_scram_params<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(Vec<u8>, u32)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get SCRAM-SHA-256 parameters (salt, iteration count) for a user Read more
Source§fn get_scram_stored_key<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_scram_stored_key<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get SCRAM-SHA-256 StoredKey for a user Read more
Source§fn get_scram_server_key<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_scram_server_key<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get SCRAM-SHA-256 ServerKey for a user Read more
Source§fn store_scram_credentials<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 Username,
salt: Vec<u8>,
iterations: u32,
stored_key: Vec<u8>,
server_key: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn store_scram_credentials<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 Username,
salt: Vec<u8>,
iterations: u32,
stored_key: Vec<u8>,
server_key: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Store SCRAM-SHA-256 credentials for a user Read more
Auto Trait Implementations§
impl Freeze for SqlBackend
impl !RefUnwindSafe for SqlBackend
impl Send for SqlBackend
impl Sync for SqlBackend
impl Unpin for SqlBackend
impl UnsafeUnpin for SqlBackend
impl !UnwindSafe for SqlBackend
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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