dav: Make reusable for other projects

This commit is contained in:
Lennart
2025-04-18 13:26:44 +02:00
parent 626eff0373
commit 54e327d764
36 changed files with 210 additions and 121 deletions

View File

@@ -2,9 +2,9 @@ use super::methods::mkcalendar::route_mkcalendar;
use super::methods::post::route_post;
use super::methods::report::route_report_calendar;
use super::prop::{SupportedCalendarComponentSet, SupportedCalendarData, SupportedReportSet};
use crate::Error;
use crate::calendar_object::resource::CalendarObjectResource;
use crate::principal::PrincipalResource;
use crate::Error;
use actix_web::dev::ResourceMap;
use actix_web::http::Method;
use actix_web::web;
@@ -12,12 +12,12 @@ use async_trait::async_trait;
use chrono::{DateTime, Utc};
use derive_more::derive::{From, Into};
use rustical_dav::extensions::{
CommonPropertiesExtension, CommonPropertiesProp, DavPushExtension, DavPushExtensionProp,
SyncTokenExtension, SyncTokenExtensionProp,
CommonPropertiesExtension, CommonPropertiesProp, SyncTokenExtension, SyncTokenExtensionProp,
};
use rustical_dav::privileges::UserPrivilegeSet;
use rustical_dav::resource::{Resource, ResourceService};
use rustical_dav::xml::{HrefElement, Resourcetype, ResourcetypeInner};
use rustical_dav_push::{DavPushExtension, DavPushExtensionProp};
use rustical_store::auth::User;
use rustical_store::calendar::CalDateTime;
use rustical_store::{Calendar, CalendarStore, SubscriptionStore};
@@ -104,6 +104,7 @@ impl Resource for CalendarResource {
type Prop = CalendarPropWrapper;
type Error = Error;
type PrincipalResource = PrincipalResource;
type Principal = User;
fn get_resourcetype(&self) -> Resourcetype {
if self.cal.subscription_url.is_none() {
@@ -331,6 +332,7 @@ impl<C: CalendarStore, S: SubscriptionStore> ResourceService for CalendarResourc
type PathComponents = (String, String); // principal, calendar_id
type Resource = CalendarResource;
type Error = Error;
type Principal = User;
async fn get_resource(
&self,