Skip to content

linting fixes #43

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 1 commit into from
May 2, 2018
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
2 changes: 1 addition & 1 deletion src/dynamodb_encryption_sdk/encrypted/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
16 changes: 11 additions & 5 deletions src/dynamodb_encryption_sdk/encrypted/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'):
Expand Down
1 change: 0 additions & 1 deletion src/dynamodb_encryption_sdk/encrypted/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions src/pylintrc
Original file line number Diff line number Diff line change
@@ -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}$
Expand Down