Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
bb62eba
test(EnhancedClient): Nested Objects via Annotations
texastony Jul 12, 2023
ced9024
test(EnhancedClient): Valid Nested Annotations
texastony Jul 13, 2023
b3299bd
test(EnhancedClient): Valid & Invalid ConvertedBy
texastony Jul 13, 2023
3600f61
test(EnhancedClient): Remove Converter Provider
texastony Jul 13, 2023
ce903f5
test(EnhancedClient): Refactor InvalidAnnotatedNestedBean
texastony Jul 13, 2023
b053724
test(EnhancedClient): Java Doc InvalidAnnotatedNestedBean
texastony Jul 13, 2023
b9f4adc
test(EnhancedClient): Conflicting Behavior
texastony Jul 14, 2023
0758027
feat(EnhancedClient): Detect Conflicting Configurations
texastony Jul 14, 2023
26f9369
feat(EnhancedClient): Remove commented out work in progress
texastony Jul 14, 2023
2a8bcd4
Merge branch 'main' into tony-test-nested-via-annotations
texastony Jul 14, 2023
1e50fad
refactor(EnhancedClient): scanForIgnoredEncryptionTagsShallow
texastony Jul 14, 2023
2d26691
refactor(Tests-EnhancedClient): Inline comments for IGNORED
texastony Jul 14, 2023
8e40186
refactor(Tests-EnhancedClient): Remove un-supported configurations th…
texastony Jul 15, 2023
883df88
Merge branch 'main' of github.com:aws/aws-database-encryption-sdk-dyn…
texastony Jul 17, 2023
160ac9a
test(EnhancedClient): Skip & Document Failing Config test
texastony Jul 17, 2023
90ac3d7
docs(EnhancedClient): Document Scan for Ignored Tags
texastony Jul 17, 2023
5287e66
Merge branch 'main' into tony-test-nested-via-annotations
texastony Jul 17, 2023
c11face
docs(EnhancedClient): reference GHI #259 for skipped test
texastony Jul 17, 2023
f2756fb
Merge branch 'tony-test-nested-via-annotations' of github.com:aws/aws…
texastony Jul 17, 2023
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor(Tests-EnhancedClient): Inline comments for IGNORED
  • Loading branch information
texastony committed Jul 14, 2023
commit 2d26691e0ff8cd10dcaf95aa2f6d4ba020e8495f
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ public void setSortKey(int sortKey) {
this.sortKey = sortKey;
}

// Any @DynamoDbEncryption annotation here would be IGNORED
// Instead, the Annotations MUST BE placed on the Getter Methods of
// FlattenedNestedBean.
@DynamoDbFlatten
public FlattenedNestedBean getNestedBeanClass() {
return this.nestedBeanClass;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,48 +188,6 @@ public void TestPutAndGetAnnotatedConvertedBy() {
assertEquals(result.getNestedSigned(), record.getNestedSigned());
}

@Test(
expectedExceptions = DynamoDbEncryptionException.class
)
public void TestPutAndGetConflictingAnnotatedNestedBean() {
// final String PARTITION = "ConflictingAnnotatedNestedBean";
// final int SORT = 20230713;
TableSchema<ConflictingAnnotatedNestedBean> schemaOnEncrypt =
TableSchema.fromBean(ConflictingAnnotatedNestedBean.class);
List<String> allowedUnsignedAttributes = Collections.singletonList("nestedIgnored");
DynamoDbEnhancedClient enhancedClient =
initEnhancedClientWithInterceptor(schemaOnEncrypt, allowedUnsignedAttributes, null, null);

// DynamoDbTable<ConflictingAnnotatedNestedBean> table = enhancedClient.table(TEST_TABLE_NAME, schemaOnEncrypt);
//
// ConflictingAnnotatedNestedBean record = new ConflictingAnnotatedNestedBean();
// record.setPartitionKey(PARTITION);
// record.setSortKey(SORT);
// ConflictingAnnotatedNestedBean.NestedBean nestedBean = new ConflictingAnnotatedNestedBean.NestedBean (
// "9305B367-C477-4A58-9E6C-BF7D59D17C8A", "Tigger", "the-Tiger"
// );
// record.setNestedEncrypted(nestedBean);
// record.setNestedIgnored(nestedBean);
// record.setNestedSigned(nestedBean);
//
// // Put an item into an Amazon DynamoDB table.
// table.putItem(record);
//
// // Get the item back from the table
// Key key = Key.builder()
// .partitionValue(PARTITION).sortValue(SORT)
// .build();
//
// // Get the item by using the key.
// ConflictingAnnotatedNestedBean result = table.getItem(
// (GetItemEnhancedRequest.Builder requestBuilder) -> requestBuilder.key(key));
// assertEquals(result.getPartitionKey(), record.getPartitionKey());
// assertEquals(result.getSortKey(), record.getSortKey());
// assertEquals(result.getNestedIgnored(), record.getNestedIgnored());
// assertEquals(result.getNestedEncrypted(), record.getNestedEncrypted());
// assertEquals(result.getNestedSigned(), record.getNestedSigned());
}

@Test
public void TestPutAndGetConflictingFlattenedBean() {
final String PARTITION = "ConflictingFlattenedBean";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import software.amazon.awssdk.services.dynamodb.model.AttributeValue;

/**
* This is a INVALID use of DynamoDbEncryption annotations on nested attributes.
* This is an INVALID use of DynamoDbEncryption annotations on nested attributes.
* The DynamoDbEncryption annotations are placed on elements that are NOT
* DynamoDB Attributes but that will be mapped together into one attribute.<p>
*/
Expand Down Expand Up @@ -70,11 +70,11 @@ public ConvertedByNestedBean(String id, String firstName, String lastName) {
public String getId() { return this.id; }
public void setId(String id) { this.id = id; }

@DynamoDbEncryptionSignOnly
@DynamoDbEncryptionSignOnly //This annotation is IGNORED
public String getFirstName() { return firstName; }
public void setFirstName(String firstName) { this.firstName = firstName; }

@DynamoDbEncryptionDoNothing
@DynamoDbEncryptionDoNothing //This annotation is IGNORED
public String getLastName() { return lastName; }
public void setLastName(String lastName) { this.lastName = lastName; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static class NestedBean {
this.lastName = lastName;
}

@DynamoDbAttribute("id")
@DynamoDbAttribute("id") //This annotation is IGNORED
public String getId() {
return this.id;
}
Expand All @@ -67,8 +67,8 @@ public void setId(String id) {
this.id = id;
}

@DynamoDbEncryptionSignOnly
@DynamoDbAttribute("firstName")
@DynamoDbEncryptionSignOnly //This annotation is IGNORED
@DynamoDbAttribute("firstName") //This annotation is IGNORED
public String getFirstName() {
return firstName;
}
Expand All @@ -77,8 +77,8 @@ public void setFirstName(String firstName) {
this.firstName = firstName;
}

@DynamoDbEncryptionDoNothing
@DynamoDbAttribute("lastName")
@DynamoDbEncryptionDoNothing //This annotation is IGNORED
@DynamoDbAttribute("lastName") //This annotation is IGNORED
public String getLastName() {
return lastName;
}
Expand Down