mirror of
https://github.com/minio/minio.git
synced 2025-04-22 11:26:36 -04:00
avoid using URL encoding to generate keys (#6731)
This commit is contained in:
parent
3f744c0361
commit
89b14639a9
@ -21,6 +21,7 @@ import (
|
|||||||
"crypto/subtle"
|
"crypto/subtle"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
jwtgo "github.com/dgrijalva/jwt-go"
|
jwtgo "github.com/dgrijalva/jwt-go"
|
||||||
@ -131,7 +132,7 @@ func GetNewCredentialsWithMetadata(m map[string]interface{}, tokenSecret string)
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return cred, err
|
return cred, err
|
||||||
}
|
}
|
||||||
cred.SecretKey = string([]byte(base64.URLEncoding.EncodeToString(keyBytes))[:secretKeyMaxLen])
|
cred.SecretKey = strings.Replace(string([]byte(base64.StdEncoding.EncodeToString(keyBytes))[:secretKeyMaxLen]), "/", "+", -1)
|
||||||
cred.Status = "enabled"
|
cred.Status = "enabled"
|
||||||
|
|
||||||
expiry, ok := m["exp"].(float64)
|
expiry, ok := m["exp"].(float64)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user