Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

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: 2 additions & 1 deletion src/client-side-encryption/providers/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { Binary } from '../../bson';
import { loadAWSCredentials } from './aws';
import { loadAzureCredentials } from './azure';
import { loadGCPCredentials } from './gcp';
Expand Down Expand Up @@ -39,7 +40,7 @@ export interface LocalKMSProviderConfiguration {
* The master key used to encrypt/decrypt data keys.
* A 96-byte long Buffer or base64 encoded string.
*/
key: Buffer | string;
key: Binary | Buffer | string;
}

/** @public */
Expand Down
6 changes: 5 additions & 1 deletion test/types/client-side-encryption.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
KMSProviders,
RangeOptions
} from '../..';
import type { ClientEncryptionDataKeyProvider } from '../mongodb';
import { Binary, type ClientEncryptionDataKeyProvider } from '../mongodb';

type RequiredCreateEncryptedCollectionSettings = Parameters<
ClientEncryption['createEncryptedCollection']
Expand Down Expand Up @@ -51,6 +51,10 @@ expectAssignable<RequiredCreateEncryptedCollectionSettings>({

{
// KMSProviders
// local
expectAssignable<KMSProviders['local']>({ key: '' });
expectAssignable<KMSProviders['local']>({ key: Buffer.alloc(0) });
expectAssignable<KMSProviders['local']>({ key: Binary.createFromBase64('') });
// aws
expectAssignable<KMSProviders['aws']>({ accessKeyId: '', secretAccessKey: '' });
expectAssignable<KMSProviders['aws']>({
Expand Down