Skip to content

Commit fd6b20e

Browse files
authored
fix: Data model migration doc breadcrumb.
Merge pull request #139 from lizroth/migration-doc-note
1 parent 619c7bd commit fd6b20e

File tree

10 files changed

+48
-7
lines changed

10 files changed

+48
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ release.sh
33
target
44
.idea/
55
*.iml
6+
.DS_Store

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,18 @@ Note that by default all attributes except the primary keys are both encrypted a
111111

112112
There is a variety of existing [EncryptionMaterialsProvider][materialprovider] implementations that you can use to provide the encryption material, including [KeyStoreMaterialsProvider][keystoreprovider] which makes use of a Java keystore. Alternatively, you can also plug in your own custom implementation.
113113

114+
### Changing Your Data Model
115+
116+
Every time you encrypt or decrypt an item, you need to provide attribute actions that tell the DynamoDB Encryption
117+
Client which attributes to encrypt and sign, which attributes to sign (but not encrypt), and which to ignore. Attribute
118+
actions are not saved in the encrypted item and the DynamoDB Encryption Client does not update your attribute actions
119+
automatically.
120+
121+
Whenever you change your data model, that is, when you add or remove attributes from your table items, you need to take
122+
additional steps to safely migrate the client-side encryption configuration.
123+
124+
For guidance on this process, please see the developer guide on [Changing Your Data Model](https://docs.aws.amazon.com/dynamodb-encryption-client/latest/devguide/data-model.html).
125+
114126
### Downloads
115127

116128
You can download the [latest snapshot release][download] or pick it up from Maven:

sdk1/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/AttributeEncryptor.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,13 @@
3838

3939
/**
4040
* Encrypts all non-key fields prior to storing them in DynamoDB.
41-
* <em>This must be used with @{link SaveBehavior#PUT} or @{link SaveBehavior#CLOBBER}.</em>
42-
*
43-
* @author Greg Rubin
41+
* <em>This must be used with {@link SaveBehavior#PUT} or {@link SaveBehavior#CLOBBER}.</em>
42+
*
43+
* <p>For guidance on performing a safe data model change procedure, please see
44+
* <a href="https://docs.aws.amazon.com/dynamodb-encryption-client/latest/devguide/data-model.html" target="_blank">
45+
* DynamoDB Encryption Client Developer Guide: Changing your data model</a></p>
46+
*
47+
* @author Greg Rubin
4448
*/
4549
public class AttributeEncryptor implements AttributeTransformer {
4650
private static final Log LOG = LogFactory.getLog(AttributeEncryptor.class);

sdk1/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/encryption/DoNotEncrypt.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@
2323

2424
/**
2525
* Prevents the associated item (class or attribute) from being encrypted.
26-
*
26+
*
27+
* <p>For guidance on performing a safe data model change procedure, please see
28+
* <a href="https://docs.aws.amazon.com/dynamodb-encryption-client/latest/devguide/data-model.html" target="_blank">
29+
* DynamoDB Encryption Client Developer Guide: Changing your data model</a></p>
30+
*
2731
* @author Greg Rubin
2832
*/
2933
@DynamoDB

sdk1/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/encryption/DoNotTouch.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323

2424
/**
2525
* Prevents the associated item from being encrypted or signed.
26+
*
27+
* <p>For guidance on performing a safe data model change procedure, please see
28+
* <a href="https://docs.aws.amazon.com/dynamodb-encryption-client/latest/devguide/data-model.html" target="_blank">
29+
* DynamoDB Encryption Client Developer Guide: Changing your data model</a></p>
2630
*
2731
* @author Greg Rubin
2832
*/

sdk1/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/encryption/DynamoDBEncryptor.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@
5050
/**
5151
* The low-level API used by {@link AttributeEncryptor} to perform crypto
5252
* operations on the record attributes.
53-
*
53+
*
54+
* <p>For guidance on performing a safe data model change procedure, please see
55+
* <a href="https://docs.aws.amazon.com/dynamodb-encryption-client/latest/devguide/data-model.html" target="_blank">
56+
* DynamoDB Encryption Client Developer Guide: Changing your data model</a></p>
57+
*
5458
* @author Greg Rubin
5559
*/
5660
public class DynamoDBEncryptor {

sdk1/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/encryption/DynamoDBSigner.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343
import com.amazonaws.services.dynamodbv2.model.AttributeValue;
4444

4545
/**
46+
* <p>For guidance on performing a safe data model change procedure, please see
47+
* <a href="https://docs.aws.amazon.com/dynamodb-encryption-client/latest/devguide/data-model.html" target="_blank">
48+
* DynamoDB Encryption Client Developer Guide: Changing your data model</a></p>
49+
*
4650
* @author Greg Rubin
4751
*/
4852
// NOTE: This class must remain thread-safe.

sdk1/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/encryption/HandleUnknownAttributes.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@
3030
* attributes will only be included in the signature calculation, and if it's
3131
* added to a class with default encryption behavior, the unknown attributes
3232
* will be signed and decrypted.
33+
*
34+
* <p>For guidance on performing a safe data model change procedure, please see
35+
* <a href="https://docs.aws.amazon.com/dynamodb-encryption-client/latest/devguide/data-model.html" target="_blank">
36+
* DynamoDB Encryption Client Developer Guide: Changing your data model</a></p>
3337
*
34-
* @author Dan Cavallaro
38+
* @author Dan Cavallaro
3539
*/
3640
@Target(value = {ElementType.TYPE})
3741
@Retention(value = RetentionPolicy.RUNTIME)

sdk1/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/encryption/TableAadOverride.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
* {@code tableName} instead. This can be useful when multiple tables are
2525
* used interchangably and data should be able to be copied or moved
2626
* between them without needing to be reencrypted.
27+
*
28+
* <p>For guidance on performing a safe data model change procedure, please see
29+
* <a href="https://docs.aws.amazon.com/dynamodb-encryption-client/latest/devguide/data-model.html" target="_blank">
30+
* DynamoDB Encryption Client Developer Guide: Changing your data model</a></p>
2731
*
2832
* @author Greg Rubin
2933
*/

sdk1/src/test/java/com/amazonaws/services/dynamodbv2/datamodeling/TransformerHolisticIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ public void simpleSaveLoad() {
397397

398398
/**
399399
* This test ensures that optimistic locking can be successfully done through the {@link DynamoDBMapper} when
400-
* combined with the @{link AttributeEncryptor}. Specifically it checks that {@link SaveBehavior#PUT} properly
400+
* combined with the {@link AttributeEncryptor}. Specifically it checks that {@link SaveBehavior#PUT} properly
401401
* enforces versioning and will result in a {@link ConditionalCheckFailedException} when optimistic locking should
402402
* prevent a write. Finally, it checks that {@link SaveBehavior#CLOBBER} properly ignores optimistic locking and
403403
* overwrites the old value.

0 commit comments

Comments
 (0)