CalDAV Scheduling - part 6

This commit is contained in:
mdecimus
2025-06-21 19:53:23 +02:00
parent 068457ea87
commit 367ddeeae4
24 changed files with 869 additions and 73 deletions

View File

@@ -40,20 +40,23 @@ impl Server {
expiry_in: u64,
) -> trc::Result<String> {
// Build context
if client_id.len() > CLIENT_ID_MAX_LEN {
return Err(trc::AuthEvent::Error
.into_err()
.details("Client id too long"));
}
let mut password_hash = String::new();
// Include password hash if expiration is over 1 hour
let password_hash = if !matches!(grant_type, GrantType::Rsvp) && expiry_in > 3600 {
self.password_hash(account_id)
.await
.caused_by(trc::location!())?
} else {
"".into()
};
if !matches!(grant_type, GrantType::Rsvp) {
if client_id.len() > CLIENT_ID_MAX_LEN {
return Err(trc::AuthEvent::Error
.into_err()
.details("Client id too long"));
}
// Include password hash if expiration is over 1 hour
if expiry_in > 3600 {
password_hash = self
.password_hash(account_id)
.await
.caused_by(trc::location!())?
}
}
let key = &self.core.oauth.oauth_key;
let context = format!(

View File

@@ -133,7 +133,7 @@ impl Caches {
),
scheduling: Cache::from_config(
config,
"events",
"scheduling",
MB_1,
(std::mem::size_of::<DavResources>() + (500 * std::mem::size_of::<DavResource>()))
as u64,