mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 17:52:24 +00:00
Move authentication middleware into the caldav scope
This commit is contained in:
@@ -53,7 +53,7 @@ impl<S, B, AP> Service<ServiceRequest> for InnerAuthenticationMiddleware<S, AP>
|
||||
where
|
||||
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = actix_web::Error> + 'static,
|
||||
S::Future: 'static,
|
||||
AP: AuthenticationProvider + 'static,
|
||||
AP: AuthenticationProvider,
|
||||
{
|
||||
type Response = ServiceResponse<B>;
|
||||
type Error = actix_web::Error;
|
||||
|
||||
@@ -6,11 +6,10 @@ use crate::error::Error;
|
||||
use async_trait::async_trait;
|
||||
|
||||
#[async_trait]
|
||||
pub trait AuthenticationProvider {
|
||||
pub trait AuthenticationProvider: 'static {
|
||||
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 user::User;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user