@@ -31,16 +31,16 @@ This example follows a use case of a database that stores unit inspection inform
31
31
32
32
Running this example requires access to a DDB table with the
33
33
following key configuration:
34
- - Partition key is named partitionKeyName with type (S)
35
- - Sort key is named sortKey with type (S)
34
+ - Partition key is named "work_id" with type (S)
35
+ - Sort key is named "inspection_date" with type (S)
36
36
37
37
This table must have a Global Secondary Index (GSI) configured named "last4-unit-index":
38
38
- Partition key is named "aws_dbe_b_inspector_id_last4" with type (S)
39
39
- Sort key is named "aws_dbe_b_unit" with type (S)
40
40
41
41
In this example for storing unit inspection information, this schema is utilized for the data:
42
- - partitionKeyName stores a unique identifier for a unit inspection work order (v4 UUID)
43
- - sortKey stores an ISO 8601 date for the inspection (YYYY-MM-DD)
42
+ - "work_id" stores a unique identifier for a unit inspection work order (v4 UUID)
43
+ - "inspection_date" stores an ISO 8601 date for the inspection (YYYY-MM-DD)
44
44
- "inspector_id_last4" stores the last 4 digits of the ID of the inspector performing the work
45
45
- "unit" stores a 12-digit serial number for the unit being inspected
46
46
@@ -59,7 +59,7 @@ func BasicSearchableEncryptionExample(
59
59
branchKeyDdbTableName string ) {
60
60
const gsiName = "last4-unit-index"
61
61
partitionKeyName := "work_id"
62
- sortKey := "inspection_date"
62
+ sortKeyName := "inspection_date"
63
63
// 1. Configure Beacons.
64
64
// The beacon name must be the name of a table attribute that will be encrypted.
65
65
// The `length` parameter dictates how many bits are in the beacon attribute value.
@@ -238,7 +238,7 @@ func BasicSearchableEncryptionExample(
238
238
// Any attributes that will be used in beacons must be configured as ENCRYPT_AND_SIGN.
239
239
attributeActionsOnEncrypt := map [string ]dbesdkstructuredencryptiontypes.CryptoAction {
240
240
partitionKeyName : dbesdkstructuredencryptiontypes .CryptoActionSignOnly , // Our partition attribute must be SIGN_ONLY
241
- sortKey : dbesdkstructuredencryptiontypes .CryptoActionSignOnly , // Our sort attribute must be SIGN_ONLY
241
+ sortKeyName : dbesdkstructuredencryptiontypes .CryptoActionSignOnly , // Our sort attribute must be SIGN_ONLY
242
242
"inspector_id_last4" : dbesdkstructuredencryptiontypes .CryptoActionEncryptAndSign , // Beaconized attributes must be encrypted
243
243
"unit" : dbesdkstructuredencryptiontypes .CryptoActionEncryptAndSign , // Beaconized attributes must be encrypted
244
244
}
@@ -254,7 +254,7 @@ func BasicSearchableEncryptionExample(
254
254
tableConfig := dbesdkdynamodbencryptiontypes.DynamoDbTableEncryptionConfig {
255
255
LogicalTableName : ddbTableName ,
256
256
PartitionKeyName : partitionKeyName ,
257
- SortKeyName : & sortKey ,
257
+ SortKeyName : & sortKeyName ,
258
258
AttributeActionsOnEncrypt : attributeActionsOnEncrypt ,
259
259
Keyring : kmsKeyring ,
260
260
Search : & searchConfig ,
@@ -285,7 +285,7 @@ func BasicSearchableEncryptionExample(
285
285
// aws_dbe_b_unit = truncate(HMAC("123456789012"), 30)
286
286
item := map [string ]types.AttributeValue {
287
287
partitionKeyName : & types.AttributeValueMemberS {Value : "1313ba89-5661-41eb-ba6c-cb1b4cb67b2d" },
288
- sortKey : & types.AttributeValueMemberS {Value : "2023-06-13" },
288
+ sortKeyName : & types.AttributeValueMemberS {Value : "2023-06-13" },
289
289
"inspector_id_last4" : & types.AttributeValueMemberS {Value : "4321" },
290
290
"unit" : & types.AttributeValueMemberS {Value : "123456789012" },
291
291
}
0 commit comments