Skip to content

Commit 971546b

Browse files
update
1 parent b6859e6 commit 971546b

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

README.rst

+16-14
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,12 @@ On encryption, it encrypts the plaintext with the data key.
157157
On decryption, it decrypts an encrypted version of the data key,
158158
then uses the decrypted data key to decrypt the ciphertext.
159159

160-
To create a ``AwsKmsKeyring`` you must provide one or more AWS KMS key ARNs.
160+
To create a ``AwsKmsKeyring`` you must provide a AWS KMS key ARN.
161161
For keyrings that will only be used for encryption,
162162
you can use any valid `KMS key identifier`_.
163163
For providers that will be used for decryption,
164164
you must use the key ARN.
165-
Key ids, alias names, and alias ARNs are not supported.
165+
Key ids, alias names, and alias ARNs are not supported for decryption.
166166

167167
Because the ``AwsKmsKeyring`` uses the `boto3 SDK`_ to interact with `AWS KMS`_,
168168
it requires AWS Credentials.
@@ -171,7 +171,7 @@ pre-existing instance of a ``botocore session`` to the ``AwsKmsKeyring``.
171171
This latter option can be useful if you have an alternate way to store your AWS credentials or
172172
you want to reuse an existing instance of a botocore session in order to decrease startup costs.
173173

174-
TODO: Code example
174+
TODO-MPL: Code example
175175

176176
If you want to configure a keyring with multiple AWS KMS keys, see the multi-keyring.
177177

@@ -180,9 +180,9 @@ MultiKeyring
180180

181181
A ``MultiKeyring`` is configured with an optional generator keyring and a list of child keyrings.
182182

183-
TODO: More words
183+
TODO-MPL: More words
184184

185-
TODO: Code example
185+
TODO-MPL: Code example
186186

187187
AwsKmsDiscoveryKeyring
188188
======================
@@ -195,7 +195,7 @@ attempts decryption of any ciphertexts as long as they match a ``DiscoveryFilter
195195
you configure. A ``DiscoveryFilter`` consists of a list of AWS account ids and an AWS
196196
partition.
197197

198-
TODO: Code example
198+
TODO-MPL: Code example
199199

200200
If you do not want to filter the set of allowed accounts, you can also omit the ``discovery_filter`` argument.
201201

@@ -206,11 +206,11 @@ Encryption and Decryption
206206
After you create an instance of an ``EncryptionSDKClient`` and a ``Keyring``, you can use either of
207207
the client's two ``encrypt``/``decrypt`` functions to encrypt and decrypt your data.
208208

209-
TODO: Code example; basic example with keyring
209+
TODO-MPL: Code example; basic example with keyring
210210

211211
You can provide an `encryption context`_: a form of additional authenticating information.
212212

213-
TODO: Code example with encryption context
213+
TODO-MPL: Code example with encryption context
214214

215215
Streaming
216216
=========
@@ -219,7 +219,7 @@ memory at once, you can use this library's streaming clients directly. The strea
219219
file-like objects, and behave exactly as you would expect a Python file object to behave,
220220
offering context manager and iteration support.
221221

222-
TODO: Update code example to use a keyring
222+
TODO-MPL: Update code example to use a keyring
223223

224224
.. code:: python
225225
@@ -231,15 +231,15 @@ TODO: Update code example to use a keyring
231231
commitment_policy=CommitmentPolicy.FORBID_ENCRYPT_ALLOW_DECRYPT
232232
)
233233
234-
# TODO: create a keyring
234+
# TODO-MPL: create a keyring
235235
plaintext_filename = 'my-secret-data.dat'
236236
ciphertext_filename = 'my-encrypted-data.ct'
237237
238238
with open(plaintext_filename, 'rb') as pt_file, open(ciphertext_filename, 'wb') as ct_file:
239239
with client.stream(
240240
mode='e',
241241
source=pt_file,
242-
keyring = # TODO: provide keyring
242+
keyring = # TODO-MPL: provide keyring
243243
) as encryptor:
244244
for chunk in encryptor:
245245
ct_file.write(chunk)
@@ -250,7 +250,7 @@ TODO: Update code example to use a keyring
250250
with client.stream(
251251
mode='d',
252252
source=ct_file,
253-
keyring = # TODO: provide keyring
253+
keyring = # TODO-MPL: provide keyring
254254
) as decryptor:
255255
for chunk in decryptor:
256256
pt_file.write(chunk)
@@ -268,6 +268,10 @@ to your use-case in order to obtain peak performance.
268268

269269
Thread safety
270270
==========================
271+
TODO-MPL: need to write about keyring thread safety.
272+
kms keyrings definitely not thread safe.
273+
raw keyrings need testing, but may be launched as not thread safe.
274+
271275
The ``EncryptionSDKClient`` class is thread safe.
272276
But instances of key material providers (i.e. keyrings or legacy master key providers) that call AWS KMS
273277
(ex. ``AwsKmsKeyring`` or other KMS keyrings; ``BaseKmsMasterKeyProvider`` or children of this class)
@@ -284,8 +288,6 @@ Finally, while the ``CryptoMaterialsCache`` is thread safe,
284288
sharing entries in that cache across threads needs to be done carefully
285289
(see the !Note about partition name `in the API Docs <https://aws-encryption-sdk-python.readthedocs.io/en/latest/generated/aws_encryption_sdk.materials_managers.caching.html#aws_encryption_sdk.materials_managers.caching.CachingCryptoMaterialsManager>`_).
286290

287-
TODO: Note on MPL
288-
289291
.. _AWS Encryption SDK: https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/introduction.html
290292
.. _cryptography: https://cryptography.io/en/latest/
291293
.. _cryptography installation guide: https://cryptography.io/en/latest/installation/

src/aws_encryption_sdk/key_providers/kms.py

+1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ def _check_mrk_arns_equal(key1, key2):
129129
)
130130

131131

132+
@deprecated("Use DiscoveryFilter from the aws-cryptographic-material-providers library.")
132133
@attr.s(hash=True)
133134
class DiscoveryFilter(object):
134135
"""DiscoveryFilter to control accounts and partitions that can be used by a KMS Master Key Provider.

0 commit comments

Comments
 (0)