Skip to content

Commit 4979fe6

Browse files
add v6 deprecations
1 parent 34dfec6 commit 4979fe6

File tree

4 files changed

+112
-28
lines changed

4 files changed

+112
-28
lines changed

bindings/node/README.md

+45-25
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,22 @@ npm test
4848
<dd><p>An internal class to be used by the driver for auto encryption
4949
<strong>NOTE</strong>: Not meant to be instantiated directly, this is for internal use only.</p>
5050
</dd>
51-
<dt><a href="#ClientEncryption">ClientEncryption</a></dt>
52-
<dd><p>The public interface for explicit in-use encryption</p>
53-
</dd>
54-
<dt><a href="#MongoCryptError">MongoCryptError</a></dt>
51+
<dt><del><a href="#ClientEncryption">ClientEncryption</a></del></dt>
52+
<dd></dd>
53+
<dt><del><a href="#MongoCryptError">MongoCryptError</a></del></dt>
5554
<dd><p>An error indicating that something went wrong specifically with MongoDB Client Encryption</p>
5655
</dd>
57-
<dt><a href="#MongoCryptCreateDataKeyError">MongoCryptCreateDataKeyError</a></dt>
56+
<dt><del><a href="#MongoCryptCreateDataKeyError">MongoCryptCreateDataKeyError</a></del></dt>
5857
<dd><p>An error indicating that <code>ClientEncryption.createEncryptedCollection()</code> failed to create data keys</p>
5958
</dd>
60-
<dt><a href="#MongoCryptCreateEncryptedCollectionError">MongoCryptCreateEncryptedCollectionError</a></dt>
59+
<dt><del><a href="#MongoCryptCreateEncryptedCollectionError">MongoCryptCreateEncryptedCollectionError</a></del></dt>
6160
<dd><p>An error indicating that <code>ClientEncryption.createEncryptedCollection()</code> failed to create a collection</p>
6261
</dd>
63-
<dt><a href="#MongoCryptAzureKMSRequestError">MongoCryptAzureKMSRequestError</a></dt>
62+
<dt><del><a href="#MongoCryptAzureKMSRequestError">MongoCryptAzureKMSRequestError</a></del></dt>
6463
<dd><p>An error indicating that mongodb-client-encryption failed to auto-refresh Azure KMS credentials.</p>
6564
</dd>
65+
<dt><del><a href="#MongoCryptKMSRequestNetworkTimeoutError">MongoCryptKMSRequestNetworkTimeoutError</a></del></dt>
66+
<dd></dd>
6667
</dl>
6768

6869
## Typedefs
@@ -100,7 +101,7 @@ npm test
100101
Can be used for <a href="ClientEncryption.encrypt">ClientEncryption.encrypt</a>, and can be used to directly
101102
query for the data key itself against the key vault namespace.</p>
102103
</dd>
103-
<dt><a href="#ClientEncryptionCreateDataKeyCallback">ClientEncryptionCreateDataKeyCallback</a> : <code>function</code></dt>
104+
<dt><del><a href="#ClientEncryptionCreateDataKeyCallback">ClientEncryptionCreateDataKeyCallback</a> : <code>function</code></del></dt>
104105
<dd></dd>
105106
<dt><a href="#AWSEncryptionKeyOptions">AWSEncryptionKeyOptions</a> : <code>object</code></dt>
106107
<dd><p>Configuration options for making an AWS encryption key</p>
@@ -113,7 +114,7 @@ query for the data key itself against the key vault namespace.</p>
113114
</dd>
114115
<dt><a href="#RewrapManyDataKeyResult">RewrapManyDataKeyResult</a> : <code>object</code></dt>
115116
<dd></dd>
116-
<dt><a href="#ClientEncryptionEncryptCallback">ClientEncryptionEncryptCallback</a> : <code>function</code></dt>
117+
<dt><del><a href="#ClientEncryptionEncryptCallback">ClientEncryptionEncryptCallback</a> : <code>function</code></del></dt>
117118
<dd></dd>
118119
<dt><a href="#RangeOptions">RangeOptions</a> : <code>object</code></dt>
119120
<dd><p>min, max, sparsity, and range must match the values set in the encryptedFields of the destination collection.
@@ -282,12 +283,12 @@ the underlying C++ Bindings.
282283

283284
<a name="ClientEncryption"></a>
284285

285-
## ClientEncryption
286-
The public interface for explicit in-use encryption
287-
286+
## ~~ClientEncryption~~
287+
***Deprecated***
288288

289-
* [ClientEncryption](#ClientEncryption)
290289

290+
* ~~[ClientEncryption](#ClientEncryption)
291+
~~
291292
* [new ClientEncryption(client, options)](#new_ClientEncryption_new)
292293

293294
* _instance_
@@ -318,8 +319,8 @@ The public interface for explicit in-use encryption
318319
* [.askForKMSCredentials()](#ClientEncryption+askForKMSCredentials)
319320

320321
* _inner_
321-
* [~decryptCallback](#ClientEncryption..decryptCallback)
322-
322+
* ~~[~decryptCallback](#ClientEncryption..decryptCallback)
323+
~~
323324

324325
<a name="new_ClientEncryption_new"></a>
325326

@@ -369,7 +370,7 @@ new ClientEncryption(mongoClient, {
369370
| [options] | <code>object</code> | Options for creating the data key |
370371
| [options.masterKey] | [<code>AWSEncryptionKeyOptions</code>](#AWSEncryptionKeyOptions) \| [<code>AzureEncryptionKeyOptions</code>](#AzureEncryptionKeyOptions) \| [<code>GCPEncryptionKeyOptions</code>](#GCPEncryptionKeyOptions) | Idenfities a new KMS-specific key used to encrypt the new data key |
371372
| [options.keyAltNames] | <code>Array.&lt;string&gt;</code> | An optional list of string alternate names used to reference a key. If a key is created with alternate names, then encryption may refer to the key by the unique alternate name instead of by _id. |
372-
| [callback] | [<code>ClientEncryptionCreateDataKeyCallback</code>](#ClientEncryptionCreateDataKeyCallback) | Optional callback to invoke when key is created |
373+
| [callback] | [<code>ClientEncryptionCreateDataKeyCallback</code>](#ClientEncryptionCreateDataKeyCallback) | DEPRECATED - Callbacks will be removed in the next major version. Optional callback to invoke when key is created |
373374

374375
Creates a data key used for explicit encryption and inserts it into the key vault namespace
375376

@@ -606,7 +607,7 @@ and then create a new collection with the full set of encryptedFields.
606607
| --- | --- | --- |
607608
| value | <code>\*</code> | The value that you wish to serialize. Must be of a type that can be serialized into BSON |
608609
| options | [<code>EncryptOptions</code>](#EncryptOptions) | |
609-
| [callback] | [<code>ClientEncryptionEncryptCallback</code>](#ClientEncryptionEncryptCallback) | Optional callback to invoke when value is encrypted |
610+
| [callback] | [<code>ClientEncryptionEncryptCallback</code>](#ClientEncryptionEncryptCallback) | DEPRECATED: Callbacks will be removed in the next major version. Optional callback to invoke when value is encrypted |
610611

611612
Explicitly encrypt a provided value. Note that either `options.keyId` or `options.keyAltName` must
612613
be specified. Specifying both `options.keyId` and `options.keyAltName` is considered an error.
@@ -662,7 +663,7 @@ Only supported when queryType is "rangePreview" and algorithm is "RangePreview".
662663
| Param | Type | Description |
663664
| --- | --- | --- |
664665
| value | <code>Buffer</code> \| <code>Binary</code> | An encrypted value |
665-
| callback | [<code>decryptCallback</code>](#ClientEncryption..decryptCallback) | Optional callback to invoke when value is decrypted |
666+
| callback | [<code>decryptCallback</code>](#ClientEncryption..decryptCallback) | DEPRECATED - Callbacks will be removed in the next major version. Optional callback to invoke when value is decrypted |
666667

667668
Explicitly decrypt a provided encrypted value
668669

@@ -692,7 +693,9 @@ the original ones.
692693

693694
<a name="ClientEncryption..decryptCallback"></a>
694695

695-
### *ClientEncryption*~decryptCallback
696+
### ~~*ClientEncryption*~decryptCallback~~
697+
***Deprecated***
698+
696699

697700
| Param | Type | Description |
698701
| --- | --- | --- |
@@ -701,22 +704,30 @@ the original ones.
701704

702705
<a name="MongoCryptError"></a>
703706

704-
## MongoCryptError
707+
## ~~MongoCryptError~~
708+
***Deprecated***
709+
705710
An error indicating that something went wrong specifically with MongoDB Client Encryption
706711

707712
<a name="MongoCryptCreateDataKeyError"></a>
708713

709-
## MongoCryptCreateDataKeyError
714+
## ~~MongoCryptCreateDataKeyError~~
715+
***Deprecated***
716+
710717
An error indicating that `ClientEncryption.createEncryptedCollection()` failed to create data keys
711718

712719
<a name="MongoCryptCreateEncryptedCollectionError"></a>
713720

714-
## MongoCryptCreateEncryptedCollectionError
721+
## ~~MongoCryptCreateEncryptedCollectionError~~
722+
***Deprecated***
723+
715724
An error indicating that `ClientEncryption.createEncryptedCollection()` failed to create a collection
716725

717726
<a name="MongoCryptAzureKMSRequestError"></a>
718727

719-
## MongoCryptAzureKMSRequestError
728+
## ~~MongoCryptAzureKMSRequestError~~
729+
***Deprecated***
730+
720731
An error indicating that mongodb-client-encryption failed to auto-refresh Azure KMS credentials.
721732

722733
<a name="new_MongoCryptAzureKMSRequestError_new"></a>
@@ -728,6 +739,11 @@ An error indicating that mongodb-client-encryption failed to auto-refresh Azure
728739
| message | <code>string</code> |
729740
| body | <code>object</code> \| <code>undefined</code> |
730741

742+
<a name="MongoCryptKMSRequestNetworkTimeoutError"></a>
743+
744+
## ~~MongoCryptKMSRequestNetworkTimeoutError~~
745+
***Deprecated***
746+
731747
<a name="BSONValue"></a>
732748

733749
## BSONValue
@@ -821,7 +837,9 @@ query for the data key itself against the key vault namespace.
821837

822838
<a name="ClientEncryptionCreateDataKeyCallback"></a>
823839

824-
## ClientEncryptionCreateDataKeyCallback
840+
## ~~ClientEncryptionCreateDataKeyCallback~~
841+
***Deprecated***
842+
825843

826844
| Param | Type | Description |
827845
| --- | --- | --- |
@@ -881,7 +899,9 @@ Configuration options for making an Azure encryption key
881899

882900
<a name="ClientEncryptionEncryptCallback"></a>
883901

884-
## ClientEncryptionEncryptCallback
902+
## ~~ClientEncryptionEncryptCallback~~
903+
***Deprecated***
904+
885905

886906
| Param | Type | Description |
887907
| --- | --- | --- |

bindings/node/index.d.ts

+41
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,19 @@ export interface DataKey {
2828
}
2929

3030
/**
31+
* @deprecated This class will be moved into the [Node driver](https://github.com/mongodb/node-mongodb-native)
32+
* in the next major version and in the next major version must be imported from the driver.
33+
*
3134
* An error indicating that something went wrong specifically with MongoDB Client Encryption
3235
*/
3336
export class MongoCryptError extends Error {
3437
cause?: Error;
3538
}
3639

3740
/**
41+
* @deprecated This class will be moved into the [Node driver](https://github.com/mongodb/node-mongodb-native)
42+
* in the next major version and in the next major version must be imported from the driver.
43+
*
3844
* An error indicating that `ClientEncryption.createEncryptedCollection()` failed to create a collection
3945
*/
4046
export class MongoCryptCreateEncryptedCollectionError extends MongoCryptError {
@@ -47,6 +53,9 @@ export class MongoCryptCreateEncryptedCollectionError extends MongoCryptError {
4753
}
4854

4955
/**
56+
* @deprecated This class will be moved into the [Node driver](https://github.com/mongodb/node-mongodb-native)
57+
* in the next major version and in the next major version must be imported from the driver.
58+
*
5059
* An error indicating that `ClientEncryption.createEncryptedCollection()` failed to create data keys
5160
*/
5261
export class MongoCryptCreateDataKeyError extends MongoCryptError {
@@ -59,13 +68,21 @@ export class MongoCryptCreateDataKeyError extends MongoCryptError {
5968
}
6069

6170
/**
71+
* @deprecated This class will be moved into the [Node driver](https://github.com/mongodb/node-mongodb-native)
72+
* in the next major version and in the next major version must be imported from the driver.
73+
*
6274
* An error indicating that mongodb-client-encryption failed to auto-refresh Azure KMS credentials.
6375
*/
6476
export class MongoCryptAzureKMSRequestError extends MongoCryptError {
6577
/* The body of the IMDS request that produced the error, if present. */
6678
body?: Document ;
6779
}
6880

81+
/**
82+
* @deprecated This class will be moved into the [Node driver](https://github.com/mongodb/node-mongodb-native)
83+
* in the next major version and in the next major version must be imported from the driver.
84+
*
85+
*/
6986
export class MongoCryptKMSRequestNetworkTimeoutError extends MongoCryptError {}
7087

7188
/**
@@ -78,6 +95,10 @@ export interface ProxyOptions {
7895
proxyPassword?: string;
7996
}
8097

98+
/**
99+
* @deprecated Callback overloads are deprecated and will be removed in the next major version. Please
100+
* use the Promise overloads instead.
101+
*/
81102
export interface ClientEncryptionCreateDataKeyCallback {
82103
/**
83104
* @param error If present, indicates an error that occurred in the creation of the data key
@@ -86,6 +107,10 @@ export interface ClientEncryptionCreateDataKeyCallback {
86107
(error?: Error, dataKeyId?: Binary): void;
87108
}
88109

110+
/**
111+
* @deprecated Callback overloads are deprecated and will be removed in the next major version. Please
112+
* use the Promise overloads instead.
113+
*/
89114
export interface ClientEncryptionEncryptCallback {
90115
/**
91116
* @param error If present, indicates an error that occurred in the process of encryption
@@ -94,6 +119,10 @@ export interface ClientEncryptionEncryptCallback {
94119
(error?: Error, result?: Binary): void;
95120
}
96121

122+
/**
123+
* @deprecated Callback overloads are deprecated and will be removed in the next major version. Please
124+
* use the Promise overloads instead.
125+
*/
97126
export interface ClientEncryptionDecryptCallback {
98127
/**
99128
* @param error If present, indicates an error that occurred in the process of decryption
@@ -479,6 +508,9 @@ export class ClientEncryption {
479508
): Promise<Binary>;
480509

481510
/**
511+
* @deprecated Callback overloads are deprecated and will be removed in the next major version. Please
512+
* use the Promise overloads instead.
513+
*
482514
* Creates a data key used for explicit encryption and inserts it into the key vault namespace
483515
* @param provider The KMS provider used for this data key. Must be `'aws'`, `'azure'`, `'gcp'`, or `'local'`
484516
* @param callback Callback to invoke when key is created
@@ -489,6 +521,9 @@ export class ClientEncryption {
489521
): void;
490522

491523
/**
524+
* @deprecated Callback overloads are deprecated and will be removed in the next major version. Please
525+
* use the Promise overloads instead.
526+
*
492527
* Creates a data key used for explicit encryption and inserts it into the key vault namespace
493528
* @param provider The KMS provider used for this data key. Must be `'aws'`, `'azure'`, `'gcp'`, or `'local'`
494529
* @param options Options for creating the data key
@@ -593,6 +628,9 @@ export class ClientEncryption {
593628
encrypt(value: any, options: ClientEncryptionEncryptOptions): Promise<Binary>;
594629

595630
/**
631+
* @deprecated Callback overloads are deprecated and will be removed in the next major version. Please
632+
* use the Promise overloads instead.
633+
*
596634
* Explicitly encrypt a provided value.
597635
* Note that either options.keyId or options.keyAltName must be specified.
598636
* Specifying both options.keyId and options.keyAltName is considered an error.
@@ -630,6 +668,9 @@ export class ClientEncryption {
630668
decrypt(value: Buffer | Binary): Promise<any>;
631669

632670
/**
671+
* @deprecated Callback overloads are deprecated and will be removed in the next major version. Please
672+
* use the Promise overloads instead.
673+
*
633674
* Explicitly decrypt a provided encrypted value
634675
* @param value An encrypted value
635676
* @param callback Callback to invoke when value is decrypted

bindings/node/lib/clientEncryption.js

+14-3
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ module.exports = function (modules) {
7373
*/
7474

7575
/**
76+
* @deprecated This class will be moved into the [Node driver](https://github.com/mongodb/node-mongodb-native)
77+
* in the next major version and in the next major version must be imported from the driver.
78+
*
7679
* The public interface for explicit in-use encryption
7780
*/
7881
class ClientEncryption {
@@ -138,6 +141,8 @@ module.exports = function (modules) {
138141
*/
139142

140143
/**
144+
* @deprecated Callback overloads are deprecated and will be removed in the next major version. Please
145+
* use the Promise overloads instead.
141146
* @callback ClientEncryptionCreateDataKeyCallback
142147
* @param {Error} [error] If present, indicates an error that occurred in the creation of the data key
143148
* @param {ClientEncryption~dataKeyId} [dataKeyId] If present, returns the id of the created data key
@@ -174,7 +179,7 @@ module.exports = function (modules) {
174179
* @param {object} [options] Options for creating the data key
175180
* @param {AWSEncryptionKeyOptions|AzureEncryptionKeyOptions|GCPEncryptionKeyOptions} [options.masterKey] Idenfities a new KMS-specific key used to encrypt the new data key
176181
* @param {string[]} [options.keyAltNames] An optional list of string alternate names used to reference a key. If a key is created with alternate names, then encryption may refer to the key by the unique alternate name instead of by _id.
177-
* @param {ClientEncryptionCreateDataKeyCallback} [callback] Optional callback to invoke when key is created
182+
* @param {ClientEncryptionCreateDataKeyCallback} [callback] DEPRECATED - Callbacks will be removed in the next major version. Optional callback to invoke when key is created
178183
* @returns {Promise|void} If no callback is provided, returns a Promise that either resolves with {@link ClientEncryption~dataKeyId the id of the created data key}, or rejects with an error. If a callback is provided, returns nothing.
179184
* @example
180185
* // Using callbacks to create a local key
@@ -613,6 +618,9 @@ module.exports = function (modules) {
613618
}
614619

615620
/**
621+
* @deprecated Callback overloads are deprecated and will be removed in the next major version. Please
622+
* use the Promise overloads instead.
623+
*
616624
* @callback ClientEncryptionEncryptCallback
617625
* @param {Error} [err] If present, indicates an error that occurred in the process of encryption
618626
* @param {Buffer} [result] If present, is the encrypted result
@@ -644,7 +652,7 @@ module.exports = function (modules) {
644652
*
645653
* @param {*} value The value that you wish to serialize. Must be of a type that can be serialized into BSON
646654
* @param {EncryptOptions} options
647-
* @param {ClientEncryptionEncryptCallback} [callback] Optional callback to invoke when value is encrypted
655+
* @param {ClientEncryptionEncryptCallback} [callback] DEPRECATED: Callbacks will be removed in the next major version. Optional callback to invoke when value is encrypted
648656
* @returns {Promise|void} If no callback is provided, returns a Promise that either resolves with the encrypted value, or rejects with an error. If a callback is provided, returns nothing.
649657
*
650658
* @example
@@ -699,6 +707,9 @@ module.exports = function (modules) {
699707
}
700708

701709
/**
710+
* @deprecated Callback overloads are deprecated and will be removed in the next major version. Please
711+
* use the Promise overloads instead.
712+
*
702713
* @callback ClientEncryption~decryptCallback
703714
* @param {Error} [err] If present, indicates an error that occurred in the process of decryption
704715
* @param {object} [result] If present, is the decrypted result
@@ -708,7 +719,7 @@ module.exports = function (modules) {
708719
* Explicitly decrypt a provided encrypted value
709720
*
710721
* @param {Buffer | Binary} value An encrypted value
711-
* @param {ClientEncryption~decryptCallback} callback Optional callback to invoke when value is decrypted
722+
* @param {ClientEncryption~decryptCallback} callback DEPRECATED - Callbacks will be removed in the next major version. Optional callback to invoke when value is decrypted
712723
* @returns {Promise|void} If no callback is provided, returns a Promise that either resolves with the decrypted value, or rejects with an error. If a callback is provided, returns nothing.
713724
*
714725
* @example

0 commit comments

Comments
 (0)