Skip to content

Commit f47746e

Browse files
author
Lucas McDonald
committed
m
1 parent 68bc741 commit f47746e

File tree

4 files changed

+44
-39
lines changed

4 files changed

+44
-39
lines changed

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ def put_item(self, **kwargs) -> dict[str, Any]:
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. This matches the boto3 ``put_item`` request syntax.
109+
**kwargs: Keyword arguments to pass to the operation. This matches the boto3 client ``put_item`` request syntax.
110110
The value in ``"Item"`` will be encrypted locally before being written to DynamoDB.
111111
112112
Returns:
113-
dict: The response from DynamoDB. This matches the boto3 ``put_item`` response syntax.
113+
dict: The response from DynamoDB. This matches the boto3 client ``put_item`` response syntax.
114114
115115
"""
116116
return self._client_operation_logic(
@@ -135,10 +135,10 @@ def get_item(self, **kwargs) -> dict[str, Any]:
135135
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/client/get_item.html
136136
137137
Args:
138-
**kwargs: Keyword arguments to pass to the operation. This matches the boto3 ``get_item`` request syntax.
138+
**kwargs: Keyword arguments to pass to the operation. This matches the boto3 client ``get_item`` request syntax.
139139
140140
Returns:
141-
dict: The response from DynamoDB. This matches the boto3 ``get_item`` response syntax.
141+
dict: The response from DynamoDB. This matches the boto3 client ``get_item`` response syntax.
142142
The value in ``"Item"`` field be decrypted locally after being read from DynamoDB.
143143
144144
"""
@@ -159,16 +159,16 @@ def query(self, **kwargs) -> dict[str, Any]:
159159
"""
160160
Query items from a table or index. Decrypts any returned items.
161161
162-
The parameters and return value match the boto3 DynamoDB query API:
162+
The input and output syntaxes match those for the boto3 DynamoDB client ``query`` API:
163163
164164
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/client/query.html
165165
166166
Args:
167167
**kwargs: Keyword arguments to pass to the operation. These match the boto3 query API parameters.
168168
169169
Returns:
170-
dict: The response from DynamoDB. This matches the boto3 query API response.
171-
The "Items" field will be decrypted locally after being read from DynamoDB.
170+
dict: The response from DynamoDB. This matches the boto3 client ``query`` API response.
171+
The ``"Items"`` field will be decrypted locally after being read from DynamoDB.
172172
173173
"""
174174
return self._client_operation_logic(
@@ -193,10 +193,10 @@ def scan(self, **kwargs) -> dict[str, Any]:
193193
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/client/scan.html
194194
195195
Args:
196-
**kwargs: Keyword arguments to pass to the operation. This matches the boto3 ``scan`` request syntax.
196+
**kwargs: Keyword arguments to pass to the operation. This matches the boto3 client ``scan`` request syntax.
197197
198198
Returns:
199-
dict: The response from DynamoDB. This matches the boto3 ``scan`` response syntax.
199+
dict: The response from DynamoDB. This matches the boto3 client ``scan`` response syntax.
200200
The values in ``"Items"`` will be decrypted locally after being read from DynamoDB.
201201
202202
"""
@@ -224,12 +224,12 @@ def batch_write_item(self, **kwargs) -> dict[str, Any]:
224224
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/client/batch_write_item.html
225225
226226
Args:
227-
**kwargs: Keyword arguments to pass to the operation. This matches the boto3 ``batch_write_item``
227+
**kwargs: Keyword arguments to pass to the operation. This matches the boto3 client ``batch_write_item``
228228
request syntax. Items in ``"PutRequest"`` values in the ``"RequestItems"`` argument will be encrypted
229229
locally before being written to DynamoDB.
230230
231231
Returns:
232-
dict: The response from DynamoDB. This matches the boto3 ``batch_write_item`` response syntax.
232+
dict: The response from DynamoDB. This matches the boto3 client ``batch_write_item`` response syntax.
233233
234234
"""
235235
return self._client_operation_logic(
@@ -258,7 +258,7 @@ def batch_get_item(self, **kwargs) -> dict[str, Any]:
258258
request syntax.
259259
260260
Returns:
261-
dict: The response from DynamoDB. This matches the boto3 ``batch_get_item`` response syntax.
261+
dict: The response from DynamoDB. This matches the boto3 client ``batch_get_item`` response syntax.
262262
The values in ``"Responses"`` will be decrypted locally after being read from DynamoDB.
263263
264264
"""
@@ -284,11 +284,11 @@ def transact_get_items(self, **kwargs) -> dict[str, Any]:
284284
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/client/transact_get_items.html
285285
286286
Args:
287-
**kwargs: Keyword arguments to pass to the operation. This matches the boto3 ``transact_get_items``
287+
**kwargs: Keyword arguments to pass to the operation. This matches the boto3 client ``transact_get_items``
288288
request syntax.
289289
290290
Returns:
291-
dict: The response from DynamoDB. This matches the boto3 ``transact_get_items`` response syntax.
291+
dict: The response from DynamoDB. This matches the boto3 client ``transact_get_items`` response syntax.
292292
293293
"""
294294
return self._client_operation_logic(
@@ -310,17 +310,17 @@ def transact_write_items(self, **kwargs) -> dict[str, Any]:
310310
311311
For put operations, encrypts items before writing.
312312
313-
The input and output syntaxes match those for the boto3 DynamoDB ``transact_write_items`` API:
313+
The input and output syntaxes match those for the boto3 DynamoDB client ``transact_write_items`` API:
314314
315315
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/client/transact_write_items.html
316316
317317
Args:
318-
**kwargs: Keyword arguments to pass to the operation. This matches the boto3 ``transact_write_items``
318+
**kwargs: Keyword arguments to pass to the operation. This matches the boto3 client ``transact_write_items``
319319
request syntax. Any ``"PutRequest"`` values in the ``"TransactItems"`` argument will be encrypted
320320
locally before being written to DynamoDB.
321321
322322
Returns:
323-
dict: The response from DynamoDB. This matches the boto3 ``transact_write_items`` response syntax.
323+
dict: The response from DynamoDB. This matches the boto3 client ``transact_write_items`` response syntax.
324324
325325
"""
326326
return self._client_operation_logic(

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@
2727

2828

2929
class EncryptedPaginator(EncryptedBotoInterface):
30-
"""Wrapping class for botocore.paginate.Paginator that decrypts returned items before returning them."""
30+
"""Wrapping class for the boto3 Paginator that decrypts returned items before returning them."""
3131

3232
def __init__(
3333
self,
34+
*,
3435
paginator: Paginator,
3536
encryption_config: DynamoDbTablesEncryptionConfig,
3637
expect_standard_dictionaries: bool | None = False,

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

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
class EncryptedTablesCollectionManager(EncryptedBotoInterface):
3030
"""
31-
Tables collection manager that provides EncryptedTable objects.
31+
Collection manager that provides EncryptedTable objects.
3232
3333
The API matches boto3's tables collection manager interface:
3434
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/service-resource/tables.html
@@ -131,16 +131,17 @@ class EncryptedResource(EncryptedBotoInterface):
131131
drop-in replacement that transparently handles encryption and decryption of items.
132132
133133
The API matches the standard boto3 DynamoDB resource interface:
134+
134135
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/service-resource/index.html
135136
136137
This class will encrypt/decrypt items for the following operations:
137-
* batch_get_item
138-
* batch_write_item
138+
* ``batch_get_item``
139+
* ``batch_write_item``
139140
140-
Calling Table() will return an EncryptedTable object.
141+
Calling ``Table()`` will return an ``EncryptedTable`` object.
141142
142143
Any other operations on this class will defer to the underlying boto3 DynamoDB resource's implementation
143-
and will not be encrypted/decrypted.
144+
and will not be encrypted/decrypted.
144145
145146
"""
146147

@@ -151,7 +152,7 @@ def __init__(
151152
encryption_config: DynamoDbTablesEncryptionConfig,
152153
):
153154
"""
154-
Create an EncryptedResource object.
155+
Create an ``EncryptedResource`` object.
155156
156157
Args:
157158
resource (ServiceResource): Initialized boto3 DynamoDB resource
@@ -169,15 +170,15 @@ def __init__(
169170

170171
def Table(self, name):
171172
"""
172-
Create an EncryptedTable resource.
173+
Create an ``EncryptedTable`` resource.
173174
174175
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/service-resource/Table.html
175176
176177
Args:
177178
name (str): The EncryptedTable's name identifier. This must be set.
178179
179180
Returns:
180-
EncryptedTable: An EncryptedTable resource
181+
EncryptedTable: An ``EncryptedTable`` resource
181182
182183
"""
183184
return EncryptedTable(table=self._resource.Table(name), encryption_config=self._encryption_config)
@@ -186,15 +187,17 @@ def batch_get_item(self, **kwargs):
186187
"""
187188
Get multiple items from one or more tables. Decrypts any returned items.
188189
189-
The parameters and return value match the boto3 DynamoDB batch_get_item API:
190+
The input and output syntaxes match those for the boto3 DynamoDB resource ``batch_get_item`` API:
191+
190192
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/service-resource/batch_get_item.html
191193
192194
Args:
193-
**kwargs: Keyword arguments to pass to the operation. These match the boto3 batch_get_item API parameters.
195+
**kwargs: Keyword arguments to pass to the operation. These match the boto3 resource ``batch_get_item``
196+
request syntax.
194197
195198
Returns:
196-
dict: The response from DynamoDB. This matches the boto3 batch_get_item API response.
197-
The "Responses" field will be decrypted locally after being read from DynamoDB.
199+
dict: The response from DynamoDB. This matches the boto3 resource ``batch_get_item`` response syntax.
200+
The ``"Responses"`` field will be decrypted locally after being read from DynamoDB.
198201
199202
"""
200203
return self._resource_operation_logic(
@@ -216,16 +219,17 @@ def batch_write_item(self, **kwargs):
216219
217220
For put operations, encrypts items before writing.
218221
219-
The parameters and return value match the boto3 DynamoDB batch_write_item API:
222+
The input and output syntaxes match those for the boto3 DynamoDB resource ``batch_write_item`` API:
223+
220224
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/service-resource/batch_write_item.html
221225
222226
Args:
223-
**kwargs: Keyword arguments to pass to the operation. These match the boto3 batch_write_item API parameters.
224-
Any put operations in the "RequestItems" argument will be encrypted locally
225-
before being written to DynamoDB.
227+
**kwargs: Keyword arguments to pass to the operation. These match the boto3 resource
228+
``batch_write_item`` request syntax. Any ``"PutRequest"`` values in the ``"RequestItems"``
229+
argument will be encrypted locally before being written to DynamoDB.
226230
227231
Returns:
228-
dict: The response from DynamoDB. This matches the boto3 batch_write_item API response.
232+
dict: The response from DynamoDB. This matches the boto3 resource ``batch_write_item`` response syntax.
229233
230234
"""
231235
return self._resource_operation_logic(

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class EncryptedTable(EncryptedBotoInterface):
3838
3939
The API matches the standard boto3 DynamoDB table interface:
4040
41-
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/table.html
41+
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/table/index.html
4242
4343
This class will encrypt/decrypt items for the following operations:
4444
* ``put_item``
@@ -119,7 +119,7 @@ def get_item(self, **kwargs) -> dict[str, Any]:
119119
120120
Returns:
121121
dict: The response from DynamoDB. This matches the boto3 Table ``get_item`` response syntax.
122-
The value in ``"Item"`` will be decrypted locally after being read from DynamoDB.
122+
The value in ``"Item"`` will be decrypted locally after being read from DynamoDB.
123123
124124
"""
125125
return self._table_operation_logic(
@@ -149,7 +149,7 @@ def query(self, **kwargs) -> dict[str, Any]:
149149
150150
Returns:
151151
dict: The response from DynamoDB. This matches the boto3 Table ``query`` response syntax.
152-
The value in ``"Items"`` will be decrypted locally after being read from DynamoDB.
152+
The value in ``"Items"`` will be decrypted locally after being read from DynamoDB.
153153
154154
"""
155155
return self._table_operation_logic(
@@ -179,7 +179,7 @@ def scan(self, **kwargs) -> dict[str, Any]:
179179
180180
Returns:
181181
dict: The response from DynamoDB. This matches the boto3 Table ``scan`` response syntax.
182-
The value in ``"Items"`` will be decrypted locally after being read from DynamoDB.
182+
The value in ``"Items"`` will be decrypted locally after being read from DynamoDB.
183183
184184
"""
185185
return self._table_operation_logic(

0 commit comments

Comments
 (0)