Add insert_principal method to AuthenticationProvider

This commit is contained in:
Lennart
2025-04-13 15:29:43 +02:00
parent 63c16f411d
commit f132f9ccc8
3 changed files with 14 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ use async_trait::async_trait;
#[async_trait]
pub trait AuthenticationProvider: 'static {
async fn get_principal(&self, id: &str) -> Result<Option<User>, crate::Error>;
async fn insert_principal(&self, user: User) -> Result<(), crate::Error>;
async fn validate_user_token(&self, user_id: &str, token: &str) -> Result<Option<User>, Error>;
async fn add_app_token(&self, user_id: &str, name: String, token: String) -> Result<(), Error>;
}