Skip to content
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

feat: AWS KMS Keyring(s) refactor/reimplementation #211

Merged
merged 16 commits into from
Oct 5, 2020
Merged

Conversation

acioc
Copy link
Contributor

@acioc acioc commented Aug 12, 2020

Issue #, if available:

Description of changes:

  • Re-implementing the AWS KMS keyring(s)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Check any applicable:

  • Were any files moved? Moving files changes their URL, which breaks all hyperlinks to the files.
    Files were moved but links (internal to this codebase) have been updated accordingly. Files prior to keyrings have not been moved.

@acioc acioc requested review from robin-aws and lavaleri August 12, 2020 06:45
@acioc acioc self-assigned this Aug 12, 2020
@acioc acioc changed the title feat!: AWS KMS Keyring(s) refactor/reimplementation feat: AWS KMS Keyring(s) refactor/reimplementation Aug 13, 2020
Copy link
Contributor

@lavaleri lavaleri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Part 1 up to AwsKmsSymmetricRegionDiscoveryKeyring.java

Copy link
Contributor

@lavaleri lavaleri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finished Part 2 of naive review. I will take another pass tomorrow looking closely at https://github.com/awslabs/aws-encryption-sdk-specification/blob/master/proposals/2020-07-01_aws-kms-keyring-redesign/change.md and ensuring we have sufficient test coverage over the spec of that behavior.

@acioc acioc marked this pull request as ready for review August 17, 2020 21:52
Copy link
Contributor

@lavaleri lavaleri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work! LGTM once feedback is resolved one way or another. Feel free to let me know if any of this feedback should be addressed as part of #223 instead.

// Create the keyring that determines how your data keys are protected.
final String region = Arn.fromString(awsKmsCmk.toString()).getRegion();
final Keyring keyring = StandardKeyrings.awsKmsSymmetric(
CustomMultiPartitionDao.daoGivenRegionId(region),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taking another look at this, the example makes sense, but I still think will be confusing for customers. At the very least "CustomDataKeyEncryptionDao" as an example name isn't very helpful because customers don't know what a DataKeyEncryptionDao is. Maybe this would be better framed as a "CustomCredentialProvider" example? And then explain what the default credential provider configuration is.

It might also be good to highlight the difference between this example and the CustomKmsClientConfig example. That example is useful if you want every call using the same client config. If you need different client config depending on the key you're trying ot decrypt (in this example, based on what region it is), then you'll need to do something more complicated, like in this example.

@acioc acioc merged commit 6ff15f9 into aws:keyring Oct 5, 2020
@acioc acioc deleted the kms branch October 5, 2020 21:41
acioc pushed a commit to acioc/aws-encryption-sdk-java that referenced this pull request Oct 5, 2020
acioc pushed a commit to acioc/aws-encryption-sdk-java that referenced this pull request Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants