Compare commits

..

5 Commits

Author SHA1 Message Date
Lennart
4fabf74333 version 0.11.9 2025-12-31 15:58:49 +01:00
Lennart
7b154adec3 remove stray dbg! 2025-12-31 15:57:56 +01:00
Lennart
951a1e4bdc update mkdocs.yml 2025-12-31 15:57:23 +01:00
Lennart
8c44733d0a carddav: Fix namespace for max-resource-size 2025-12-31 15:57:13 +01:00
Lennart
829f7b727f carddav calendar-query: Add parsing support for limit 2025-12-31 15:15:07 +01:00
10 changed files with 53 additions and 22 deletions

24
Cargo.lock generated
View File

@@ -3273,7 +3273,7 @@ dependencies = [
[[package]]
name = "rustical"
version = "0.11.8"
version = "0.11.9"
dependencies = [
"anyhow",
"argon2",
@@ -3318,7 +3318,7 @@ dependencies = [
[[package]]
name = "rustical_caldav"
version = "0.11.8"
version = "0.11.9"
dependencies = [
"async-std",
"async-trait",
@@ -3360,7 +3360,7 @@ dependencies = [
[[package]]
name = "rustical_carddav"
version = "0.11.8"
version = "0.11.9"
dependencies = [
"async-trait",
"axum",
@@ -3394,7 +3394,7 @@ dependencies = [
[[package]]
name = "rustical_dav"
version = "0.11.8"
version = "0.11.9"
dependencies = [
"async-trait",
"axum",
@@ -3420,7 +3420,7 @@ dependencies = [
[[package]]
name = "rustical_dav_push"
version = "0.11.8"
version = "0.11.9"
dependencies = [
"async-trait",
"axum",
@@ -3445,7 +3445,7 @@ dependencies = [
[[package]]
name = "rustical_frontend"
version = "0.11.8"
version = "0.11.9"
dependencies = [
"askama",
"askama_web",
@@ -3481,7 +3481,7 @@ dependencies = [
[[package]]
name = "rustical_ical"
version = "0.11.8"
version = "0.11.9"
dependencies = [
"axum",
"chrono",
@@ -3498,7 +3498,7 @@ dependencies = [
[[package]]
name = "rustical_oidc"
version = "0.11.8"
version = "0.11.9"
dependencies = [
"async-trait",
"axum",
@@ -3514,7 +3514,7 @@ dependencies = [
[[package]]
name = "rustical_store"
version = "0.11.8"
version = "0.11.9"
dependencies = [
"anyhow",
"async-trait",
@@ -3547,7 +3547,7 @@ dependencies = [
[[package]]
name = "rustical_store_sqlite"
version = "0.11.8"
version = "0.11.9"
dependencies = [
"async-trait",
"chrono",
@@ -3570,7 +3570,7 @@ dependencies = [
[[package]]
name = "rustical_xml"
version = "0.11.8"
version = "0.11.9"
dependencies = [
"quick-xml",
"thiserror 2.0.17",
@@ -5393,7 +5393,7 @@ checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9"
[[package]]
name = "xml_derive"
version = "0.11.8"
version = "0.11.9"
dependencies = [
"darling 0.23.0",
"heck",

View File

@@ -2,7 +2,7 @@
members = ["crates/*"]
[workspace.package]
version = "0.11.8"
version = "0.11.9"
rust-version = "1.92"
edition = "2024"
description = "A CalDAV server"

View File

@@ -105,4 +105,30 @@ pub struct AddressbookQueryRequest {
pub prop: PropfindType<AddressObjectPropWrapperName>,
#[xml(ns = "rustical_dav::namespace::NS_CARDDAV")]
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);

View File

@@ -159,7 +159,7 @@ mod tests {
use crate::{
address_object::AddressObjectPropName,
addressbook::methods::report::addressbook_query::{
Allof, FilterElement, PropFilterElement,
Allof, FilterElement, LimitElement, NresultsElement, PropFilterElement,
},
};
use rustical_dav::xml::{PropElement, sync_collection::SyncLevel};
@@ -237,6 +237,9 @@ mod tests {
<card:filter>
<card:prop-filter name="FN"/>
</card:filter>
<card:limit>
<card:nresults>100</card:nresults>
</card:limit>
</card:addressbook-query>
"#,
)
@@ -259,8 +262,11 @@ mod tests {
text_match: vec![],
param_filter: vec![],
test: Allof::default()
}]
}
}],
},
limit: Some(LimitElement {
nresults: NresultsElement(100)
})
})
);
}

View File

@@ -19,7 +19,7 @@ pub enum AddressbookProp {
SupportedCollationSet(SupportedCollationSet),
#[xml(ns = "rustical_dav::namespace::NS_DAV", skip_deserializing)]
SupportedReportSet(SupportedReportSet<ReportMethod>),
#[xml(ns = "rustical_dav::namespace::NS_DAV")]
#[xml(ns = "rustical_dav::namespace::NS_CARDDAV")]
MaxResourceSize(i64),
}

View File

@@ -28,7 +28,7 @@ expression: response.serialize_to_string().unwrap()
</report>
</supported-report>
</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>
<getctag xmlns="http://calendarserver.org/ns/">github.com/lennart-k/rustical/ns/0</getctag>
<transports xmlns="https://bitfire.at/webdav-push">

View File

@@ -53,7 +53,6 @@ pub async fn route_delete<R: ResourceService>(
}
if let Some(if_match) = if_match {
dbg!(&if_match);
if !resource.satisfies_if_match(&if_match) {
// Precondition failed
return Err(crate::Error::PreconditionFailed.into());

View File

@@ -104,9 +104,7 @@ pub async fn route_post_oidc(
TypedHeader(host): TypedHeader<Host>,
Form(GetOidcForm { redirect_uri }): Form<GetOidcForm>,
) -> Result<Response, OidcError> {
dbg!(&host);
let callback_uri = format!("https://{host}/frontend/login/oidc/callback");
dbg!(&callback_uri);
let http_client = get_http_client();
let oidc_client = get_oidc_client(

View File

@@ -59,6 +59,8 @@ markdown_extensions:
- admonition
- attr_list
- pymdownx.tabbed
- pymdownx.tasklist:
custom_checkbox: true
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg

View File

@@ -30,7 +30,7 @@ expression: body
</report>
</supported-report>
</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>
<CS:getctag>github.com/lennart-k/rustical/ns/0</CS:getctag>
<PUSH:transports>