Skip to content

Commit

Permalink
docs(NODE-4724): update fle docs to use "in use encryption" terminolo…
Browse files Browse the repository at this point in the history
…gy (#3448)
  • Loading branch information
nbbeeken committed Oct 18, 2022
1 parent 7a8b186 commit 631455d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/collection.ts
Expand Up @@ -288,8 +288,8 @@ export class Collection<TSchema extends Document = Document> {
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'));
}
Expand Down
2 changes: 1 addition & 1 deletion src/deps.ts
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/error.ts
Expand Up @@ -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 */
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/mongo_client.ts
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/sdam/topology.ts
Expand Up @@ -252,7 +252,8 @@ export class Topology extends TypedEventEmitter<TopologyEvents> {
) => 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;
Expand Down

0 comments on commit 631455d

Please sign in to comment.