@@ -15,7 +15,6 @@ import {
15
15
IncorrectKeyException ,
16
16
} from '@aws-sdk/client-kms'
17
17
import { DynamoDBClient } from '@aws-sdk/client-dynamodb'
18
- import { SrkCompatibilityKmsConfig } from '../src/kms_config'
19
18
import { getRegionFromIdentifier } from '@aws-crypto/kms-keyring'
20
19
import {
21
20
BRANCH_KEY_ACTIVE_VERSION ,
@@ -47,7 +46,7 @@ describe('Test Branch keystore', () => {
47
46
} )
48
47
49
48
describe ( 'Test constructor' , ( ) => {
50
- const KMS_CONFIGURATION = new SrkCompatibilityKmsConfig ( KEY_ARN )
49
+ const KMS_CONFIGURATION = { identifier : KEY_ARN }
51
50
52
51
const BRANCH_KEYSTORE = new BranchKeyStoreNode ( {
53
52
storage : { ddbTableName : DDB_TABLE_NAME } ,
@@ -194,7 +193,7 @@ describe('Test Branch keystore', () => {
194
193
const kmsClient = new KMSClient ( { } )
195
194
const ddbClient = new DynamoDBClient ( { } )
196
195
expect ( ( ) => {
197
- const kmsConfig = new SrkCompatibilityKmsConfig ( KEY_ID )
196
+ const kmsConfig = { identifier : KEY_ID }
198
197
return new BranchKeyStoreNode ( {
199
198
storage : { ddbTableName : DDB_TABLE_NAME , ddbClient } ,
200
199
logicalKeyStoreName : LOGICAL_KEYSTORE_NAME ,
@@ -210,7 +209,7 @@ describe('Test Branch keystore', () => {
210
209
const kmsClient = new KMSClient ( { } )
211
210
const ddbClient = new DynamoDBClient ( { } )
212
211
expect ( ( ) => {
213
- const kmsConfig = new SrkCompatibilityKmsConfig ( KMS_KEY_ALIAS )
212
+ const kmsConfig = { identifier : KMS_KEY_ALIAS }
214
213
return new BranchKeyStoreNode ( {
215
214
storage : { ddbTableName : DDB_TABLE_NAME , ddbClient } ,
216
215
logicalKeyStoreName : LOGICAL_KEYSTORE_NAME ,
@@ -225,7 +224,7 @@ describe('Test Branch keystore', () => {
225
224
it ( 'Valid config' , ( ) => {
226
225
const kmsClient = new KMSClient ( { } )
227
226
const ddbClient = new DynamoDBClient ( { } )
228
- const kmsConfig = new SrkCompatibilityKmsConfig ( KEY_ARN )
227
+ const kmsConfig = { identifier : KEY_ID }
229
228
const keyStore = new BranchKeyStoreNode ( {
230
229
storage : { ddbTableName : DDB_TABLE_NAME , ddbClient } ,
231
230
logicalKeyStoreName : LOGICAL_KEYSTORE_NAME ,
@@ -243,7 +242,7 @@ describe('Test Branch keystore', () => {
243
242
it ( 'Test valid config with no clients' , ( ) => {
244
243
const kmsClient = new KMSClient ( { } )
245
244
const ddbClient = new DynamoDBClient ( { } )
246
- const kmsConfig = new SrkCompatibilityKmsConfig ( KEY_ARN )
245
+ const kmsConfig = { identifier : KEY_ID }
247
246
248
247
// test with no kms client supplied
249
248
expect (
@@ -408,7 +407,7 @@ describe('Test Branch keystore', () => {
408
407
it ( 'Test get active key' , async ( ) => {
409
408
const kmsClient = new KMSClient ( { } )
410
409
const ddbClient = new DynamoDBClient ( { } )
411
- const kmsConfig = new SrkCompatibilityKmsConfig ( KEY_ARN )
410
+ const kmsConfig = { identifier : KEY_ID }
412
411
const keyStore = new BranchKeyStoreNode ( {
413
412
kmsConfiguration : kmsConfig ,
414
413
storage : { ddbTableName : DDB_TABLE_NAME , ddbClient : ddbClient } ,
@@ -444,7 +443,7 @@ describe('Test Branch keystore', () => {
444
443
it ( 'Test get branch key version' , async ( ) => {
445
444
const kmsClient = new KMSClient ( { } )
446
445
const ddbClient = new DynamoDBClient ( { } )
447
- const kmsConfig = new SrkCompatibilityKmsConfig ( KEY_ARN )
446
+ const kmsConfig = { identifier : KEY_ID }
448
447
449
448
const keyStore = new BranchKeyStoreNode ( {
450
449
kmsConfiguration : kmsConfig ,
@@ -494,7 +493,7 @@ describe('Test Branch keystore', () => {
494
493
it ( 'Test get active key with incorrect kms key arn' , async ( ) => {
495
494
const kmsClient = new KMSClient ( { } )
496
495
const ddbClient = new DynamoDBClient ( { } )
497
- const kmsConfig = new SrkCompatibilityKmsConfig ( KEY_ARN )
496
+ const kmsConfig = { identifier : KEY_ID }
498
497
499
498
const keyStore = new BranchKeyStoreNode ( {
500
499
kmsConfiguration : kmsConfig ,
@@ -514,7 +513,7 @@ describe('Test Branch keystore', () => {
514
513
it ( 'Test get active key with wrong logical keystore name' , async ( ) => {
515
514
const kmsClient = new KMSClient ( { } )
516
515
const ddbClient = new DynamoDBClient ( { } )
517
- const kmsConfig = new SrkCompatibilityKmsConfig ( KEY_ARN )
516
+ const kmsConfig = { identifier : KEY_ID }
518
517
519
518
const keyStore = new BranchKeyStoreNode ( {
520
519
kmsConfiguration : kmsConfig ,
@@ -532,7 +531,7 @@ describe('Test Branch keystore', () => {
532
531
it ( 'Test get active key does not exist fails' , async ( ) => {
533
532
const kmsClient = new KMSClient ( { } )
534
533
const ddbClient = new DynamoDBClient ( { } )
535
- const kmsConfig = new SrkCompatibilityKmsConfig ( KEY_ARN )
534
+ const kmsConfig = { identifier : KEY_ID }
536
535
537
536
const keyStore = new BranchKeyStoreNode ( {
538
537
kmsConfiguration : kmsConfig ,
@@ -550,7 +549,7 @@ describe('Test Branch keystore', () => {
550
549
} )
551
550
552
551
it ( 'Test get active key with no clients' , async ( ) => {
553
- const kmsConfig = new SrkCompatibilityKmsConfig ( KEY_ARN )
552
+ const kmsConfig = { identifier : KEY_ID }
554
553
const keyStore = new BranchKeyStoreNode ( {
555
554
kmsConfiguration : kmsConfig ,
556
555
logicalKeyStoreName : LOGICAL_KEYSTORE_NAME ,
@@ -564,7 +563,7 @@ describe('Test Branch keystore', () => {
564
563
it ( 'Test get active key for lying branch key' , async ( ) => {
565
564
const kmsClient = new KMSClient ( { } )
566
565
const ddbClient = new DynamoDBClient ( { } )
567
- const kmsConfig = new SrkCompatibilityKmsConfig ( POSTAL_HORN_KEY_ARN )
566
+ const kmsConfig = { identifier : POSTAL_HORN_KEY_ARN }
568
567
569
568
const keyStore = new BranchKeyStoreNode ( {
570
569
kmsConfiguration : kmsConfig ,
@@ -582,7 +581,7 @@ describe('Test Branch keystore', () => {
582
581
it ( 'Test get versioned key for lying branch key' , async ( ) => {
583
582
const kmsClient = new KMSClient ( { } )
584
583
const ddbClient = new DynamoDBClient ( { } )
585
- const kmsConfig = new SrkCompatibilityKmsConfig ( POSTAL_HORN_KEY_ARN )
584
+ const kmsConfig = { identifier : POSTAL_HORN_KEY_ARN }
586
585
587
586
const keyStore = new BranchKeyStoreNode ( {
588
587
kmsConfiguration : kmsConfig ,
0 commit comments