completely rebuilt the auth implementation to support OIDC in the future

This commit is contained in:
Lennart
2024-10-03 19:47:50 +02:00
parent 235e7b207a
commit 6f12a1d80e
29 changed files with 257 additions and 312 deletions

View File

@@ -10,7 +10,7 @@ use actix_web::web::{Data, Path};
use actix_web::HttpRequest;
use derive_more::derive::Deref;
use log::debug;
use rustical_auth::{AuthInfoExtractor, CheckAuthentication};
use rustical_store::auth::User;
use serde::Deserialize;
// This is not the final place for this struct
@@ -39,12 +39,12 @@ struct PropfindElement {
prop: PropfindType,
}
pub async fn route_propfind<A: CheckAuthentication, R: ResourceService>(
pub async fn route_propfind<R: ResourceService>(
path_components: Path<R::PathComponents>,
body: String,
req: HttpRequest,
prefix: Data<ServicePrefix>,
auth: AuthInfoExtractor<A>,
user: User,
depth: Depth,
) -> Result<
MultistatusElement<
@@ -86,7 +86,7 @@ pub async fn route_propfind<A: CheckAuthentication, R: ResourceService>(
}
}
let resource = resource_service.get_resource(auth.inner.user_id).await?;
let resource = resource_service.get_resource(user.id).await?;
let response = resource.propfind(&prefix, req.path(), props).await?;
Ok(MultistatusElement {