1
0
mirror of https://github.com/minio/mc.git synced 2025-11-09 02:22:18 +03:00

support missing role-arn and role-session-name (#4763)

This commit is contained in:
Harshavardhana
2023-11-15 14:45:58 -08:00
committed by GitHub
parent 6c9cdc27bc
commit 4724c024c6
3 changed files with 17 additions and 3 deletions

View File

@@ -84,6 +84,9 @@ func max(a, b int) int {
// randString generates random names and prepends them with a known prefix.
func randString(n int, src rand.Source, prefix string) string {
if n == 0 {
return prefix
}
b := make([]byte, n)
// A rand.Int63() generates 63 random bits, enough for letterIdxMax letters!
for i, cache, remain := n-1, src.Int63(), letterIdxMax; i >= 0; {
@@ -97,7 +100,11 @@ func randString(n int, src rand.Source, prefix string) string {
cache >>= letterIdxBits
remain--
}
return prefix + string(b[0:30-len(prefix)])
x := n / 2
if x == 0 {
x = 1
}
return prefix + string(b[0:x])
}
// printTLSCertInfo prints some fields of the certificates received from the server.