mirror of
https://github.com/lennart-k/rustical.git
synced 2026-01-30 17:38:22 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4fabf74333 | ||
|
|
7b154adec3 | ||
|
|
951a1e4bdc | ||
|
|
8c44733d0a | ||
|
|
829f7b727f |
24
Cargo.lock
generated
24
Cargo.lock
generated
@@ -3273,7 +3273,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustical"
|
name = "rustical"
|
||||||
version = "0.11.8"
|
version = "0.11.9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"argon2",
|
"argon2",
|
||||||
@@ -3318,7 +3318,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustical_caldav"
|
name = "rustical_caldav"
|
||||||
version = "0.11.8"
|
version = "0.11.9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-std",
|
"async-std",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@@ -3360,7 +3360,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustical_carddav"
|
name = "rustical_carddav"
|
||||||
version = "0.11.8"
|
version = "0.11.9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"axum",
|
"axum",
|
||||||
@@ -3394,7 +3394,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustical_dav"
|
name = "rustical_dav"
|
||||||
version = "0.11.8"
|
version = "0.11.9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"axum",
|
"axum",
|
||||||
@@ -3420,7 +3420,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustical_dav_push"
|
name = "rustical_dav_push"
|
||||||
version = "0.11.8"
|
version = "0.11.9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"axum",
|
"axum",
|
||||||
@@ -3445,7 +3445,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustical_frontend"
|
name = "rustical_frontend"
|
||||||
version = "0.11.8"
|
version = "0.11.9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"askama",
|
"askama",
|
||||||
"askama_web",
|
"askama_web",
|
||||||
@@ -3481,7 +3481,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustical_ical"
|
name = "rustical_ical"
|
||||||
version = "0.11.8"
|
version = "0.11.9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"axum",
|
"axum",
|
||||||
"chrono",
|
"chrono",
|
||||||
@@ -3498,7 +3498,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustical_oidc"
|
name = "rustical_oidc"
|
||||||
version = "0.11.8"
|
version = "0.11.9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"axum",
|
"axum",
|
||||||
@@ -3514,7 +3514,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustical_store"
|
name = "rustical_store"
|
||||||
version = "0.11.8"
|
version = "0.11.9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@@ -3547,7 +3547,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustical_store_sqlite"
|
name = "rustical_store_sqlite"
|
||||||
version = "0.11.8"
|
version = "0.11.9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"chrono",
|
"chrono",
|
||||||
@@ -3570,7 +3570,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustical_xml"
|
name = "rustical_xml"
|
||||||
version = "0.11.8"
|
version = "0.11.9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quick-xml",
|
"quick-xml",
|
||||||
"thiserror 2.0.17",
|
"thiserror 2.0.17",
|
||||||
@@ -5393,7 +5393,7 @@ checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "xml_derive"
|
name = "xml_derive"
|
||||||
version = "0.11.8"
|
version = "0.11.9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"darling 0.23.0",
|
"darling 0.23.0",
|
||||||
"heck",
|
"heck",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
members = ["crates/*"]
|
members = ["crates/*"]
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "0.11.8"
|
version = "0.11.9"
|
||||||
rust-version = "1.92"
|
rust-version = "1.92"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
description = "A CalDAV server"
|
description = "A CalDAV server"
|
||||||
|
|||||||
@@ -105,4 +105,30 @@ pub struct AddressbookQueryRequest {
|
|||||||
pub prop: PropfindType<AddressObjectPropWrapperName>,
|
pub prop: PropfindType<AddressObjectPropWrapperName>,
|
||||||
#[xml(ns = "rustical_dav::namespace::NS_CARDDAV")]
|
#[xml(ns = "rustical_dav::namespace::NS_CARDDAV")]
|
||||||
pub(crate) filter: FilterElement,
|
pub(crate) filter: FilterElement,
|
||||||
|
#[xml(ns = "rustical_dav::namespace::NS_CARDDAV")]
|
||||||
|
pub(crate) limit: Option<LimitElement>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://datatracker.ietf.org/doc/html/rfc5323#section-5.17
|
||||||
|
#[derive(XmlDeserialize, Clone, Debug, PartialEq, Eq)]
|
||||||
|
pub struct LimitElement {
|
||||||
|
#[xml(ns = "rustical_dav::namespace::NS_CARDDAV")]
|
||||||
|
pub nresults: NresultsElement,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<u64> for LimitElement {
|
||||||
|
fn from(value: u64) -> Self {
|
||||||
|
Self {
|
||||||
|
nresults: NresultsElement(value),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<LimitElement> for u64 {
|
||||||
|
fn from(value: LimitElement) -> Self {
|
||||||
|
value.nresults.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(XmlDeserialize, Clone, Debug, PartialEq, Eq)]
|
||||||
|
pub struct NresultsElement(#[xml(ty = "text")] pub u64);
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ mod tests {
|
|||||||
use crate::{
|
use crate::{
|
||||||
address_object::AddressObjectPropName,
|
address_object::AddressObjectPropName,
|
||||||
addressbook::methods::report::addressbook_query::{
|
addressbook::methods::report::addressbook_query::{
|
||||||
Allof, FilterElement, PropFilterElement,
|
Allof, FilterElement, LimitElement, NresultsElement, PropFilterElement,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use rustical_dav::xml::{PropElement, sync_collection::SyncLevel};
|
use rustical_dav::xml::{PropElement, sync_collection::SyncLevel};
|
||||||
@@ -237,6 +237,9 @@ mod tests {
|
|||||||
<card:filter>
|
<card:filter>
|
||||||
<card:prop-filter name="FN"/>
|
<card:prop-filter name="FN"/>
|
||||||
</card:filter>
|
</card:filter>
|
||||||
|
<card:limit>
|
||||||
|
<card:nresults>100</card:nresults>
|
||||||
|
</card:limit>
|
||||||
</card:addressbook-query>
|
</card:addressbook-query>
|
||||||
"#,
|
"#,
|
||||||
)
|
)
|
||||||
@@ -259,8 +262,11 @@ mod tests {
|
|||||||
text_match: vec![],
|
text_match: vec![],
|
||||||
param_filter: vec![],
|
param_filter: vec![],
|
||||||
test: Allof::default()
|
test: Allof::default()
|
||||||
}]
|
}],
|
||||||
}
|
},
|
||||||
|
limit: Some(LimitElement {
|
||||||
|
nresults: NresultsElement(100)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ pub enum AddressbookProp {
|
|||||||
SupportedCollationSet(SupportedCollationSet),
|
SupportedCollationSet(SupportedCollationSet),
|
||||||
#[xml(ns = "rustical_dav::namespace::NS_DAV", skip_deserializing)]
|
#[xml(ns = "rustical_dav::namespace::NS_DAV", skip_deserializing)]
|
||||||
SupportedReportSet(SupportedReportSet<ReportMethod>),
|
SupportedReportSet(SupportedReportSet<ReportMethod>),
|
||||||
#[xml(ns = "rustical_dav::namespace::NS_DAV")]
|
#[xml(ns = "rustical_dav::namespace::NS_CARDDAV")]
|
||||||
MaxResourceSize(i64),
|
MaxResourceSize(i64),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ expression: response.serialize_to_string().unwrap()
|
|||||||
</report>
|
</report>
|
||||||
</supported-report>
|
</supported-report>
|
||||||
</supported-report-set>
|
</supported-report-set>
|
||||||
<max-resource-size xmlns="DAV:">10000000</max-resource-size>
|
<max-resource-size xmlns="urn:ietf:params:xml:ns:carddav">10000000</max-resource-size>
|
||||||
<sync-token xmlns="DAV:">github.com/lennart-k/rustical/ns/0</sync-token>
|
<sync-token xmlns="DAV:">github.com/lennart-k/rustical/ns/0</sync-token>
|
||||||
<getctag xmlns="http://calendarserver.org/ns/">github.com/lennart-k/rustical/ns/0</getctag>
|
<getctag xmlns="http://calendarserver.org/ns/">github.com/lennart-k/rustical/ns/0</getctag>
|
||||||
<transports xmlns="https://bitfire.at/webdav-push">
|
<transports xmlns="https://bitfire.at/webdav-push">
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ pub async fn route_delete<R: ResourceService>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let Some(if_match) = if_match {
|
if let Some(if_match) = if_match {
|
||||||
dbg!(&if_match);
|
|
||||||
if !resource.satisfies_if_match(&if_match) {
|
if !resource.satisfies_if_match(&if_match) {
|
||||||
// Precondition failed
|
// Precondition failed
|
||||||
return Err(crate::Error::PreconditionFailed.into());
|
return Err(crate::Error::PreconditionFailed.into());
|
||||||
|
|||||||
@@ -104,9 +104,7 @@ pub async fn route_post_oidc(
|
|||||||
TypedHeader(host): TypedHeader<Host>,
|
TypedHeader(host): TypedHeader<Host>,
|
||||||
Form(GetOidcForm { redirect_uri }): Form<GetOidcForm>,
|
Form(GetOidcForm { redirect_uri }): Form<GetOidcForm>,
|
||||||
) -> Result<Response, OidcError> {
|
) -> Result<Response, OidcError> {
|
||||||
dbg!(&host);
|
|
||||||
let callback_uri = format!("https://{host}/frontend/login/oidc/callback");
|
let callback_uri = format!("https://{host}/frontend/login/oidc/callback");
|
||||||
dbg!(&callback_uri);
|
|
||||||
|
|
||||||
let http_client = get_http_client();
|
let http_client = get_http_client();
|
||||||
let oidc_client = get_oidc_client(
|
let oidc_client = get_oidc_client(
|
||||||
|
|||||||
@@ -59,6 +59,8 @@ markdown_extensions:
|
|||||||
- admonition
|
- admonition
|
||||||
- attr_list
|
- attr_list
|
||||||
- pymdownx.tabbed
|
- pymdownx.tabbed
|
||||||
|
- pymdownx.tasklist:
|
||||||
|
custom_checkbox: true
|
||||||
- pymdownx.emoji:
|
- pymdownx.emoji:
|
||||||
emoji_index: !!python/name:material.extensions.emoji.twemoji
|
emoji_index: !!python/name:material.extensions.emoji.twemoji
|
||||||
emoji_generator: !!python/name:material.extensions.emoji.to_svg
|
emoji_generator: !!python/name:material.extensions.emoji.to_svg
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ expression: body
|
|||||||
</report>
|
</report>
|
||||||
</supported-report>
|
</supported-report>
|
||||||
</supported-report-set>
|
</supported-report-set>
|
||||||
<max-resource-size>10000000</max-resource-size>
|
<CARD:max-resource-size>10000000</CARD:max-resource-size>
|
||||||
<sync-token>github.com/lennart-k/rustical/ns/0</sync-token>
|
<sync-token>github.com/lennart-k/rustical/ns/0</sync-token>
|
||||||
<CS:getctag>github.com/lennart-k/rustical/ns/0</CS:getctag>
|
<CS:getctag>github.com/lennart-k/rustical/ns/0</CS:getctag>
|
||||||
<PUSH:transports>
|
<PUSH:transports>
|
||||||
|
|||||||
Reference in New Issue
Block a user