Skip to content

Commit

Permalink
implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
baileympearson committed Jun 20, 2024
1 parent 070f0e2 commit a670c28
Show file tree
Hide file tree
Showing 11 changed files with 135 additions and 174 deletions.
122 changes: 47 additions & 75 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"js-yaml": "^4.1.0",
"mocha": "^10.4.0",
"mocha-sinon": "^2.1.2",
"mongodb-client-encryption": "^6.0.1",
"mongodb-client-encryption": "^6.1.0-alpha",
"mongodb-legacy": "^6.0.1",
"nyc": "^15.1.0",
"prettier": "^2.8.8",
Expand Down
45 changes: 3 additions & 42 deletions src/client-side-encryption/client_encryption.ts
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ export class ClientEncryption {
/**
* Encrypts a Match Expression or Aggregate Expression to query a range index.
*
* Only supported when queryType is "rangePreview" and algorithm is "RangePreview".
* Only supported when queryType is "range" and algorithm is "Range".
*
* @experimental The Range algorithm is experimental only. It is not intended for production use. It is subject to breaking changes.
*
Expand Down Expand Up @@ -737,7 +737,7 @@ export interface ClientEncryptionEncryptOptions {
| 'AEAD_AES_256_CBC_HMAC_SHA_512-Random'
| 'Indexed'
| 'Unindexed'
| 'RangePreview';
| 'Range';

/**
* The id of the Binary dataKey to use for encryption
Expand All @@ -757,7 +757,7 @@ export interface ClientEncryptionEncryptOptions {
*
* @experimental Public Technical Preview: The queryType `rangePreview` is experimental.
*/
queryType?: 'equality' | 'rangePreview';
queryType?: 'equality' | 'range';

/** @experimental Public Technical Preview: The index options for a Queryable Encryption field supporting "rangePreview" queries.*/
rangeOptions?: RangeOptions;
Expand Down Expand Up @@ -957,42 +957,3 @@ export interface RangeOptions {
sparsity: Long;
precision?: number;
}

/**
* @public
* Options to provide when encrypting data.
*/
export interface ClientEncryptionEncryptOptions {
/**
* The algorithm to use for encryption.
*/
algorithm:
| 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'
| 'AEAD_AES_256_CBC_HMAC_SHA_512-Random'
| 'Indexed'
| 'Unindexed'
| 'RangePreview';

/**
* The id of the Binary dataKey to use for encryption
*/
keyId?: Binary;

/**
* A unique string name corresponding to an already existing dataKey.
*/
keyAltName?: string;

/** The contention factor. */
contentionFactor?: bigint | number;

/**
* The query type supported. Only the queryType `equality` is stable.
*
* @experimental Public Technical Preview: The queryType `rangePreview` is experimental.
*/
queryType?: 'equality' | 'rangePreview';

/** @experimental Public Technical Preview: The index options for a Queryable Encryption field supporting "rangePreview" queries.*/
rangeOptions?: RangeOptions;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('Client Side Encryption Prose Corpus Test', function () {
const metadata = {
requires: {
mongodb: '>=4.2.0',
clientSideEncryption: true
clientSideEncryption: true as const
}
};

Expand Down
Loading

0 comments on commit a670c28

Please sign in to comment.