@@ -29,6 +29,9 @@ describe('Client Side Encryption Corpus', function () {
2929 'base64'
3030 )
3131 } ;
32+ kmsProviders . kmip = {
33+ endpoint : 'localhost:5698'
34+ } ;
3235
3336 // TODO: build this into EJSON
3437 // TODO: make a custom chai assertion for this
@@ -55,6 +58,7 @@ describe('Client Side Encryption Corpus', function () {
5558 const corpusKeyLocal = loadCorpusData ( 'corpus-key-local.json' ) ;
5659 const corpusKeyAws = loadCorpusData ( 'corpus-key-aws.json' ) ;
5760 const corpusKeyAzure = loadCorpusData ( 'corpus-key-azure.json' ) ;
61+ const corpusKeyKmip = loadCorpusData ( 'corpus-key-kmip.json' ) ;
5862 const corpusKeyGcp = loadCorpusData ( 'corpus-key-gcp.json' ) ;
5963 const corpusAll = filterImportedObject ( loadCorpusData ( 'corpus.json' ) ) ;
6064 const corpusEncryptedExpectedAll = filterImportedObject ( loadCorpusData ( 'corpus-encrypted.json' ) ) ;
@@ -74,20 +78,23 @@ describe('Client Side Encryption Corpus', function () {
7478 [ 'local' , corpusKeyLocal . _id ] ,
7579 [ 'aws' , corpusKeyAws . _id ] ,
7680 [ 'azure' , corpusKeyAzure . _id ] ,
77- [ 'gcp' , corpusKeyGcp . _id ]
81+ [ 'gcp' , corpusKeyGcp . _id ] ,
82+ [ 'kmip' , corpusKeyKmip . _id ]
7883 ] ) ;
7984 const keyAltNameMap = new Map ( [
8085 [ 'local' , 'local' ] ,
8186 [ 'aws' , 'aws' ] ,
8287 [ 'azure' , 'azure' ] ,
83- [ 'gcp' , 'gcp' ]
88+ [ 'gcp' , 'gcp' ] ,
89+ [ 'kmip' , 'kmip' ]
8490 ] ) ;
8591 const copyOverValues = new Set ( [
8692 '_id' ,
8793 'altname_aws' ,
8894 'altname_local' ,
8995 'altname_azure' ,
90- 'altname_gcp'
96+ 'altname_gcp' ,
97+ 'altname_kmip'
9198 ] ) ;
9299
93100 let client ;
@@ -153,7 +160,13 @@ describe('Client Side Encryption Corpus', function () {
153160 . catch ( ( ) => { } )
154161 . then ( ( ) => keyDb . collection ( keyVaultCollName ) )
155162 . then ( keyColl =>
156- keyColl . insertMany ( [ corpusKeyLocal , corpusKeyAws , corpusKeyAzure , corpusKeyGcp ] )
163+ keyColl . insertMany ( [
164+ corpusKeyLocal ,
165+ corpusKeyAws ,
166+ corpusKeyAzure ,
167+ corpusKeyGcp ,
168+ corpusKeyKmip
169+ ] )
157170 ) ;
158171 } ) ;
159172 } ) ;
@@ -195,9 +208,16 @@ describe('Client Side Encryption Corpus', function () {
195208 // .. code:: javascript
196209 // Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk
197210 // Configure both objects with ``keyVaultNamespace`` set to ``keyvault.datakeys``.
211+ const tlsOptions = {
212+ kmip : {
213+ tlsCAFile : process . env . KMIP_TLS_CA_FILE ,
214+ tlsCertificateKeyFile : process . env . KMIP_TLS_CERT_FILE
215+ }
216+ } ;
198217 const autoEncryption = {
199218 keyVaultNamespace,
200- kmsProviders
219+ kmsProviders,
220+ tlsOptions
201221 } ;
202222 if ( useClientSideSchema ) {
203223 autoEncryption . schemaMap = {
@@ -210,7 +230,8 @@ describe('Client Side Encryption Corpus', function () {
210230 clientEncryption = new mongodbClientEncryption . ClientEncryption ( client , {
211231 bson : BSON ,
212232 keyVaultNamespace,
213- kmsProviders
233+ kmsProviders,
234+ tlsOptions
214235 } ) ;
215236 } ) ;
216237 } ) ;
0 commit comments