File tree 5 files changed +23
-18
lines changed
TestVectors/runtimes/python
src/aws_dbesdk_dynamodb_test_vectors/internaldafny/extern
5 files changed +23
-18
lines changed Original file line number Diff line number Diff line change 7
7
from aws_dbesdk_dynamodb .encrypted .resource import EncryptedResource
8
8
from smithy_dafny_standard_library .internaldafny .generated import Wrappers
9
9
from aws_dbesdk_dynamodb .smithygenerated .aws_cryptography_dbencryptionsdk_dynamodb .errors import _smithy_error_to_dafny_error
10
- from aws_dbesdk_dynamodb_test_vectors .waiting_boto3_ddb_client import WaitingDynamoClient
10
+ from aws_dbesdk_dynamodb_test_vectors .waiting_boto3_ddb_client import WaitingLocalDynamoClient
11
11
from aws_dbesdk_dynamodb .transform import (
12
12
dict_to_ddb ,
13
13
ddb_to_dict ,
@@ -139,15 +139,15 @@ class default__:
139
139
@staticmethod
140
140
def CreateVanillaDDBClient ():
141
141
try :
142
- return aws_cryptography_internal_dynamodb .internaldafny .extern .Com_Amazonaws_Dynamodb .default__ .DynamoDBClient (WaitingDynamoClient ())
142
+ return aws_cryptography_internal_dynamodb .internaldafny .extern .Com_Amazonaws_Dynamodb .default__ .DynamoDBClient (WaitingLocalDynamoClient ())
143
143
except Exception as e :
144
144
return Wrappers .Result_Failure (_smithy_error_to_dafny_error (e ))
145
145
146
146
@staticmethod
147
147
def CreateInterceptedDDBClient (dafny_encryption_config ):
148
148
try :
149
149
native_encryption_config = aws_cryptography_dbencryptionsdk_dynamodb_DynamoDbTablesEncryptionConfig (dafny_encryption_config )
150
- boto3_client = WaitingDynamoClient ()
150
+ boto3_client = WaitingLocalDynamoClient ()
151
151
table_config_names = list (native_encryption_config .table_encryption_configs .keys ())
152
152
if len (table_config_names ) > 1 :
153
153
raise ValueError ("TODO more than 1 table; need EncryptedTablesManager" )
Original file line number Diff line number Diff line change 10
10
from aws_dbesdk_dynamodb .internal .client_to_resource import ClientShapeToResourceShapeConverter
11
11
from smithy_dafny_standard_library .internaldafny .generated import Wrappers
12
12
from aws_dbesdk_dynamodb .smithygenerated .aws_cryptography_dbencryptionsdk_dynamodb .errors import _smithy_error_to_dafny_error
13
- from aws_dbesdk_dynamodb_test_vectors .waiting_boto3_ddb_client import WaitingDynamoClient
13
+ from aws_dbesdk_dynamodb_test_vectors .waiting_boto3_ddb_client import WaitingLocalDynamoClient
14
14
from aws_dbesdk_dynamodb .transform import (
15
15
dict_to_ddb ,
16
16
ddb_to_dict ,
@@ -442,15 +442,15 @@ class default__:
442
442
@staticmethod
443
443
def CreateVanillaDDBClient ():
444
444
try :
445
- return aws_cryptography_internal_dynamodb .internaldafny .extern .Com_Amazonaws_Dynamodb .default__ .DynamoDBClient (WaitingDynamoClient ())
445
+ return aws_cryptography_internal_dynamodb .internaldafny .extern .Com_Amazonaws_Dynamodb .default__ .DynamoDBClient (WaitingLocalDynamoClient ())
446
446
except Exception as e :
447
447
return Wrappers .Result_Failure (_smithy_error_to_dafny_error (e ))
448
448
449
449
@staticmethod
450
450
def CreateInterceptedDDBClient (dafny_encryption_config ):
451
451
try :
452
452
native_encryption_config = aws_cryptography_dbencryptionsdk_dynamodb_DynamoDbTablesEncryptionConfig (dafny_encryption_config )
453
- boto3_client = WaitingDynamoClient ()
453
+ boto3_client = WaitingLocalDynamoClient ()
454
454
table_config_names = list (native_encryption_config .table_encryption_configs .keys ())
455
455
if len (table_config_names ) > 1 :
456
456
raise ValueError ("TODO more than 1 table; need EncryptedTablesManager" )
Original file line number Diff line number Diff line change 16
16
sys .path .append (test_dir + "/internaldafny/extern" )
17
17
sys .path .append (test_dir + "/internaldafny/generated" )
18
18
19
+ # Import extern to use an EncryptedClient as the wrapped DBESDK client.
19
20
import aws_dbesdk_dynamodb_test_vectors .internaldafny .extern .CreateInterceptedDDBClient
21
+ # Import extern to use the ItemEncryptor with DDB JSON-formatted items.
22
+ # (EncryptedClients use DDB JSON-formatted items by default.)
20
23
import aws_dbesdk_dynamodb_test_vectors .internaldafny .extern .CreateWrappedDynamoDbItemEncryptor
21
24
22
25
def test_dafny ():
Original file line number Diff line number Diff line change 26
26
# Supported operations on Resources that are also supported by DBESDK are:
27
27
# - batch_get_item
28
28
# - batch_write_item
29
+ # https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/service-resource/index.html
30
+ #
29
31
# However, Resources can provide Tables.
30
32
# Unsupported operations on Resources are that are supported by provided Tables are:
31
33
# - put_item
32
34
# - get_item
33
35
# - query
34
36
# - scan
37
+ # https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/table/index.html#DynamoDB.Table
35
38
# These operations will be tested on EncryptedResources via provided EncryptedTables.
39
+ #
36
40
# Unsupported operations on both Resources and Tables are that are supported by DBESDK are:
37
41
# - transact_get_items
38
42
# - transact_write_items
39
- # Remove any tests that call unsupported operations.
43
+ # Remove any tests that call unsupported operations by overriding the test method to do nothing. .
40
44
# If more tests that call these operations are added, remove them below.
41
- # If the list below becomes unmaintainable,
42
- # or if other languages add clients with unsupported operations,
43
- # refactor the Dafny code to conditionally call tests
44
- # based on whether the client supports the operation under test.
45
+ # If the list below becomes unmaintainable, or if other languages add clients with unsupported operations,
46
+ # refactor the Dafny code to conditionally call tests based on whether the client supports the operation under test.
45
47
46
48
def EmptyTest (* args ):
47
49
pass
Original file line number Diff line number Diff line change 20
20
import aws_dbesdk_dynamodb_test_vectors .internaldafny .extern .CreateWrappedDictItemEncryptor
21
21
22
22
# Remove invalid tests.
23
- # Supported operations on `table` that are also supported by DBESDK are:
23
+ # Supported operations on Tables that are also supported by DBESDK are:
24
24
# - put_item
25
25
# - get_item
26
26
# - query
27
27
# - scan
28
- # Unsupported operations on `table` are that are supported by DBESDK are:
28
+ # https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/table/index.html#DynamoDB.Table
29
+ #
30
+ # Unsupported operations on Tables are that are supported by DBESDK are:
29
31
# - transact_get_items
30
32
# - transact_write_items
31
33
# - batch_get_item
32
- # Remove any tests that call unsupported operations.
34
+ # Remove any tests that call unsupported operations by overriding the test method to do nothing .
33
35
# If more tests that call these operations are added, remove them below.
34
- # If the list below becomes unmaintainable,
35
- # or if other languages add clients with unsupported operations,
36
- # refactor the Dafny code to conditionally call tests
37
- # based on whether the client supports the operation under test.
36
+ # If the list below becomes unmaintainable, or if other languages add clients with unsupported operations,
37
+ # refactor the Dafny code to conditionally call tests based on whether the client supports the operation under test.
38
38
39
39
def EmptyTest (* args ):
40
40
pass
You can’t perform that action at this time.
0 commit comments