-
Notifications
You must be signed in to change notification settings - Fork 919
GODRIVER-3540 Support Prefix/Suffix/Substring Indexes. #2267
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
base: master
Are you sure you want to change the base?
Conversation
🧪 Performance ResultsCommit SHA: 915f59eThe following benchmark tests for version 6945d3323f89b900076a2759 had statistically significant changes (i.e., |z-score| > 1.96):
For a comprehensive view of all microbenchmark results for this PR's commit, please check out the Evergreen perf task for this patch. |
API Change Report./v2/mongo/optionscompatible changes(*EncryptOptionsBuilder).SetTextOptions: added ./v2/x/mongo/driver/mongocrypt/optionscompatible changes(*ExplicitEncryptionOptions).SetTextOptions: added |
1365b74 to
197145d
Compare
07ccbf6 to
78de09d
Compare
| run-kms-tls-test: | ||
| - command: subprocess.exec | ||
| params: | ||
| binary: "bash" | ||
| env: | ||
| GO_BUILD_TAGS: cse | ||
| include_expansions_in_env: [AUTH, SSL, MONGODB_URI, TOPOLOGY, MONGO_GO_DRIVER_COMPRESSOR] | ||
| args: [*task-runner, setup-test] | ||
| - command: subprocess.exec | ||
| type: test | ||
| retry_on_failure: true | ||
| params: | ||
| binary: "bash" | ||
| include_expansions_in_env: [KMS_TLS_TESTCASE] | ||
| args: [*task-runner, evg-test-kms] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merged into run-client-side-encryption-test.
| - name: "test-kms-tls-invalid-cert" | ||
| tags: ["kms-test"] | ||
| commands: | ||
| - func: bootstrap-mongo-orchestration | ||
| vars: | ||
| TOPOLOGY: "server" | ||
| AUTH: "noauth" | ||
| SSL: "nossl" | ||
| - func: start-cse-servers | ||
| - func: run-kms-tls-test | ||
| vars: | ||
| KMS_TLS_TESTCASE: "INVALID_CERT" | ||
| TOPOLOGY: "server" | ||
| AUTH: "noauth" | ||
| SSL: "nossl" | ||
| - name: "test-kms-tls-invalid-hostname" | ||
| tags: ["kms-test"] | ||
| commands: | ||
| - func: bootstrap-mongo-orchestration | ||
| vars: | ||
| TOPOLOGY: "server" | ||
| AUTH: "noauth" | ||
| SSL: "nossl" | ||
| - func: start-cse-servers | ||
| - func: run-kms-tls-test | ||
| vars: | ||
| KMS_TLS_TESTCASE: "INVALID_HOSTNAME" | ||
| TOPOLOGY: "server" | ||
| AUTH: "noauth" | ||
| SSL: "nossl" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merged into run-client-side-encryption-test.
| assume-test-secrets-ec2-role: | ||
| - command: ec2.assume_role | ||
| params: | ||
| role_arn: ${aws_test_secrets_role} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A duplicate of L565.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copied from "specifications/source/client-side-encryption/etc/data/encryptedFields-prefix-suffix.json"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for Prefix/Suffix/Substring indexes in client-side encryption (queryable encryption) and consolidates client-side encryption prose test infrastructure into a single task.
- Adds new
TextOptions,SubstringOptions,PrefixOptions, andSuffixOptionstypes to support text query indexes - Implements BSON document construction for text options in the mongocrypt context
- Consolidates multiple KMS test tasks into a unified client-side encryption test task
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
mongo/options/encryptoptions.go |
Adds TextOptions types and builder pattern for configuring prefix, suffix, and substring query options |
x/mongo/driver/mongocrypt/options/mongocrypt_context_options.go |
Adds internal TextOptions types mirroring the public API options |
x/mongo/driver/mongocrypt/mongocrypt.go |
Implements BSON document construction and C API calls for text encryption options |
mongo/client_encryption.go |
Transforms public TextOptions to internal mongocrypt options format |
testdata/client-side-encryption-prose/encryptedFields-prefix-suffix.json |
Adds test data configuration for prefix and suffix query testing |
internal/integration/client_side_encryption_prose_test.go |
Adds comprehensive test cases for prefix, suffix, and substring query operations; refactors KMS TLS tests to run all mock servers in parallel |
internal/spectest/skip.go |
Removes skip entries for now-supported text index tests |
Taskfile.yml |
Consolidates multiple client-side encryption test tasks into single evg-test-client-side-encryption task |
.evergreen/config.yml |
Removes individual KMS test tasks and functions in favor of unified client-side-encryption-test task |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
78de09d to
86f1f09
Compare
86f1f09 to
915f59e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "keyId": { | ||
| "$binary": { | ||
| "base64": "EjRWeBI0mHYSNBI0VniQEg==", | ||
| "subType": "04" | ||
| } | ||
| }, | ||
| "path": "encryptedText", | ||
| "bsonType": "string", | ||
| "queries": [ | ||
| { | ||
| "queryType": "prefixPreview", | ||
| "strMinQueryLength": { | ||
| "$numberInt": "2" | ||
| }, | ||
| "strMaxQueryLength": { | ||
| "$numberInt": "10" | ||
| }, | ||
| "caseSensitive": true, | ||
| "diacriticSensitive": true | ||
| }, | ||
| { | ||
| "queryType": "suffixPreview", | ||
| "strMinQueryLength": { | ||
| "$numberInt": "2" | ||
| }, | ||
| "strMaxQueryLength": { | ||
| "$numberInt": "10" | ||
| }, | ||
| "caseSensitive": true, | ||
| "diacriticSensitive": true | ||
| } | ||
| ] | ||
| } |
Copilot
AI
Dec 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation in this JSON file is inconsistent. The first field object starting at line 3 has excessive indentation (12 spaces) compared to standard JSON formatting (typically 2 or 4 spaces per level). This should be corrected to maintain consistent formatting throughout the file.
| "keyId": { | |
| "$binary": { | |
| "base64": "EjRWeBI0mHYSNBI0VniQEg==", | |
| "subType": "04" | |
| } | |
| }, | |
| "path": "encryptedText", | |
| "bsonType": "string", | |
| "queries": [ | |
| { | |
| "queryType": "prefixPreview", | |
| "strMinQueryLength": { | |
| "$numberInt": "2" | |
| }, | |
| "strMaxQueryLength": { | |
| "$numberInt": "10" | |
| }, | |
| "caseSensitive": true, | |
| "diacriticSensitive": true | |
| }, | |
| { | |
| "queryType": "suffixPreview", | |
| "strMinQueryLength": { | |
| "$numberInt": "2" | |
| }, | |
| "strMaxQueryLength": { | |
| "$numberInt": "10" | |
| }, | |
| "caseSensitive": true, | |
| "diacriticSensitive": true | |
| } | |
| ] | |
| } | |
| "keyId": { | |
| "$binary": { | |
| "base64": "EjRWeBI0mHYSNBI0VniQEg==", | |
| "subType": "04" | |
| } | |
| }, | |
| "path": "encryptedText", | |
| "bsonType": "string", | |
| "queries": [ | |
| { | |
| "queryType": "prefixPreview", | |
| "strMinQueryLength": { | |
| "$numberInt": "2" | |
| }, | |
| "strMaxQueryLength": { | |
| "$numberInt": "10" | |
| }, | |
| "caseSensitive": true, | |
| "diacriticSensitive": true | |
| }, | |
| { | |
| "queryType": "suffixPreview", | |
| "strMinQueryLength": { | |
| "$numberInt": "2" | |
| }, | |
| "strMaxQueryLength": { | |
| "$numberInt": "10" | |
| }, | |
| "caseSensitive": true, | |
| "diacriticSensitive": true | |
| } | |
| ] | |
| } |
GODRIVER-3540
Summary
Background & Motivation