mirror of
https://github.com/minio/minio.git
synced 2026-11-26 07:24:49 +00:00
add missing validate access keys after being extracted from AuthHeader
This commit is contained in:
1 parent
138288f788
commit
e11f9110b6
2 files changed
+19
-19
No files matched your search
@@ -23,6 +23,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/minio/minio/pkg/api/config"
|
||||
"github.com/minio/minio/pkg/utils/crypto/keys"
|
||||
)
|
||||
|
||||
type contentTypeHandler struct {
|
||||
@@ -78,6 +79,9 @@ func stripAuth(r *http.Request) (*auth, error) {
|
||||
a.signedheaders = strings.Split(signedheaders, "=")[1]
|
||||
a.signature = strings.Split(signature, "=")[1]
|
||||
a.accessKey = strings.Split(a.credential, "/")[0]
|
||||
if !keys.IsValidAccessKey(a.accessKey) {
|
||||
return nil, errors.New("Invalid access key")
|
||||
}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user