in src/dynamodb_encryption_sdk/encrypted/table.py [0:0]
def __attrs_post_init__(self):
"""Prepare table info is it was not set and set up translation methods."""
if self._table_info is None:
self._table_info = TableInfo(name=self._table.name)
if self._auto_refresh_table_indexes:
self._table_info.refresh_indexed_attributes(self._table.meta.client)
# Clone the attribute actions before we modify them
self._attribute_actions = self._attribute_actions.copy()
self._attribute_actions.set_index_keys(*self._table_info.protected_index_keys())
self._crypto_config = partial( # attrs confuses pylint: disable=attribute-defined-outside-init
crypto_config_from_kwargs,
partial(crypto_config_from_table_info, self._materials_provider, self._attribute_actions, self._table_info),
)
self.get_item = partial( # attrs confuses pylint: disable=attribute-defined-outside-init
decrypt_get_item, decrypt_python_item, self._crypto_config, self._table.get_item
)
self.put_item = partial( # attrs confuses pylint: disable=attribute-defined-outside-init
encrypt_put_item, encrypt_python_item, self._crypto_config, self._table.put_item
)
self.query = partial( # attrs confuses pylint: disable=attribute-defined-outside-init
decrypt_multi_get, decrypt_python_item, self._crypto_config, self._table.query
)
self.scan = partial( # attrs confuses pylint: disable=attribute-defined-outside-init
decrypt_multi_get, decrypt_python_item, self._crypto_config, self._table.scan
)