Skip to content

bump version to 1.4.0 and update changelog #153

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 4 commits into from
May 23, 2019
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
15 changes: 14 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Changelog
*********

1.x.x -- 201x-xx-xx
1.4.0 -- 2019-05-23
===================

Minor
Expand All @@ -11,6 +11,19 @@ Minor
* Remove dependence on all ``source_stream`` APIs except for ``read()``.
`#103 <https://github.com/aws/aws-encryption-sdk-python/issues/103>`_

Potentially Backwards Incompatible
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

* Encryption streams no longer close the ``source_stream`` when they themselves close.
If you are using context managers for all of your stream handling,
this change will not affect you.
However, if you have been relying on the ``StreamDecryptor``
or ``StreamEncryptor`` to close your ``source_stream`` for you,
you will now need to close those streams yourself.
* ``StreamDecryptor.body_start`` and ``StreamDecryptor.body_end``,
deprecated in a prior release,
have now been removed.

Maintenance
-----------

Expand Down
2 changes: 1 addition & 1 deletion src/aws_encryption_sdk/identifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# We only actually need these imports when running the mypy checks
pass

__version__ = "1.3.8"
__version__ = "1.4.0"
USER_AGENT_SUFFIX = "AwsEncryptionSdkPython/{}".format(__version__)


Expand Down
12 changes: 0 additions & 12 deletions src/aws_encryption_sdk/streaming_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,18 +781,6 @@ def _read_header(self):
validate_header(header=header, header_auth=header_auth, raw_header=raw_header, data_key=self._derived_data_key)
return header, header_auth

@property
def body_start(self):
"""Log deprecation warning when body_start is accessed."""
_LOGGER.warning("StreamDecryptor.body_start is deprecated and will be removed in 1.4.0")
return self._body_start

@property
def body_end(self):
"""Log deprecation warning when body_end is accessed."""
_LOGGER.warning("StreamDecryptor.body_end is deprecated and will be removed in 1.4.0")
return self._body_end

def _prep_non_framed(self):
"""Prepare the opening data for a non-framed message."""
self._unframed_body_iv, self.body_length = deserialize_non_framed_values(
Expand Down
33 changes: 27 additions & 6 deletions test/functional/test_f_aws_encryption_sdk_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,17 @@ def test_decrypt_minimal_source_stream_api(frame_length, wrapping_class):
assert plaintext == decrypted


def _assert_deprecated_but_not_yet_removed(logcap, instance, attribute_name, error_message, no_later_than):
assert hasattr(instance, attribute_name)
assert error_message in logcap.text
assert aws_encryption_sdk.__version__ < no_later_than


def _assert_decrypted_and_removed(instance, attribute_name, removed_in):
assert not hasattr(instance, attribute_name)
assert aws_encryption_sdk.__version__ >= removed_in


@pytest.mark.parametrize("attribute, no_later_than", (("body_start", "1.4.0"), ("body_end", "1.4.0")))
def test_decryptor_deprecated_attributes(caplog, attribute, no_later_than):
caplog.set_level(logging.WARNING)
Expand All @@ -820,9 +831,19 @@ def test_decryptor_deprecated_attributes(caplog, attribute, no_later_than):
decrypted = decryptor.read()

assert decrypted == plaintext
assert hasattr(decryptor, attribute)
watch_string = "StreamDecryptor.{name} is deprecated and will be removed in {version}".format(
name=attribute, version=no_later_than
)
assert watch_string in caplog.text
assert aws_encryption_sdk.__version__ < no_later_than
if aws_encryption_sdk.__version__ < no_later_than:
_assert_deprecated_but_not_yet_removed(
logcap=caplog,
instance=decryptor,
attribute_name=attribute,
error_message="StreamDecryptor.{name} is deprecated and will be removed in {version}".format(
name=attribute, version=no_later_than
),
no_later_than=no_later_than
)
else:
_assert_decrypted_and_removed(
instance=decryptor,
attribute_name=attribute,
removed_in=no_later_than
)
4 changes: 2 additions & 2 deletions test/unit/test_streaming_client_stream_decryptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ def test_prep_non_framed(self):
stream=test_decryptor.source_stream, header=self.mock_header, verifier=sentinel.verifier
)
assert test_decryptor.body_length == len(VALUES["data_128"])
assert test_decryptor.body_start == self.mock_header.algorithm.iv_len + 8
assert test_decryptor.body_end == self.mock_header.algorithm.iv_len + 8 + len(VALUES["data_128"])
assert test_decryptor._body_start == self.mock_header.algorithm.iv_len + 8
assert test_decryptor._body_end == self.mock_header.algorithm.iv_len + 8 + len(VALUES["data_128"])

def test_read_bytes_from_non_framed(self):
ct_stream = io.BytesIO(VALUES["data_128"])
Expand Down