Skip to content

Commit 53da8e3

Browse files
committed
chore: add DO_NOTHING
1 parent 1005889 commit 53da8e3

File tree

2 files changed

+351407
-255663
lines changed

2 files changed

+351407
-255663
lines changed

TestVectors/dafny/DDBEncryption/src/WriteManifest.dfy

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -127,27 +127,36 @@ module {:options "-functionSyntax:4"} WriteManifest {
127127
},
128128
""allowedUnsignedAttributes"" : [""Stuff"", ""Junk""]
129129
}"
130-
131130
// Configuration with a new encrypted attribute not present in basic config
132-
const ExpandedConfig := @"{
131+
const ExpandedBasicConfig := @"{
133132
""attributeActionsOnEncrypt"": {
134133
""RecNum"": ""SIGN_ONLY"",
135134
""Stuff"": ""ENCRYPT_AND_SIGN"",
136135
""Junk"": ""ENCRYPT_AND_SIGN"",
137-
""NewAttribute"": ""ENCRYPT_AND_SIGN""
136+
""NewThing"": ""ENCRYPT_AND_SIGN""
138137
}
139138
}"
140-
141-
// Configuration with a new sign-only attribute not present in basic config
139+
// Configuration with a new sign-only attribute not present in basic config
142140
const ExpandedSignConfig := @"{
143141
""attributeActionsOnEncrypt"": {
144142
""RecNum"": ""SIGN_ONLY"",
145143
""Stuff"": ""ENCRYPT_AND_SIGN"",
146144
""Junk"": ""ENCRYPT_AND_SIGN"",
147-
""NewAttribute"": ""SIGN_ONLY""
145+
""NewThing"": ""SIGN_ONLY""
148146
}
149147
}"
150148

149+
// Configuration with a new DO_NOTHING attribute not present in basic config
150+
const ExpandedDoNothingConfig := @"{
151+
""attributeActionsOnEncrypt"": {
152+
""RecNum"": ""SIGN_ONLY"",
153+
""Stuff"": ""ENCRYPT_AND_SIGN"",
154+
""Junk"": ""ENCRYPT_AND_SIGN"",
155+
""NewThing"": ""DO_NOTHING""
156+
},
157+
""allowedUnsignedAttributes"": [""NewThing""]
158+
}"
159+
151160
method TextToJson(x: string) returns (output : JSON)
152161
{
153162
var str :- expect UTF8.Encode(x);
@@ -417,14 +426,15 @@ module {:options "-functionSyntax:4"} WriteManifest {
417426
var test13 := MakeTest("13", "positive-encrypt", "Basic encrypt V2 switching2", LongerV2Config2, BasicRecord, Some(LongerV2Config1));
418427
var test14 := MakeTest("14", "positive-encrypt", "Special characters in attribute names", SpecialConfig, SpecialRecord);
419428

420-
// Comprehensive tests for schema evolution scenarios based on AddNewAttributeExample
421-
var test15 := MakeTest("15", "positive-encrypt", "Encrypt with basic config, decrypt expecting new ENCRYPT_AND_SIGN attribute", BasicConfig, BasicRecord, Some(ExpandedConfig));
422-
var test16 := MakeTest("16", "positive-encrypt", "Encrypt with basic config, decrypt expecting new SIGN_ONLY attribute", BasicConfig, BasicRecord, Some(ExpandedSignConfig));
423-
var test17 := MakeTest("17", "positive-encrypt", "Encrypt with expanded config having new attribute, decrypt with basic config", ExpandedConfig, BasicRecord, Some(BasicConfig));
424-
var test18 := MakeTest("18", "positive-encrypt", "Encrypt with expanded SIGN_ONLY config having new attribute, decrypt with basic config", ExpandedSignConfig, BasicRecord, Some(BasicConfig));
429+
var test15 := MakeTest("15", "positive-encrypt", "Add new ENCRYPT_AND_SIGN attribute", BasicConfig, BasicRecord, Some(ExpandedBasicConfig));
430+
var test16 := MakeTest("16", "positive-encrypt", "Add new SIGN_ONLY attribute", BasicConfig, BasicRecord, Some(ExpandedSignConfig));
431+
var test17 := MakeTest("17", "positive-encrypt", "Add new DO_NOTHING attribute", BasicConfig, BasicRecord, Some(ExpandedDoNothingConfig));
432+
var test18 := MakeTest("18", "positive-encrypt", "Remove ENCRYPT_AND_SIGN attribute, encrypt with expanded, decrypt with basic", ExpandedBasicConfig, BasicRecord, Some(BasicConfig));
433+
var test19 := MakeTest("19", "positive-encrypt", "Remove SIGN_ONLY attribute, encrypt with expanded, decrypt with basic", ExpandedSignConfig, BasicRecord, Some(BasicConfig));
434+
var test20 := MakeTest("20", "positive-encrypt", "Remove DO_NOTHING attribute, encrypt with expanded, decrypt with basic", ExpandedDoNothingConfig, BasicRecord, Some(BasicConfig));
425435

426436
var configTests := MakeConfigTests();
427-
var tests : seq<(string, JSON)> := [test1, test2, test3, test4, test5, test6, test7, test8, test9, test10, test11, test12, test13, test14, test15, test16, test17, test18] + configTests;
437+
var tests : seq<(string, JSON)> := [test1, test2, test3, test4, test5, test6, test7, test8, test9, test10, test11, test12, test13, test14, test15, test16, test17, test18, test19, test20] + configTests;
428438
var final := Object(result + [("tests", Object(tests))]);
429439

430440
var jsonBytes :- expect API.Serialize(final);

0 commit comments

Comments
 (0)