Browse Source

compile

pull/7160/head
chrislu 1 month ago
parent
commit
db58964a21
  1. 8
      test/s3/iam/s3_iam_framework.go

8
test/s3/iam/s3_iam_framework.go

@ -2,13 +2,13 @@ package iam
import ( import (
"context" "context"
"crypto/rand"
cryptorand "crypto/rand"
"crypto/rsa" "crypto/rsa"
"encoding/base64" "encoding/base64"
"encoding/json" "encoding/json"
"fmt" "fmt"
"io" "io"
"math/rand"
mathrand "math/rand"
"net/http" "net/http"
"net/http/httptest" "net/http/httptest"
"net/url" "net/url"
@ -91,7 +91,7 @@ func NewS3IAMTestFramework(t *testing.T) *S3IAMTestFramework {
t.Logf("Using mock OIDC server for testing") t.Logf("Using mock OIDC server for testing")
// Generate RSA keys for JWT signing (mock mode) // Generate RSA keys for JWT signing (mock mode)
var err error var err error
framework.privateKey, err = rsa.GenerateKey(rand.Reader, 2048)
framework.privateKey, err = rsa.GenerateKey(cryptorand.Reader, 2048)
require.NoError(t, err) require.NoError(t, err)
framework.publicKey = &framework.privateKey.PublicKey framework.publicKey = &framework.privateKey.PublicKey
@ -622,7 +622,7 @@ func (f *S3IAMTestFramework) GenerateUniqueBucketName(prefix string) string {
testName = strings.ReplaceAll(testName, "_", "-") testName = strings.ReplaceAll(testName, "_", "-")
// Add random suffix to handle parallel tests // Add random suffix to handle parallel tests
randomSuffix := rand.Intn(10000)
randomSuffix := mathrand.Intn(10000)
return fmt.Sprintf("%s-%s-%d", prefix, testName, randomSuffix) return fmt.Sprintf("%s-%s-%d", prefix, testName, randomSuffix)
} }

Loading…
Cancel
Save