Skip to content

Commit c7d3968

Browse files
committed
lint and tests
1 parent dc448dd commit c7d3968

File tree

8 files changed

+175
-164
lines changed

8 files changed

+175
-164
lines changed

modules/branch-keystore-node/src/branch_keystore.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ export class BranchKeyStoreNode implements IBranchKeyStoreNode {
319319
'MUST supply a string branch key id'
320320
)
321321
needs(
322-
branchKeyVersion && typeof branchKeyVersion === 'string,
322+
branchKeyVersion && typeof branchKeyVersion === 'string',
323323
'MUST supply a string branch key version'
324324
)
325325

modules/branch-keystore-node/src/dynamodb_key_storage.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class DynamoDBKeyStorage implements IBranchKeyStorage {
6060
typeof logicalKeyStoreName === 'string',
6161
'Logical Key Store name must be a string'
6262
)
63-
needs(logicalKeyStoreName, 'Logical Key Store name required')
63+
needs(logicalKeyStoreName, 'Logical Key Store name required')
6464
/* Precondition: DDB client must be a DynamoDBClient */
6565
needs(
6666
ddbClient instanceof DynamoDBClient,
@@ -155,9 +155,9 @@ needs(logicalKeyStoreName, 'Logical Key Store name required')
155155
//= aws-encryption-sdk-specification/framework/key-store/dynamodb-key-storage.md#getencryptedbranchkeyversion
156156
//# The returned EncryptedHierarchicalKey MUST have the same identifier as the input.
157157
needs(
158-
encrypted.branchKeyId == branchKeyId,
159-
'Unexpected branch key id. Expected ${branchKeyId}, found ${encrypted.branchKeyId}'
160-
)
158+
encrypted.branchKeyId == branchKeyId,
159+
'Unexpected branch key id. Expected ${branchKeyId}, found ${encrypted.branchKeyId}'
160+
)
161161

162162
//= aws-encryption-sdk-specification/framework/key-store/dynamodb-key-storage.md#getencryptedbranchkeyversion
163163
//# The returned EncryptedHierarchicalKey MUST have the same version as the input.

modules/branch-keystore-node/test/branch_keystore.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ describe('Test Branch keystore', () => {
480480
logicalKeyStoreName: '',
481481
kmsConfiguration: KMS_CONFIGURATION,
482482
})
483-
).to.throw('Logical Keystore name required')
483+
).to.throw('Logical Key Store name required')
484484
})
485485

486486
describe('Test proper init', () => {
@@ -696,7 +696,7 @@ describe('Test Branch keystore', () => {
696696
void (await expect(
697697
keyStore.getActiveBranchKey('Robbie')
698698
).to.be.rejectedWith(
699-
`A branch key record with ${PARTITION_KEY}=Robbie and ${SORT_KEY}=${BRANCH_KEY_ACTIVE_TYPE} was not found in DynamoDB`
699+
`A branch key record with ${PARTITION_KEY}=Robbie and ${SORT_KEY}=${BRANCH_KEY_ACTIVE_TYPE} was not found in the DynamoDB table ${DDB_TABLE_NAME}.`
700700
))
701701
})
702702

modules/branch-keystore-node/test/branch_keystore_helpers.test.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ import {
4040
SORT_KEY,
4141
} from '../src/constants'
4242
import { DynamoDBKeyStorage } from '../src/dynamodb_key_storage'
43-
import {
44-
EncryptedHierarchicalKey,
45-
} from '../src/types'
43+
import { EncryptedHierarchicalKey } from '../src/types'
4644

4745
const VALID_CUSTOM_ENCRYPTION_CONTEXT_KV_PAIRS = {
4846
'aws-crypto-ec:key1': 'value 1',
@@ -116,7 +114,7 @@ describe('Test keystore helpers', () => {
116114
BRANCH_KEY_ACTIVE_TYPE
117115
)
118116
).to.rejectedWith(
119-
`A branch key record with ${PARTITION_KEY}=${nonexistentBranchKeyId} and ${SORT_KEY}=${BRANCH_KEY_ACTIVE_TYPE} was not found in DynamoDB`
117+
`A branch key record with ${PARTITION_KEY}=${nonexistentBranchKeyId} and ${SORT_KEY}=${BRANCH_KEY_ACTIVE_TYPE} was not found in the DynamoDB table ${DDB_TABLE_NAME}.`
120118
))
121119

122120
void (await expect(
@@ -126,7 +124,7 @@ describe('Test keystore helpers', () => {
126124
VERSION_BRANCH_KEY[TYPE_FIELD]
127125
)
128126
).to.be.rejectedWith(
129-
`A branch key record with ${PARTITION_KEY}=${nonexistentBranchKeyId} and ${SORT_KEY}=${VERSION_BRANCH_KEY[TYPE_FIELD]} was not found in DynamoDB`
127+
`A branch key record with ${PARTITION_KEY}=${nonexistentBranchKeyId} and ${SORT_KEY}=${VERSION_BRANCH_KEY[TYPE_FIELD]} was not found in the DynamoDB table ${DDB_TABLE_NAME}.`
130128
))
131129
})
132130

@@ -137,7 +135,7 @@ describe('Test keystore helpers', () => {
137135
void (await expect(
138136
getBranchKeyItem(BRANCH_KEY_STORAGE, BRANCH_KEY_ID, nonexistentType)
139137
).to.be.rejectedWith(
140-
`A branch key record with ${PARTITION_KEY}=${BRANCH_KEY_ID} and ${SORT_KEY}=${nonexistentType} was not found in DynamoDB`
138+
`A branch key record with ${PARTITION_KEY}=${BRANCH_KEY_ID} and ${SORT_KEY}=${nonexistentType} was not found in the DynamoDB table ${DDB_TABLE_NAME}.`
141139
))
142140
})
143141
})

modules/kdf-ctr-mode-node/src/kdfctr.ts

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ export function kdfCounterMode({
3737
purpose,
3838
expectedLength,
3939
}: KdfCtrInput): Buffer {
40-
4140
/* Precondition: the ikm must be 32, 48, 66 bytes long */
4241
needs(
4342
SUPPORTED_IKM_LENGTHS.includes(ikm.length),

0 commit comments

Comments
 (0)