Skip to content

Commit c571c16

Browse files
committed
chore: bump version, prettier build script and update comment, getters for accuracy
1 parent 737535e commit c571c16

File tree

3 files changed

+14
-19
lines changed

3 files changed

+14
-19
lines changed

.github/scripts/libmongocrypt.mjs

+11-16
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ import events from 'node:events';
88
import path from 'node:path';
99
import https from 'node:https';
1010
import stream from 'node:stream/promises';
11-
import { buildLibmongocryptDownloadUrl, getLibmongocryptPrebuildName, resolveRoot, run } from './utils.mjs';
11+
import {
12+
buildLibmongocryptDownloadUrl,
13+
getLibmongocryptPrebuildName,
14+
resolveRoot,
15+
run
16+
} from './utils.mjs';
1217

1318
async function parseArguments() {
1419
const pkg = JSON.parse(await fs.readFile(resolveRoot('package.json'), 'utf8'));
@@ -72,19 +77,11 @@ export async function buildLibMongoCrypt(libmongocryptRoot, nodeDepsRoot, option
7277

7378
const CMAKE_FLAGS = toCLIFlags({
7479
/**
75-
* We provide crypto hooks from Node.js binding to openssl (so disable system crypto)
76-
* TODO: NODE-5455
80+
* We provide crypto hooks from Node.js binding to openssl (so disable **system** crypto)
7781
*
78-
* One thing that is not obvious from the build instructions for libmongocrypt
79-
* and the Node.js bindings is that the Node.js driver uses libmongocrypt in
80-
* DISABLE_NATIVE_CRYPTO aka nocrypto mode, that is, instead of using native
81-
* system libraries for crypto operations, it provides callbacks to libmongocrypt
82-
* which, in the Node.js addon case, call JS functions that in turn call built-in
83-
* Node.js crypto methods.
84-
*
85-
* That’s way more convoluted than it needs to be, considering that we always
86-
* have a copy of OpenSSL available directly, but for now it seems to make sense
87-
* to stick with what the Node.js addon does here.
82+
* Node.js ships with openssl statically compiled into the runtime.
83+
* We provide hooks to libmongocrypt that uses Node.js copy of openssl
84+
* instead of the operating system's copy so we build without linking to the system crypto.
8885
*/
8986
DDISABLE_NATIVE_CRYPTO: '1',
9087
/** A consistent name for the output "library" directory */
@@ -185,9 +182,7 @@ async function buildBindings(args, pkg) {
185182

186183
gypDefines = gypDefines.trim();
187184
const prebuildOptions =
188-
gypDefines.length > 0
189-
? { env: { ...process.env, GYP_DEFINES: gypDefines } }
190-
: undefined;
185+
gypDefines.length > 0 ? { env: { ...process.env, GYP_DEFINES: gypDefines } } : undefined;
191186

192187
await run('npm', ['run', 'prebuild'], prebuildOptions);
193188
// Compile Typescript

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636
"license": "Apache-2.0",
3737
"gypfile": true,
38-
"mongodb:libmongocrypt": "67f10bfb8de69549987cc62a1d4548d7b511a7ef",
38+
"mongodb:libmongocrypt": "1.13.0",
3939
"dependencies": {
4040
"node-addon-api": "^4.3.0",
4141
"prebuild-install": "^7.1.3"

src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ export interface MongoCryptContext {
5454
finishKMSRequests(): void;
5555
finalize(): Buffer;
5656

57-
readonly status: MongoCryptStatus;
58-
readonly state: number;
57+
get status(): MongoCryptStatus;
58+
get state(): number;
5959
}
6060

6161
type MongoCryptConstructorOptions = {

0 commit comments

Comments
 (0)