Skip to content

Commit 5104c0f

Browse files
authored
feat(NODE-7230): add deprecations of items to be removed in v7 (#4774)
1 parent 6f78f5a commit 5104c0f

File tree

5 files changed

+35
-16
lines changed

5 files changed

+35
-16
lines changed

src/cmap/auth/mongo_credentials.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export interface AuthMechanismProperties extends Document {
5858
SERVICE_NAME?: string;
5959
SERVICE_REALM?: string;
6060
CANONICALIZE_HOST_NAME?: GSSAPICanonicalizationValue;
61+
/** @deprecated Will be removed in the next major version. */
6162
AWS_SESSION_TOKEN?: string;
6263
/** A user provided OIDC machine callback function. */
6364
OIDC_CALLBACK?: OIDCCallbackFunction;

src/cmap/connection.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export interface CommandOptions extends BSONSerializeOptions {
9191
/** Session to use for the operation */
9292
session?: ClientSession;
9393
documentsReturnedIn?: string;
94+
/** @deprecated Will be removed in the next major version. */
9495
noResponse?: boolean;
9596
omitMaxTimeMS?: boolean;
9697

@@ -139,6 +140,7 @@ export interface ConnectionOptions
139140
tls: boolean;
140141
noDelay?: boolean;
141142
socketTimeoutMS?: number;
143+
/** @deprecated Will be removed in the next major version */
142144
cancellationToken?: CancellationToken;
143145
metadata: ClientMetadata;
144146
/** @internal */

src/cursor/abstract_cursor.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,12 @@ export const CURSOR_FLAGS = [
5959
'partial'
6060
] as const;
6161

62-
/** @public */
62+
/**
63+
* @public
64+
* @deprecated Will be removed in the next major version
65+
*/
6366
export interface CursorStreamOptions {
64-
/** A transformation method applied to each document emitted by the stream */
67+
/** @deprecated Will be removed in the next major version */
6568
transform?(this: void, doc: Document): Document;
6669
}
6770

test/integration/client-side-encryption/client_side_encryption.prose.10.kms_tls.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import { expect } from 'chai';
2+
import { satisfies } from 'semver';
23

34
import { getCSFLEKMSProviders } from '../../csfle-kms-providers';
45
import { ClientEncryption, type MongoClient } from '../../mongodb';
56

67
const metadata: MongoDBMetadataUI = {
78
requires: {
8-
clientSideEncryption: true
9+
clientSideEncryption: true,
10+
predicate: () =>
11+
satisfies(process.version, '<25.0.0') ? true : 'TODO(NODE-7252): fix these tests in v25'
912
}
1013
};
1114

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

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { BSON, EJSON } from 'bson';
22
import { expect } from 'chai';
33
import * as fs from 'fs/promises';
44
import * as path from 'path';
5+
import { satisfies } from 'semver';
56

67
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
78
import { 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+
5060
const 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

Comments
 (0)