Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .evergreen/config.in.yml
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,9 @@ functions:
export AWS_ACCESS_KEY_ID=${aws_key}
export AWS_SECRET_ACCESS_KEY=${aws_secret}

# use Node20
export PATH=/opt/devtools/node20/bin:/opt/dev/tools/bin:$PATH

# Download all the task coverage files.
# NOTE: All coverage files are too large for V8 to handle the resulting call to
# JSON.stringify from within nyc, so with stick to Fermiun to include the
Expand Down
22 changes: 3 additions & 19 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,9 @@ functions:
export AWS_ACCESS_KEY_ID=${aws_key}
export AWS_SECRET_ACCESS_KEY=${aws_secret}

# use Node20
export PATH=/opt/devtools/node20/bin:/opt/dev/tools/bin:$PATH

# Download all the task coverage files.
# NOTE: All coverage files are too large for V8 to handle the resulting call to
# JSON.stringify from within nyc, so with stick to Fermiun to include the
Expand Down Expand Up @@ -1994,24 +1997,6 @@ tasks:
- func: install mongodb-client-encryption from source
- func: assume secrets manager role
- func: run custom csfle tests
- name: test-latest-driver-mongodb-client-encryption-6.0.0
tags:
- run-custom-dependency-tests
commands:
- command: expansions.update
type: setup
params:
updates:
- {key: NODE_LTS_VERSION, value: 20.19.0}
- {key: VERSION, value: '7.0'}
- {key: TOPOLOGY, value: replica_set}
- {key: CLIENT_ENCRYPTION, value: 'true'}
- func: install dependencies
- func: bootstrap mongo-orchestration
- func: install package
vars:
PACKAGE: mongodb-client-encryption@6.0.0
- func: run tests
- name: test-alpine-fle
tags:
- alpine-fle
Expand Down Expand Up @@ -3205,7 +3190,6 @@ buildvariants:
- run-custom-csfle-tests-5.0
- run-custom-csfle-tests-rapid
- run-custom-csfle-tests-latest
- test-latest-driver-mongodb-client-encryption-6.0.0
- name: rhel8-test-gcp-kms
display_name: GCP KMS Test
run_on: debian11-small
Expand Down
43 changes: 22 additions & 21 deletions .evergreen/generate_evergreen_tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -623,27 +623,28 @@ for (const serverVersion of ['5.0', 'rapid', 'latest']) {
});
}

customDependencyTests.push({
name: `test-latest-driver-mongodb-client-encryption-6.0.0`,
tags: ['run-custom-dependency-tests'],
commands: [
updateExpansions({
NODE_LTS_VERSION: LOWEST_LTS,
VERSION: '7.0',
TOPOLOGY: 'replica_set',
CLIENT_ENCRYPTION: true
}),
{ func: 'install dependencies' },
{ func: 'bootstrap mongo-orchestration' },
{
func: 'install package',
vars: {
PACKAGE: 'mongodb-client-encryption@6.0.0'
}
},
{ func: 'run tests' }
]
});
// TODO(NODE-6997): update to 7.0.0 after release
// customDependencyTests.push({
// name: `test-latest-driver-mongodb-client-encryption-6.0.0`,
// tags: ['run-custom-dependency-tests'],
// commands: [
// updateExpansions({
// NODE_LTS_VERSION: LOWEST_LTS,
// VERSION: '7.0',
// TOPOLOGY: 'replica_set',
// CLIENT_ENCRYPTION: true
// }),
// { func: 'install dependencies' },
// { func: 'bootstrap mongo-orchestration' },
// {
// func: 'install package',
// vars: {
// PACKAGE: 'mongodb-client-encryption@6.0.0'
// }
// },
// { func: 'run tests' }
// ]
// });

const coverageTask = {
name: 'download and merge coverage'.split(' ').join('-'),
Expand Down
116 changes: 63 additions & 53 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@mongodb-js/zstd": "^1.1.0 || ^2.0.0",
"gcp-metadata": "^5.2.0",
"kerberos": "^2.0.1",
"mongodb-client-encryption": ">=6.0.0 <7",
"mongodb-client-encryption": "^7.0.0-alpha",
"snappy": "^7.3.2",
"socks": "^2.7.1"
},
Expand Down Expand Up @@ -96,7 +96,7 @@
"js-yaml": "^4.1.0",
"mocha": "^11.7.1",
"mocha-sinon": "^2.1.2",
"mongodb-client-encryption": "^6.5.0",
"mongodb-client-encryption": "^7.0.0-alpha.1",
"mongodb-legacy": "^6.1.3",
"nyc": "^15.1.0",
"prettier": "^3.6.2",
Expand Down Expand Up @@ -174,4 +174,4 @@
"moduleResolution": "node"
}
}
}
}
14 changes: 4 additions & 10 deletions src/client-side-encryption/auto_encrypter.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
type MongoCrypt,
type MongoCryptConstructor,
type MongoCryptOptions
} from 'mongodb-client-encryption';
import { type MongoCrypt, type MongoCryptOptions } from 'mongodb-client-encryption';
import * as net from 'net';

import { deserialize, type Document, serialize } from '../bson';
Expand All @@ -14,8 +10,7 @@ import { MongoClient, type MongoClientOptions } from '../mongo_client';
import { type Abortable } from '../mongo_types';
import { MongoDBCollectionNamespace } from '../utils';
import { autoSelectSocketOptions } from './client_encryption';
import * as cryptoCallbacks from './crypto_callbacks';
import { MongoCryptInvalidArgumentError } from './errors';
import { defaultErrorWrapper, MongoCryptInvalidArgumentError } from './errors';
import { MongocryptdManager } from './mongocryptd_manager';
import {
type CredentialProviders,
Expand Down Expand Up @@ -183,7 +178,7 @@ export class AutoEncrypter {
[kDecorateResult] = false;

/** @internal */
static getMongoCrypt(): MongoCryptConstructor {
static getMongoCrypt(): typeof MongoCrypt {
const encryption = getMongoDBClientEncryption();
if ('kModuleError' in encryption) {
throw encryption.kModuleError;
Expand Down Expand Up @@ -258,8 +253,7 @@ export class AutoEncrypter {
}

const mongoCryptOptions: MongoCryptOptions = {
enableMultipleCollinfo: true,
cryptoCallbacks
errorWrapper: defaultErrorWrapper
};
if (options.schemaMap) {
mongoCryptOptions.schemaMap = Buffer.isBuffer(options.schemaMap)
Expand Down
9 changes: 4 additions & 5 deletions src/client-side-encryption/client_encryption.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type {
ExplicitEncryptionContextOptions,
MongoCrypt,
MongoCryptConstructor,
MongoCryptOptions
} from 'mongodb-client-encryption';

Expand All @@ -26,8 +25,8 @@ import { type CreateCollectionOptions } from '../operations/create_collection';
import { type DeleteResult } from '../operations/delete';
import { type CSOTTimeoutContext, TimeoutContext } from '../timeout';
import { MongoDBCollectionNamespace, resolveTimeoutOptions } from '../utils';
import * as cryptoCallbacks from './crypto_callbacks';
import {
defaultErrorWrapper,
MongoCryptCreateDataKeyError,
MongoCryptCreateEncryptedCollectionError,
MongoCryptInvalidArgumentError
Expand Down Expand Up @@ -87,7 +86,7 @@ export class ClientEncryption {
_credentialProviders?: CredentialProviders;

/** @internal */
static getMongoCrypt(): MongoCryptConstructor {
static getMongoCrypt(): typeof MongoCrypt {
const encryption = getMongoDBClientEncryption();
if ('kModuleError' in encryption) {
throw encryption.kModuleError;
Expand Down Expand Up @@ -144,10 +143,10 @@ export class ClientEncryption {

const mongoCryptOptions: MongoCryptOptions = {
...options,
cryptoCallbacks,
kmsProviders: !Buffer.isBuffer(this._kmsProviders)
? (serialize(this._kmsProviders) as Buffer)
: this._kmsProviders
: this._kmsProviders,
errorWrapper: defaultErrorWrapper
};

this._keyVaultNamespace = options.keyVaultNamespace;
Expand Down
Loading