-
Notifications
You must be signed in to change notification settings - Fork 123
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
Conversation
…kms-keyring-redesign keyrings
…need to add new unit tests
There was a problem hiding this 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
...s/java/com/amazonaws/crypto/examples/keyring/awskms/ActSimilarToAwsKmsMasterKeyProvider.java
Outdated
Show resolved
Hide resolved
...s/java/com/amazonaws/crypto/examples/keyring/awskms/ActSimilarToAwsKmsMasterKeyProvider.java
Outdated
Show resolved
Hide resolved
...s/java/com/amazonaws/crypto/examples/keyring/awskms/ActSimilarToAwsKmsMasterKeyProvider.java
Outdated
Show resolved
Hide resolved
...s/java/com/amazonaws/crypto/examples/keyring/awskms/ActSimilarToAwsKmsMasterKeyProvider.java
Outdated
Show resolved
Hide resolved
src/main/java/com/amazonaws/encryptionsdk/keyrings/AwsKmsSymmetricMultiCmkKeyringBuilder.java
Outdated
Show resolved
Hide resolved
.../com/amazonaws/encryptionsdk/keyrings/AwsKmsSymmetricMultiRegionDiscoveryKeyringBuilder.java
Outdated
Show resolved
Hide resolved
.../com/amazonaws/encryptionsdk/keyrings/AwsKmsSymmetricMultiRegionDiscoveryKeyringBuilder.java
Outdated
Show resolved
Hide resolved
.../com/amazonaws/encryptionsdk/keyrings/AwsKmsSymmetricMultiRegionDiscoveryKeyringBuilder.java
Outdated
Show resolved
Hide resolved
src/main/java/com/amazonaws/encryptionsdk/keyrings/AwsKmsSymmetricRegionDiscoveryKeyring.java
Show resolved
Hide resolved
There was a problem hiding this 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.
src/main/java/com/amazonaws/encryptionsdk/keyrings/StandardKeyrings.java
Outdated
Show resolved
Hide resolved
src/main/java/com/amazonaws/encryptionsdk/keyrings/AwsKmsSymmetricMultiCmkKeyringBuilder.java
Show resolved
Hide resolved
src/main/java/com/amazonaws/encryptionsdk/kms/AwsKmsDataKeyEncryptionDao.java
Outdated
Show resolved
Hide resolved
src/test/java/com/amazonaws/encryptionsdk/keyrings/AwsKmsSymmetricKeyringTest.java
Show resolved
Hide resolved
src/test/java/com/amazonaws/encryptionsdk/keyrings/AwsKmsSymmetricKeyringTest.java
Show resolved
Hide resolved
src/test/java/com/amazonaws/encryptionsdk/keyrings/AwsKmsSymmetricKeyringTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/amazonaws/encryptionsdk/keyrings/AwsKmsSymmetricKeyringTest.java
Outdated
Show resolved
Hide resolved
src/main/java/com/amazonaws/encryptionsdk/keyrings/AwsKmsSymmetricKeyring.java
Outdated
Show resolved
Hide resolved
src/test/java/com/amazonaws/encryptionsdk/keyrings/AwsKmsSymmetricKeyringTest.java
Show resolved
Hide resolved
...est/java/com/amazonaws/encryptionsdk/keyrings/AwsKmsSymmetricRegionDiscoveryKeyringTest.java
Show resolved
Hide resolved
There was a problem hiding this 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.
...s/java/com/amazonaws/crypto/examples/keyring/awskms/ActSimilarToAwsKmsMasterKeyProvider.java
Show resolved
Hide resolved
// 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), |
There was a problem hiding this comment.
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.
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.
Check any applicable:
Files were moved but links (internal to this codebase) have been updated accordingly. Files prior to keyrings have not been moved.