Skip to content

Commit c519da6

Browse files
auto commit
1 parent 714780a commit c519da6

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

Examples/runtimes/net/src/migration/PlaintextToAWSDBE/MigrationUtils.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,37 +14,37 @@ public class MigrationUtils
1414
public static readonly string ENCRYPTED_AND_SIGNED_VALUE = "this will be encrypted and signed";
1515
public static readonly string SIGN_ONLY_VALUE = "this will never be encrypted, but it will be signed";
1616
public static readonly string DO_NOTHING_VALUE = "this will never be encrypted nor signed";
17-
17+
1818
// Verify that a returned item matches the expected values
1919
public static bool VerifyReturnedItem(GetItemResponse response, string partitionKeyValue, string sortKeyValue)
20-
{
20+
{
2121
var item = response.Item;
22-
22+
2323
if (!item.ContainsKey("partition_key") || item["partition_key"].S != partitionKeyValue)
2424
{
2525
throw new Exception($"partition_key mismatch: expected {partitionKeyValue}, got {(item.ContainsKey("partition_key") ? item["partition_key"].S : "null")}");
2626
}
27-
27+
2828
if (!item.ContainsKey("sort_key") || item["sort_key"].N != sortKeyValue)
2929
{
3030
throw new Exception($"sort_key mismatch: expected {sortKeyValue}, got {(item.ContainsKey("sort_key") ? item["sort_key"].N : "null")}");
3131
}
32-
32+
3333
if (!item.ContainsKey("attribute1") || item["attribute1"].S != ENCRYPTED_AND_SIGNED_VALUE)
3434
{
3535
throw new Exception($"attribute1 mismatch: expected {ENCRYPTED_AND_SIGNED_VALUE}, got {(item.ContainsKey("attribute1") ? item["attribute1"].S : "null")}");
3636
}
37-
37+
3838
if (!item.ContainsKey("attribute2") || item["attribute2"].S != SIGN_ONLY_VALUE)
3939
{
4040
throw new Exception($"attribute2 mismatch: expected {SIGN_ONLY_VALUE}, got {(item.ContainsKey("attribute2") ? item["attribute2"].S : "null")}");
4141
}
42-
42+
4343
if (!item.ContainsKey("attribute3") || item["attribute3"].S != DO_NOTHING_VALUE)
4444
{
4545
throw new Exception($"attribute3 mismatch: expected {DO_NOTHING_VALUE}, got {(item.ContainsKey("attribute3") ? item["attribute3"].S : "null")}");
4646
}
47-
47+
4848
return true;
4949
}
5050
}

Examples/runtimes/net/src/migration/PlaintextToAWSDBE/awsdbe/Common.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public static Dictionary<string, DynamoDbTableEncryptionConfig> CreateTableConfi
1616
var matProv = new MaterialProviders(new MaterialProvidersConfig());
1717
var keyringInput = new CreateAwsKmsMrkMultiKeyringInput { Generator = kmsKeyId };
1818
var kmsKeyring = matProv.CreateAwsKmsMrkMultiKeyring(keyringInput);
19-
19+
2020
// Configure which attributes are encrypted and/or signed when writing new items.
2121
// For each attribute that may exist on the items we plan to write to our DynamoDbTable,
2222
// we must explicitly configure how they should be treated during item encryption:
@@ -33,7 +33,7 @@ public static Dictionary<string, DynamoDbTableEncryptionConfig> CreateTableConfi
3333
["attribute2"] = CryptoAction.SIGN_ONLY,
3434
["attribute3"] = CryptoAction.DO_NOTHING
3535
};
36-
36+
3737
// Configure which attributes we expect to be excluded in the signature
3838
// when reading items. There are two options for configuring this:
3939
//

Examples/runtimes/net/src/migration/PlaintextToAWSDBE/awsdbe/MigrationStep1.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ This table must be configured with the following
3636
public class MigrationStep1
3737
{
3838
public static async Task<bool> MigrationStep1Example(string kmsKeyId, string ddbTableName, string partitionKeyValue, string sortKeyWriteValue, string sortKeyReadValue)
39-
{
39+
{
4040
// 1. Create table configurations
4141
// In this of migration we will use PlaintextOverride.FORCE_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ
4242
// which means:

Examples/runtimes/net/src/migration/PlaintextToAWSDBE/plaintext/MigrationStep0Test.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,28 +41,28 @@ public async Task TestMigrationStep0()
4141

4242
// Given: Step 1 has succeeded
4343
await awsdbe.MigrationStep1.MigrationStep1Example(kmsKeyID, tableName, partitionKey, sortKeys[1], sortKeys[1]);
44-
44+
4545
// When: Execute Step 0 with sortReadValue=1, Then: Success (i.e. can read plaintext values)
4646
success = await MigrationStep0.MigrationStep0Example(tableName, partitionKey, sortKeys[0], sortKeys[1]);
4747
Assert.True(success, "MigrationStep0 should be able to read items written by Step 1");
48-
48+
4949
// Given: Step 2 has succeeded
5050
await awsdbe.MigrationStep2.MigrationStep2Example(kmsKeyID, tableName, partitionKey, sortKeys[2], sortKeys[2]);
51-
51+
5252
// When: Execute Step 0 with sortReadValue=2, Then: should error out when reading encrypted items.
53-
var exception = await Assert.ThrowsAsync<Exception>(() =>
53+
var exception = await Assert.ThrowsAsync<Exception>(() =>
5454
MigrationStep0.MigrationStep0Example(tableName, partitionKey, sortKeys[0], sortKeys[2]));
5555

5656
Assert.Contains("attribute1 mismatch", exception.Message);
57-
57+
5858
// Given: Step 3 has succeeded
5959
await awsdbe.MigrationStep3.MigrationStep3Example(kmsKeyID, tableName, partitionKey, sortKeys[3], sortKeys[3]);
60-
60+
6161
// When: Execute Step 0 with sortReadValue=3, Then: should error out
62-
exception = await Assert.ThrowsAsync<Exception>(() =>
62+
exception = await Assert.ThrowsAsync<Exception>(() =>
6363
MigrationStep0.MigrationStep0Example(tableName, partitionKey, sortKeys[0], sortKeys[3]));
6464
Assert.Contains("attribute1 mismatch", exception.Message);
65-
65+
6666
// Cleanup
6767
foreach (var sortKey in sortKeys)
6868
{

0 commit comments

Comments
 (0)