mirror of
https://github.com/minio/minio.git
synced 2025-11-20 18:06:10 -05:00
jwt: Simplify JWT parsing (#8802)
JWT parsing is simplified by using a custom claim
data structure such as MapClaims{}, also writes
a custom Unmarshaller for faster unmarshalling.
- Avoid as much reflections as possible
- Provide the right types for functions as much
as possible
- Avoid strings.Join, strings.Split to reduce
allocations, rely on indexes directly.
This commit is contained in:
@@ -201,7 +201,9 @@ func getReqAccessCred(r *http.Request, region string) (cred auth.Credentials) {
|
||||
if owner {
|
||||
return globalActiveCred
|
||||
}
|
||||
cred, _ = globalIAMSys.GetUser(claims.AccessKey())
|
||||
if claims != nil {
|
||||
cred, _ = globalIAMSys.GetUser(claims.AccessKey)
|
||||
}
|
||||
}
|
||||
return cred
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user