Search dav spaces (#4661)

* Add a Ref option to SearchRequest, e.g. for limiting the search to a space

* Enable REPORT requests for /dav/spaces URLs

* Limit the search to the according space in case of /dav/spaces searches

* Add changelog

* Adapt expected failures

* Comment exported functions
This commit is contained in:
Andre Duffeck
2022-09-27 10:38:15 +02:00
committed by GitHub
parent 918bc85879
commit 68b17eb68d
15 changed files with 286 additions and 201 deletions

View File

@@ -127,6 +127,11 @@ func DefaultPolicies() []config.Policy {
Endpoint: "/remote.php/webdav",
Backend: "http://localhost:9115", // TODO use registry?
},
{
Method: "REPORT",
Endpoint: "/dav/spaces",
Backend: "http://localhost:9115",
},
{
Type: config.QueryRoute,
Endpoint: "/dav/?preview=1",
@@ -204,6 +209,7 @@ func DefaultPolicies() []config.Policy {
}
}
// EnsureDefaults adds default values to the configuration if they are not set yet
func EnsureDefaults(cfg *config.Config) {
// provide with defaults for shared logging, since we need a valid destination address for "envdecode".
if cfg.Log == nil && cfg.Commons != nil && cfg.Commons.Log != nil {
@@ -249,8 +255,8 @@ func EnsureDefaults(cfg *config.Config) {
}
}
// Sanitize sanitizes the configuration
func Sanitize(cfg *config.Config) {
// sanitize config
if cfg.Policies == nil {
cfg.Policies = DefaultPolicies()
}