Browse Source
Merge pull request #3169 from shichanglin5/fix_auth
fix: When there is no access permission configured before startup, th…
pull/3171/head
Chris Lu
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
5 additions and
5 deletions
-
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 != "" { |
|
|
|