Skip to content

Commit a259b71

Browse files
mattsb42-awslizroth
authored andcommitted
merging 1.3.1 housekeeping updates
1 parent b61f2ee commit a259b71

File tree

120 files changed

+4448
-2308
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+4448
-2308
lines changed

.gitignore

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
1+
*.class
2+
*.egg-info
13
*.pyc
24
*.pyo
35
*~
4-
test/integration/test_values.conf
56
.DS_Store
6-
*.pyc
7+
.tox
8+
/.cache*
9+
/.coverage*
10+
/build
11+
/doc/generated/*
12+
/runpy
13+
/test/integration/test_values.conf
714
__pycache__
8-
dist
15+
aws_encryption_sdk_resources
916
build
17+
dist
1018
docs/build
11-
*.egg-info
19+
test/integration/test_values.conf
20+
.python-version

CHANGELOG.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
=========
1+
*********
22
Changelog
3-
=========
3+
*********
44

55
1.3.0
66
=====
@@ -31,4 +31,4 @@ Minor
3131
=====
3232
* Initial public release
3333

34-
.. _breaking changes in attrs 17.1.0: https://attrs.readthedocs.io/en/stable/changelog.html
34+
.. _breaking changes in attrs 17.1.0: https://attrs.readthedocs.io/en/stable/changelog.html

MANIFEST.in

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
include README.rst
2+
include CHANGELOG.rst
3+
include CONTRIBUTING.rst
24
include LICENSE
35
include requirements.txt

README.rst

+22-24
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Getting Started
1414
Required Prerequisites
1515
======================
1616

17-
* Python 2.7+ or 3.x
17+
* Python 2.7+ or 3.4+
1818
* cryptography >= 1.8.1
1919
* boto3
2020
* attrs
@@ -28,7 +28,7 @@ Installation
2828
detailed in the `cryptography installation guide`_ for your operating system.
2929

3030
.. code::
31-
31+
3232
$ pip install aws-encryption-sdk
3333
3434
Concepts
@@ -44,7 +44,7 @@ An example of a CMM is the default CMM, which is automatically generated anywher
4444
key provider. The default CMM collects encrypted data keys from all master keys referenced by the master key
4545
provider.
4646

47-
An example of a more advanced CMM is the caching CMM, which caches cryptographic materials provided by another CMM.
47+
An example of a more advanced CMM is the caching CMM, which caches cryptographic materials provided by a another CMM.
4848

4949
Master Key Providers
5050
--------------------
@@ -57,13 +57,12 @@ To encrypt data in this client, a ``MasterKeyProvider`` object must contain at l
5757

5858
Master Keys
5959
-----------
60-
Master keys generate, encrypt, and decrypt data keys.
60+
Master keys provide data keys.
6161
An example of a master key is a `KMS customer master key (CMK)`_.
6262

6363
Data Keys
6464
---------
65-
Data keys are the encryption keys that are used to encrypt your data. If your algorithm suite
66-
uses a key derivation function, the data key is used to generate the key that directly encrypts the data.
65+
Data Keys are the actual encryption keys which are used to encrypt your data.
6766

6867
*****
6968
Usage
@@ -83,9 +82,9 @@ you want to reuse an existing instance of a botocore session in order to decreas
8382
8483
import aws_encryption_sdk
8584
import botocore.session
86-
85+
8786
kms_key_provider = aws_encryption_sdk.KMSMasterKeyProvider()
88-
87+
8988
existing_botocore_session = botocore.session.Session()
9089
kms_key_provider = aws_encryption_sdk.KMSMasterKeyProvider(botocore_session=existing_botocore_session)
9190
@@ -98,7 +97,7 @@ will include a copy of the data key encrypted by each configured CMK.
9897
.. code:: python
9998
10099
import aws_encryption_sdk
101-
100+
102101
kms_key_provider = aws_encryption_sdk.KMSMasterKeyProvider(key_ids=[
103102
'arn:aws:kms:us-east-1:2222222222222:key/22222222-2222-2222-2222-222222222222',
104103
'arn:aws:kms:us-east-1:3333333333333:key/33333333-3333-3333-3333-333333333333'
@@ -109,7 +108,7 @@ You can add CMKs from multiple regions to the ``KMSMasterKeyProvider``.
109108
.. code:: python
110109
111110
import aws_encryption_sdk
112-
111+
113112
kms_key_provider = aws_encryption_sdk.KMSMasterKeyProvider(key_ids=[
114113
'arn:aws:kms:us-east-1:2222222222222:key/22222222-2222-2222-2222-222222222222',
115114
'arn:aws:kms:us-west-2:3333333333333:key/33333333-3333-3333-3333-333333333333',
@@ -125,23 +124,23 @@ high-level ``encrypt``/``decrypt`` functions to encrypt and decrypt your data.
125124
.. code:: python
126125
127126
import aws_encryption_sdk
128-
127+
129128
kms_key_provider = aws_encryption_sdk.KMSMasterKeyProvider(key_ids=[
130129
'arn:aws:kms:us-east-1:2222222222222:key/22222222-2222-2222-2222-222222222222',
131130
'arn:aws:kms:us-east-1:3333333333333:key/33333333-3333-3333-3333-333333333333'
132131
])
133132
my_plaintext = 'This is some super secret data! Yup, sure is!'
134-
133+
135134
my_ciphertext, encryptor_header = aws_encryption_sdk.encrypt(
136135
source=my_plaintext,
137136
key_provider=kms_key_provider
138137
)
139-
138+
140139
decrypted_plaintext, decryptor_header = aws_encryption_sdk.decrypt(
141140
source=my_ciphertext,
142141
key_provider=kms_key_provider
143142
)
144-
143+
145144
assert my_plaintext == decrypted_plaintext
146145
assert encryptor_header.encryption_context == decryptor_header.encryption_context
147146
@@ -150,13 +149,13 @@ You can provide an `encryption context`_: a form of additional authenticating in
150149
.. code:: python
151150
152151
import aws_encryption_sdk
153-
152+
154153
kms_key_provider = aws_encryption_sdk.KMSMasterKeyProvider(key_ids=[
155154
'arn:aws:kms:us-east-1:2222222222222:key/22222222-2222-2222-2222-222222222222',
156155
'arn:aws:kms:us-east-1:3333333333333:key/33333333-3333-3333-3333-333333333333'
157156
])
158157
my_plaintext = 'This is some super secret data! Yup, sure is!'
159-
158+
160159
my_ciphertext, encryptor_header = aws_encryption_sdk.encrypt(
161160
source=my_plaintext,
162161
key_provider=kms_key_provider,
@@ -165,12 +164,12 @@ You can provide an `encryption context`_: a form of additional authenticating in
165164
'but adds': 'some authentication'
166165
}
167166
)
168-
167+
169168
decrypted_plaintext, decryptor_header = aws_encryption_sdk.decrypt(
170169
source=my_ciphertext,
171170
key_provider=kms_key_provider
172171
)
173-
172+
174173
assert my_plaintext == decrypted_plaintext
175174
assert encryptor_header.encryption_context == decryptor_header.encryption_context
176175
@@ -186,15 +185,14 @@ offering context manager and iteration support.
186185
187186
import aws_encryption_sdk
188187
import filecmp
189-
188+
190189
kms_key_provider = aws_encryption_sdk.KMSMasterKeyProvider(key_ids=[
191190
'arn:aws:kms:us-east-1:2222222222222:key/22222222-2222-2222-2222-222222222222',
192191
'arn:aws:kms:us-east-1:3333333333333:key/33333333-3333-3333-3333-333333333333'
193192
])
194193
plaintext_filename = 'my-secret-data.dat'
195194
ciphertext_filename = 'my-encrypted-data.ct'
196-
197-
195+
198196
with open(plaintext_filename, 'rb') as pt_file, open(ciphertext_filename, 'wb') as ct_file:
199197
with aws_encryption_sdk.stream(
200198
mode='e',
@@ -203,9 +201,9 @@ offering context manager and iteration support.
203201
) as encryptor:
204202
for chunk in encryptor:
205203
ct_file.write(chunk)
206-
204+
207205
new_plaintext_filename = 'my-decrypted-data.dat'
208-
206+
209207
with open(ciphertext_filename, 'rb') as ct_file, open(new_plaintext_filename, 'wb') as pt_file:
210208
with aws_encryption_sdk.stream(
211209
mode='d',
@@ -214,7 +212,7 @@ offering context manager and iteration support.
214212
) as decryptor:
215213
for chunk in decryptor:
216214
pt_file.write(chunk)
217-
215+
218216
assert filecmp.cmp(plaintext_filename, new_plaintext_filename)
219217
assert encryptor.header.encryption_context == decryptor.header.encryption_context
220218

aws_encryption_sdk/internal/__init__.py

-6
This file was deleted.

0 commit comments

Comments
 (0)