diff options
Diffstat (limited to 'jstests/client_encrypt/fle_valid_fle_options.js')
-rw-r--r-- | jstests/client_encrypt/fle_valid_fle_options.js | 90 |
1 files changed, 47 insertions, 43 deletions
diff --git a/jstests/client_encrypt/fle_valid_fle_options.js b/jstests/client_encrypt/fle_valid_fle_options.js index 9bdabaf4875..08a44f18725 100644 --- a/jstests/client_encrypt/fle_valid_fle_options.js +++ b/jstests/client_encrypt/fle_valid_fle_options.js @@ -3,60 +3,64 @@ load("jstests/client_encrypt/lib/mock_kms.js"); load('jstests/ssl/libs/ssl_helpers.js'); (function() { - "use strict"; +"use strict"; - const mock_kms = new MockKMSServer(); - mock_kms.start(); +const mock_kms = new MockKMSServer(); +mock_kms.start(); - const randomAlgorithm = "AEAD_AES_256_CBC_HMAC_SHA_512-Random"; - const deterministicAlgorithm = "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic"; +const randomAlgorithm = "AEAD_AES_256_CBC_HMAC_SHA_512-Random"; +const deterministicAlgorithm = "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic"; - const x509_options = - {sslMode: "requireSSL", sslPEMKeyFile: SERVER_CERT, sslCAFile: CA_CERT, vvvvv: ""}; +const x509_options = { + sslMode: "requireSSL", + sslPEMKeyFile: SERVER_CERT, + sslCAFile: CA_CERT, + vvvvv: "" +}; - const conn = MongoRunner.runMongod(x509_options); - const unencryptedDatabase = conn.getDB("test"); - const collection = unencryptedDatabase.keystore; +const conn = MongoRunner.runMongod(x509_options); +const unencryptedDatabase = conn.getDB("test"); +const collection = unencryptedDatabase.keystore; - const awsKMS = { - accessKeyId: "access", - secretAccessKey: "secret", - url: mock_kms.getURL(), - }; +const awsKMS = { + accessKeyId: "access", + secretAccessKey: "secret", + url: mock_kms.getURL(), +}; - const clientSideFLEOptionsFail = [ - { - kmsProviders: { - aws: awsKMS, - }, - schemaMap: {}, +const clientSideFLEOptionsFail = [ + { + kmsProviders: { + aws: awsKMS, }, - { - keyVaultNamespace: "test.keystore", - schemaMap: {}, - }, - ]; + schemaMap: {}, + }, + { + keyVaultNamespace: "test.keystore", + schemaMap: {}, + }, +]; - clientSideFLEOptionsFail.forEach(element => { - assert.throws(Mongo, [conn.host, element]); - }); +clientSideFLEOptionsFail.forEach(element => { + assert.throws(Mongo, [conn.host, element]); +}); - const clientSideFLEOptionsPass = [ - { - kmsProviders: { - aws: awsKMS, - }, - keyVaultNamespace: "test.keystore", - schemaMap: {}, +const clientSideFLEOptionsPass = [ + { + kmsProviders: { + aws: awsKMS, }, - ]; + keyVaultNamespace: "test.keystore", + schemaMap: {}, + }, +]; - clientSideFLEOptionsPass.forEach(element => { - assert.doesNotThrow(() => { - Mongo(conn.host, element); - }); +clientSideFLEOptionsPass.forEach(element => { + assert.doesNotThrow(() => { + Mongo(conn.host, element); }); +}); - MongoRunner.stopMongod(conn); - mock_kms.stop(); +MongoRunner.stopMongod(conn); +mock_kms.stop(); }()); |