Skip to content

Commit ac71de3

Browse files
seebeesjosecorellatexastony
authored
Apply suggestions from code review
Co-authored-by: José Corella <[email protected]> Co-authored-by: Tony Knapp <[email protected]>
1 parent 47b8f0d commit ac71de3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -274,15 +274,15 @@ export class BranchKeyStoreNode implements IBranchKeyStoreNode {
274274
needs(
275275
activeEncryptedBranchKey.type instanceof
276276
ActiveHierarchicalSymmetricVersion,
277-
'Unexpected type. Not an version record.'
277+
'Unexpected type. Not a version record.'
278278
)
279279

280280
//= aws-encryption-sdk-specification/framework/branch-key-store.md#getactivebranchkey
281281
//# GetActiveBranchKey MUST verify that the returned EncryptedHierarchicalKey MUST have a logical table name equal to the configured logical table name.
282282
needs(
283283
activeEncryptedBranchKey.encryptionContext[TABLE_FIELD] ==
284284
this.logicalKeyStoreName,
285-
'Unexpected logical table name.'
285+
'Unexpected logical table name. Expected ${this.logicalKeyStoreName}, found ${activeEncryptedBranchKey.encryptionContext[TABLE_FIELD]}.'
286286
)
287287

288288
//= aws-encryption-sdk-specification/framework/branch-key-store.md#getactivebranchkey
@@ -319,7 +319,7 @@ export class BranchKeyStoreNode implements IBranchKeyStoreNode {
319319
'MUST supply a string branch key id'
320320
)
321321
needs(
322-
branchKeyId && branchKeyVersion,
322+
branchKeyVersion && typeof branchKeyVersion === 'string,
323323
'MUST supply a string branch key version'
324324
)
325325

@@ -352,15 +352,15 @@ export class BranchKeyStoreNode implements IBranchKeyStoreNode {
352352
//# GetActiveBranchKey MUST verify that the returned EncryptedHierarchicalKey is an HierarchicalSymmetricVersion.
353353
needs(
354354
encryptedBranchKey.type instanceof HierarchicalSymmetricVersion,
355-
'Unexpected type. Not an version record.'
355+
'Unexpected type. Not a version record.'
356356
)
357357

358358
//= aws-encryption-sdk-specification/framework/branch-key-store.md#getbranchkeyversion
359359
//# GetBranchKeyVersion MUST verify that the returned EncryptedHierarchicalKey MUST have a logical table name equal to the configured logical table name.
360360
needs(
361361
encryptedBranchKey.encryptionContext[TABLE_FIELD] ==
362362
this.logicalKeyStoreName,
363-
'Unexpected logical table name.'
363+
'Unexpected logical table name. Expected ${this.logicalKeyStoreName}, found ${encryptedBranchKey.encryptionContext[TABLE_FIELD}.'
364364
)
365365

366366
//= aws-encryption-sdk-specification/framework/branch-key-store.md#getbranchkeyversion

0 commit comments

Comments
 (0)