Skip to content

Commit dd2ce47

Browse files
auto commit
1 parent 37a60c5 commit dd2ce47

File tree

4 files changed

+8
-55
lines changed

4 files changed

+8
-55
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,14 @@ 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+
{
40+
// 1. Create table configurations
41+
// In this of migration we will use PlaintextOverride.FORCE_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ
42+
// which means:
43+
// - Write: Items are forced to be written as plaintext.
44+
// Items may not be written as encrypted items.
45+
// - Read: Items are allowed to be read as plaintext.
46+
// Items are allowed to be read as encrypted items.
4047
var tableConfigs = Common.CreateTableConfigs(kmsKeyId, ddbTableName, PlaintextOverride.FORCE_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ);
4148

4249
// 1. Create a new AWS SDK DynamoDb client using the TableEncryptionConfigs

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

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,6 @@
1010

1111
namespace Examples.migration.PlaintextToAWSDBE.awsdbe
1212
{
13-
/*
14-
Test for Migration Step 1: This tests the first step in the
15-
plaintext-to-encrypted database migration.
16-
17-
This test verifies that:
18-
1. Step 1 can successfully write plaintext items
19-
2. Step 1 can read items written by Step 0 (plaintext)
20-
3. Step 1 can read items written by itself (plaintext)
21-
4. Step 1 can read items written by Step 2 (encrypted)
22-
5. Step 1 can read items written by Step 3 (encrypted)
23-
24-
Running this test requires access to the DDB Table whose name
25-
is provided by TestUtils.TEST_DDB_TABLE_NAME.
26-
This table must be configured with the following
27-
primary key configuration:
28-
- Partition key is named "partition_key" with type (S)
29-
- Sort key is named "sort_key" with type (N)
30-
*/
3113
public class MigrationStep1Test
3214
{
3315
[Fact]

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

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,6 @@
1010

1111
namespace Examples.migration.PlaintextToAWSDBE.awsdbe
1212
{
13-
/*
14-
Test for Migration Step 2: This tests the second step in the
15-
plaintext-to-encrypted database migration.
16-
17-
This test verifies that:
18-
1. Step 2 can successfully write encrypted items
19-
2. Step 2 can read items written by Step 0 (plaintext)
20-
3. Step 2 can read items written by Step 1 (plaintext)
21-
4. Step 2 can read items written by itself (encrypted)
22-
5. Step 2 can read items written by Step 3 (encrypted)
23-
24-
Running this test requires access to the DDB Table whose name
25-
is provided by TestUtils.TEST_DDB_TABLE_NAME.
26-
This table must be configured with the following
27-
primary key configuration:
28-
- Partition key is named "partition_key" with type (S)
29-
- Sort key is named "sort_key" with type (N)
30-
*/
3113
public class MigrationStep2Test
3214
{
3315
[Fact]

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

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,6 @@
1111

1212
namespace Examples.migration.PlaintextToAWSDBE.awsdbe
1313
{
14-
/*
15-
Test for Migration Step 3: This tests the final step in the
16-
plaintext-to-encrypted database migration.
17-
18-
This test verifies that:
19-
1. Step 3 can successfully write encrypted items
20-
2. Step 3 cannot read items written by Step 0 (plaintext) - should throw an exception
21-
3. Step 3 cannot read items written by Step 1 (plaintext) - should throw an exception
22-
4. Step 3 can read items written by Step 2 (encrypted)
23-
5. Step 3 can read items written by itself (encrypted)
24-
25-
Running this test requires access to the DDB Table whose name
26-
is provided by TestUtils.TEST_DDB_TABLE_NAME.
27-
This table must be configured with the following
28-
primary key configuration:
29-
- Partition key is named "partition_key" with type (S)
30-
- Sort key is named "sort_key" with type (N)
31-
*/
3214
public class MigrationStep3Test
3315
{
3416
[Fact]

0 commit comments

Comments
 (0)