From bbda6a830083e0b5938a676e79f990cb0b92437a Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 1 Jun 2022 11:20:22 +0200 Subject: [PATCH 1/4] chore(NODE-4285): rename csfle shared library references Adjust the AutoEncryption typings as indicated in the updated spec. --- src/deps.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/deps.ts b/src/deps.ts index 4c6ce98bef2..1d66b81b3c1 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -324,7 +324,7 @@ export interface AutoEncryptionOptions { /** Command line arguments to use when auto-spawning a mongocryptd */ mongocryptdSpawnArgs?: string[]; /** - * Full path to a CSFLE shared library to be used (instead of mongocryptd). + * Full path to a MongoDB Crypt shared library to be used (instead of mongocryptd). * * This needs to be the path to the file itself, not a directory. * It can be an absolute or relative path. If the path is relative and @@ -332,32 +332,32 @@ export interface AutoEncryptionOptions { * containing the mongodb-client-encryption native addon file. Otherwise, * the path will be interpreted relative to the current working directory. * - * Currently, loading different CSFLE shared library files from different + * Currently, loading different MongoDB Crypt shared library files from different * MongoClients in the same process is not supported. * - * If this option is provided and no CSFLE shared library could be loaded + * If this option is provided and no MongoDB Crypt shared library could be loaded * from the specified location, creating the MongoClient will fail. * - * If this option is not provided and `csfleRequired` is not specified, + * If this option is not provided and `cryptSharedLibRequired` is not specified, * the AutoEncrypter will attempt to spawn and/or use mongocryptd according * to the mongocryptd-specific `extraOptions` options. * * Specifying a path prevents mongocryptd from being used as a fallback. */ - csflePath?: string; + cryptSharedLibPath?: string; /** - * If specified, never use mongocryptd and instead fail when the CSFLE shared library - * could not be loaded. + * If specified, never use mongocryptd and instead fail when the MongoDB Crypt + * shared library could not be loaded. * - * This is always true when `csflePath` is specified. + * This is always true when `cryptSharedLibPath` is specified. */ - csfleRequired?: boolean; + cryptSharedLibRequired?: boolean; /** - * Search paths for a CSFLE shared library to be used (instead of mongocryptd) + * Search paths for a MongoDB Crypt shared library to be used (instead of mongocryptd) * Only for driver testing! * @internal */ - csfleSearchPaths?: string[]; + cryptSharedLibSearchPaths?: string[]; }; proxyOptions?: ProxyOptions; /** The TLS options to use connecting to the KMS provider */ @@ -378,5 +378,5 @@ export interface AutoEncrypter { teardown(force: boolean, callback: Callback): void; encrypt(ns: string, cmd: Document, options: any, callback: Callback): void; decrypt(cmd: Document, options: any, callback: Callback): void; - readonly csfleVersionInfo: { version: bigint; versionStr: string } | null; + readonly cryptSharedLibVersionInfo: { version: bigint; versionStr: string } | null; } From 9eb4574ae92f3e994252857f2267b4ed5da5425a Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 1 Jun 2022 21:01:37 +0200 Subject: [PATCH 2/4] fixup: add versioning note --- src/deps.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/deps.ts b/src/deps.ts index 1d66b81b3c1..0a0393371ba 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -343,6 +343,8 @@ export interface AutoEncryptionOptions { * to the mongocryptd-specific `extraOptions` options. * * Specifying a path prevents mongocryptd from being used as a fallback. + * + * Requires the MongoDB Crypt shared library, available in MongoDB 6.0 or higher. */ cryptSharedLibPath?: string; /** @@ -350,6 +352,8 @@ export interface AutoEncryptionOptions { * shared library could not be loaded. * * This is always true when `cryptSharedLibPath` is specified. + * + * Requires the MongoDB Crypt shared library, available in MongoDB 6.0 or higher. */ cryptSharedLibRequired?: boolean; /** From c55125c919c89421d3aca1b3c5dc400dc61ee9aa Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 1 Jun 2022 22:22:16 +0200 Subject: [PATCH 3/4] fixup: add back experimental tags --- src/deps.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/deps.ts b/src/deps.ts index 0a0393371ba..d86704d7320 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -344,7 +344,7 @@ export interface AutoEncryptionOptions { * * Specifying a path prevents mongocryptd from being used as a fallback. * - * Requires the MongoDB Crypt shared library, available in MongoDB 6.0 or higher. + * @experimental Requires the MongoDB Crypt shared library, available in MongoDB 6.0 or higher. */ cryptSharedLibPath?: string; /** @@ -353,7 +353,7 @@ export interface AutoEncryptionOptions { * * This is always true when `cryptSharedLibPath` is specified. * - * Requires the MongoDB Crypt shared library, available in MongoDB 6.0 or higher. + * @experimental Requires the MongoDB Crypt shared library, available in MongoDB 6.0 or higher. */ cryptSharedLibRequired?: boolean; /** From 10d5462def8390d5113b6f1bfed2d46d7eb78c6f Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Thu, 2 Jun 2022 10:00:05 +0200 Subject: [PATCH 4/4] fixup: add experimental tag for cryptSharedLibVersionInfo --- src/deps.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/deps.ts b/src/deps.ts index d86704d7320..1c3ab68eb96 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -382,5 +382,6 @@ export interface AutoEncrypter { teardown(force: boolean, callback: Callback): void; encrypt(ns: string, cmd: Document, options: any, callback: Callback): void; decrypt(cmd: Document, options: any, callback: Callback): void; + /** @experimental */ readonly cryptSharedLibVersionInfo: { version: bigint; versionStr: string } | null; }