Skip to content

Commit 95bc5c9

Browse files
committed
fix(NODE-3777): update metadata in prose test
1 parent 1402cf1 commit 95bc5c9

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

test/integration/client-side-encryption/client_side_encryption.prose.test.js

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ describe('Client Side Encryption Prose Tests', function () {
9999
await client.close();
100100
});
101101

102-
context('when encrypting with kmip', function () {
103-
context('when not providing an endpoint in the master key', function () {
102+
context('when encrypting with kmip', metadata, function () {
103+
context('when not providing an endpoint in the master key', metadata, function () {
104104
const masterKey = { keyId: '1' };
105105
let dataKey;
106106
let encrypted;
@@ -121,15 +121,15 @@ describe('Client Side Encryption Prose Tests', function () {
121121
decrypted = await clientEncryption.decrypt(encrypted);
122122
});
123123

124-
it('must create a data key', function () {
124+
it('must create a data key', metadata, function () {
125125
expect(dataKey).to.have.property('sub_type', 4);
126126
});
127127

128-
it('properly encrypts and decrypts', function () {
128+
it('properly encrypts and decrypts', metadata, function () {
129129
expect(decrypted).to.equal('test');
130130
});
131131

132-
it('fails with invalid provider host', async function () {
132+
it('fails with invalid provider host', metadata, async function () {
133133
try {
134134
await clientEncryptionInvalid.createDataKey('kmip', { masterKey });
135135
} catch (e) {
@@ -138,8 +138,8 @@ describe('Client Side Encryption Prose Tests', function () {
138138
});
139139
});
140140

141-
context('when providing an endpoint in the master key', function () {
142-
context('when the endpoint is valid', function () {
141+
context('when providing an endpoint in the master key', metadata, function () {
142+
context('when the endpoint is valid', metadata, function () {
143143
const masterKey = { keyId: '1', endpoint: 'localhost:5698' };
144144
let dataKey;
145145
let encrypted;
@@ -160,16 +160,16 @@ describe('Client Side Encryption Prose Tests', function () {
160160
decrypted = await clientEncryption.decrypt(encrypted);
161161
});
162162

163-
it('must create a data key', function () {
163+
it('must create a data key', metadata, function () {
164164
expect(dataKey).to.have.property('sub_type', 4);
165165
});
166166

167-
it('properly encrypts and decrypts', function () {
167+
it('properly encrypts and decrypts', metadata, function () {
168168
expect(decrypted).to.equal('test');
169169
});
170170
});
171171

172-
context('when the endpoint is invalid', function () {
172+
context('when the endpoint is invalid', metadata, function () {
173173
const masterKey = { keyId: '1', endpoint: 'doesnotexist.localhost:5698' };
174174

175175
/**
@@ -178,7 +178,7 @@ describe('Client Side Encryption Prose Tests', function () {
178178
* { keyId: 1, endpoint: 'doesnotexist.localhost:5698 '}
179179
* - Expect failure.
180180
*/
181-
it('fails with invalid provider host', async function () {
181+
it('fails with invalid provider host', metadata, async function () {
182182
try {
183183
await clientEncryption.createDataKey('kmip', { masterKey });
184184
} catch (e) {
@@ -302,7 +302,7 @@ describe('Client Side Encryption Prose Tests', function () {
302302
});
303303

304304
// Case 1.
305-
context('when using aws', function () {
305+
context('when using aws', metadata, function () {
306306
const masterKey = {
307307
region: 'us-east-1',
308308
key: 'arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0',
@@ -311,31 +311,31 @@ describe('Client Side Encryption Prose Tests', function () {
311311
const masterKeyExpired = { ...masterKey, endpoint: '127.0.0.1:8000' };
312312
const masterKeyInvalidHostname = { ...masterKey, endpoint: '127.0.0.1:8001' };
313313

314-
it('fails with no tls', async function () {
314+
it('fails with no tls', metadata, async function () {
315315
try {
316316
await clientEncryptionNoTls.createDataKey('aws', { masterKey });
317317
} catch (e) {
318318
expect(e.originalError.message).to.include('certificate required');
319319
}
320320
});
321321

322-
it('passes with tls but fails to parse', async function () {
322+
it('passes with tls but fails to parse', metadata, async function () {
323323
try {
324324
await clientEncryptionWithTls.createDataKey('aws', { masterKey });
325325
} catch (e) {
326326
expect(e.message).to.include('parse error');
327327
}
328328
});
329329

330-
it('fails with expired certificates', async function () {
330+
it('fails with expired certificates', metadata, async function () {
331331
try {
332332
await clientEncryptionWithTlsExpired.createDataKey('aws', { masterKeyExpired });
333333
} catch (e) {
334334
expect(e.message).to.include('expected UTF-8 key');
335335
}
336336
});
337337

338-
it('fails with invalid hostnames', async function () {
338+
it('fails with invalid hostnames', metadata, async function () {
339339
try {
340340
await clientEncryptionWithInvalidHostname.createDataKey('aws', {
341341
masterKeyInvalidHostname
@@ -347,37 +347,37 @@ describe('Client Side Encryption Prose Tests', function () {
347347
});
348348

349349
// Case 2.
350-
context('when using azure', function () {
350+
context('when using azure', metadata, function () {
351351
const masterKey = {
352352
keyVaultEndpoint: 'doesnotexist.local',
353353
keyName: 'foo'
354354
};
355355

356-
it('fails with no tls', async function () {
356+
it('fails with no tls', metadata, async function () {
357357
try {
358358
await clientEncryptionNoTls.createDataKey('azure', { masterKey });
359359
} catch (e) {
360360
expect(e.originalError.message).to.include('certificate required');
361361
}
362362
});
363363

364-
it('fails with invalid host', async function () {
364+
it('fails with invalid host', metadata, async function () {
365365
try {
366366
await clientEncryptionWithTls.createDataKey('azure', { masterKey });
367367
} catch (e) {
368368
expect(e.message).to.include('HTTP status=404');
369369
}
370370
});
371371

372-
it('fails with expired certificates', async function () {
372+
it('fails with expired certificates', metadata, async function () {
373373
try {
374374
await clientEncryptionWithTlsExpired.createDataKey('azure', { masterKey });
375375
} catch (e) {
376376
expect(e.originalError.message).to.include('certificate has expired');
377377
}
378378
});
379379

380-
it('fails with invalid hostnames', async function () {
380+
it('fails with invalid hostnames', metadata, async function () {
381381
try {
382382
await clientEncryptionWithInvalidHostname.createDataKey('azure', { masterKey });
383383
} catch (e) {
@@ -387,39 +387,39 @@ describe('Client Side Encryption Prose Tests', function () {
387387
});
388388

389389
// Case 3.
390-
context('when using gcp', function () {
390+
context('when using gcp', metadata, function () {
391391
const masterKey = {
392392
projectId: 'foo',
393393
location: 'bar',
394394
keyRing: 'baz',
395395
keyName: 'foo'
396396
};
397397

398-
it('fails with no tls', async function () {
398+
it('fails with no tls', metadata, async function () {
399399
try {
400400
await clientEncryptionNoTls.createDataKey('gcp', { masterKey });
401401
} catch (e) {
402402
expect(e.originalError.message).to.include('certificate required');
403403
}
404404
});
405405

406-
it('fails with invalid host', async function () {
406+
it('fails with invalid host', metadata, async function () {
407407
try {
408408
await clientEncryptionWithTls.createDataKey('gcp', { masterKey });
409409
} catch (e) {
410410
expect(e.message).to.include('HTTP status=404');
411411
}
412412
});
413413

414-
it('fails with expired certificates', async function () {
414+
it('fails with expired certificates', metadata, async function () {
415415
try {
416416
await clientEncryptionWithTlsExpired.createDataKey('gcp', { masterKey });
417417
} catch (e) {
418418
expect(e.originalError.message).to.include('certificate has expired');
419419
}
420420
});
421421

422-
it('fails with invalid hostnames', async function () {
422+
it('fails with invalid hostnames', metadata, async function () {
423423
try {
424424
await clientEncryptionWithInvalidHostname.createDataKey('gcp', { masterKey });
425425
} catch (e) {
@@ -429,31 +429,31 @@ describe('Client Side Encryption Prose Tests', function () {
429429
});
430430

431431
// Case 4.
432-
context('when using kmip', function () {
432+
context('when using kmip', metadata, function () {
433433
it('passes with tls', async function () {
434434
const dataKey = await clientEncryptionWithTls.createDataKey('kmip');
435435
// TODO: NODE-3927
436436
await clientWithTls.close();
437437
expect(dataKey).to.have.property('sub_type', 4);
438438
});
439439

440-
it('fails with no tls', async function () {
440+
it('fails with no tls', metadata, async function () {
441441
try {
442442
await clientEncryptionNoTls.createDataKey('kmip');
443443
} catch (e) {
444444
expect(e.originalError.message).to.include('before secure TLS connection');
445445
}
446446
});
447447

448-
it('fails with expired certificates', async function () {
448+
it('fails with expired certificates', metadata, async function () {
449449
try {
450450
await clientEncryptionWithTlsExpired.createDataKey('kmip');
451451
} catch (e) {
452452
expect(e.originalError.message).to.include('certificate has expired');
453453
}
454454
});
455455

456-
it('fails with invalid hostnames', async function () {
456+
it('fails with invalid hostnames', metadata, async function () {
457457
try {
458458
await clientEncryptionWithInvalidHostname.createDataKey('kmip');
459459
} catch (e) {

0 commit comments

Comments
 (0)