Skip to content

Add unified, legacy, and prose tests for CSFLE multi-KMS support. #1424

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 8 commits into from
Jul 25, 2024

Conversation

vbabanin
Copy link
Member

@vbabanin vbabanin commented Jun 20, 2024

Summary

This PR implements the changes described in the "Downstream Changes Summary" of DRIVERS-2731.

  • Updates JavaDoc.
  • Implements required spec tests.
  • Passes new AWS credentials to test a rewrapManyDataKey with two different AWS accounts using Evergreen expansions: AWS_ACCESS_KEY_ID_2 and AWS_SECRET_ACCESS_KEY_2, configured in the Evergreen Variables page.

NOTE: No changes to the CSFLE API are necessary, as it is forward-compatible because of using Map AutoEncryptionSettings.java#L126). All relevant logic is encapsulated within libmongocrypt. This PR builds on the updated dependency of mongocrypt version 1.10.0-SNAPSHOT which was updated in PR 1406.

Background

Named KMS providers is further described in DBX Scope: Support Named KMS Providers.

The KMS provider identified by a string. Previously supported KMS providers were only: "aws", "azure", "gcp", "kmip", and "local". The KMS provider is now expanded to support name suffixes. (e.g. "local:myname").

Named KMS providers enables more than one of each KMS provider type to be configured.

kms_providers = {
    "local": {"key": local_kek1},        # Unnamed KMS provider.
    "local:myname": {"key": local_kek2 } # Named KMS provider with name "myname".
}

@vbabanin vbabanin marked this pull request as ready for review June 22, 2024 05:35
@vbabanin vbabanin requested review from a team and stIncMale and removed request for a team June 22, 2024 05:36
@vbabanin vbabanin self-assigned this Jun 22, 2024
/**
* See <a href="https://github.com/mongodb/specifications/tree/master/source/client-side-encryption/tests#11-kms-tls-options-tests">
* 11. KMS TLS Options Tests</a>.
*/
@Test()
public void testThatCustomSslContextIsUsed() {
Copy link
Member Author

@vbabanin vbabanin Jun 22, 2024

Choose a reason for hiding this comment

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

A new use-case related to named providers was recently added to the KMS TLS Options specification prose tests. While the existing test testThatCustomSslContextIsUsed for KMS TLS Options does not precisely align with the spec tests, it has been purposefully designed for simplicity achieving the desired effect. In line with the approach discussed in this original comment, this test has been extended to include named providers.

vbabanin and others added 3 commits July 16, 2024 19:13
Co-authored-by: Valentin Kovalenko <[email protected]>
Fix issues.

JAVA-5275
@vbabanin vbabanin requested a review from stIncMale July 17, 2024 06:56
@vbabanin vbabanin requested a review from stIncMale July 22, 2024 17:02
@vbabanin vbabanin merged commit a461dba into mongodb:master Jul 25, 2024
57 of 59 checks passed
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