Socket
Socket
Sign inDemoInstall

mongodb-client-encryption

Package Overview
Dependencies
Maintainers
6
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongodb-client-encryption - npm Package Compare versions

Comparing version 6.0.0-alpha.0 to 6.0.0-alpha.1

2

CHANGELOG.md

@@ -5,2 +5,4 @@ # Changelog

## [6.0.0-alpha.1](https://github.com/mongodb/libmongocrypt/compare/node-v2.9.0...node-v6.0.0-alpha.1) (2023-07-27)
## [6.0.0-alpha.0](https://github.com/mongodb/libmongocrypt/compare/node-v2.9.0...node-v6.0.0-alpha.0) (2023-07-13)

@@ -7,0 +9,0 @@

81

lib/index.d.ts
/// <reference types="node" />
export interface MongoCryptCtor {
new (): MongoCryptInstance;
libmongocryptVersion: string;
}
interface MongoCryptKMSRequest {
export interface MongoCryptKMSRequest {
addResponse(response: Buffer): void;
status: MongoCryptStatus;
bytesNeeded: number;
kmsProvider: string;
endpoint: string;
message: Buffer;
readonly status: MongoCryptStatus;
readonly bytesNeeded: number;
readonly kmsProvider: string;
readonly endpoint: string;
readonly message: Buffer;
}
interface MongoCryptStatus {
export interface MongoCryptStatus {
type: number;

@@ -19,20 +15,33 @@ code: number;

}
interface MongoCryptContext {
export interface MongoCryptContext {
nextMongoOperation(): Buffer;
addMongoOperationResponse(response: Buffer): void;
addMongoOperationResponse(response: Uint8Array): void;
finishMongoOperation(): void;
nextKMSRequest(): MongoCryptKMSRequest | null;
provideKMSProviders(providers: Buffer): void;
provideKMSProviders(providers: Uint8Array): void;
finishKMSRequests(): void;
finalize(): Buffer;
status: MongoCryptStatus;
state: number;
readonly status: MongoCryptStatus;
readonly state: number;
}
export interface MongoCryptInstance {
makeEncryptionContext(ns: string, command: Buffer): MongoCryptContext;
makeExplicitEncryptionContext(value: Buffer, options?: {
keyId?: Buffer;
keyAltName?: Buffer;
export interface MongoCryptConstructor {
new (options: {
kmsProviders?: Buffer;
schemaMap?: Buffer;
encryptedFieldsMap?: Buffer;
logger?: unknown;
cryptoCallbacks?: Record<string, unknown>;
cryptSharedLibSearchPaths?: string[];
cryptSharedLibPath?: string;
bypassQueryAnalysis?: boolean;
}): MongoCrypt;
libmongocryptVersion: string;
}
export interface MongoCrypt {
makeEncryptionContext(ns: string, command: Uint8Array): MongoCryptContext;
makeExplicitEncryptionContext(value: Uint8Array, options?: {
keyId?: Uint8Array;
keyAltName?: Uint8Array;
algorithm?: string;
rangeOptions?: Buffer;
rangeOptions?: Uint8Array;
contentionFactor?: bigint | number;

@@ -48,11 +57,11 @@ queryType?: string;

}): MongoCryptContext;
makeDecryptionContext(buffer: Buffer): MongoCryptContext;
makeExplicitDecryptionContext(buffer: Buffer): MongoCryptContext;
makeDataKeyContext(optionsBuffer: Buffer, options: {
keyAltNames: Buffer[];
keyMaterial: Buffer;
}): void;
makeRewrapManyDataKeyContext(filter: Buffer, encryptionKey: Buffer): void;
status: MongoCryptStatus;
cryptSharedLibVersionInfo: {
makeDecryptionContext(buffer: Uint8Array): MongoCryptContext;
makeExplicitDecryptionContext(buffer: Uint8Array): MongoCryptContext;
makeDataKeyContext(optionsBuffer: Uint8Array, options: {
keyAltNames?: Uint8Array[];
keyMaterial?: Uint8Array;
}): MongoCryptContext;
makeRewrapManyDataKeyContext(filter: Uint8Array, encryptionKey?: Uint8Array): MongoCryptContext;
readonly status: MongoCryptStatus;
readonly cryptSharedLibVersionInfo: {
version: bigint;

@@ -62,4 +71,12 @@ versionStr: string;

}
export declare const MongoCrypt: MongoCryptCtor;
export type ExplicitEncryptionContextOptions = NonNullable<Parameters<MongoCrypt['makeExplicitEncryptionContext']>[1]>;
export type DataKeyContextOptions = NonNullable<Parameters<MongoCrypt['makeDataKeyContext']>[1]>;
export type MongoCryptOptions = NonNullable<ConstructorParameters<MongoCryptConstructor>[0]>;
export declare const MongoCrypt: MongoCryptConstructor;
/** exported for testing only. */
interface MongoCryptContextCtor {
new (): MongoCryptContext;
}
export declare const MongoCryptContextCtor: MongoCryptContextCtor;
export {};
//# sourceMappingURL=index.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MongoCrypt = void 0;
exports.MongoCryptContextCtor = exports.MongoCrypt = void 0;
const bindings = require("bindings");
const mc = bindings('mongocrypt');
exports.MongoCrypt = mc.MongoCrypt;
exports.MongoCryptContextCtor = mc.MongoCryptContextCtor;
//# sourceMappingURL=index.js.map
{
"name": "mongodb-client-encryption",
"version": "6.0.0-alpha.0",
"version": "6.0.0-alpha.1",
"description": "Official client encryption module for the MongoDB Node.js driver",
"main": "lib/index.js",
"types": "index.d.ts",
"types": "lib/index.d.ts",
"files": [

@@ -21,3 +21,3 @@ "README.md",

"build:ts": "tsc",
"check:lint": "eslint src",
"check:lint": "eslint src test",
"docs": "jsdoc2md --template etc/README.hbs --plugin dmd-clear --files 'lib/**/*.js' > README.md",

@@ -46,2 +46,5 @@ "test": "mocha test",

"@types/bindings": "^1.5.1",
"@types/chai": "^4.3.5",
"@types/mocha": "^10.0.1",
"@types/node": "^20.4.2",
"@typescript-eslint/eslint-plugin": "^6.0.0",

@@ -58,8 +61,13 @@ "chai": "^4.3.7",

"prettier": "^2.8.8",
"sinon": "^15.2.0",
"sinon-chai": "^3.7.0",
"source-map-support": "^0.5.21",
"standard-version": "^9.5.0",
"tar": "^6.1.14",
"typescript": "^5.1.6"
"ts-node": "^10.9.1",
"typescript": "^5.1.6",
"typescript-cached-transpile": "^0.0.6"
},
"engines": {
"node": ">=12.9.0"
"node": ">=16.20.1"
},

@@ -66,0 +74,0 @@ "binary": {

@@ -1,20 +0,15 @@

import * as bindings from 'bindings';
import bindings = require('bindings');
const mc = bindings('mongocrypt');
export interface MongoCryptCtor {
new (): MongoCryptInstance;
libmongocryptVersion: string;
}
interface MongoCryptKMSRequest {
export interface MongoCryptKMSRequest {
addResponse(response: Buffer): void;
status: MongoCryptStatus;
bytesNeeded: number;
kmsProvider: string;
endpoint: string;
message: Buffer;
readonly status: MongoCryptStatus;
readonly bytesNeeded: number;
readonly kmsProvider: string;
readonly endpoint: string;
readonly message: Buffer;
}
interface MongoCryptStatus {
export interface MongoCryptStatus {
type: number;

@@ -25,24 +20,38 @@ code: number;

interface MongoCryptContext {
export interface MongoCryptContext {
nextMongoOperation(): Buffer;
addMongoOperationResponse(response: Buffer): void;
addMongoOperationResponse(response: Uint8Array): void;
finishMongoOperation(): void;
nextKMSRequest(): MongoCryptKMSRequest | null;
provideKMSProviders(providers: Buffer): void;
provideKMSProviders(providers: Uint8Array): void;
finishKMSRequests(): void;
finalize(): Buffer;
status: MongoCryptStatus;
state: number;
readonly status: MongoCryptStatus;
readonly state: number;
}
export interface MongoCryptInstance {
makeEncryptionContext(ns: string, command: Buffer): MongoCryptContext;
export interface MongoCryptConstructor {
new (options: {
kmsProviders?: Buffer;
schemaMap?: Buffer;
encryptedFieldsMap?: Buffer;
logger?: unknown;
cryptoCallbacks?: Record<string, unknown>;
cryptSharedLibSearchPaths?: string[];
cryptSharedLibPath?: string;
bypassQueryAnalysis?: boolean;
}): MongoCrypt;
libmongocryptVersion: string;
}
export interface MongoCrypt {
makeEncryptionContext(ns: string, command: Uint8Array): MongoCryptContext;
makeExplicitEncryptionContext(
value: Buffer,
value: Uint8Array,
options?: {
keyId?: Buffer;
keyAltName?: Buffer;
keyId?: Uint8Array;
keyAltName?: Uint8Array;
algorithm?: string;
rangeOptions?: Buffer;
rangeOptions?: Uint8Array;
contentionFactor?: bigint | number;

@@ -60,14 +69,14 @@ queryType?: string;

): MongoCryptContext;
makeDecryptionContext(buffer: Buffer): MongoCryptContext;
makeExplicitDecryptionContext(buffer: Buffer): MongoCryptContext;
makeDecryptionContext(buffer: Uint8Array): MongoCryptContext;
makeExplicitDecryptionContext(buffer: Uint8Array): MongoCryptContext;
makeDataKeyContext(
optionsBuffer: Buffer,
optionsBuffer: Uint8Array,
options: {
keyAltNames: Buffer[];
keyMaterial: Buffer;
keyAltNames?: Uint8Array[];
keyMaterial?: Uint8Array;
}
): void;
makeRewrapManyDataKeyContext(filter: Buffer, encryptionKey: Buffer): void;
status: MongoCryptStatus;
cryptSharedLibVersionInfo: {
): MongoCryptContext;
makeRewrapManyDataKeyContext(filter: Uint8Array, encryptionKey?: Uint8Array): MongoCryptContext;
readonly status: MongoCryptStatus;
readonly cryptSharedLibVersionInfo: {
version: bigint;

@@ -78,2 +87,14 @@ versionStr: string;

export const MongoCrypt: MongoCryptCtor = mc.MongoCrypt;
export type ExplicitEncryptionContextOptions = NonNullable<
Parameters<MongoCrypt['makeExplicitEncryptionContext']>[1]
>;
export type DataKeyContextOptions = NonNullable<Parameters<MongoCrypt['makeDataKeyContext']>[1]>;
export type MongoCryptOptions = NonNullable<ConstructorParameters<MongoCryptConstructor>[0]>;
export const MongoCrypt: MongoCryptConstructor = mc.MongoCrypt;
/** exported for testing only. */
interface MongoCryptContextCtor {
new (): MongoCryptContext;
}
export const MongoCryptContextCtor: MongoCryptContextCtor = mc.MongoCryptContextCtor;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc