Skip to content

Commit 9acd33d

Browse files
committed
docs: change examples to talk about "KMS discovery keyring" rather than "KMS keyring in discovery mode"
1 parent 810eff2 commit 9acd33d

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

examples/src/keyring/aws_kms/discovery_decrypt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
This is true both on encrypt and on decrypt.
66
However, sometimes you need more flexibility on decrypt,
77
especially if you might not know beforehand which CMK was used to encrypt a message.
8-
To address this need, the KMS keyring also supports "discovery" mode.
9-
In discovery mode, the KMS keyring will do nothing on encrypt
8+
To address this need, you can use a KMS discovery keyring.
9+
The KMS discovery keyring will do nothing on encrypt
1010
but will attempt to decrypt *any* data keys that were encrypted under a KMS CMK.
1111
1212
This example shows how to configure and use a KMS keyring in discovery mode.

examples/src/keyring/aws_kms/discovery_decrypt_in_region_only.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
This is true both on encrypt and on decrypt.
66
However, sometimes you need more flexibility on decrypt,
77
especially if you might not know beforehand which CMK was used to encrypt a message.
8-
To address this need, the KMS keyring also supports "discovery" mode.
9-
In discovery mode, the KMS keyring will do nothing on encrypt
8+
To address this need, you can use a KMS discovery keyring.
9+
The KMS discovery keyring will do nothing on encrypt
1010
but will attempt to decrypt *any* data keys that were encrypted under a KMS CMK.
1111
1212
However, sometimes you need to be a *bit* more restrictive than that.
1313
To address this need, you can use a client supplier to restrict what regions a KMS keyring can talk to.
1414
15-
This example shows how to configure and use a KMS keyring in discovery mode that is restricted to one region.
15+
This example shows how to configure and use a KMS regional discovery keyring that is restricted to one region.
1616
1717
https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/choose-keyring.html#use-kms-keyring
1818
@@ -23,7 +23,7 @@
2323
see the ``keyring/aws_kms/custom_client_supplier``
2424
and ``keyring/aws_kms/custom_kms_client_config`` examples.
2525
26-
For examples of how to use the KMS keyring in discovery mode on decrypt,
26+
For examples of how to use the KMS discovery keyring on decrypt,
2727
see the ``keyring/aws_kms/discovery_decrypt``
2828
and ``keyring/aws_kms/discovery_decrypt_with_preferred_region`` examples.
2929
"""

examples/src/keyring/aws_kms/discovery_decrypt_with_preferred_regions.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
This is true both on encrypt and on decrypt.
66
However, sometimes you need more flexibility on decrypt,
77
especially if you might not know beforehand which CMK was used to encrypt a message.
8-
To address this need, the KMS keyring also supports "discovery" mode.
9-
In discovery mode, the KMS keyring will do nothing on encrypt
8+
To address this need, you can use a KMS discovery keyring.
9+
The KMS discovery keyring will do nothing on encrypt
1010
but will attempt to decrypt *any* data keys that were encrypted under a KMS CMK.
1111
1212
However, sometimes you need to be a *bit* more restrictive than that.
@@ -29,7 +29,7 @@
2929
see the ``keyring/aws_kms/custom_client_supplier``
3030
and ``keyring/aws_kms/custom_kms_client_config`` examples.
3131
32-
For examples of how to use the KMS keyring in discovery mode on decrypt,
32+
For examples of how to use the KMS discovery keyring on decrypt,
3333
see the ``keyring/aws_kms/discovery_decrypt``
3434
and ``keyring/aws_kms/discovery_decrypt_in_region_only`` examples.
3535
"""
@@ -64,8 +64,7 @@ def run(aws_kms_cmk, source_plaintext):
6464
# To create our decrypt keyring, we need to know our current default AWS region.
6565
#
6666
# Create a throw-away boto3 session to discover the default region.
67-
boto3_session = Session()
68-
local_region = boto3_session.region_name
67+
local_region = Session().region_name
6968

7069
# Now, use that region name to create two KMS discovery keyrings:
7170
#
@@ -78,7 +77,7 @@ def run(aws_kms_cmk, source_plaintext):
7877

7978
# Finally, combine those two keyrings into a multi-keyring.
8079
#
81-
# The multi-keyring steps through its member keyrings in the order that you provider them,
80+
# The multi-keyring steps through its member keyrings in the order that you provide them,
8281
# attempting to decrypt every encrypted data key with each keyring before moving on to the next keyring.
8382
# Because of this, other_regions_decrypt_keyring will not be called
8483
# unless local_region_decrypt_keyring fails to decrypt every encrypted data key.
@@ -92,7 +91,7 @@ def run(aws_kms_cmk, source_plaintext):
9291
# Demonstrate that the ciphertext and plaintext are different.
9392
assert ciphertext != source_plaintext
9493

95-
# Decrypt your encrypted data using the KMS discovery keyring.
94+
# Decrypt your encrypted data using the multi-keyring.
9695
#
9796
# We do not need to specify the encryption context on decrypt
9897
# because the header message includes the encryption context.

0 commit comments

Comments
 (0)