Add support for EncryptionContext overrides to the DynamoDBEncryptor#60
Merged
SalusaSecondus merged 3 commits intoaws:masterfrom Dec 3, 2018
johnwalker:pitr
Merged
Add support for EncryptionContext overrides to the DynamoDBEncryptor#60SalusaSecondus merged 3 commits intoaws:masterfrom johnwalker:pitr
SalusaSecondus merged 3 commits intoaws:masterfrom
johnwalker:pitr
Conversation
There are people asking for overrides, and it would be better if they didn't need to wait for longer term, internal refactors before they are able to use overrides. This adds optional operators that give the client the last say on the EncryptionContext's value. Note: I haven't tested the example, since I didn't figure out a way to run them. How are we running example code? If we don't have a suggested way yet, I can figure something out and document it.
shutdown must be called on ddb and kms to threads to exit when using mvn exec:java to run commands, otherwise maven will pause for a configurable (by default 15s) timeout to join daemon threads.
Contributor
Author
|
Figured out how to run examples. |
|
|
||
| public static final String DEFAULT_SIGNING_ALGORITHM_HEADER = DEFAULT_DESCRIPTION_BASE + "signingAlg"; | ||
|
|
||
| private Function<EncryptionContext, EncryptionContext> encryptionContextOverrideOperator; |
Contributor
There was a problem hiding this comment.
This should be a UnaryOperator here and throughout.
Contributor
Author
There was a problem hiding this comment.
I'd have liked UnaryOperator as well, but the chaining methods inherited from Function<T,T> returns a Function<T,T> instead of an UnaryOperator. Ex. calling .andThen on an UnaryOperator<T> returns a Function<T, T>.
I'm tempted to drop UnaryOperator completely and instead use Function<T,T> throughout, but also think that returning a more specific object from a helper class is acceptable. What do you think?
.../amazonaws/services/dynamodbv2/datamodeling/encryption/utils/EncryptionContextOperators.java
Show resolved
Hide resolved
examples/com/amazonaws/examples/EncryptionContextOverridesWithDynamoDBMapper.java
Outdated
Show resolved
Hide resolved
Update the AWS SDK to latest in order to get access to SaveBehavior.PUT for examples. Update tests to use the more general Function<T, T> instead of UnaryOperator<T>. Make it so EncryptionContextOperators can't be instantiated by adding a private constructor.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There are people asking for overrides, and it would be better if they didn't
need to wait for longer term, internal refactors before they are able to use
overrides. This adds optional operators that give the client the last say on the
EncryptionContext's value.
Note: I haven't tested the example, since I didn't figure out a way to run them.
How are we running example code? If we don't have a suggested way yet, I can
figure something out and document it.
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.