aboutsummaryrefslogtreecommitdiff
path: root/weed/s3api/auth_credentials.go
diff options
context:
space:
mode:
authorshichanglin5 <shichanglin5@qq.com>2022-06-13 13:23:26 +0800
committershichanglin5 <shichanglin5@qq.com>2022-06-13 13:23:26 +0800
commitf01dd27752c507bc99013da4502c12877aaeff26 (patch)
tree99a25cf9ebf602f8dfb0aca9a5e8e66e80200eb4 /weed/s3api/auth_credentials.go
parent37da68931941b1f084b7f4312722e4241e9ab0b0 (diff)
downloadseaweedfs-f01dd27752c507bc99013da4502c12877aaeff26.tar.xz
seaweedfs-f01dd27752c507bc99013da4502c12877aaeff26.zip
fix: When there is no access permission configured before startup, the authentication does not take effect after configuring the permission after startup
Diffstat (limited to 'weed/s3api/auth_credentials.go')
-rw-r--r--weed/s3api/auth_credentials.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/weed/s3api/auth_credentials.go b/weed/s3api/auth_credentials.go
index 757e3ddd9..fb23d9ce9 100644
--- a/weed/s3api/auth_credentials.go
+++ b/weed/s3api/auth_credentials.go
@@ -176,12 +176,12 @@ func (iam *IdentityAccessManagement) lookupAnonymous() (identity *Identity, foun
}
func (iam *IdentityAccessManagement) Auth(f http.HandlerFunc, action Action) http.HandlerFunc {
-
- if !iam.isEnabled() {
- return f
- }
-
return func(w http.ResponseWriter, r *http.Request) {
+ if !iam.isEnabled() {
+ f(w, r)
+ return
+ }
+
identity, errCode := iam.authRequest(r, action)
if errCode == s3err.ErrNone {
if identity != nil && identity.Name != "" {