Skip to content

Assorted housekeeping #12

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 5 commits into from
Sep 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
*.class
*.egg-info
*.pyc
*.pyo
*~
test/integration/test_values.conf
.DS_Store
*.pyc
.tox
/.cache*
/.coverage*
/build
/doc/generated/*
/runpy
/test/integration/test_values.conf
__pycache__
dist
aws_encryption_sdk_resources
build
dist
docs/build
*.egg-info
test/integration/test_values.conf
.python-version
37 changes: 32 additions & 5 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
=========
*********
Changelog
=========
*********

1.3.1
=====

Reorganization
--------------
* Moved source into ``src``.
* Moved examples into ``examples``.
* Broke out ``internal.crypto`` into smaller, feature-oriented, modules.

Tooling
-------
* Added `tox`_ configuration to support automation and development tooling.
* Added `pylint`_, `flake8`_, and `doc8`_ configuration to enforce style rules.

Maintenance
-----------
* Updated ``internal.crypto.authentication.Verifier`` to use ``Prehashed``.
* Addressed `docstring issue #7 <https://github.com/awslabs/aws-encryption-sdk-python/issues/7>`_.
* Addressed `docstring issue #8 <https://github.com/awslabs/aws-encryption-sdk-python/issues/8>`_.
* Addressed `logging issue #10 <https://github.com/awslabs/aws-encryption-sdk-python/issues/10>`_.
* Addressed assorted linting issues to bring source, tests, examples, and docs up to configured
linting standards.

1.3.0
=====
Expand All @@ -17,8 +40,8 @@ Minor
* Fixed attrs usage to provide consistent behavior with 16.3.0 and 17.x
* Fixed performance bug which caused KDF calculations to be performed too frequently
* Removed ``line_length`` as a configurable parameter of ``EncryptingStream`` and
``DecryptingStream`` objects to simplify class APIs after it was found in further
testing to have no measurable impact on performance
``DecryptingStream`` objects to simplify class APIs after it was found in further
testing to have no measurable impact on performance
* Added deterministic length eliptic curve signature generation
* Added support for calculating ciphertext message length from header
* Migrated README from md to rst
Expand All @@ -31,4 +54,8 @@ Minor
=====
* Initial public release

.. _breaking changes in attrs 17.1.0: https://attrs.readthedocs.io/en/stable/changelog.html
.. _breaking changes in attrs 17.1.0: https://attrs.readthedocs.io/en/stable/changelog.html
.. _tox: https://tox.readthedocs.io/en/latest/
.. _pylint: https://www.pylint.org/
.. _flake8: http://flake8.pycqa.org/en/latest/
.. _doc8: https://launchpad.net/doc8
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include README.rst
include CHANGELOG.rst
include CONTRIBUTING.rst
include LICENSE
include requirements.txt
39 changes: 19 additions & 20 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Getting Started
Required Prerequisites
======================

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

.. code::

$ pip install aws-encryption-sdk

Concepts
Expand Down Expand Up @@ -83,9 +83,9 @@ you want to reuse an existing instance of a botocore session in order to decreas

import aws_encryption_sdk
import botocore.session

kms_key_provider = aws_encryption_sdk.KMSMasterKeyProvider()

existing_botocore_session = botocore.session.Session()
kms_key_provider = aws_encryption_sdk.KMSMasterKeyProvider(botocore_session=existing_botocore_session)

Expand All @@ -98,7 +98,7 @@ will include a copy of the data key encrypted by each configured CMK.
.. code:: python

import aws_encryption_sdk

kms_key_provider = aws_encryption_sdk.KMSMasterKeyProvider(key_ids=[
'arn:aws:kms:us-east-1:2222222222222:key/22222222-2222-2222-2222-222222222222',
'arn:aws:kms:us-east-1:3333333333333:key/33333333-3333-3333-3333-333333333333'
Expand All @@ -109,7 +109,7 @@ You can add CMKs from multiple regions to the ``KMSMasterKeyProvider``.
.. code:: python

import aws_encryption_sdk

kms_key_provider = aws_encryption_sdk.KMSMasterKeyProvider(key_ids=[
'arn:aws:kms:us-east-1:2222222222222:key/22222222-2222-2222-2222-222222222222',
'arn:aws:kms:us-west-2:3333333333333:key/33333333-3333-3333-3333-333333333333',
Expand All @@ -125,23 +125,23 @@ high-level ``encrypt``/``decrypt`` functions to encrypt and decrypt your data.
.. code:: python

import aws_encryption_sdk

kms_key_provider = aws_encryption_sdk.KMSMasterKeyProvider(key_ids=[
'arn:aws:kms:us-east-1:2222222222222:key/22222222-2222-2222-2222-222222222222',
'arn:aws:kms:us-east-1:3333333333333:key/33333333-3333-3333-3333-333333333333'
])
my_plaintext = 'This is some super secret data! Yup, sure is!'

my_ciphertext, encryptor_header = aws_encryption_sdk.encrypt(
source=my_plaintext,
key_provider=kms_key_provider
)

decrypted_plaintext, decryptor_header = aws_encryption_sdk.decrypt(
source=my_ciphertext,
key_provider=kms_key_provider
)

assert my_plaintext == decrypted_plaintext
assert encryptor_header.encryption_context == decryptor_header.encryption_context

Expand All @@ -150,13 +150,13 @@ You can provide an `encryption context`_: a form of additional authenticating in
.. code:: python

import aws_encryption_sdk

kms_key_provider = aws_encryption_sdk.KMSMasterKeyProvider(key_ids=[
'arn:aws:kms:us-east-1:2222222222222:key/22222222-2222-2222-2222-222222222222',
'arn:aws:kms:us-east-1:3333333333333:key/33333333-3333-3333-3333-333333333333'
])
my_plaintext = 'This is some super secret data! Yup, sure is!'

my_ciphertext, encryptor_header = aws_encryption_sdk.encrypt(
source=my_plaintext,
key_provider=kms_key_provider,
Expand All @@ -165,12 +165,12 @@ You can provide an `encryption context`_: a form of additional authenticating in
'but adds': 'some authentication'
}
)

decrypted_plaintext, decryptor_header = aws_encryption_sdk.decrypt(
source=my_ciphertext,
key_provider=kms_key_provider
)

assert my_plaintext == decrypted_plaintext
assert encryptor_header.encryption_context == decryptor_header.encryption_context

Expand All @@ -186,15 +186,14 @@ offering context manager and iteration support.

import aws_encryption_sdk
import filecmp

kms_key_provider = aws_encryption_sdk.KMSMasterKeyProvider(key_ids=[
'arn:aws:kms:us-east-1:2222222222222:key/22222222-2222-2222-2222-222222222222',
'arn:aws:kms:us-east-1:3333333333333:key/33333333-3333-3333-3333-333333333333'
])
plaintext_filename = 'my-secret-data.dat'
ciphertext_filename = 'my-encrypted-data.ct'



with open(plaintext_filename, 'rb') as pt_file, open(ciphertext_filename, 'wb') as ct_file:
with aws_encryption_sdk.stream(
mode='e',
Expand All @@ -203,9 +202,9 @@ offering context manager and iteration support.
) as encryptor:
for chunk in encryptor:
ct_file.write(chunk)

new_plaintext_filename = 'my-decrypted-data.dat'

with open(ciphertext_filename, 'rb') as ct_file, open(new_plaintext_filename, 'wb') as pt_file:
with aws_encryption_sdk.stream(
mode='d',
Expand All @@ -214,7 +213,7 @@ offering context manager and iteration support.
) as decryptor:
for chunk in decryptor:
pt_file.write(chunk)

assert filecmp.cmp(plaintext_filename, new_plaintext_filename)
assert encryptor.header.encryption_context == decryptor.header.encryption_context

Expand Down
6 changes: 0 additions & 6 deletions aws_encryption_sdk/internal/__init__.py

This file was deleted.

Loading