Skip to content

Commit dec3f40

Browse files
author
Lucas McDonald
committed
sync
1 parent 59ec88e commit dec3f40

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

DynamoDbEncryption/runtimes/python/src/aws_dbesdk_dynamodb/encrypted/client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,15 @@ class EncryptedClient(EncryptedBotoInterface):
7272
Any calls to ``update_item`` can only update unsigned attributes. If an attribute to be updated is marked as signed,
7373
this operation will raise a ``DynamoDbEncryptionTransformsException``.
7474
75-
The following operations are not supported and will raise DynamoDbEncryptionTransformsException:
75+
The following operations are not supported for encrypted tables:
7676
7777
* ``execute_statement``
7878
* ``execute_transaction``
7979
* ``batch_execute_statement``
8080
81+
Calling these operations for encrypted tables will raise a ``DynamoDbEncryptionTransformsException``.
82+
This client can still be used to call these operations on plaintext tables.
83+
8184
Any other operations on this class will defer to the underlying boto3 DynamoDB client's implementation.
8285
8386
``EncryptedClient`` can also return an ``EncryptedPaginator`` for transparent decryption of paginated results.

DynamoDbEncryption/runtimes/python/test/integ/encrypted/test_client.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,6 @@ def test_WHEN_update_item_with_signed_attribute_THEN_raises_DynamoDbEncryptionTr
420420
update_item_request_signed_attribute,
421421
encrypted,
422422
):
423-
"""Test that update_item raises DynamoDbEncryptionTransformsException."""
424423
if not encrypted:
425424
pytest.skip("Skipping negative test for plaintext client")
426425

@@ -431,6 +430,11 @@ def test_WHEN_update_item_with_signed_attribute_THEN_raises_DynamoDbEncryptionTr
431430
client.update_item(**update_item_request_signed_attribute)
432431

433432

433+
# Create a matrix of tests for each value in param,
434+
# with a user-friendly string for test output:
435+
# execute_uses_encrypted_table = True -> "encrypted_table"
436+
# execute_uses_encrypted_table = False -> "plaintext_table"
437+
# This indicates whether an execute_(statement,transaction,etc.) operation should be on an encrypted table
434438
@pytest.fixture(params=[True, False], ids=["encrypted_table", "plaintext_table"])
435439
def execute_uses_encrypted_table(request):
436440
return request.param
@@ -449,7 +453,6 @@ def test_WHEN_execute_statement_for_encrypted_table_THEN_raises_DynamoDbEncrypti
449453
encrypted,
450454
execute_uses_encrypted_table,
451455
):
452-
"""Test that execute_statement raises DynamoDbEncryptionTransformsException."""
453456
if not encrypted:
454457
pytest.skip("Skipping negative test for plaintext client")
455458

@@ -491,7 +494,6 @@ def test_WHEN_execute_transaction_for_encrypted_table_THEN_raises_DynamoDbEncryp
491494
encrypted,
492495
execute_uses_encrypted_table,
493496
):
494-
"""Test that execute_transaction raises DynamoDbEncryptionTransformsException."""
495497
if not encrypted:
496498
pytest.skip("Skipping negative test for plaintext client")
497499

@@ -537,7 +539,6 @@ def test_WHEN_batch_execute_statement_for_encrypted_table_THEN_raises_DynamoDbEn
537539
encrypted,
538540
execute_uses_encrypted_table,
539541
):
540-
"""Test that batch_execute_statement raises DynamoDbEncryptionTransformsException."""
541542
if not encrypted:
542543
pytest.skip("Skipping negative test for plaintext client")
543544

0 commit comments

Comments
 (0)