mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-22 14:04:28 +02:00
Fix variable scoping in verifyV4Signature for STS session token validation
This commit is contained in:
1 parent
198ecdb141
commit
571338a474
1 file changed
+4
-1
@@ -205,6 +205,8 @@ func (iam *IdentityAccessManagement) verifyV4Signature(r *http.Request, shouldCh
|
||||
return nil, nil, "", nil, errCode
|
||||
}
|
||||
|
||||
var cred *Credential
|
||||
|
||||
// 2. Check for STS session token
|
||||
if sessionToken := r.Header.Get("X-Amz-Security-Token"); sessionToken != "" {
|
||||
// Validate STS session token
|
||||
@@ -214,7 +216,8 @@ func (iam *IdentityAccessManagement) verifyV4Signature(r *http.Request, shouldCh
|
||||
}
|
||||
} else {
|
||||
// 3. Lookup user and credentials
|
||||
identity, cred, found := iam.lookupByAccessKey(authInfo.AccessKey)
|
||||
var found bool
|
||||
identity, cred, found = iam.lookupByAccessKey(authInfo.AccessKey)
|
||||
if !found {
|
||||
// Log detailed error information for InvalidAccessKeyId
|
||||
iam.m.RLock()
|
||||
|
||||
Reference in new issue
Block a user