Example for using multiple keys in multiple regions#177
Example for using multiple keys in multiple regions#177caitlin-tibbetts wants to merge 24 commits intoaws:masterfrom caitlin-tibbetts:a1b1c1-example
Conversation
…yption-sdk-python into a1b1c1-example
|
Please run: tox -re autoformat
tox -re "{flake8,pylint}-examples" |
mattsb42-aws
left a comment
There was a problem hiding this comment.
Thanks for the contribution!
In addition to the comments below, please make sure you run tox -re autoformat.
ttjsu-aws
left a comment
There was a problem hiding this comment.
Great start, let me know if you need help in identifying the different scenarios to test.
… still working on populating the tests correctly, so the CI will fail, but I tested the code with my own KMS CMK ARNs, so I know it will work once the tests are populated (working with Tejeswini on this)
…d test keys in different regions for this example
| ) | ||
|
|
||
| # Check that the original message and the decrypted message are the same | ||
| assert source_plaintext == plaintext1 |
There was a problem hiding this comment.
The output of the decrypt function will always be bytes.
source_plaintext might not be bytes.
Before this check, let's add a decoding if necessary:
if not isinstance(source_plaintext, bytes):
plaintext1 = plaintext1.decode("utf-8")
plaintext2 = plaintext2.decode("utf-8")There was a problem hiding this comment.
Does this make the assumption that source_plaintext is either bytes or str?
|
:/ I think I may have broken this PR by changing it to point at I'll see if I can merge this into my examples branch and still retain the authorship. |
|
That does appear to have worked. :) I'll fix up the things that were blocking this merging and incorporate it into my examples revamp. I'll close this PR once I cut that one. |
|
This is now merged in #219. Thanks @caitlin-tibbetts and sorry this took so long. :) |
Issue #156, example A2.B1.C1
Added an example and a test for when multiple keys in multiple regions are used to encrypt and decrypt a passed-in message.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.