@@ -2,7 +2,7 @@ import { expect } from 'chai';
2
2
3
3
/* eslint-disable @typescript-eslint/no-restricted-imports */
4
4
import { ClientEncryption } from '../../../src/client-side-encryption/client_encryption' ;
5
- import { AWSTemporaryCredentialProvider , Binary } from '../../mongodb' ;
5
+ import { AWSTemporaryCredentialProvider , Binary , MongoClient } from '../../mongodb' ;
6
6
import { getEncryptExtraOptions } from '../../tools/utils' ;
7
7
8
8
const metadata : MongoDBMetadataUI = {
@@ -53,7 +53,7 @@ describe('25. Custom AWS Credential Providers', metadata, () => {
53
53
} ,
54
54
credentialProviders : { aws : credentialProvider . fromNodeProviderChain ( ) }
55
55
} ) ;
56
- } ) . to . throw ( ) ;
56
+ } ) . to . throw ( / c u s t o m c r e d e n t i a l p r o v i d e r a n d c r e d e n t i a l s / ) ;
57
57
} ) ;
58
58
}
59
59
) ;
@@ -84,37 +84,26 @@ describe('25. Custom AWS Credential Providers', metadata, () => {
84
84
} ) ;
85
85
} ) ;
86
86
87
- context . skip ( 'Case 3: Automatic encryption with different custom providers' , function ( ) {
88
- let client ;
89
-
90
- beforeEach ( function ( ) {
91
- client = this . configuration . newClient ( process . env . MONGODB_URI , {
92
- authMechanismProperties : {
93
- AWS_CREDENTIAL_PROVIDER : credentialProvider . fromNodeProviderChain ( )
94
- } ,
95
- autoEncryption : {
96
- keyVaultNamespace : 'keyvault.datakeys' ,
97
- kmsProviders : { aws : { } } ,
98
- credentialProviders : {
99
- aws : async ( ) => {
100
- return {
101
- accessKeyId : process . env . FLE_AWS_KEY ,
102
- secretAccessKey : process . env . FLE_AWS_SECRET
103
- } ;
87
+ context (
88
+ 'Case 3: Auto encryption with credentials and custom credential provider' ,
89
+ metadata ,
90
+ function ( ) {
91
+ it ( 'throws an error' , metadata , function ( ) {
92
+ expect ( ( ) => {
93
+ new MongoClient ( 'mongodb://127.0.0.1:27017' , {
94
+ autoEncryption : {
95
+ keyVaultNamespace : 'keyvault.datakeys' ,
96
+ kmsProviders : {
97
+ aws : {
98
+ accessKeyId : process . env . FLE_AWS_KEY ,
99
+ secretAccessKey : process . env . FLE_AWS_SECRET
100
+ }
101
+ } ,
102
+ credentialProviders : { aws : credentialProvider . fromNodeProviderChain ( ) }
104
103
}
105
- } ,
106
- extraOptions : getEncryptExtraOptions ( )
107
- }
104
+ } ) ;
105
+ } ) . to . throw ( / c u s t o m c r e d e n t i a l p r o v i d e r a n d c r e d e n t i a l s / ) ;
108
106
} ) ;
109
- } ) ;
110
-
111
- afterEach ( async function ( ) {
112
- await client ?. close ( ) ;
113
- } ) ;
114
-
115
- it ( 'is successful' , async function ( ) {
116
- const result = await client . db ( 'test' ) . collection ( 'test' ) . insertOne ( { n : 1 } ) ;
117
- expect ( result . ok ) . to . equal ( 1 ) ;
118
- } ) ;
119
- } ) ;
107
+ }
108
+ ) ;
120
109
} ) ;
0 commit comments