Basic, PUT, GET, DELETE and MKCOL WebDAV tests
This commit is contained in:
@@ -7,7 +7,8 @@
|
||||
use utils::config::Config;
|
||||
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub struct DavConfig {
|
||||
pub struct GroupwareConfig {
|
||||
// DAV settings
|
||||
pub max_request_size: usize,
|
||||
pub dead_property_size: Option<usize>,
|
||||
pub live_property_size: usize,
|
||||
@@ -15,19 +16,26 @@ pub struct DavConfig {
|
||||
pub max_locks_per_user: usize,
|
||||
pub max_changes: usize,
|
||||
pub max_match_results: usize,
|
||||
pub max_vcard_size: usize,
|
||||
|
||||
// Calendar settings
|
||||
pub max_ical_size: usize,
|
||||
pub max_ical_instances: usize,
|
||||
pub max_ical_attendees_per_instance: usize,
|
||||
pub default_calendar_name: Option<String>,
|
||||
pub default_addressbook_name: Option<String>,
|
||||
pub default_calendar_display_name: Option<String>,
|
||||
|
||||
// Addressbook settings
|
||||
pub max_vcard_size: usize,
|
||||
pub default_addressbook_name: Option<String>,
|
||||
pub default_addressbook_display_name: Option<String>,
|
||||
|
||||
// File storage settings
|
||||
pub max_file_size: usize,
|
||||
}
|
||||
|
||||
impl DavConfig {
|
||||
impl GroupwareConfig {
|
||||
pub fn parse(config: &mut Config) -> Self {
|
||||
DavConfig {
|
||||
GroupwareConfig {
|
||||
max_request_size: config
|
||||
.property("dav.limits.size.request")
|
||||
.unwrap_or(25 * 1024 * 1024),
|
||||
@@ -75,6 +83,9 @@ impl DavConfig {
|
||||
max_ical_attendees_per_instance: config
|
||||
.property("dav.limits.ical.max-attendees-per-instance")
|
||||
.unwrap_or(1000),
|
||||
max_file_size: config
|
||||
.property("dav.limits.size.file")
|
||||
.unwrap_or(25 * 1024 * 1024),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,10 +6,18 @@
|
||||
|
||||
use std::{str::FromStr, sync::Arc};
|
||||
|
||||
use self::{
|
||||
imap::ImapConfig, jmap::settings::JmapConfig, scripts::Scripting, smtp::SmtpConfig,
|
||||
storage::Storage,
|
||||
};
|
||||
use crate::{
|
||||
Core, Network, Security, auth::oauth::config::OAuthConfig, expr::*,
|
||||
listener::tls::AcmeProviders, manager::config::ConfigManager,
|
||||
};
|
||||
use arc_swap::ArcSwap;
|
||||
use base64::{Engine, engine::general_purpose};
|
||||
use dav::DavConfig;
|
||||
use directory::{Directories, Directory};
|
||||
use groupware::GroupwareConfig;
|
||||
use hyper::{
|
||||
HeaderMap,
|
||||
header::{AUTHORIZATION, HeaderName, HeaderValue},
|
||||
@@ -20,17 +28,7 @@ use store::{BlobBackend, BlobStore, FtsStore, InMemoryStore, Store, Stores};
|
||||
use telemetry::Metrics;
|
||||
use utils::config::{Config, utils::AsKey};
|
||||
|
||||
use crate::{
|
||||
Core, Network, Security, auth::oauth::config::OAuthConfig, expr::*,
|
||||
listener::tls::AcmeProviders, manager::config::ConfigManager,
|
||||
};
|
||||
|
||||
use self::{
|
||||
imap::ImapConfig, jmap::settings::JmapConfig, scripts::Scripting, smtp::SmtpConfig,
|
||||
storage::Storage,
|
||||
};
|
||||
|
||||
pub mod dav;
|
||||
pub mod groupware;
|
||||
pub mod imap;
|
||||
pub mod inner;
|
||||
pub mod jmap;
|
||||
@@ -188,7 +186,7 @@ impl Core {
|
||||
acme: AcmeProviders::parse(config),
|
||||
metrics: Metrics::parse(config),
|
||||
spam: SpamFilterConfig::parse(config).await,
|
||||
dav: DavConfig::parse(config),
|
||||
groupware: GroupwareConfig::parse(config),
|
||||
storage: Storage {
|
||||
data,
|
||||
blob,
|
||||
|
||||
@@ -6,22 +6,12 @@
|
||||
|
||||
#![warn(clippy::large_futures)]
|
||||
|
||||
use std::{
|
||||
hash::{BuildHasher, Hasher},
|
||||
net::{IpAddr, Ipv4Addr, Ipv6Addr},
|
||||
sync::{
|
||||
Arc,
|
||||
atomic::{AtomicBool, AtomicU8},
|
||||
},
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
use ahash::{AHashMap, AHashSet};
|
||||
use arc_swap::ArcSwap;
|
||||
use auth::{AccessToken, oauth::config::OAuthConfig, roles::RolePermissions};
|
||||
use calcard::common::timezone::Tz;
|
||||
use config::{
|
||||
dav::DavConfig,
|
||||
groupware::GroupwareConfig,
|
||||
imap::ImapConfig,
|
||||
jmap::settings::{JmapConfig, SpecialUse},
|
||||
network::Network,
|
||||
@@ -34,16 +24,23 @@ use config::{
|
||||
storage::Storage,
|
||||
telemetry::Metrics,
|
||||
};
|
||||
|
||||
use ipc::{HousekeeperEvent, QueueEvent, ReportingEvent, StateEvent};
|
||||
use jmap_proto::types::value::AclGrant;
|
||||
use listener::{asn::AsnGeoLookupData, blocked::Security, tls::AcmeProviders};
|
||||
|
||||
use mail_auth::{MX, Txt};
|
||||
use manager::webadmin::{Resource, WebAdminManager};
|
||||
use nlp::bayes::{TokenHash, Weights};
|
||||
use parking_lot::{Mutex, RwLock};
|
||||
use rustls::sign::CertifiedKey;
|
||||
use std::{
|
||||
hash::{BuildHasher, Hasher},
|
||||
net::{IpAddr, Ipv4Addr, Ipv6Addr},
|
||||
sync::{
|
||||
Arc,
|
||||
atomic::{AtomicBool, AtomicU8},
|
||||
},
|
||||
time::Duration,
|
||||
};
|
||||
use store::roaring::RoaringBitmap;
|
||||
use tinyvec::TinyVec;
|
||||
use tokio::sync::{Notify, Semaphore, mpsc};
|
||||
@@ -253,7 +250,7 @@ pub struct DavResources {
|
||||
pub modseq: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
#[derive(Debug, Default, Clone)]
|
||||
pub struct DavResource {
|
||||
pub document_id: u32,
|
||||
pub parent_id: Option<u32>,
|
||||
@@ -261,7 +258,7 @@ pub struct DavResource {
|
||||
pub data: DavResourceMetadata,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
#[derive(Debug, Default, Clone)]
|
||||
pub enum DavResourceMetadata {
|
||||
File {
|
||||
size: u32,
|
||||
@@ -288,7 +285,7 @@ pub struct Core {
|
||||
pub oauth: OAuthConfig,
|
||||
pub smtp: SmtpConfig,
|
||||
pub jmap: JmapConfig,
|
||||
pub dav: DavConfig,
|
||||
pub groupware: GroupwareConfig,
|
||||
pub spam: SpamFilterConfig,
|
||||
pub imap: ImapConfig,
|
||||
pub metrics: Metrics,
|
||||
|
||||
Reference in New Issue
Block a user