File tree 2 files changed +7
-2
lines changed
src/client-side-encryption/providers
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change
1
+ import type { Binary } from '../../bson' ;
1
2
import { loadAWSCredentials } from './aws' ;
2
3
import { loadAzureCredentials } from './azure' ;
3
4
import { loadGCPCredentials } from './gcp' ;
@@ -39,7 +40,7 @@ export interface LocalKMSProviderConfiguration {
39
40
* The master key used to encrypt/decrypt data keys.
40
41
* A 96-byte long Buffer or base64 encoded string.
41
42
*/
42
- key : Buffer | string ;
43
+ key : Binary | Uint8Array | string ;
43
44
}
44
45
45
46
/** @public */
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import type {
9
9
KMSProviders ,
10
10
RangeOptions
11
11
} from '../..' ;
12
- import type { ClientEncryptionDataKeyProvider } from '../mongodb' ;
12
+ import { Binary , type ClientEncryptionDataKeyProvider } from '../mongodb' ;
13
13
14
14
type RequiredCreateEncryptedCollectionSettings = Parameters <
15
15
ClientEncryption [ 'createEncryptedCollection' ]
@@ -51,6 +51,10 @@ expectAssignable<RequiredCreateEncryptedCollectionSettings>({
51
51
52
52
{
53
53
// KMSProviders
54
+ // local
55
+ expectAssignable < KMSProviders [ 'local' ] > ( { key : '' } ) ;
56
+ expectAssignable < KMSProviders [ 'local' ] > ( { key : Buffer . alloc ( 0 ) } ) ;
57
+ expectAssignable < KMSProviders [ 'local' ] > ( { key : Binary . createFromBase64 ( '' ) } ) ;
54
58
// aws
55
59
expectAssignable < KMSProviders [ 'aws' ] > ( { accessKeyId : '' , secretAccessKey : '' } ) ;
56
60
expectAssignable < KMSProviders [ 'aws' ] > ( {
You can’t perform that action at this time.
0 commit comments