mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
Fix Access Key requests (#11979)
Fix accessing claims when auth error is unchecked. Only replaced when unchecked and when clearly without side effects. Fixes #11959
This commit is contained in:
parent
abb55bd49e
commit
0276652f26
@ -81,6 +81,15 @@ type MapClaims struct {
|
||||
jwtgo.MapClaims
|
||||
}
|
||||
|
||||
// GetAccessKey will return the access key.
|
||||
// If nil an empty string will be returned.
|
||||
func (c *MapClaims) GetAccessKey() string {
|
||||
if c == nil {
|
||||
return ""
|
||||
}
|
||||
return c.AccessKey
|
||||
}
|
||||
|
||||
// NewStandardClaims - initializes standard claims
|
||||
func NewStandardClaims() *StandardClaims {
|
||||
return &StandardClaims{}
|
||||
|
@ -226,7 +226,7 @@ func (web *webAPIHandlers) MakeBucket(r *http.Request, args *MakeBucketArgs, rep
|
||||
reply.UIVersion = Version
|
||||
|
||||
reqParams := extractReqParams(r)
|
||||
reqParams["accessKey"] = claims.AccessKey
|
||||
reqParams["accessKey"] = claims.GetAccessKey()
|
||||
|
||||
sendEvent(eventArgs{
|
||||
EventName: event.BucketCreated,
|
||||
@ -723,7 +723,7 @@ func (web *webAPIHandlers) RemoveObject(r *http.Request, args *RemoveObjectArgs,
|
||||
)
|
||||
|
||||
reqParams := extractReqParams(r)
|
||||
reqParams["accessKey"] = claims.AccessKey
|
||||
reqParams["accessKey"] = claims.GetAccessKey()
|
||||
sourceIP := handlers.GetSourceIP(r)
|
||||
|
||||
next:
|
||||
@ -1340,7 +1340,7 @@ func (web *webAPIHandlers) Upload(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
reqParams := extractReqParams(r)
|
||||
reqParams["accessKey"] = claims.AccessKey
|
||||
reqParams["accessKey"] = claims.GetAccessKey()
|
||||
|
||||
// Notify object created event.
|
||||
sendEvent(eventArgs{
|
||||
@ -1529,7 +1529,7 @@ func (web *webAPIHandlers) Download(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
reqParams := extractReqParams(r)
|
||||
reqParams["accessKey"] = claims.AccessKey
|
||||
reqParams["accessKey"] = claims.GetAccessKey()
|
||||
|
||||
// Notify object accessed via a GET request.
|
||||
sendEvent(eventArgs{
|
||||
@ -1684,7 +1684,7 @@ func (web *webAPIHandlers) DownloadZip(w http.ResponseWriter, r *http.Request) {
|
||||
defer archive.Close()
|
||||
|
||||
reqParams := extractReqParams(r)
|
||||
reqParams["accessKey"] = claims.AccessKey
|
||||
reqParams["accessKey"] = claims.GetAccessKey()
|
||||
respElements := extractRespElements(w)
|
||||
|
||||
for i, object := range args.Objects {
|
||||
|
Loading…
Reference in New Issue
Block a user