Skip to content

Commit 6bf6094

Browse files
cleanup
1 parent 20bdaff commit 6bf6094

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

src/aws_encryption_sdk/internal/formatting/serialize.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def _serialize_header_auth_v2(
237237
for all items whose keys are in the required_encryption_context list.
238238
This is ONLY processed if using the aws-cryptographic-materialproviders library
239239
AND its required encryption context CMM. (optional)
240-
:type required_encryption_context_bytes: bytes
240+
:type required_encryption_context_bytes: bytes
241241
:returns: Serialized header authentication data
242242
:rtype: bytes
243243
"""
@@ -294,14 +294,16 @@ def serialize_header_auth(
294294
This is ONLY processed if using the aws-cryptographic-materialproviders library
295295
AND its required encryption context CMM
296296
AND if using the v2 message format. (optional)
297-
:type required_encryption_context_bytes: bytes
297+
:type required_encryption_context_bytes: bytes
298298
:returns: Serialized header authentication data
299299
:rtype: bytes
300300
"""
301301
if version == SerializationVersion.V1:
302302
return _serialize_header_auth_v1(algorithm, header, data_encryption_key, signer)
303303
elif version == SerializationVersion.V2:
304-
return _serialize_header_auth_v2(algorithm, header, data_encryption_key, signer, required_encryption_context_bytes)
304+
return _serialize_header_auth_v2(
305+
algorithm, header, data_encryption_key, signer, required_encryption_context_bytes
306+
)
305307
else:
306308
raise SerializationError("Unrecognized message format version: {}".format(version))
307309

src/aws_encryption_sdk/materials_managers/mpl/materials.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ def data_encryption_key(self) -> DataKey:
9595
def signing_key(self) -> bytes:
9696
"""Materials' signing key."""
9797
return self.mpl_materials.signing_key
98-
9998

10099
@property
101100
def required_encryption_context_keys(self) -> bytes:

src/aws_encryption_sdk/streaming_client.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def _has_mpl_attrs_post_init(self):
198198
# Wrap MPL error into the ESDK error type
199199
# so customers only have to catch ESDK error types.
200200
raise AWSEncryptionSDKClientError(mpl_exception)
201-
201+
202202
# If the provided materials_manager is directly from the MPL, wrap it in a native interface
203203
# for internal use.
204204
elif (self.materials_manager is not None
@@ -673,9 +673,10 @@ def _write_header(self):
673673
# If there is _required_encryption_context,
674674
# serialize it, then authenticate it
675675
if hasattr(self, "_required_encryption_context"):
676-
required_ec_serialized = aws_encryption_sdk.internal.formatting.encryption_context.serialize_encryption_context(
677-
self._required_encryption_context
678-
)
676+
required_ec_serialized = \
677+
aws_encryption_sdk.internal.formatting.encryption_context.serialize_encryption_context(
678+
self._required_encryption_context
679+
)
679680
self.output_buffer += serialize_header_auth(
680681
version=self._header.version,
681682
algorithm=self._encryption_materials.algorithm,
@@ -955,7 +956,7 @@ def _prep_message(self):
955956
self._prep_non_framed()
956957
self._message_prepped = True
957958

958-
def _read_header(self):
959+
def _read_header(self): # noqa: C901
959960
"""Reads the message header from the input stream.
960961
961962
:returns: tuple containing deserialized header and header_auth objects
@@ -1056,9 +1057,10 @@ def _read_header(self):
10561057
# The authenticated only encryption context is all encryption context key-value pairs where the
10571058
# key exists in Required Encryption Context Keys. It is then serialized according to the
10581059
# message header Key Value Pairs.
1059-
required_ec_serialized = aws_encryption_sdk.internal.formatting.encryption_context.serialize_encryption_context(
1060-
self._required_encryption_context
1061-
)
1060+
required_ec_serialized = \
1061+
aws_encryption_sdk.internal.formatting.encryption_context.serialize_encryption_context(
1062+
self._required_encryption_context
1063+
)
10621064

10631065
validate_header(
10641066
header=header,

0 commit comments

Comments
 (0)