Preparation of a carddav crate

This commit is contained in:
Lennart
2024-05-29 17:00:19 +02:00
parent 3e1e289350
commit 5f194bbeb4
5 changed files with 89 additions and 3 deletions

24
crates/carddav/src/lib.rs Normal file
View File

@@ -0,0 +1,24 @@
use actix_web::{web, HttpResponse, Responder};
use rustical_auth::CheckAuthentication;
use std::sync::Arc;
pub fn configure_well_known(cfg: &mut web::ServiceConfig, carddav_root: String) {
cfg.service(web::redirect("/carddav", carddav_root).permanent());
}
pub fn configure_dav<A: CheckAuthentication>(
cfg: &mut web::ServiceConfig,
prefix: String,
auth: Arc<A>,
) {
}
async fn options_handler() -> impl Responder {
HttpResponse::Ok()
.insert_header((
"Allow",
"OPTIONS, GET, HEAD, POST, PUT, REPORT, PROPFIND, PROPPATCH, MKCOL",
))
.insert_header(("DAV", "1, 2, 3, addressbook, extended-mkcol"))
.body("options")
}