From ce0ae3c8d07f30f04f0e2029f13d49ac1deaeea1 Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Fri, 15 Sep 2023 10:14:11 +0200 Subject: [PATCH] update reva --- changelog/unreleased/add-passwod-policies.md | 1 + go.mod | 2 +- go.sum | 2 ++ .../owncloud/ocs/data/capabilities.go | 33 +++++++++---------- .../handlers/apps/sharing/shares/shares.go | 18 +++++----- .../reva/v2/pkg/password/password_policies.go | 4 +-- vendor/modules.txt | 2 +- 7 files changed, 32 insertions(+), 30 deletions(-) diff --git a/changelog/unreleased/add-passwod-policies.md b/changelog/unreleased/add-passwod-policies.md index ece2306e56d..6abaa7a1312 100644 --- a/changelog/unreleased/add-passwod-policies.md +++ b/changelog/unreleased/add-passwod-policies.md @@ -2,5 +2,6 @@ Enhancement: Add the password policies Add the password policies OCIS-3767 +https://github.com/owncloud/ocis/pull/7285 https://github.com/owncloud/ocis/pull/7194 https://github.com/cs3org/reva/pull/4147 diff --git a/go.mod b/go.mod index 7994cb5ccb9..63337d0c8ed 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/coreos/go-oidc v2.2.1+incompatible github.com/coreos/go-oidc/v3 v3.6.0 github.com/cs3org/go-cs3apis v0.0.0-20230516150832-730ac860c71d - github.com/cs3org/reva/v2 v2.16.1-0.20230911153145-a2e2320f3448 + github.com/cs3org/reva/v2 v2.16.1-0.20230915081009-843fe781fbf8 github.com/disintegration/imaging v1.6.2 github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e github.com/egirna/icap-client v0.1.1 diff --git a/go.sum b/go.sum index 6d5fa32f182..81bd3cf8993 100644 --- a/go.sum +++ b/go.sum @@ -1017,6 +1017,8 @@ github.com/crewjam/saml v0.4.13 h1:TYHggH/hwP7eArqiXSJUvtOPNzQDyQ7vwmwEqlFWhMc= github.com/crewjam/saml v0.4.13/go.mod h1:igEejV+fihTIlHXYP8zOec3V5A8y3lws5bQBFsTm4gA= github.com/cs3org/reva/v2 v2.16.1-0.20230911153145-a2e2320f3448 h1:cQt0iMKURVZ6d0DhiNh9eqJ0WTQfPwDn29VArnJpwYg= github.com/cs3org/reva/v2 v2.16.1-0.20230911153145-a2e2320f3448/go.mod h1:RvhuweTFqzezjUFU0SIdTXakrEx9vJlMvQ7znPXSP1g= +github.com/cs3org/reva/v2 v2.16.1-0.20230915081009-843fe781fbf8 h1:7aj/OEZ6NbpB3nSKRJUlp2l0AT0j5tGP0nynLZS8UpU= +github.com/cs3org/reva/v2 v2.16.1-0.20230915081009-843fe781fbf8/go.mod h1:RvhuweTFqzezjUFU0SIdTXakrEx9vJlMvQ7znPXSP1g= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= diff --git a/vendor/github.com/cs3org/reva/v2/internal/http/services/owncloud/ocs/data/capabilities.go b/vendor/github.com/cs3org/reva/v2/internal/http/services/owncloud/ocs/data/capabilities.go index a53ac679b91..27f24561666 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/http/services/owncloud/ocs/data/capabilities.go +++ b/vendor/github.com/cs3org/reva/v2/internal/http/services/owncloud/ocs/data/capabilities.go @@ -50,14 +50,14 @@ type CapabilitiesData struct { // Capabilities groups several capability aspects type Capabilities struct { - Core *CapabilitiesCore `json:"core" xml:"core"` - Checksums *CapabilitiesChecksums `json:"checksums" xml:"checksums"` - Files *CapabilitiesFiles `json:"files" xml:"files" mapstructure:"files"` - Dav *CapabilitiesDav `json:"dav" xml:"dav"` - FilesSharing *CapabilitiesFilesSharing `json:"files_sharing" xml:"files_sharing" mapstructure:"files_sharing"` - Spaces *Spaces `json:"spaces,omitempty" xml:"spaces,omitempty" mapstructure:"spaces"` - Graph *CapabilitiesGraph `json:"graph,omitempty" xml:"graph,omitempty" mapstructure:"graph"` - PasswordPolicies *CapabilitiesPasswordPolicies `json:"password_policies,omitempty" xml:"password_policies,omitempty" mapstructure:"password_policies"` + Core *CapabilitiesCore `json:"core" xml:"core"` + Checksums *CapabilitiesChecksums `json:"checksums" xml:"checksums"` + Files *CapabilitiesFiles `json:"files" xml:"files" mapstructure:"files"` + Dav *CapabilitiesDav `json:"dav" xml:"dav"` + FilesSharing *CapabilitiesFilesSharing `json:"files_sharing" xml:"files_sharing" mapstructure:"files_sharing"` + Spaces *Spaces `json:"spaces,omitempty" xml:"spaces,omitempty" mapstructure:"spaces"` + Graph *CapabilitiesGraph `json:"graph,omitempty" xml:"graph,omitempty" mapstructure:"graph"` + PasswordPolicy *CapabilitiesPasswordPolicy `json:"password_policy,omitempty" xml:"password_policy,omitempty" mapstructure:"password_policy"` Notifications *CapabilitiesNotifications `json:"notifications,omitempty" xml:"notifications,omitempty"` } @@ -86,15 +86,14 @@ type CapabilitiesGraph struct { Users CapabilitiesGraphUsers `json:"users" xml:"users" mapstructure:"users"` } -// CapabilitiesPasswordPolicies hold the password policies capabilities -type CapabilitiesPasswordPolicies struct { - MinCharacters int `json:"min_characters" xml:"min_characters" mapstructure:"min_characters"` - MaxCharacters int `json:"max_characters" xml:"max_characters" mapstructure:"max_characters"` - MinLowerCaseCharacters int `json:"min_lowercase_characters" xml:"min_lowercase_characters" mapstructure:"min_lowercase_characters"` - MinUpperCaseCharacters int `json:"min_uppercase_characters" xml:"min_uppercase_characters" mapstructure:"min_uppercase_characters"` - MinDigits int `json:"min_digits" xml:"min_digits" mapstructure:"min_digits"` - MinSpecialCharacters int `json:"min_special_characters" xml:"min_special_characters" mapstructure:"min_special_characters"` - SpecialCharacters string `json:"special_characters" xml:"special_characters" mapstructure:"special_characters"` +// CapabilitiesPasswordPolicy hold the password policy capabilities +type CapabilitiesPasswordPolicy struct { + MinCharacters int `json:"min_characters" xml:"min_characters" mapstructure:"min_characters"` + MaxCharacters int `json:"max_characters" xml:"max_characters" mapstructure:"max_characters"` + MinLowerCaseCharacters int `json:"min_lowercase_characters" xml:"min_lowercase_characters" mapstructure:"min_lowercase_characters"` + MinUpperCaseCharacters int `json:"min_uppercase_characters" xml:"min_uppercase_characters" mapstructure:"min_uppercase_characters"` + MinDigits int `json:"min_digits" xml:"min_digits" mapstructure:"min_digits"` + MinSpecialCharacters int `json:"min_special_characters" xml:"min_special_characters" mapstructure:"min_special_characters"` } // CapabilitiesGraphUsers holds the graph user capabilities diff --git a/vendor/github.com/cs3org/reva/v2/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go b/vendor/github.com/cs3org/reva/v2/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go index ff239b649c0..28ed61adc77 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go +++ b/vendor/github.com/cs3org/reva/v2/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go @@ -1591,15 +1591,15 @@ func publicPwdEnforced(c *config.Config) passwordEnforced { } func passwordPolicies(c *config.Config) password.Validator { - if c.Capabilities.Capabilities == nil || c.Capabilities.Capabilities.PasswordPolicies == nil { - return password.NewPasswordPolicies(0, 0, 0, 0, 0) - } - return password.NewPasswordPolicies( - c.Capabilities.Capabilities.PasswordPolicies.MinCharacters, - c.Capabilities.Capabilities.PasswordPolicies.MinLowerCaseCharacters, - c.Capabilities.Capabilities.PasswordPolicies.MinUpperCaseCharacters, - c.Capabilities.Capabilities.PasswordPolicies.MinDigits, - c.Capabilities.Capabilities.PasswordPolicies.MinSpecialCharacters, + if c.Capabilities.Capabilities == nil || c.Capabilities.Capabilities.PasswordPolicy == nil { + return password.NewPasswordPolicy(0, 0, 0, 0, 0) + } + return password.NewPasswordPolicy( + c.Capabilities.Capabilities.PasswordPolicy.MinCharacters, + c.Capabilities.Capabilities.PasswordPolicy.MinLowerCaseCharacters, + c.Capabilities.Capabilities.PasswordPolicy.MinUpperCaseCharacters, + c.Capabilities.Capabilities.PasswordPolicy.MinDigits, + c.Capabilities.Capabilities.PasswordPolicy.MinSpecialCharacters, ) } diff --git a/vendor/github.com/cs3org/reva/v2/pkg/password/password_policies.go b/vendor/github.com/cs3org/reva/v2/pkg/password/password_policies.go index 9a499ba8ce7..4cada0b9d34 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/password/password_policies.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/password/password_policies.go @@ -27,8 +27,8 @@ type Policies struct { specialCharactersRegexp *regexp.Regexp } -// NewPasswordPolicies returns a new NewPasswordPolicies instance -func NewPasswordPolicies(minCharacters, minLowerCaseCharacters, minUpperCaseCharacters, minDigits, minSpecialCharacters int) Validator { +// NewPasswordPolicy returns a new NewPasswordPolicy instance +func NewPasswordPolicy(minCharacters, minLowerCaseCharacters, minUpperCaseCharacters, minDigits, minSpecialCharacters int) Validator { p := &Policies{ minCharacters: minCharacters, minLowerCaseCharacters: minLowerCaseCharacters, diff --git a/vendor/modules.txt b/vendor/modules.txt index 26bae98c0b9..4d48b24484a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -359,7 +359,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.16.1-0.20230911153145-a2e2320f3448 +# github.com/cs3org/reva/v2 v2.16.1-0.20230915081009-843fe781fbf8 ## explicit; go 1.20 github.com/cs3org/reva/v2/cmd/revad/internal/grace github.com/cs3org/reva/v2/cmd/revad/runtime