Skip to content

docs: add keyring examples #221

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 38 commits into from
Mar 31, 2020
Merged

docs: add keyring examples #221

merged 38 commits into from
Mar 31, 2020

Conversation

mattsb42-aws
Copy link
Member

@mattsb42-aws mattsb42-aws commented Mar 12, 2020

Issue #, if available: #156 #146

Description of changes:

This adds several examples that show how to use keyrings to solve some common problems.

These new examples all follow the format set in #219.

Who reviews what

Everyone is of course welcome to review anything else, but these are the things that I'm specifically looking for from each tagged person.

@SalusaSecondus : The example scenario description and framing for the multi-keyring escrow example.
@WesleyRosenblum : Keyring use and any additional example use-cases you can think of. We'll also be translating these examples to Java once these are merged.
@acioc : Python good-ness and any thoughts on example use-cases.
@juneb : Descriptions of example use-cases and the in-line comments where they diverge from the template.

What this is not

Things I intentionally left out of this PR:

  • Master key providers : Once this batch of keyring examples is merged, I'll go through and translate all that can be to use MKPs.
  • Cryptographic materials managers : To avoid an even larger PR, I did not include any examples of CMMs. I'll be adding several such examples in a later PR.

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
Copy link
Member Author

doh; looks like I need to seed the environment with a default AWS region :/

Copy link

@acioc acioc left a comment

Choose a reason for hiding this comment

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

Looks good! Just had a few questions/ np's below

@WesleyRosenblum
Copy link
Contributor

Once this batch of keyring examples is merged, I'll go through and translate all that can be to use MKPs.

What is the value of doing that? The way I see it, all current customers are already using MKPs and don't really need example code to follow for doing something with MKPs, and if they want to try out a new use case they should just use Keyrings anyway? I could see an argument to do it for completeness, but it still seems like the lowest priority to me.

Copy link
Contributor

@juneb juneb left a comment

Choose a reason for hiding this comment

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

Review in progress (back later).

SalusaSecondus
SalusaSecondus previously approved these changes Mar 24, 2020
acioc
acioc previously approved these changes Mar 24, 2020
Copy link

@acioc acioc left a comment

Choose a reason for hiding this comment

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

Looked over all diffs since my last review. Looks good! Would be great to also get an example of how to handle errors/ failing to encrypt/decrypt, but that can be out of scope for this PR.

}

# Create the keyring that determines how your data keys are protected.
encrypt_keyring = KmsKeyring(generator_key_id=aws_kms_cmk)
Copy link
Contributor

Choose a reason for hiding this comment

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

+1

Copy link
Contributor

@juneb juneb left a comment

Choose a reason for hiding this comment

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

A couple of general comments.

  • The example readme is a nice description of the ESDK. But it needs a table with the name and description of each example.

  • The examples all use (one?) CMK that's passed to the function. Please show at least one example with multiple CMKs (generator, additional) and different keyrings for encrypt and decrypt.

  • Show examples for discovery keyring and client supplier variants. (I suspect that's coming.)

@mattsb42-aws
Copy link
Member Author

The example readme is a nice description of the ESDK. But it needs a table with the name and description of each example.

Let's look at that separately from this PR. I opened #232 to track this.

The examples all use (one?) CMK that's passed to the function. Please show at least one example with multiple CMKs (generator, additional) and different keyrings for encrypt and decrypt.

https://github.com/aws/aws-encryption-sdk-python/pull/221/files#diff-473fcd9a070a3379cefee9a26242b882

Show examples for discovery keyring and client supplier variants. (I suspect that's coming.)

@mattsb42-aws mattsb42-aws merged commit 8d84ff5 into aws:keyring Mar 31, 2020
@mattsb42-aws mattsb42-aws deleted the moar-examples branch March 31, 2020 18:48
@ttjsu-aws ttjsu-aws mentioned this pull request Apr 7, 2020
15 tasks
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.

5 participants