From 3eb6e74535e71fed8689d4597f4a3a6c435bc72c Mon Sep 17 00:00:00 2001 From: Christian Richter Date: Mon, 24 Jul 2023 13:49:22 +0200 Subject: [PATCH] add missing options Signed-off-by: Christian Richter --- go.mod | 2 +- go.sum | 4 ++-- services/ocdav/pkg/command/server.go | 1 + services/ocdav/pkg/config/config.go | 3 +++ .../cs3org/reva/v2/pkg/micro/ocdav/option.go | 19 +++++++++++++------ .../cs3org/reva/v2/pkg/micro/ocdav/service.go | 3 +++ vendor/modules.txt | 4 ++-- 7 files changed, 25 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 9a9ac51740..31e2213d95 100644 --- a/go.mod +++ b/go.mod @@ -341,4 +341,4 @@ replace github.com/cs3org/go-cs3apis => github.com/2403905/go-cs3apis v0.0.0-202 // replace github.com/cs3org/reva/v2 => github.com/micbar/reva/v2 v2.0.0-20230626125956-c381fe19a108 -replace github.com/cs3org/reva/v2 => github.com/dragonchaser/reva/v2 v2.4.1-0.20230721092423-decf58981cfd +replace github.com/cs3org/reva/v2 => github.com/dragonchaser/reva/v2 v2.4.1-0.20230724131208-75f0f69666f9 diff --git a/go.sum b/go.sum index fc7c95e8ea..4dda080293 100644 --- a/go.sum +++ b/go.sum @@ -657,8 +657,8 @@ github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyG github.com/dnsimple/dnsimple-go v0.63.0/go.mod h1:O5TJ0/U6r7AfT8niYNlmohpLbCSG+c71tQlGr9SeGrg= github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/dragonchaser/reva/v2 v2.4.1-0.20230721092423-decf58981cfd h1:ngsy/v6TBnhJ2CqrXUmQBhlEhUs3y/TOMu7e2kSuonY= -github.com/dragonchaser/reva/v2 v2.4.1-0.20230721092423-decf58981cfd/go.mod h1:4z5EQghS2LhSWZWocH51Dw9VAs16No1zSFvFgQtgS7w= +github.com/dragonchaser/reva/v2 v2.4.1-0.20230724131208-75f0f69666f9 h1:vX6+r4itC3fNzPbWquOoR1VlRcZYIs453j9a4GGmeOw= +github.com/dragonchaser/reva/v2 v2.4.1-0.20230724131208-75f0f69666f9/go.mod h1:4z5EQghS2LhSWZWocH51Dw9VAs16No1zSFvFgQtgS7w= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e h1:rcHHSQqzCgvlwP0I/fQ8rQMn/MpHE5gWSLdtpxtP6KQ= diff --git a/services/ocdav/pkg/command/server.go b/services/ocdav/pkg/command/server.go index 5fd3c11bc9..7a54eab6b9 100644 --- a/services/ocdav/pkg/command/server.go +++ b/services/ocdav/pkg/command/server.go @@ -62,6 +62,7 @@ func Server(cfg *config.Config) *cli.Command { ocdav.AllowedOrigins(cfg.HTTP.CORS.AllowedOrigins), ocdav.FilesNamespace(cfg.FilesNamespace), ocdav.WebdavNamespace(cfg.WebdavNamespace), + ocdav.AllowDepthInfinity(cfg.AllowPropfindDepthInfinitiy), ocdav.SharesNamespace(cfg.SharesNamespace), ocdav.Timeout(cfg.Timeout), ocdav.Insecure(cfg.Insecure), diff --git a/services/ocdav/pkg/config/config.go b/services/ocdav/pkg/config/config.go index f3d420e2bc..732b835e36 100644 --- a/services/ocdav/pkg/config/config.go +++ b/services/ocdav/pkg/config/config.go @@ -35,7 +35,10 @@ type Config struct { Context context.Context `yaml:"-"` Status Status `yaml:"-"` + + AllowPropfindDepthInfinitiy bool `yaml:"allow_propfind_depth_infinitiy" env:"OCDAV_ALLOW_PROPFIND_DEPTH_INFINITY" desc:"Allow the use of depth infinity in PROPFINDS. Can cause heavy serverload"` } + type Tracing struct { Enabled bool `yaml:"enabled" env:"OCIS_TRACING_ENABLED;OCDAV_TRACING_ENABLED" desc:"Activates tracing."` Type string `yaml:"type" env:"OCIS_TRACING_TYPE;OCDAV_TRACING_TYPE" desc:"The type of tracing. Defaults to '', which is the same as 'jaeger'. Allowed tracing types are 'jaeger' and '' as of now."` diff --git a/vendor/github.com/cs3org/reva/v2/pkg/micro/ocdav/option.go b/vendor/github.com/cs3org/reva/v2/pkg/micro/ocdav/option.go index 838710cd9f..9dbea66fbe 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/micro/ocdav/option.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/micro/ocdav/option.go @@ -63,12 +63,13 @@ type Options struct { MetricsSubsystem string // ocdav.* is internal so we need to set config options individually - config config.Config - lockSystem ocdav.LockSystem - AllowCredentials bool - AllowedOrigins []string - AllowedHeaders []string - AllowedMethods []string + config config.Config + lockSystem ocdav.LockSystem + AllowCredentials bool + AllowedOrigins []string + AllowedHeaders []string + AllowedMethods []string + AllowDepthInfinity bool } // newOptions initializes the available default options. @@ -103,6 +104,12 @@ func Address(val string) Option { } } +func AllowDepthInfinity(val bool) Option { + return func(o *Options) { + o.AllowDepthInfinity = val + } +} + // JWTSecret provides a function to set the jwt secret option. func JWTSecret(s string) Option { return func(o *Options) { diff --git a/vendor/github.com/cs3org/reva/v2/pkg/micro/ocdav/service.go b/vendor/github.com/cs3org/reva/v2/pkg/micro/ocdav/service.go index 3173e0c90b..d7a8591cfc 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/micro/ocdav/service.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/micro/ocdav/service.go @@ -155,6 +155,9 @@ func setDefaults(sopts *Options) error { if sopts.config.VersionString == "" { sopts.config.VersionString = "0.0.0" } + + sopts.config.AllowPropfindDepthInfinitiy = sopts.AllowDepthInfinity + return nil } diff --git a/vendor/modules.txt b/vendor/modules.txt index 388fba5207..982a5dbdf7 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -352,7 +352,7 @@ github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1 github.com/cs3org/go-cs3apis/cs3/storage/registry/v1beta1 github.com/cs3org/go-cs3apis/cs3/tx/v1beta1 github.com/cs3org/go-cs3apis/cs3/types/v1beta1 -# github.com/cs3org/reva/v2 v2.15.1-0.20230718140539-0af2a07c7fd9 => github.com/dragonchaser/reva/v2 v2.4.1-0.20230721092423-decf58981cfd +# github.com/cs3org/reva/v2 v2.15.1-0.20230718140539-0af2a07c7fd9 => github.com/dragonchaser/reva/v2 v2.4.1-0.20230724131208-75f0f69666f9 ## explicit; go 1.20 github.com/cs3org/reva/v2/cmd/revad/internal/grace github.com/cs3org/reva/v2/cmd/revad/runtime @@ -2207,4 +2207,4 @@ stash.kopano.io/kgol/oidc-go ## explicit; go 1.13 stash.kopano.io/kgol/rndm # github.com/cs3org/go-cs3apis => github.com/2403905/go-cs3apis v0.0.0-20230517122726-727045414fd1 -# github.com/cs3org/reva/v2 => github.com/dragonchaser/reva/v2 v2.4.1-0.20230721092423-decf58981cfd +# github.com/cs3org/reva/v2 => github.com/dragonchaser/reva/v2 v2.4.1-0.20230724131208-75f0f69666f9