dynamodb_encryption_sdk.internal.utils
Otherwise undifferentiated utility resources.
Warning
No guarantee is provided on the modules and APIs within this namespace staying consistent. Directly reference at your own risk.
Functions
|
Build a crypto config from the provided values, loading the table info from the provided cache. |
|
Pull all encryption-specific parameters from the request and use them to build a crypto config. |
Build a crypto config from the provided values and table info. |
|
|
Transparently decrypt multiple items after getting them in a batch request. |
|
Transparently decrypt an item after getting it from the table. |
|
Iterate through a list of encrypted items, decrypting each item and yielding the plaintext item. |
|
Transparently decrypt multiple items after getting them from the table with a scan or query method. |
|
Transparently encrypt multiple items before putting them in a batch request. |
|
Transparently encrypt an item before putting it to the table. |
|
Verify that attribute filtering parameters are not found in the request. |
Classes
|
Very simple cache of TableInfo objects, providing configuration information about DynamoDB tables. |
- class dynamodb_encryption_sdk.internal.utils.TableInfoCache(client: botocore.client.BaseClient, auto_refresh_table_indexes: bool)[source]
Bases:
object
Very simple cache of TableInfo objects, providing configuration information about DynamoDB tables.
- Parameters
client (botocore.client.BaseClient) – Boto3 DynamoDB client
auto_refresh_table_indexes (bool) – Should we attempt to refresh information about table indexes? Requires
dynamodb:DescribeTable
permissions on each table.
- dynamodb_encryption_sdk.internal.utils.crypto_config_from_kwargs(fallback, **kwargs)[source]
Pull all encryption-specific parameters from the request and use them to build a crypto config.
- Returns
crypto config and updated kwargs
- Return type
dynamodb_encryption_sdk.encrypted.CryptoConfig and dict
- dynamodb_encryption_sdk.internal.utils.crypto_config_from_table_info(materials_provider, attribute_actions, table_info)[source]
Build a crypto config from the provided values and table info.
- Returns
crypto config and updated kwargs
- Return type
- dynamodb_encryption_sdk.internal.utils.crypto_config_from_cache(materials_provider, attribute_actions, table_info_cache, table_name)[source]
Build a crypto config from the provided values, loading the table info from the provided cache.
- Returns
crypto config and updated kwargs
- Return type
- dynamodb_encryption_sdk.internal.utils.decrypt_get_item(decrypt_method: Callable, crypto_config_method: Callable, read_method: Callable, **kwargs: Any) Dict [source]
Transparently decrypt an item after getting it from the table.
- Parameters
decrypt_method (callable) – Method to use to decrypt item
crypto_config_method (callable) – Method that accepts
kwargs
and provides aCryptoConfig
read_method (callable) – Method that reads from the table
**kwargs – Keyword arguments to pass to
read_method
- Returns
DynamoDB response
- Return type
- dynamodb_encryption_sdk.internal.utils.decrypt_multi_get(decrypt_method: Callable, crypto_config_method: Callable, read_method: Callable, **kwargs: Any) Dict [source]
Transparently decrypt multiple items after getting them from the table with a scan or query method.
- Parameters
decrypt_method (callable) – Method to use to decrypt items
crypto_config_method (callable) – Method that accepts
kwargs
and provides aCryptoConfig
read_method (callable) – Method that reads from the table
**kwargs – Keyword arguments to pass to
read_method
- Returns
DynamoDB response
- Return type
- dynamodb_encryption_sdk.internal.utils.decrypt_list_of_items(crypto_config: dynamodb_encryption_sdk.encrypted.CryptoConfig, decrypt_method: Callable, items: Iterable[Any]) Iterable[Any] [source]
Iterate through a list of encrypted items, decrypting each item and yielding the plaintext item.
- Parameters
crypto_config (CryptoConfig) –
CryptoConfig
to usedecrypt_method (callable) – Method to use to decrypt items
items – Iterable of encrypted items
- Returns
Iterable of plaintext items
- dynamodb_encryption_sdk.internal.utils.decrypt_batch_get_item(decrypt_method: Callable, crypto_config_method: Callable, read_method: Callable, **kwargs: Any) Dict [source]
Transparently decrypt multiple items after getting them in a batch request.
- Parameters
decrypt_method (callable) – Method to use to decrypt items
crypto_config_method (callable) – Method that accepts
kwargs
and provides aCryptoConfig
read_method (callable) – Method that reads from the table
**kwargs – Keyword arguments to pass to
read_method
- Returns
DynamoDB response
- Return type
- dynamodb_encryption_sdk.internal.utils.encrypt_put_item(encrypt_method: Callable, crypto_config_method: Callable, write_method: Callable, **kwargs: Any) Dict [source]
Transparently encrypt an item before putting it to the table.
- Parameters
encrypt_method (callable) – Method to use to encrypt items
crypto_config_method (callable) – Method that accepts
kwargs
and provides aCryptoConfig
write_method (callable) – Method that writes to the table
**kwargs – Keyword arguments to pass to
write_method
- Returns
DynamoDB response
- Return type
- dynamodb_encryption_sdk.internal.utils.encrypt_batch_write_item(encrypt_method: Callable, crypto_config_method: Callable, write_method: Callable, **kwargs: Any) Dict [source]
Transparently encrypt multiple items before putting them in a batch request.
- Parameters
encrypt_method (callable) – Method to use to encrypt items
crypto_config_method (callable) – Method that accepts a table name string and provides a
CryptoConfig
write_method (callable) – Method that writes to the table
**kwargs – Keyword arguments to pass to
write_method
- Returns
DynamoDB response
- Return type