in src/dynamodb_encryption_sdk/encrypted/__init__.py [0:0]
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
): # noqa pylint: disable=line-too-long
raise InvalidArgumentError("Cannot encrypt partition key")
if self.encryption_context.sort_key_name is not None:
if self.attribute_actions.action(self.encryption_context.sort_key_name) is CryptoAction.ENCRYPT_AND_SIGN:
raise InvalidArgumentError("Cannot encrypt sort key")