From 631455d559313ebca47b1a91554dc4bce83205eb Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Tue, 18 Oct 2022 15:55:51 -0400 Subject: [PATCH] docs(NODE-4724): update fle docs to use "in use encryption" terminology (#3448) --- src/collection.ts | 4 ++-- src/deps.ts | 2 +- src/error.ts | 4 ++-- src/mongo_client.ts | 2 +- src/sdam/topology.ts | 3 ++- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/collection.ts b/src/collection.ts index 3229b0b27e..e22ce9eeca 100644 --- a/src/collection.ts +++ b/src/collection.ts @@ -288,8 +288,8 @@ export class Collection { options = {}; } - // CSFLE passes in { w: 'majority' } to ensure the lib works in both 3.x and 4.x - // we support that option style here only + // versions of mongodb-client-encryption before v1.2.6 pass in hardcoded { w: 'majority' } + // specifically to an insertOne call in createDataKey, so we want to support this only here if (options && Reflect.get(options, 'w')) { options.writeConcern = WriteConcern.fromOptions(Reflect.get(options, 'w')); } diff --git a/src/deps.ts b/src/deps.ts index ce9c2ebb26..c2a31eb5ed 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -306,7 +306,7 @@ export interface AutoEncryptionOptions { * * **NOTE**: Supplying options.schemaMap provides more security than relying on JSON Schemas obtained from the server. * It protects against a malicious server advertising a false JSON Schema, which could trick the client into sending decrypted data that should be encrypted. - * Schemas supplied in the schemaMap only apply to configuring automatic encryption for client side encryption. + * Schemas supplied in the schemaMap only apply to configuring automatic encryption for Client-Side Field Level Encryption. * Other validation rules in the JSON schema will not be enforced by the driver and will result in an error. */ schemaMap?: Document; diff --git a/src/error.ts b/src/error.ts index d6abfec879..800be95c8b 100644 --- a/src/error.ts +++ b/src/error.ts @@ -111,7 +111,7 @@ export interface ErrorDescription extends Document { * @category Error * * @privateRemarks - * CSFLE has a dependency on this error, it uses the constructor with a string argument + * mongodb-client-encryption has a dependency on this error, it uses the constructor with a string argument */ export class MongoError extends Error { /** @internal */ @@ -568,7 +568,7 @@ export class MongoNetworkError extends MongoError { * @category Error * * @privateRemarks - * CSFLE has a dependency on this error with an instanceof check + * mongodb-client-encryption has a dependency on this error with an instanceof check */ export class MongoNetworkTimeoutError extends MongoNetworkError { constructor(message: string, options?: MongoNetworkErrorOptions) { diff --git a/src/mongo_client.ts b/src/mongo_client.ts index 42bee20bf8..23a6d502b7 100644 --- a/src/mongo_client.ts +++ b/src/mongo_client.ts @@ -243,7 +243,7 @@ export interface MongoClientOptions extends BSONSerializeOptions, SupportedNodeC /** Server API version */ serverApi?: ServerApi | ServerApiVersion; /** - * Optionally enable client side auto encryption + * Optionally enable in-use auto encryption * * @remarks * Automatic encryption is an enterprise only feature that only applies to operations on a collection. Automatic encryption is not supported for operations on a database or view, and operations that are not bypassed will result in error diff --git a/src/sdam/topology.ts b/src/sdam/topology.ts index 48bf9f7bdb..f132cdc24a 100644 --- a/src/sdam/topology.ts +++ b/src/sdam/topology.ts @@ -252,7 +252,8 @@ export class Topology extends TypedEventEmitter { ) => this.selectServer(selector, options, callback as any) ); - // Legacy CSFLE support + // Saving a reference to these BSON functions + // supports v2.2.0 and older versions of mongodb-client-encryption this.bson = Object.create(null); this.bson.serialize = serialize; this.bson.deserialize = deserialize;