Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
qingyang-hu committed Dec 2, 2024
1 parent f1f2c08 commit db03cdf
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions internal/integration/client_side_encryption_prose_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3023,6 +3023,24 @@ func TestClientSideEncryptionProse(t *testing.T) {
return res.Body.Close()
}

kmsProviders := map[string]map[string]interface{}{
"aws": {
"accessKeyId": awsAccessKeyID,
"secretAccessKey": awsSecretAccessKey,
},
"azure": {
"tenantId": azureTenantID,
"clientId": azureClientID,
"clientSecret": azureClientSecret,
"identityPlatformEndpoint": "127.0.0.1:9003",
},
"gcp": {
"email": gcpEmail,
"privateKey": gcpPrivateKey,
"endpoint": "127.0.0.1:9003",
},
}

dataKeys := []struct {
provider string
masterKey interface{}
Expand Down Expand Up @@ -3056,15 +3074,12 @@ func TestClientSideEncryptionProse(t *testing.T) {
for _, tc := range testCases {
for _, dataKey := range dataKeys {
mt.Run(fmt.Sprintf("%s_%s", tc.name, dataKey.provider), func(mt *mtest.T) {
if dataKey.provider == "azure" || dataKey.provider == "gcp" {
mt.Skipf("For some reason libmongocrypt ignores custom endpoints for Azure and CGP")
}
keyVaultClient, err := mongo.Connect(options.Client().ApplyURI(mtest.ClusterURI()))
require.NoError(mt, err, "error on Connect: %v", err)

ceo := options.ClientEncryption().
SetKeyVaultNamespace(kvNamespace).
SetKmsProviders(fullKmsProvidersMap).
SetKmsProviders(kmsProviders).
SetTLSConfig(map[string]*tls.Config{dataKey.provider: tlsCfg})
clientEncryption, err := mongo.NewClientEncryption(keyVaultClient, ceo)
require.NoError(mt, err, "error on NewClientEncryption: %v", err)
Expand Down

0 comments on commit db03cdf

Please sign in to comment.