CalDAV Scheduling - part 6
This commit is contained in:
@@ -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!(
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user