Skip to content

PYTHON-5143 Support auto encryption in unified tests #2488

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 18 commits into from
Aug 20, 2025

Conversation

blink1073
Copy link
Member

@blink1073 blink1073 commented Aug 19, 2025

  • Sync spec tests
  • Implement unified test format version 1.23
  • Support autoEncryptOpts
  • Drop QE state collections (_enxcol..esc and _enxcol..ecoc)

@blink1073 blink1073 closed this Aug 19, 2025
@blink1073 blink1073 reopened this Aug 19, 2025
@blink1073 blink1073 requested a review from NoahStapp August 19, 2025 17:03
@blink1073 blink1073 marked this pull request as ready for review August 19, 2025 17:03
@blink1073 blink1073 requested a review from a team as a code owner August 19, 2025 17:03
aclark4life
aclark4life previously approved these changes Aug 19, 2025
Copy link
Contributor

@aclark4life aclark4life left a comment

Choose a reason for hiding this comment

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

LGTM and looks helpful for mongodb/django-mongodb-backend#329

@@ -488,6 +515,7 @@ def tearDownClass(cls) -> None:
async def asyncSetUp(self):
# super call creates internal client cls.client
await super().asyncSetUp()

Copy link
Contributor

Choose a reason for hiding this comment

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

Unintended whitespace?

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated

@@ -118,10 +119,22 @@
("kmip", KMIP_CREDS),
("kmip:name1", KMIP_CREDS),
]:
# Use the temp aws creds for autoEncryptOpts.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain why we do this specifically for AWS?

Copy link
Member Author

Choose a reason for hiding this comment

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

For clientEncryptionOpts, the tests are using the non-temp credentials, and for autoEncryptOpts they're using the temp credentials. Ideally they'd be the same, but other teams have already implemented.

Copy link
Contributor

Choose a reason for hiding this comment

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

For every provider? Or only for AWS tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

AWS is the only provider that has temp credentials as an option

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it, makes sense.

"sessionToken": os.environ.get("CSFLE_AWS_TEMP_SESSION_TOKEN", ""),
}

ALL_KMS_PROVIDERS = dict(
Copy link
Contributor

Choose a reason for hiding this comment

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

Do these need to be here where they'll be duplicated by synchro? Or can they go in a shared file in test?

Copy link
Member Author

Choose a reason for hiding this comment

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

Are you suggesting we move the rest of the constants as well?

Copy link
Contributor

@NoahStapp NoahStapp Aug 19, 2025

Choose a reason for hiding this comment

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

Any constant (or function, value, anything really) that doesn't change based on async/sync should live outside of the synchro'd directories, yeah.

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, I'll refactor a bit

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated, let's see how the tests do

@blink1073
Copy link
Member Author

Okay, this is ready for review again

@blink1073 blink1073 merged commit f7b94be into mongodb:master Aug 20, 2025
79 checks passed
@blink1073 blink1073 deleted the PYTHON-5143 branch August 20, 2025 13:58
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.

3 participants