torii-core 0.5.2

Core functionality for the torii authentication ecosystem
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::{Error, UserId};
use async_trait::async_trait;

/// Repository for password-related data access
#[async_trait]
pub trait PasswordRepository: Send + Sync + 'static {
    /// Store a password hash for a user
    async fn set_password_hash(&self, user_id: &UserId, hash: &str) -> Result<(), Error>;

    /// Retrieve a user's password hash
    async fn get_password_hash(&self, user_id: &UserId) -> Result<Option<String>, Error>;

    /// Remove a user's password hash
    async fn remove_password_hash(&self, user_id: &UserId) -> Result<(), Error>;
}