Skip to content

Define the MultiKeyring #148

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 2 commits into from
Dec 18, 2019
Merged

Define the MultiKeyring #148

merged 2 commits into from
Dec 18, 2019

Conversation

WesleyRosenblum
Copy link
Contributor

Description of changes:

This change contains the initial implementation of the Multi Keyring.

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.

@mattsb42-aws mattsb42-aws mentioned this pull request Dec 12, 2019
15 tasks

MultiKeyring(Keyring generatorKeyring, List<Keyring> childrenKeyrings) {
this.generatorKeyring = generatorKeyring;
this.childrenKeyrings = childrenKeyrings == null ? emptyList() : unmodifiableList(childrenKeyrings);
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be worth making a defensive copy of childrenKeyrings. unmodifiableList keeps you from modifying it, not anyone else.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. I'll make this change in the KmsKeyring too

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.

Multikeyring logic follows spec and tests LGTM. Make sure this also gets the OK from a Java expert.

@WesleyRosenblum WesleyRosenblum merged commit b75027d into keyring Dec 18, 2019
@WesleyRosenblum WesleyRosenblum deleted the multi branch December 18, 2019 21:30
Comment on lines +65 to +70
requireNonNull(decryptionMaterials, "decryptionMaterials are required");
requireNonNull(encryptedDataKeys, "encryptedDataKeys are required");

if (decryptionMaterials.hasPlaintextDataKey()) {
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

These are all important for every keyring.
The fact that this code is here in the MultiKeyring implies to me that it will need to be in every keyring?
While not the end of the world,
this does mean that if we have people write their own keyring
they will need to remember to include this.

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.

4 participants