Skip to content

Commit 94c421e

Browse files
committed
update
1 parent fe14024 commit 94c421e

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

DynamoDbEncryption/dafny/DynamoDbEncryption/test/Beacon.dfy

+6
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,9 @@ module TestBaseBeacon {
273273
var badVersion := GetLotsaBeaconsMultiWithSharedCacheWithBadKeyStore(cache := sharedCache, partitionId := Some(partitionIdBadVersion));
274274
var badSrc :- expect C.MakeKeySource(FullTableConfig, badVersion.keyStore, badVersion.keySource, primitives);
275275
var badBv :- expect C.ConvertVersionWithSource(FullTableConfig, badVersion, badSrc);
276+
// This KeyId is a valid branch_key_id present in the KeyStoreDdbTable.
277+
// Providing a valid branch_key_id is important in this method because unlike other tests in Beacon.dfy,
278+
// this is used in a test which actually fetches data from DynamoDb without using a Literal KeySource.
276279
var badAttrs := badBv.GenerateEncryptedBeacons(SimpleItem, KeyId("040a32a8-3737-4f16-a3ba-bd4449556d73"));
277280
expect badAttrs.Failure?;
278281

@@ -309,6 +312,9 @@ module TestBaseBeacon {
309312
var badVersion := GetLotsaBeaconsMultiWithSharedCacheWithBadKeyStore(cache := sharedCache, partitionId := None);
310313
var badSrc :- expect C.MakeKeySource(FullTableConfig, badVersion.keyStore, badVersion.keySource, primitives);
311314
var badBv :- expect C.ConvertVersionWithSource(FullTableConfig, badVersion, badSrc);
315+
// This KeyId is a valid branch_key_id present in the KeyStoreDdbTable.
316+
// Providing a valid branch_key_id is important in this method because unlike other tests in Beacon.dfy,
317+
// this is used in a test which actually fetches data from DynamoDb without using a Literal KeySource.
312318
var badAttrs := badBv.GenerateEncryptedBeacons(SimpleItem, KeyId("040a32a8-3737-4f16-a3ba-bd4449556d73"));
313319
expect badAttrs.Failure?;
314320

DynamoDbEncryption/dafny/DynamoDbEncryption/test/BeaconTestFixtures.dfy

+6-5
Original file line numberDiff line numberDiff line change
@@ -151,17 +151,18 @@ module BeaconTestFixtures {
151151
{
152152
var kmsClient :- expect KMS.KMSClient();
153153
var ddbClient :- expect DDBC.DynamoDBClient();
154+
// This is the bad-arn key which does NOT exist.
154155
var kmsConfig := KTypes.KMSConfiguration.kmsKeyArn(
155156
"arn:aws:kms:us-west-2:370957321024:key/bad-arn"
156157
);
157158
var keyStoreConfig := KTypes.KeyStoreConfig(
158159
id := None,
159160
kmsConfiguration := kmsConfig,
160161
// This needs to be the same as logicalKeyStoreName of KeyStore
161-
// generated by GetKeyStore to have the same cache identifier
162+
// generated by GetKeyStore to have the same cache identifier.
162163
logicalKeyStoreName := "KeyStoreDdbTable",
163164
grantTokens := None,
164-
// This is the bad-table-name which does NOT exist
165+
// This is the bad-table-name which does NOT exist.
165166
ddbTableName := "bad-table-name",
166167
ddbClient := Some(ddbClient),
167168
kmsClient := Some(kmsClient)
@@ -241,9 +242,9 @@ module BeaconTestFixtures {
241242
return BeaconVersion (
242243
version := 1,
243244
keyStore := store,
244-
// This KeyId is a valid branch_key_id present in the KeyStoreDdbTable
245+
// This KeyId is a valid branch_key_id present in the KeyStoreDdbTable.
245246
// Providing a valid branch_key_id is important in this method because unlike other tests in Beacon.dfy,
246-
// this is used in a test which actually fetches data from DynamoDb without using a Literal KeySource
247+
// this is used in a test which actually fetches data from DynamoDb without using a Literal KeySource.
247248
keySource := single(SingleKeyStore(keyId := "040a32a8-3737-4f16-a3ba-bd4449556d73", cacheTTL := 42, cache := Some(cache), partitionId := partitionId)),
248249
standardBeacons := [std2, std4, std6, NameTitleBeacon, NameB, TitleB],
249250
compoundBeacons := Some([NameTitle, YearName, Mixed, JustSigned]),
@@ -265,7 +266,7 @@ module BeaconTestFixtures {
265266
return BeaconVersion (
266267
version := 1,
267268
keyStore := store,
268-
// This KeyId is a valid branch_key_id present in the KeyStoreDdbTable
269+
// This KeyId is a valid branch_key_id present in the KeyStoreDdbTable.
269270
// Providing a valid branch_key_id is important in this method because unlike other tests in Beacon.dfy,
270271
// this is used in a test which actually fetches data from DynamoDb without using a Literal KeySource.
271272
// Even though this method creates a BeaconVersion with a Bad Key Store which does NOT exist,

submodules/smithy-dafny

0 commit comments

Comments
 (0)