mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 05:52:19 +00:00
minor stuff
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
use crate::Error;
|
use crate::Error;
|
||||||
use crate::calendar::resource::{CalendarResource, CalendarResourceService};
|
use crate::calendar::resource::{CalendarResource, CalendarResourceService};
|
||||||
use axum::extract::{Path, State};
|
use axum::extract::{Path, State};
|
||||||
use axum::response::Response;
|
use axum::response::{IntoResponse, Response};
|
||||||
|
use http::{HeaderMap, StatusCode, header};
|
||||||
use rustical_dav::privileges::UserPrivilege;
|
use rustical_dav::privileges::UserPrivilege;
|
||||||
use rustical_dav::resource::Resource;
|
use rustical_dav::resource::Resource;
|
||||||
use rustical_dav_push::register::PushRegister;
|
use rustical_dav_push::register::PushRegister;
|
||||||
@@ -72,10 +73,17 @@ pub async fn route_post<C: CalendarStore, S: SubscriptionStore>(
|
|||||||
.upsert_subscription(subscription)
|
.upsert_subscription(subscription)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
let location = req
|
// let location = req
|
||||||
.resource_map()
|
// .resource_map()
|
||||||
.url_for(&req, "subscription", &[sub_id])
|
// .url_for(&req, "subscription", &[sub_id])
|
||||||
.unwrap();
|
// .unwrap();
|
||||||
|
//
|
||||||
|
let location = "asd";
|
||||||
|
Ok((
|
||||||
|
StatusCode::CREATED,
|
||||||
|
HeaderMap::from_iter([(header::LOCATION, location)]),
|
||||||
|
)
|
||||||
|
.into_response());
|
||||||
|
|
||||||
Ok(HttpResponse::Created()
|
Ok(HttpResponse::Created()
|
||||||
.append_header((header::LOCATION, location.to_string()))
|
.append_header((header::LOCATION, location.to_string()))
|
||||||
|
|||||||
@@ -343,7 +343,7 @@ impl<C: CalendarStore, S: SubscriptionStore> ResourceService for CalendarResourc
|
|||||||
type Principal = User;
|
type Principal = User;
|
||||||
type PrincipalUri = CalDavPrincipalUri;
|
type PrincipalUri = CalDavPrincipalUri;
|
||||||
|
|
||||||
const DAV_HEADER: &str = "1, 3, access-control, calendar-access";
|
const DAV_HEADER: &str = "1, 3, access-control, calendar-access, webdav-push";
|
||||||
|
|
||||||
async fn get_resource(
|
async fn get_resource(
|
||||||
&self,
|
&self,
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
use crate::auth::User;
|
|
||||||
|
|
||||||
use super::AuthenticationProvider;
|
use super::AuthenticationProvider;
|
||||||
use axum::{extract::Request, response::Response};
|
use axum::{extract::Request, response::Response};
|
||||||
use futures_core::future::BoxFuture;
|
use futures_core::future::BoxFuture;
|
||||||
use headers::{Authorization, HeaderMapExt, authorization::Basic};
|
use headers::{Authorization, HeaderMapExt, authorization::Basic};
|
||||||
use std::{
|
use std::{
|
||||||
pin::Pin,
|
|
||||||
sync::Arc,
|
sync::Arc,
|
||||||
task::{Context, Poll},
|
task::{Context, Poll},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
|
use crate::XmlError;
|
||||||
|
use crate::XmlRootTag;
|
||||||
use quick_xml::events::{BytesStart, Event};
|
use quick_xml::events::{BytesStart, Event};
|
||||||
use quick_xml::name::ResolveResult;
|
use quick_xml::name::ResolveResult;
|
||||||
use std::io::BufRead;
|
use std::io::BufRead;
|
||||||
pub use xml_derive::XmlDeserialize;
|
pub use xml_derive::XmlDeserialize;
|
||||||
pub use xml_derive::XmlDocument;
|
pub use xml_derive::XmlDocument;
|
||||||
|
|
||||||
use crate::XmlRootTag;
|
|
||||||
use crate::{XmlError, XmlSerialize};
|
|
||||||
|
|
||||||
pub trait XmlDeserialize: Sized {
|
pub trait XmlDeserialize: Sized {
|
||||||
fn deserialize<R: BufRead>(
|
fn deserialize<R: BufRead>(
|
||||||
reader: &mut quick_xml::NsReader<R>,
|
reader: &mut quick_xml::NsReader<R>,
|
||||||
|
|||||||
Reference in New Issue
Block a user