File tree 1 file changed +3
-5
lines changed
src/client-side-encryption
1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,8 @@ export interface AutoEncryptionOptions {
105
105
proxyOptions ?: ProxyOptions ;
106
106
/** The TLS options to use connecting to the KMS provider */
107
107
tlsOptions ?: CSFLEKMSTlsOptions ;
108
+ /** Optional custom credential provider to use for KMS requests. */
109
+ awsCredentialProvider ?: AWSCredentialProvider ;
108
110
}
109
111
110
112
/**
@@ -239,6 +241,7 @@ export class AutoEncrypter {
239
241
this . _proxyOptions = options . proxyOptions || { } ;
240
242
this . _tlsOptions = options . tlsOptions || { } ;
241
243
this . _kmsProviders = options . kmsProviders || { } ;
244
+ this . _awsCredentialProvider = options . awsCredentialProvider ;
242
245
243
246
const mongoCryptOptions : MongoCryptOptions = {
244
247
cryptoCallbacks
@@ -329,11 +332,6 @@ export class AutoEncrypter {
329
332
* This function is a no-op when bypassSpawn is set or the crypt shared library is used.
330
333
*/
331
334
async init ( ) : Promise < MongoClient | void > {
332
- // This is handled during init() as the auto encrypter is instantiated during the client's
333
- // parseOptions() call, so the client doesn't have its options set at that point.
334
- this . _awsCredentialProvider =
335
- this . _client . options . credentials ?. mechanismProperties . AWS_CREDENTIAL_PROVIDER ;
336
-
337
335
if ( this . _bypassMongocryptdAndCryptShared || this . cryptSharedLibVersionInfo ) {
338
336
return ;
339
337
}
You can’t perform that action at this time.
0 commit comments