Skip to content

Conversation

@aclark4life
Copy link
Collaborator

@aclark4life aclark4life commented Jun 27, 2025

Previous attempts and additional context here:

@aclark4life

This comment was marked as resolved.

@timgraham

This comment was marked as resolved.

@aclark4life

This comment was marked as resolved.

@timgraham

This comment was marked as resolved.

@aclark4life

This comment was marked as resolved.

@aclark4life

This comment was marked as resolved.

@aclark4life

This comment was marked as resolved.

@aclark4life

This comment was marked as resolved.

@timgraham

This comment was marked as resolved.

@aclark4life

This comment was marked as resolved.

@aclark4life

This comment was marked as resolved.

@aclark4life

This comment was marked as resolved.

@timgraham

This comment was marked as resolved.

@aclark4life

This comment was marked as resolved.

@timgraham

This comment was marked as resolved.

@aclark4life aclark4life force-pushed the INTPYTHON-527 branch 2 times, most recently from c89be3d to b22dfbd Compare December 7, 2025 21:48
WaVEV and others added 24 commits December 7, 2025 16:49
Move crypt shared installation instructions to "Installation" section and
crypt shared configuration steps to "Configuring the DATABASES setting" section.
Fall back to local if no env vars set
KMS_CREDENTIALS = {"aws": {"key": _AWS_KEY_ARN, "region": _AWS_REGION}}
else:
KMS_PROVIDERS = {"local": {"key": os.urandom(96)}}
KMS_CREDENTIALS = {"local": {}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

As far as I know "local" isn't required in this dictionary and I wouldn't put it there so we don't test an unrealistic scenario.

Comment on lines +18 to +22
_AWS_REGION = os.environ.get("FLE_AWS_KMS_REGION", "us-east-1")
_AWS_KEY_ARN = os.environ.get(
"FLE_AWS_KMS_KEY_ARN",
"arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0",
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should there be fallback values? Seems it might be better to fail loudly than silently.

Comment on lines +23 to +24
KMS_PROVIDERS = {"aws": AWS_CREDS}
KMS_CREDENTIALS = {"aws": {"key": _AWS_KEY_ARN, "region": _AWS_REGION}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would caution against using uppercased values that look like Django settings. (Any values in this file are accessible as such. It could lead to inadvertent referencing of them.)

Comment on lines +128 to +130
master_key = connections["encrypted"].settings_dict["KMS_CREDENTIALS"][
self.DEFAULT_KMS_PROVIDER
]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since we only support on provider, I think you could avoid all the logic in test_base.py and simply retrieve the configured provider/master key values similar to how schema.py does it: next(iter(kms_providers.keys()))

Comment on lines +5 to +6
# Export secrets as environment variables
. ../secrets-export.sh
Copy link
Collaborator

Choose a reason for hiding this comment

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

This file is from driver tools or something?

Comment on lines -9 to +12
pip install -e .
pip install -e '.[encryption]'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Try to avoid encryption related tasks like this on non-encrypted builds.

display_name: Run Tests 8.2 QE
run_on: rhel87-small
expansions:
MONGODB_VERSION: "8.2"
Copy link
Collaborator

@timgraham timgraham Dec 9, 2025

Choose a reason for hiding this comment

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

My impression is that we only want to test with dot zero MongoDB's, but lets get clarification on this.

Comment on lines +11 to +12
"accessKeyId": os.environ.get("FLE_AWS_KEY", ""),
"secretAccessKey": os.environ.get("FLE_AWS_SECRET", ""),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Comment where the environment variable names come from given that then name doesn't appear anywhere else in this repo. (Is it really configured correctly?) Maybe it's better to have some configuration variable like "USE_AWS_KMS" rather than inferring it from these values.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I thought it might be incorrect since the names are different from this line in evergreen config: include_expansions_in_env: ["AWS_SECRET_ACCESS_KEY", "AWS_ACCESS_KEY_ID", "AWS_SESSION_TOKEN"]

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.

6 participants