diff --git a/src/dynamodb_encryption_sdk/encrypted/__init__.py b/src/dynamodb_encryption_sdk/encrypted/__init__.py index ec2051de..59784399 100644 --- a/src/dynamodb_encryption_sdk/encrypted/__init__.py +++ b/src/dynamodb_encryption_sdk/encrypted/__init__.py @@ -50,7 +50,7 @@ def __attrs_post_init__(self): # type: () -> None """Make sure that primary index attributes are not being encrypted.""" if self.encryption_context.partition_key_name is not None: - if self.attribute_actions.action(self.encryption_context.partition_key_name) is CryptoAction.ENCRYPT_AND_SIGN: + if self.attribute_actions.action(self.encryption_context.partition_key_name) is CryptoAction.ENCRYPT_AND_SIGN: # noqa pylint: disable=line-too-long raise InvalidArgumentError('Cannot encrypt partition key') if self.encryption_context.sort_key_name is not None: diff --git a/src/dynamodb_encryption_sdk/encrypted/client.py b/src/dynamodb_encryption_sdk/encrypted/client.py index a6edd29f..4f3237e2 100644 --- a/src/dynamodb_encryption_sdk/encrypted/client.py +++ b/src/dynamodb_encryption_sdk/encrypted/client.py @@ -146,11 +146,11 @@ class EncryptedClient(object): def __attrs_post_init__(self): """Set up the table info cache and translation methods.""" if self._expect_standard_dictionaries: - self._encrypt_item = encrypt_python_item - self._decrypt_item = decrypt_python_item + self._encrypt_item = encrypt_python_item # attrs confuses pylint: disable=attribute-defined-outside-init + self._decrypt_item = decrypt_python_item # attrs confuses pylint: disable=attribute-defined-outside-init else: - self._encrypt_item = encrypt_dynamodb_item - self._decrypt_item = decrypt_dynamodb_item + self._encrypt_item = encrypt_dynamodb_item # attrs confuses pylint: disable=attribute-defined-outside-init + self._decrypt_item = decrypt_dynamodb_item # attrs confuses pylint: disable=attribute-defined-outside-init self._table_info_cache = TableInfoCache( # attrs confuses pylint: disable=attribute-defined-outside-init client=self._client, auto_refresh_table_indexes=self._auto_refresh_table_indexes @@ -217,7 +217,13 @@ def update_item(self, **kwargs): raise NotImplementedError('"update_item" is not yet implemented') def get_paginator(self, operation_name): - """""" + """Get a paginator from the underlying client. If the paginator requested is for + "scan" or "query", the paginator returned will transparently decrypt the returned items. + + :param str operation_name: Name of operation for which to get paginator + :returns: Paginator for name + :rtype: Paginator or EncryptedPaginator + """ paginator = self._client.get_paginator(operation_name) if operation_name in ('scan', 'query'): diff --git a/src/dynamodb_encryption_sdk/encrypted/item.py b/src/dynamodb_encryption_sdk/encrypted/item.py index fbbf6599..90049769 100644 --- a/src/dynamodb_encryption_sdk/encrypted/item.py +++ b/src/dynamodb_encryption_sdk/encrypted/item.py @@ -72,7 +72,6 @@ def encrypt_dynamodb_item(item, crypto_config): encrypted_item = item.copy() else: # Add the attribute encryption mode to the inner material description - # TODO: This is awkward...see if we can break this out any encryption_mode = MaterialDescriptionValues.CBC_PKCS5_ATTRIBUTE_ENCRYPTION.value inner_material_description[ MaterialDescriptionKeys.ATTRIBUTE_ENCRYPTION_MODE.value diff --git a/src/pylintrc b/src/pylintrc index 43812946..c45b647c 100644 --- a/src/pylintrc +++ b/src/pylintrc @@ -1,3 +1,10 @@ +[MESSAGES CONTROL] +# Disabling messages that we either don't care about +# for tests or are necessary to break for tests. +# +# R0801 : duplicate-code (causes lots of problems with implementations of common interfaces) +disable = R0801 + [BASIC] # Allow function names up to 50 characters function-rgx = [a-z_][a-z0-9_]{2,50}$