Breaking changes to auth provider, principal store outsourced to new config file

This commit is contained in:
Lennart
2025-02-09 17:19:08 +01:00
parent a71000ccf7
commit 8948589b09
16 changed files with 137 additions and 133 deletions

View File

@@ -1,16 +1,15 @@
pub mod middleware;
pub mod static_user_store;
pub mod toml_user_store;
pub mod user;
mod user_store;
use crate::error::Error;
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 validate_user_token(&self, user_id: &str, token: &str) -> Result<Option<User>, Error>;
}
pub use middleware::AuthenticationMiddleware;
pub use static_user_store::{StaticUserStore, StaticUserStoreConfig};
pub use toml_user_store::{TomlPrincipalStore, TomlUserStoreConfig};
pub use user::User;
pub use user_store::UserStore;