Skip to content

feat(python): Add Support for Legacy DBEC and Migration Examples #1938

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2025

Conversation

imabhichow
Copy link
Contributor

@imabhichow imabhichow commented Jun 7, 2025

Issue #, if available:

Description of changes:

  1. Add support for Legacy DBEC.
  2. Examples for migration using DB ESDK interfaces
    a. EncryptedClient
    b. EncryptedPaginator
    c. EncryptedResource
    d. EncryptedTable

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@imabhichow imabhichow force-pushed the imabhichow/legacy-extern branch 3 times, most recently from 1b314f4 to 21d22dd Compare June 12, 2025 23:26
@imabhichow imabhichow force-pushed the imabhichow/legacy-extern branch from 21d22dd to 522b0f9 Compare June 13, 2025 09:27
Copy link
Contributor

@lucasmcdonald3 lucasmcdonald3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most comments are nits/cleanups.

I'm most interested in the other interfaces, so let's get started on that. There may be some fun stuff with how all DBESDK interfaces interact with the EncryptedClient that we should take a look at

@imabhichow imabhichow force-pushed the imabhichow/legacy-extern branch 2 times, most recently from 746f096 to dbb6541 Compare June 18, 2025 16:55
Comment on lines +134 to +137
legacy_encrypted_table = LegacyEncryptedTable(
table=ddb_table,
materials_provider=cmp,
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you test what happens if someone provides a legacy EncryptedClient for use with the new EncryptedTable? (i.e. using clients that expect different item formats)

The InternalLegacyOverride code you wrote makes me think things are fine if this happens, but it would be great to double check.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chatted offline, this was tested manually and it works.

For posterity (i.e. legacy deprecation work), we will add integ tests to validate that this continues to work.

Copy link
Contributor

@lucasmcdonald3 lucasmcdonald3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new tests are fantastic -- exhaustive and truly bar-raising for our team's forward compatibility coverage.
I had one question around the default params in a constructor, but looks good otherwise.

Comment on lines 90 to 92
def create_encryption_config(legacy_encryptor=None, legacy_policy=None):
"""Create a DynamoDbTableEncryptionConfig with optional legacy override."""
if legacy_encryptor is not None and legacy_policy is not None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this actually get called with the params set to None anywhere? I looked for a bit but couldn't find it, but this code is also dense (for good reason!) and I'm probably misreading.
If it's not used anymore we can probably remove it, or add cases where these params are actually None

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove the default assignment.

@imabhichow imabhichow changed the title WIP feat(python): Legacy Extern feat(python): Add Support for Legacy DBEC and Migration Examples Jun 24, 2025
@imabhichow imabhichow marked this pull request as ready for review June 24, 2025 23:20
@imabhichow imabhichow requested a review from a team as a code owner June 24, 2025 23:20
@imabhichow imabhichow force-pushed the imabhichow/legacy-extern branch from c391d4a to e43f890 Compare June 25, 2025 20:24
@imabhichow imabhichow changed the base branch from python-poc to python-reviewed June 25, 2025 20:25
@imabhichow imabhichow merged commit 45377c9 into python-reviewed Jun 25, 2025
1 check passed
@imabhichow imabhichow deleted the imabhichow/legacy-extern branch June 25, 2025 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants