@@ -37,20 +37,21 @@ class EncryptedTable(EncryptedBotoInterface):
37
37
drop-in replacement that transparently handles encryption and decryption of items.
38
38
39
39
The API matches the standard boto3 DynamoDB table interface:
40
+
40
41
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/table.html
41
42
42
43
This class will encrypt/decrypt items for the following operations:
43
- * put_item
44
- * get_item
45
- * query
46
- * scan
44
+ * ``put_item``
45
+ * ``get_item``
46
+ * ``query``
47
+ * ``scan``
48
+
49
+ The ``update_item`` operation is not currently supported. Calling this operation will raise ``NotImplementedError``.
47
50
48
- Calling batch_writer() will return a BatchWriter that transparently encrypts batch write requests.
51
+ Calling `` batch_writer()`` will return a `` BatchWriter`` that transparently encrypts batch write requests.
49
52
50
53
Any other operations on this class will defer to the underlying boto3 DynamoDB Table's implementation
51
54
and will not be encrypted/decrypted.
52
-
53
- Note: The update_item operation is not currently supported. Calling this operation will raise NotImplementedError.
54
55
"""
55
56
56
57
def __init__ (
@@ -60,7 +61,7 @@ def __init__(
60
61
encryption_config : DynamoDbTablesEncryptionConfig ,
61
62
):
62
63
"""
63
- Create an EncryptedTable object.
64
+ Create an `` EncryptedTable`` object.
64
65
65
66
Args:
66
67
table (ServiceResource): Initialized boto3 DynamoDB table
@@ -79,15 +80,16 @@ def put_item(self, **kwargs) -> dict[str, Any]:
79
80
"""
80
81
Put a single item to the table. Encrypts the item before writing to DynamoDB.
81
82
82
- The parameters and return value match the boto3 DynamoDB table put_item API:
83
+ The input and output syntaxes match those for the boto3 DynamoDB table ``put_item`` API:
84
+
83
85
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/table/put_item.html
84
86
85
87
Args:
86
- **kwargs: Keyword arguments to pass to the operation. These match the boto3 put_item API parameters.
87
- The "Item" field will be encrypted locally before being written to DynamoDB.
88
+ **kwargs: Keyword arguments to pass to the operation. This matches the boto3 Table `` put_item`` request
89
+ syntax. The value in `` "Item"`` will be encrypted locally before being written to DynamoDB.
88
90
89
91
Returns:
90
- dict: The response from DynamoDB. This matches the boto3 put_item API response.
92
+ dict: The response from DynamoDB. This matches the boto3 `` put_item`` response syntax .
91
93
92
94
"""
93
95
return self ._table_operation_logic (
@@ -107,15 +109,17 @@ def get_item(self, **kwargs) -> dict[str, Any]:
107
109
"""
108
110
Get a single item from the table. Decrypts the item after reading from DynamoDB.
109
111
110
- The parameters and return value match the boto3 DynamoDB table get_item API:
112
+ The input and output syntaxes match those for the boto3 DynamoDB table ``get_item`` API:
113
+
111
114
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/table/get_item.html
112
115
113
116
Args:
114
- **kwargs: Keyword arguments to pass to the operation. These match the boto3 get_item API parameters.
117
+ **kwargs: Keyword arguments to pass to the operation. This matches the boto3 Table ``get_item`` request
118
+ syntax.
115
119
116
120
Returns:
117
- dict: The response from DynamoDB. This matches the boto3 get_item API response.
118
- The "Item" field will be decrypted locally after being read from DynamoDB.
121
+ 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.
119
123
120
124
"""
121
125
return self ._table_operation_logic (
@@ -135,15 +139,17 @@ def query(self, **kwargs) -> dict[str, Any]:
135
139
"""
136
140
Query items from the table or index. Decrypts any returned items.
137
141
138
- The parameters and return value match the boto3 DynamoDB table query API:
142
+ The input and output syntaxes match those for the boto3 DynamoDB table ``query`` API:
143
+
139
144
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/table/query.html
140
145
141
146
Args:
142
- **kwargs: Keyword arguments to pass to the operation. These match the boto3 query API parameters.
147
+ **kwargs: Keyword arguments to pass to the operation. This matches the boto3 Table ``query`` request
148
+ syntax.
143
149
144
150
Returns:
145
- dict: The response from DynamoDB. This matches the boto3 query API response.
146
- The "Items" field will be decrypted locally after being read from DynamoDB.
151
+ 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.
147
153
148
154
"""
149
155
return self ._table_operation_logic (
@@ -163,15 +169,17 @@ def scan(self, **kwargs) -> dict[str, Any]:
163
169
"""
164
170
Scan the entire table or index. Decrypts any returned items.
165
171
166
- The parameters and return value match the boto3 DynamoDB table scan API:
172
+ The input and output syntaxes match those for the boto3 DynamoDB table ``scan`` API:
173
+
167
174
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/table/scan.html
168
175
169
176
Args:
170
- **kwargs: Keyword arguments to pass to the operation. These match the boto3 scan API parameters.
177
+ **kwargs: Keyword arguments to pass to the operation. This matches the boto3 Table ``scan`` request
178
+ syntax.
171
179
172
180
Returns:
173
- dict: The response from DynamoDB. This matches the boto3 scan API response.
174
- The "Items" field will be decrypted locally after being read from DynamoDB.
181
+ 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.
175
183
176
184
"""
177
185
return self ._table_operation_logic (
@@ -189,7 +197,7 @@ def scan(self, **kwargs) -> dict[str, Any]:
189
197
190
198
def update_item (self , ** kwargs ):
191
199
"""
192
- Not implemented. Raises NotImplementedError.
200
+ Not implemented. Raises `` NotImplementedError`` .
193
201
194
202
Args:
195
203
**kwargs: Any arguments passed to this method
0 commit comments