aboutsummaryrefslogtreecommitdiff
path: root/aero-proto/src/dav/resource.rs
diff options
context:
space:
mode:
Diffstat (limited to 'aero-proto/src/dav/resource.rs')
-rw-r--r--aero-proto/src/dav/resource.rs35
1 files changed, 32 insertions, 3 deletions
diff --git a/aero-proto/src/dav/resource.rs b/aero-proto/src/dav/resource.rs
index fec8bcb..2269de2 100644
--- a/aero-proto/src/dav/resource.rs
+++ b/aero-proto/src/dav/resource.rs
@@ -2,7 +2,7 @@ use std::sync::Arc;
type ArcUser = std::sync::Arc<User>;
use anyhow::{anyhow, Result};
-use futures::stream::StreamExt;
+use futures::stream::{TryStream, StreamExt};
use futures::{future::BoxFuture, future::FutureExt};
use aero_collections::{user::User, calendar::Calendar, davdag::BlobId};
@@ -12,7 +12,7 @@ use aero_dav::acltypes as acl;
use aero_dav::realization::{All, self as all};
-use crate::dav::node::DavNode;
+use crate::dav::node::{DavNode, PutPolicy, Content};
#[derive(Clone)]
pub(crate) struct RootNode {}
@@ -60,6 +60,10 @@ impl DavNode for RootNode {
v => dav::AnyProperty::Request(v),
}).collect()
}
+
+ fn put(&self, policy: PutPolicy, stream: Content) -> BoxFuture<Result<()>> {
+ todo!()
+ }
}
#[derive(Clone)]
@@ -111,10 +115,18 @@ impl DavNode for HomeNode {
])),
dav::PropertyRequest::GetContentType => dav::AnyProperty::Value(dav::Property::GetContentType("httpd/unix-directory".into())),
dav::PropertyRequest::Extension(all::PropertyRequest::Cal(cal::PropertyRequest::CalendarHomeSet)) =>
- dav::AnyProperty::Value(dav::Property::Extension(all::Property::Cal(cal::Property::CalendarHomeSet(dav::Href(/*CalendarListNode{}.path(user)*/ todo!()))))),
+ dav::AnyProperty::Value(dav::Property::Extension(all::Property::Cal(cal::Property::CalendarHomeSet(dav::Href(
+ //@FIXME we are hardcoding the calendar path, instead we would want to use
+ //objects
+ format!("/{}/calendar/", user.username)
+ ))))),
v => dav::AnyProperty::Request(v),
}).collect()
}
+
+ fn put(&self, policy: PutPolicy, stream: Content) -> BoxFuture<Result<()>> {
+ todo!()
+ }
}
#[derive(Clone)]
@@ -184,6 +196,10 @@ impl DavNode for CalendarListNode {
v => dav::AnyProperty::Request(v),
}).collect()
}
+
+ fn put(&self, policy: PutPolicy, stream: Content) -> BoxFuture<Result<()>> {
+ todo!()
+ }
}
#[derive(Clone)]
@@ -270,6 +286,10 @@ impl DavNode for CalendarNode {
v => dav::AnyProperty::Request(v),
}).collect()
}
+
+ fn put(&self, policy: PutPolicy, stream: Content) -> BoxFuture<Result<()>> {
+ todo!()
+ }
}
const FAKE_ICS: &str = r#"BEGIN:VCALENDAR
@@ -350,6 +370,10 @@ impl DavNode for EventNode {
v => dav::AnyProperty::Request(v),
}).collect()
}
+
+ fn put(&self, policy: PutPolicy, stream: Content) -> BoxFuture<Result<()>> {
+ todo!()
+ }
}
#[derive(Clone)]
@@ -383,4 +407,9 @@ impl DavNode for CreateEventNode {
fn properties(&self, _user: &ArcUser, prop: dav::PropName<All>) -> Vec<dav::AnyProperty<All>> {
vec![]
}
+
+ fn put(&self, policy: PutPolicy, stream: Content) -> BoxFuture<Result<()>> {
+ //@TODO write file
+ todo!()
+ }
}