Skip to content

Commit 2c32586

Browse files
author
Lucas McDonald
committed
m
1 parent 9fca957 commit 2c32586

File tree

4 files changed

+27
-22
lines changed

4 files changed

+27
-22
lines changed

.github/workflows/ci_test_python.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,17 @@ jobs:
2727
library: [DynamoDbEncryption]
2828
python-version: ["3.11"]
2929
os: [
30-
# macos-13,
31-
ubuntu-22.04,
32-
# Dafny-transpiled Python tests use a PYTHONPATH hack that doesn't work on Windows.
33-
# Windows is tested with non-Dafny-transpiled Python tests.
34-
# windows-latest
35-
]
30+
# macos-13,
31+
ubuntu-22.04,
32+
# Dafny-transpiled Python tests use a PYTHONPATH hack that doesn't work on Windows.
33+
# Windows is tested with non-Dafny-transpiled Python tests.
34+
# windows-latest
35+
]
3636
runs-on: ${{ matrix.os }}
3737
permissions:
3838
id-token: write
3939
contents: read
4040
steps:
41-
4241
- name: Support longpaths on Git checkout
4342
run: |
4443
git config --global core.longpaths true
@@ -127,4 +126,3 @@ jobs:
127126
tox -e encrypted-interface-coverage
128127
tox -e client-to-resource-conversions-coverage
129128
tox -e resource-to-client-conversions-coverage
130-

DynamoDbEncryption/runtimes/python/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ Please **do not** create a public GitHub issue.
2121

2222
### Required Prerequisites
2323

24-
* Python 3.11+
25-
* aws-cryptographic-material-providers 1.10.0+
24+
- Python 3.11+
25+
- aws-cryptographic-material-providers 1.10.0+
2626

2727
### Installation
2828

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,16 @@ def put_item(self, **kwargs) -> dict[str, Any]:
101101
"""
102102
Put a single item to a table. Encrypts the item before writing to DynamoDB.
103103
104-
The parameters and return value match the boto3 DynamoDB put_item API:
104+
The input and output dicts' keys match the input and output dicts' keys for the boto3 DynamoDB `put_item` API:
105105
106106
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/client/put_item.html
107107
108108
Args:
109-
**kwargs: Keyword arguments to pass to the operation. These match the boto3 put_item API parameters.
109+
**kwargs: Keyword arguments to pass to the operation. These match the boto3 `put_item` API parameters' argument names.
110110
The "Item" argument will be encrypted locally before being written to DynamoDB.
111111
112112
Returns:
113-
dict: The response from DynamoDB. This matches the boto3 put_item API response.
113+
dict: The response from DynamoDB. This matches the boto3 `put_item` API response shape.
114114
115115
"""
116116
return self._client_operation_logic(
@@ -131,6 +131,7 @@ def get_item(self, **kwargs) -> dict[str, Any]:
131131
Get a single item from a table. Decrypts the item after reading from DynamoDB.
132132
133133
The parameters and return value match the boto3 DynamoDB get_item API:
134+
134135
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/client/get_item.html
135136
136137
Args:
@@ -159,6 +160,7 @@ def query(self, **kwargs) -> dict[str, Any]:
159160
Query items from a table or index. Decrypts any returned items.
160161
161162
The parameters and return value match the boto3 DynamoDB query API:
163+
162164
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/client/query.html
163165
164166
Args:
@@ -187,6 +189,7 @@ def scan(self, **kwargs) -> dict[str, Any]:
187189
Scan an entire table or index. Decrypts any returned items.
188190
189191
The parameters and return value match the boto3 DynamoDB scan API:
192+
190193
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/client/scan.html
191194
192195
Args:
@@ -217,6 +220,7 @@ def batch_write_item(self, **kwargs) -> dict[str, Any]:
217220
For put operations, encrypts items before writing.
218221
219222
The parameters and return value match the boto3 DynamoDB batch_write_item API:
223+
220224
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/client/batch_write_item.html
221225
222226
Args:
@@ -246,6 +250,7 @@ def batch_get_item(self, **kwargs) -> dict[str, Any]:
246250
Get multiple items from one or more tables. Decrypts any returned items.
247251
248252
The parameters and return value match the boto3 DynamoDB batch_get_item API:
253+
249254
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/client/batch_get_item.html
250255
251256
Args:
@@ -274,6 +279,7 @@ def transact_get_items(self, **kwargs) -> dict[str, Any]:
274279
Get multiple items in a single transaction. Decrypts any returned items.
275280
276281
The parameters and return value match the boto3 DynamoDB transact_get_items API:
282+
277283
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/client/transact_get_items.html
278284
279285
Args:
@@ -304,6 +310,7 @@ def transact_write_items(self, **kwargs) -> dict[str, Any]:
304310
For put operations, encrypts items before writing.
305311
306312
The parameters and return value match the boto3 DynamoDB transact_write_items API:
313+
307314
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/client/transact_write_items.html
308315
309316
Args:

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def __init__(
3131
item_encryptor_config: DynamoDbItemEncryptorConfig,
3232
):
3333
"""
34-
Create an ItemEncryptor.
34+
Create an `ItemEncryptor`.
3535
3636
Args:
3737
item_encryptor_config (DynamoDbItemEncryptorConfig): Encryption configuration object.
@@ -58,8 +58,8 @@ def encrypt_python_item(
5858
boto3 DynamoDB Tables and Resources expect items formatted as native Python dictionaries.
5959
Use this method to encrypt an item if you intend to pass the encrypted item
6060
to a boto3 DynamoDB Table or Resource interface to store it.
61-
(Alternatively, you can use this library's EncryptedTable or EncryptedResource interfaces
62-
to transparently encrypt items without an intermediary ItemEncryptor.)
61+
(Alternatively, you can use this library's `EncryptedTable` or `EncryptedResource` interfaces
62+
to transparently encrypt items without an intermediary `ItemEncryptor`.)
6363
6464
Args:
6565
plaintext_dict_item (dict[str, Any]): A standard Python dictionary.
@@ -100,8 +100,8 @@ def encrypt_dynamodb_item(
100100
101101
Use this method to encrypt an item if you intend to pass the encrypted item
102102
to a boto3 DynamoDB client to store it.
103-
(Alternatively, you can use this library's EncryptedClient interface
104-
to transparently encrypt items without an intermediary ItemEncryptor.)
103+
(Alternatively, you can use this library's `EncryptedClient` interface
104+
to transparently encrypt items without an intermediary `ItemEncryptor`.)
105105
106106
Args:
107107
plaintext_dynamodb_item (dict[str, dict[str, Any]]): The item to encrypt formatted as DynamoDB JSON.
@@ -184,8 +184,8 @@ def decrypt_python_item(
184184
boto3 DynamoDB Tables and Resources return items formatted as native Python dictionaries.
185185
Use this method to decrypt an item if you retrieve the encrypted item
186186
from a boto3 DynamoDB Table or Resource interface.
187-
(Alternatively, you can use this library's EncryptedTable or EncryptedResource interfaces
188-
to transparently decrypt items without an intermediary ItemEncryptor.)
187+
(Alternatively, you can use this library's `EncryptedTable` or `EncryptedResource` interfaces
188+
to transparently decrypt items without an intermediary `ItemEncryptor`.)
189189
190190
Args:
191191
encrypted_dict_item (dict[str, Any]): A standard Python dictionary with encrypted values.
@@ -226,8 +226,8 @@ def decrypt_dynamodb_item(
226226
227227
Use this method to decrypt an item if you retrieved the encrypted item
228228
from a boto3 DynamoDB client.
229-
(Alternatively, you can use this library's EncryptedClient interface
230-
to transparently decrypt items without an intermediary ItemEncryptor.)
229+
(Alternatively, you can use this library's `EncryptedClient` interface
230+
to transparently decrypt items without an intermediary `ItemEncryptor`.)
231231
232232
Args:
233233
encrypted_dynamodb_item (dict[str, dict[str, Any]]): The item to decrypt formatted as DynamoDB JSON.

0 commit comments

Comments
 (0)