rebase main

This commit is contained in:
Lennart K
2026-01-16 15:41:39 +01:00
parent 669d81aea0
commit 7c15976a1a
3 changed files with 21 additions and 23 deletions

26
Cargo.lock generated
View File

@@ -3317,7 +3317,7 @@ dependencies = [
[[package]] [[package]]
name = "rustical" name = "rustical"
version = "0.11.10" version = "0.11.17"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"argon2", "argon2",
@@ -3328,6 +3328,7 @@ dependencies = [
"figment", "figment",
"headers", "headers",
"http", "http",
"ical",
"insta", "insta",
"opentelemetry", "opentelemetry",
"opentelemetry-otlp", "opentelemetry-otlp",
@@ -3362,7 +3363,7 @@ dependencies = [
[[package]] [[package]]
name = "rustical_caldav" name = "rustical_caldav"
version = "0.11.10" version = "0.11.17"
dependencies = [ dependencies = [
"async-std", "async-std",
"async-trait", "async-trait",
@@ -3404,7 +3405,7 @@ dependencies = [
[[package]] [[package]]
name = "rustical_carddav" name = "rustical_carddav"
version = "0.11.10" version = "0.11.17"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"axum", "axum",
@@ -3438,7 +3439,7 @@ dependencies = [
[[package]] [[package]]
name = "rustical_dav" name = "rustical_dav"
version = "0.11.10" version = "0.11.17"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"axum", "axum",
@@ -3464,7 +3465,7 @@ dependencies = [
[[package]] [[package]]
name = "rustical_dav_push" name = "rustical_dav_push"
version = "0.11.10" version = "0.11.17"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"axum", "axum",
@@ -3489,7 +3490,7 @@ dependencies = [
[[package]] [[package]]
name = "rustical_frontend" name = "rustical_frontend"
version = "0.11.10" version = "0.11.17"
dependencies = [ dependencies = [
"askama", "askama",
"askama_web", "askama_web",
@@ -3525,7 +3526,7 @@ dependencies = [
[[package]] [[package]]
name = "rustical_ical" name = "rustical_ical"
version = "0.11.10" version = "0.11.17"
dependencies = [ dependencies = [
"axum", "axum",
"chrono", "chrono",
@@ -3544,7 +3545,7 @@ dependencies = [
[[package]] [[package]]
name = "rustical_oidc" name = "rustical_oidc"
version = "0.11.10" version = "0.11.17"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"axum", "axum",
@@ -3560,7 +3561,7 @@ dependencies = [
[[package]] [[package]]
name = "rustical_store" name = "rustical_store"
version = "0.11.10" version = "0.11.17"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@@ -3593,7 +3594,7 @@ dependencies = [
[[package]] [[package]]
name = "rustical_store_sqlite" name = "rustical_store_sqlite"
version = "0.11.10" version = "0.11.17"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"chrono", "chrono",
@@ -3603,6 +3604,7 @@ dependencies = [
"password-auth", "password-auth",
"password-hash", "password-hash",
"pbkdf2", "pbkdf2",
"regex",
"rstest", "rstest",
"rustical_ical", "rustical_ical",
"rustical_store", "rustical_store",
@@ -3617,7 +3619,7 @@ dependencies = [
[[package]] [[package]]
name = "rustical_xml" name = "rustical_xml"
version = "0.11.10" version = "0.11.17"
dependencies = [ dependencies = [
"quick-xml", "quick-xml",
"thiserror 2.0.17", "thiserror 2.0.17",
@@ -5439,7 +5441,7 @@ checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9"
[[package]] [[package]]
name = "xml_derive" name = "xml_derive"
version = "0.11.10" version = "0.11.17"
dependencies = [ dependencies = [
"darling 0.23.0", "darling 0.23.0",
"heck", "heck",

View File

@@ -160,6 +160,7 @@ rustical_store_sqlite.workspace = true
rustical_caldav.workspace = true rustical_caldav.workspace = true
rustical_carddav.workspace = true rustical_carddav.workspace = true
rustical_frontend.workspace = true rustical_frontend.workspace = true
ical.workspace = true
toml.workspace = true toml.workspace = true
serde.workspace = true serde.workspace = true
tokio.workspace = true tokio.workspace = true

View File

@@ -1,3 +1,4 @@
use ical::parser::{ical::IcalObjectParser, vcard::VcardParser};
use rustical_store::{AddressbookStore, CalendarStore, auth::AuthenticationProvider}; use rustical_store::{AddressbookStore, CalendarStore, auth::AuthenticationProvider};
use tracing::{error, info}; use tracing::{error, info};
@@ -8,21 +9,18 @@ pub async fn validate_calendar_objects_0_12(
let mut success = true; let mut success = true;
for principal in principal_store.get_principals().await? { for principal in principal_store.get_principals().await? {
for calendar in cal_store.get_calendars(&principal.id).await? { for calendar in cal_store.get_calendars(&principal.id).await? {
for object in cal_store for (object_id, object) in cal_store
.get_objects(&calendar.principal, &calendar.id) .get_objects(&calendar.principal, &calendar.id)
.await? .await?
{ {
if let Err(err) = ical_dev::parser::ical::IcalObjectParser::from_slice( if let Err(err) =
object.get_ics().as_bytes(), IcalObjectParser::from_slice(object.get_ics().as_bytes()).expect_one()
)
.expect_one()
{ {
success = false; success = false;
error!( error!(
"An error occured parsing a calendar object: principal={principal}, calendar={calendar}, object_id={object_id}: {err}", "An error occured parsing a calendar object: principal={principal}, calendar={calendar}, object_id={object_id}: {err}",
principal = principal.id, principal = principal.id,
calendar = calendar.id, calendar = calendar.id,
object_id = object.get_id()
); );
println!("{}", object.get_ics()); println!("{}", object.get_ics());
} }
@@ -48,20 +46,17 @@ pub async fn validate_address_objects_0_12(
let mut success = true; let mut success = true;
for principal in principal_store.get_principals().await? { for principal in principal_store.get_principals().await? {
for addressbook in addr_store.get_addressbooks(&principal.id).await? { for addressbook in addr_store.get_addressbooks(&principal.id).await? {
for object in addr_store for (object_id, object) in addr_store
.get_objects(&addressbook.principal, &addressbook.id) .get_objects(&addressbook.principal, &addressbook.id)
.await? .await?
{ {
if let Err(err) = if let Err(err) = VcardParser::from_slice(object.get_vcf().as_bytes()).expect_one()
ical_dev::parser::vcard::VcardParser::from_slice(object.get_vcf().as_bytes())
.expect_one()
{ {
success = false; success = false;
error!( error!(
"An error occured parsing an address object: principal={principal}, addressbook={addressbook}, object_id={object_id}: {err}", "An error occured parsing an address object: principal={principal}, addressbook={addressbook}, object_id={object_id}: {err}",
principal = principal.id, principal = principal.id,
addressbook = addressbook.id, addressbook = addressbook.id,
object_id = object.get_id()
); );
println!("{}", object.get_vcf()); println!("{}", object.get_vcf());
} }