@@ -2,6 +2,7 @@ import { BSON, EJSON } from 'bson';
22import { expect } from 'chai' ;
33import * as fs from 'fs/promises' ;
44import * as path from 'path' ;
5+ import { satisfies } from 'semver' ;
56
67// eslint-disable-next-line @typescript-eslint/no-restricted-imports
78import { ClientEncryption } from '../../../src/client-side-encryption/client_encryption' ;
@@ -47,6 +48,15 @@ const metadata: MongoDBMetadataUI = {
4748 }
4849} ;
4950
51+ const kmsTlsMetadata : MongoDBMetadataUI = {
52+ requires : {
53+ clientSideEncryption : true ,
54+ topology : '!load-balanced' ,
55+ predicate : ( ) =>
56+ satisfies ( process . version , '<25.0.0' ) ? true : 'TODO(NODE-7252): fix these tests in v25'
57+ }
58+ } ;
59+
5060const eeMetadata : MongoDBMetadataUI = {
5161 requires : {
5262 clientSideEncryption : true ,
@@ -1370,7 +1380,7 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
13701380 * - Create client encryption expired
13711381 * - Create client encryption invalid hostname
13721382 */
1373- context ( 'KMS TLS Options Tests' , metadata , function ( ) {
1383+ context ( 'KMS TLS Options Tests' , kmsTlsMetadata , function ( ) {
13741384 let clientNoTls ;
13751385 let clientWithTls ;
13761386 let clientWithTlsExpired ;
@@ -1507,7 +1517,7 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
15071517 } ) ;
15081518
15091519 // Case 1.
1510- context ( 'Case 1: AWS' , metadata , function ( ) {
1520+ context ( 'Case 1: AWS' , kmsTlsMetadata , function ( ) {
15111521 const masterKey = {
15121522 region : 'us-east-1' ,
15131523 key : 'arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0' ,
@@ -1526,7 +1536,7 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
15261536 }
15271537 } ) ;
15281538
1529- it ( 'should succeed with valid TLS options' , metadata , async function ( ) {
1539+ it ( 'should succeed with valid TLS options' , async function ( ) {
15301540 try {
15311541 await clientEncryptionWithTls . createDataKey ( 'aws' , { masterKey } ) ;
15321542 expect . fail ( 'it must fail to parse response' ) ;
@@ -1549,7 +1559,7 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
15491559 }
15501560 } ) ;
15511561
1552- it ( 'should fail with an invalid hostname' , metadata , async function ( ) {
1562+ it ( 'should fail with an invalid hostname' , async function ( ) {
15531563 try {
15541564 await clientEncryptionWithInvalidHostname . createDataKey ( 'aws' , {
15551565 masterKey : masterKeyInvalidHostname
@@ -1563,7 +1573,7 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
15631573 } ) ;
15641574
15651575 // Case 2.
1566- context ( 'Case 2: Azure' , metadata , function ( ) {
1576+ context ( 'Case 2: Azure' , kmsTlsMetadata , function ( ) {
15671577 const masterKey = {
15681578 keyVaultEndpoint : 'doesnotexist.invalid' ,
15691579 keyName : 'foo'
@@ -1579,7 +1589,7 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
15791589 }
15801590 } ) . skipReason = 'TODO(NODE-6861): fix flaky test' ;
15811591
1582- it ( 'should succeed with valid TLS options' , metadata , async function ( ) {
1592+ it ( 'should succeed with valid TLS options' , async function ( ) {
15831593 try {
15841594 await clientEncryptionWithTls . createDataKey ( 'azure' , { masterKey } ) ;
15851595 expect . fail ( 'it must fail with HTTP 404' ) ;
@@ -1600,7 +1610,7 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
16001610 }
16011611 } ) ;
16021612
1603- it ( 'should fail with an invalid hostname' , metadata , async function ( ) {
1613+ it ( 'should fail with an invalid hostname' , async function ( ) {
16041614 try {
16051615 await clientEncryptionWithInvalidHostname . createDataKey ( 'azure' , { masterKey } ) ;
16061616 expect . fail ( 'it must fail with invalid hostnames' ) ;
@@ -1612,7 +1622,7 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
16121622 } ) ;
16131623
16141624 // Case 3.
1615- context ( 'Case 3: GCP' , metadata , function ( ) {
1625+ context ( 'Case 3: GCP' , kmsTlsMetadata , function ( ) {
16161626 const masterKey = {
16171627 projectId : 'foo' ,
16181628 location : 'bar' ,
@@ -1630,7 +1640,7 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
16301640 }
16311641 } ) ;
16321642
1633- it ( 'should succeed with valid TLS options' , metadata , async function ( ) {
1643+ it ( 'should succeed with valid TLS options' , async function ( ) {
16341644 try {
16351645 await clientEncryptionWithTls . createDataKey ( 'gcp' , { masterKey } ) ;
16361646 expect . fail ( 'it must fail with HTTP 404' ) ;
@@ -1651,7 +1661,7 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
16511661 }
16521662 } ) ;
16531663
1654- it ( 'should fail with an invalid hostname' , metadata , async function ( ) {
1664+ it ( 'should fail with an invalid hostname' , async function ( ) {
16551665 try {
16561666 await clientEncryptionWithInvalidHostname . createDataKey ( 'gcp' , { masterKey } ) ;
16571667 expect . fail ( 'it must fail with invalid hostnames' ) ;
@@ -1663,7 +1673,7 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
16631673 } ) ;
16641674
16651675 // Case 4.
1666- context ( 'Case 4: KMIP' , metadata , function ( ) {
1676+ context ( 'Case 4: KMIP' , kmsTlsMetadata , function ( ) {
16671677 const masterKey = { } ;
16681678
16691679 it ( 'should fail with no TLS' , metadata , async function ( ) {
@@ -1688,7 +1698,7 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
16881698 }
16891699 } ) ;
16901700
1691- it ( 'should fail with an invalid hostname' , metadata , async function ( ) {
1701+ it ( 'should fail with an invalid hostname' , async function ( ) {
16921702 try {
16931703 await clientEncryptionWithInvalidHostname . createDataKey ( 'kmip' , { masterKey } ) ;
16941704 expect . fail ( 'it must fail with invalid hostnames' ) ;
@@ -1706,7 +1716,7 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
17061716 function ( ) { }
17071717 ) . skipReason = 'TODO(NODE-4840): Node does not support any OCSP options' ;
17081718
1709- context ( 'Case 6: named KMS providers apply TLS options' , function ( ) {
1719+ context ( 'Case 6: named KMS providers apply TLS options' , kmsTlsMetadata , function ( ) {
17101720 afterEach ( ( ) => keyvaultClient ?. close ( ) ) ;
17111721 beforeEach ( async function ( ) {
17121722 const shouldSkip = this . configuration . filters . ClientSideEncryptionFilter . filter ( {
0 commit comments