Skip to content

Allow overriding KMS encryption context. #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,8 @@ protected GenerateDataKeyResult generateDataKey(final GenerateDataKeyRequest req

/**
* Extracts relevant information from {@code context} and uses it to populate fields in
* {@code kmsEc}. Currently, these fields are:
* {@code kmsEc}. Subclass can override the default implementation to provide an alternative
* encryption context in calls to KMS. Currently, the default implementation includes these fields:
* <dl>
* <dt>{@code HashKeyName}</dt>
* <dd>{@code HashKeyValue}</dd>
Expand All @@ -263,7 +264,7 @@ protected GenerateDataKeyResult generateDataKey(final GenerateDataKeyRequest req
* <dt>{@link #TABLE_NAME_EC_KEY}</dt>
* <dd>{@code TableName}</dd>
*/
private static void populateKmsEcFromEc(EncryptionContext context, Map<String, String> kmsEc) {
protected void populateKmsEcFromEc(EncryptionContext context, Map<String, String> kmsEc) {
final String hashKeyName = context.getHashKeyName();
if (hashKeyName != null) {
final AttributeValue hashKey = context.getAttributeValues().get(hashKeyName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,8 @@ protected GenerateDataKeyResponse generateDataKey(final GenerateDataKeyRequest r

/**
* Extracts relevant information from {@code context} and uses it to populate fields in
* {@code kmsEc}. Currently, these fields are:
* {@code kmsEc}. Subclass can override the default implementation to provide an alternative
* encryption context in calls to KMS. Currently, the default implementation includes these fields:
* <dl>
* <dt>{@code HashKeyName}</dt>
* <dd>{@code HashKeyValue}</dd>
Expand All @@ -255,7 +256,7 @@ protected GenerateDataKeyResponse generateDataKey(final GenerateDataKeyRequest r
* <dt>{@link #TABLE_NAME_EC_KEY}</dt>
* <dd>{@code TableName}</dd>
*/
private static void populateKmsEcFromEc(EncryptionContext context, Map<String, String> kmsEc) {
protected void populateKmsEcFromEc(EncryptionContext context, Map<String, String> kmsEc) {
final String hashKeyName = context.getHashKeyName();
if (hashKeyName != null) {
final AttributeValue hashKey = context.getAttributeValues().get(hashKeyName);
Expand Down