DAV Push: Configurable list of allowed push targets

This commit is contained in:
Lennart
2025-01-15 18:05:02 +01:00
parent 4a78704cfa
commit 83d875133f
4 changed files with 85 additions and 29 deletions

View File

@@ -44,6 +44,25 @@ pub struct TracingConfig {
pub opentelemetry: bool,
}
#[derive(Debug, Deserialize, Serialize)]
#[serde(deny_unknown_fields, default)]
pub struct DavPushConfig {
pub enable: bool,
#[serde(default)]
// Allowed Push servers, accepts any by default
// Specify as URL origins
pub allowed_push_servers: Option<Vec<String>>,
}
impl Default for DavPushConfig {
fn default() -> Self {
Self {
enable: true,
allowed_push_servers: None,
}
}
}
#[derive(Debug, Deserialize, Serialize)]
#[serde(deny_unknown_fields)]
pub struct Config {
@@ -54,4 +73,6 @@ pub struct Config {
pub frontend: FrontendConfig,
#[serde(default)]
pub tracing: TracingConfig,
#[serde(default)]
pub dav_push: DavPushConfig,
}