Skip to content

Commit 3932a03

Browse files
baileympearsonnbbeeken
authored andcommitted
docs(NODE-6458): document CSOT for explicit encryption (#4302)
1 parent 0f37094 commit 3932a03

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

src/client-side-encryption/client_encryption.ts

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,9 +866,36 @@ export interface ClientEncryptionOptions {
866866
*/
867867
tlsOptions?: CSFLEKMSTlsOptions;
868868

869-
/** @internal TODO(NODE-5688): make this public
869+
/**
870+
* @experimental
870871
*
871872
* The timeout setting to be used for all the operations on ClientEncryption.
873+
*
874+
* When provided, `timeoutMS` is used as the timeout for each operation executed on
875+
* the ClientEncryption object. For example:
876+
*
877+
* ```typescript
878+
* const clientEncryption = new ClientEncryption(client, {
879+
* timeoutMS: 1_000
880+
* kmsProviders: { local: { key: '<KEY>' } }
881+
* });
882+
*
883+
* // `1_000` is used as the timeout for createDataKey call
884+
* await clientEncryption.createDataKey('local');
885+
* ```
886+
*
887+
* If `timeoutMS` is configured on the provided client, the client's `timeoutMS` value
888+
* will be used unless `timeoutMS` is also provided as a client encryption option.
889+
*
890+
* ```typescript
891+
* const client = new MongoClient('<uri>', { timeoutMS: 2_000 });
892+
*
893+
* // timeoutMS is set to 1_000 on clientEncryption
894+
* const clientEncryption = new ClientEncryption(client, {
895+
* timeoutMS: 1_000
896+
* kmsProviders: { local: { key: '<KEY>' } }
897+
* });
898+
* ```
872899
*/
873900
timeoutMS?: number;
874901
}

0 commit comments

Comments
 (0)