Skip to content

Commit 5601ab9

Browse files
committed
feedback
1 parent 44a1f6b commit 5601ab9

File tree

1 file changed

+19
-30
lines changed
  • DynamoDbEncryption/runtimes/python/test/integ/legacy

1 file changed

+19
-30
lines changed

DynamoDbEncryption/runtimes/python/test/integ/legacy/utils.py

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -87,37 +87,26 @@ def create_legacy_encrypted_resource(attribute_actions=None):
8787
# AWS DBE SDK interface creation functions with legacy override
8888

8989

90-
def create_encryption_config(legacy_encryptor=None, legacy_policy=None):
90+
def create_encryption_config(legacy_encryptor, legacy_policy):
9191
"""Create a DynamoDbTableEncryptionConfig with optional legacy override."""
92-
if legacy_encryptor is not None and legacy_policy is not None:
93-
# Configure legacy behavior
94-
legacy_override = LegacyOverride(
95-
encryptor=legacy_encryptor,
96-
attribute_actions_on_encrypt=INTEG_TEST_DEFAULT_ATTRIBUTE_ACTIONS_ON_ENCRYPT,
97-
policy=legacy_policy,
98-
)
99-
100-
# Create the table config with legacy override
101-
table_config = DynamoDbTableEncryptionConfig(
102-
logical_table_name=INTEG_TEST_DEFAULT_DYNAMODB_TABLE_NAME,
103-
partition_key_name="partition_key",
104-
sort_key_name="sort_key",
105-
attribute_actions_on_encrypt=INTEG_TEST_DEFAULT_ATTRIBUTE_ACTIONS_ON_ENCRYPT,
106-
keyring=INTEG_TEST_DEFAULT_KEYRING,
107-
legacy_override=legacy_override,
108-
allowed_unsigned_attribute_prefix=INTEG_TEST_DEFAULT_UNSIGNED_ATTRIBUTE_PREFIX,
109-
)
110-
else:
111-
# Create a pure AWS Database Encryption SDK table config (no legacy override)
112-
table_config = DynamoDbTableEncryptionConfig(
113-
logical_table_name=INTEG_TEST_DEFAULT_DYNAMODB_TABLE_NAME,
114-
partition_key_name="partition_key",
115-
sort_key_name="sort_key",
116-
attribute_actions_on_encrypt=INTEG_TEST_DEFAULT_ATTRIBUTE_ACTIONS_ON_ENCRYPT,
117-
keyring=INTEG_TEST_DEFAULT_KEYRING,
118-
allowed_unsigned_attribute_prefix=INTEG_TEST_DEFAULT_UNSIGNED_ATTRIBUTE_PREFIX,
119-
algorithm_suite_id=INTEG_TEST_DEFAULT_ALGORITHM_SUITE_ID,
120-
)
92+
# Configure legacy behavior
93+
legacy_override = LegacyOverride(
94+
encryptor=legacy_encryptor,
95+
attribute_actions_on_encrypt=INTEG_TEST_DEFAULT_ATTRIBUTE_ACTIONS_ON_ENCRYPT,
96+
policy=legacy_policy,
97+
)
98+
99+
# Create the table config with legacy override
100+
table_config = DynamoDbTableEncryptionConfig(
101+
logical_table_name=INTEG_TEST_DEFAULT_DYNAMODB_TABLE_NAME,
102+
partition_key_name="partition_key",
103+
sort_key_name="sort_key",
104+
attribute_actions_on_encrypt=INTEG_TEST_DEFAULT_ATTRIBUTE_ACTIONS_ON_ENCRYPT,
105+
keyring=INTEG_TEST_DEFAULT_KEYRING,
106+
legacy_override=legacy_override,
107+
allowed_unsigned_attribute_prefix=INTEG_TEST_DEFAULT_UNSIGNED_ATTRIBUTE_PREFIX,
108+
algorithm_suite_id=INTEG_TEST_DEFAULT_ALGORITHM_SUITE_ID,
109+
)
121110

122111
# Create the tables config
123112
table_configs = {INTEG_TEST_DEFAULT_DYNAMODB_TABLE_NAME: table_config}

0 commit comments

Comments
 (0)