@@ -118,6 +118,14 @@ public static function fromClientSideEncryption(stdClass $test, $databaseName, $
118
118
if (isset ($ autoEncryptionOptions ['kmsProviders ' ]->aws )) {
119
119
$ autoEncryptionOptions ['kmsProviders ' ]->aws = self ::getAWSCredentials ();
120
120
}
121
+
122
+ if (isset ($ autoEncryptionOptions ['kmsProviders ' ]->azure )) {
123
+ $ autoEncryptionOptions ['kmsProviders ' ]->azure = self ::getAzureCredentials ();
124
+ }
125
+
126
+ if (isset ($ autoEncryptionOptions ['kmsProviders ' ]->gcp )) {
127
+ $ autoEncryptionOptions ['kmsProviders ' ]->gcp = self ::getGCPCredentials ();
128
+ }
121
129
}
122
130
123
131
if (isset ($ test ->outcome ->collection ->name )) {
@@ -260,6 +268,41 @@ public static function getAWSCredentials()
260
268
];
261
269
}
262
270
271
+ /**
272
+ * @return array
273
+ *
274
+ * @throws SkippedTestError
275
+ */
276
+ public static function getAzureCredentials ()
277
+ {
278
+ if (! getenv ('AZURE_TENANT_ID ' ) || ! getenv ('AZURE_CLIENT_ID ' ) || ! getenv ('AZURE_CLIENT_SECRET ' )) {
279
+ throw new SkippedTestError ('Please configure Azure credentials to use Azure KMS provider. ' );
280
+ }
281
+
282
+ return [
283
+ 'tenantId ' => getenv ('AZURE_TENANT_ID ' ),
284
+ 'clientId ' => getenv ('AZURE_CLIENT_ID ' ),
285
+ 'clientSecret ' => getenv ('AZURE_CLIENT_SECRET ' ),
286
+ ];
287
+ }
288
+
289
+ /**
290
+ * @return array
291
+ *
292
+ * @throws SkippedTestError
293
+ */
294
+ public static function getGCPCredentials ()
295
+ {
296
+ if (! getenv ('GCP_EMAIL ' ) || ! getenv ('GCP_PRIVATE_KEY ' )) {
297
+ throw new SkippedTestError ('Please configure GCP credentials to use GCP KMS provider. ' );
298
+ }
299
+
300
+ return [
301
+ 'email ' => getenv ('GCP_EMAIL ' ),
302
+ 'privateKey ' => getenv ('GCP_PRIVATE_KEY ' ),
303
+ ];
304
+ }
305
+
263
306
/**
264
307
* @return Client
265
308
*/
0 commit comments