CSHARP-5984: Add QE prefix+suffix GA and rename API to string#2050
CSHARP-5984: Add QE prefix+suffix GA and rename API to string#2050adelinowona wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Warning
- Copilot's review of this pull request may be incomplete because some of the changed files are excluded by your Copilot content exclusion settings. See Excluding content from Copilot for details.
Pull request overview
This PR updates the Queryable Encryption (QE) explicit-encryption surface to use the GA string naming (renaming the previous “textPreview/text” API), adds GA prefix/suffix query type support for server 9.0+, preserves preview query types for pre-9.0 servers, and bumps the bundled libmongocrypt version to 1.19.1.
Changes:
- Rename QE explicit encryption API from Text → String (options + algorithm enum usage) and update tests/spec prose coverage accordingly.
- Add support for GA
prefix/suffixquery types on server 9.0+, while keepingprefixPreview/suffixPreview/substringPreviewflows working where appropriate. - Bump libmongocrypt dependency metadata and version pins to 1.19.1 (including SBOM/purl updates).
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/MongoDB.Driver.Tests/Specifications/client-side-encryption/prose-tests/ClientEncryptionProseTests.cs | Splits string explicit encryption coverage across GA vs preview vs substring-preview server ranges and updates query type selection. |
| tests/MongoDB.Driver.Tests/Encryption/EncryptOptionsTests.cs | Updates unit tests for renamed algorithm/options and expanded valid string query types. |
| src/MongoDB.Driver/Core/Misc/Feature.cs | Introduces new feature flags for string GA (9.0+) and preview query types (8.2+). |
| src/MongoDB.Driver.Encryption/MongoDB.Driver.Encryption.csproj | Bumps LibMongoCryptVersion to 1.19.1. |
| src/MongoDB.Driver.Encryption/ExplicitEncryptionLibMongoCryptController.cs | Switches explicit encryption context wiring from TextOptions to StringOptions. |
| src/MongoDB.Driver.Encryption/EncryptOptions.cs | Renames TextOptions→StringOptions and updates validation to include GA prefix/suffix query types. |
| src/MongoDB.Driver.Encryption/EncryptionOptionsExtensions.cs | Renames the options-to-document extension for StringOptions. |
| src/MongoDB.Driver.Encryption/EncryptionAlgorithm.cs | Renames enum value TextPreview→String. |
| sbom.json | Updates SBOM component metadata for libmongocrypt 1.19.1. |
| purls.txt | Updates libmongocrypt purl to 1.19.1. |
Files excluded by content exclusion policy (15)
- specifications/client-side-encryption/prose-tests/etc/data/encryptedFields-prefix-suffix-ci-di.json
- specifications/client-side-encryption/prose-tests/etc/data/encryptedFields-prefix-suffix-preview.json
- specifications/client-side-encryption/prose-tests/etc/data/encryptedFields-prefix-suffix.json
- specifications/client-side-encryption/tests/unified/QE-Text-cleanupStructuredEncryptionData.json
- specifications/client-side-encryption/tests/unified/QE-Text-cleanupStructuredEncryptionData.yml
- specifications/client-side-encryption/tests/unified/QE-Text-compactStructuredEncryptionData.json
- specifications/client-side-encryption/tests/unified/QE-Text-compactStructuredEncryptionData.yml
- specifications/client-side-encryption/tests/unified/QE-Text-prefix.json
- specifications/client-side-encryption/tests/unified/QE-Text-prefix.yml
- specifications/client-side-encryption/tests/unified/QE-Text-prefixPreview.json
- specifications/client-side-encryption/tests/unified/QE-Text-prefixPreview.yml
- specifications/client-side-encryption/tests/unified/QE-Text-suffix.json
- specifications/client-side-encryption/tests/unified/QE-Text-suffix.yml
- specifications/client-side-encryption/tests/unified/QE-Text-suffixPreview.json
- specifications/client-side-encryption/tests/unified/QE-Text-suffixPreview.yml
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Warning
- Copilot's review of this pull request may be incomplete because some of the changed files are excluded by your Copilot content exclusion settings. See Excluding content from Copilot for details.
Pull request overview
Copilot reviewed 25 out of 25 changed files in this pull request and generated 2 comments.
Files excluded by content exclusion policy (15)
- specifications/client-side-encryption/prose-tests/etc/data/encryptedFields-prefix-suffix-ci-di.json
- specifications/client-side-encryption/prose-tests/etc/data/encryptedFields-prefix-suffix-preview.json
- specifications/client-side-encryption/prose-tests/etc/data/encryptedFields-prefix-suffix.json
- specifications/client-side-encryption/tests/unified/QE-Text-cleanupStructuredEncryptionData.json
- specifications/client-side-encryption/tests/unified/QE-Text-cleanupStructuredEncryptionData.yml
- specifications/client-side-encryption/tests/unified/QE-Text-compactStructuredEncryptionData.json
- specifications/client-side-encryption/tests/unified/QE-Text-compactStructuredEncryptionData.yml
- specifications/client-side-encryption/tests/unified/QE-Text-prefix.json
- specifications/client-side-encryption/tests/unified/QE-Text-prefix.yml
- specifications/client-side-encryption/tests/unified/QE-Text-prefixPreview.json
- specifications/client-side-encryption/tests/unified/QE-Text-prefixPreview.yml
- specifications/client-side-encryption/tests/unified/QE-Text-suffix.json
- specifications/client-side-encryption/tests/unified/QE-Text-suffix.yml
- specifications/client-side-encryption/tests/unified/QE-Text-suffixPreview.json
- specifications/client-side-encryption/tests/unified/QE-Text-suffixPreview.yml
Add the GA Queryable Encryption "prefix"/"suffix" string query types and the "String" algorithm, with StringOptions as the replacement for TextOptions. The previous TextOptions, EncryptionAlgorithm.TextPreview, and Feature.Csfle2QEv2TextPreviewAlgorithm are retained as [Obsolete] aliases for backwards compatibility (TextPreview is translated to the "String" algorithm). The experimental prefixPreview/suffixPreview/substringPreview query types remain supported on servers before 9.0 and will be dropped later in DRIVERS-3548. Bump libmongocrypt to 1.19.1.
…st cases Move the new String algorithm member after the deprecated TextPreview alias so TextPreview keeps its released ordinal. Add a comment noting that prose test cases 7-9 are GA-only and intentionally hardcode the GA query types.
Rename QueryableEncryptionTextQueryTests to QueryableEncryptionStringQueryTests and gate it on Csfle2QEv2StringAlgorithm (server 9.0+, GA prefix/suffix) instead of the now-obsolete Csfle2QEv2TextPreviewAlgorithm, dropping the pre-9.0 version cap. The substring query stays preview (substringPreview) but remains valid on 9.0, so it runs under the same gate.
The string-algorithm StringOptions and TextOptions constructors take contentionFactor before keyId, but the XML docs listed keyId first. Reorder the doc lines to match the signatures (addresses Copilot review).
| /// <summary> | ||
| /// Gets the csfle2 textPreview algorithm feature. | ||
| /// </summary> | ||
| [Obsolete("Use Csfle2QEv2StringAlgorithm instead.")] |
There was a problem hiding this comment.
Shouldn't this refer to Csfle2QEv2StringPreviewAlgorithm (the preview one)?
There was a problem hiding this comment.
yep, fixed. Though this feature isn't being used anywhere in our internal code anyway. Ideally I will just remove it but since this is a public class, apicompat will complain. I created CSHARP-6098 so we don't have to do this deprecation dance for this class anymore.
There was a problem hiding this comment.
I totally agree with the ticket 🙏
Summary
Adds the GA Queryable Encryption
prefix/suffixstring query types and renames the QE "text" API to "string", while keeping the experimental preview query types working on servers before 9.0.StringOptionsandEncryptionAlgorithm.Stringas the GA names for the QE string API.TextOptionsandEncryptionAlgorithm.TextPreviewas[Obsolete]deprecated aliases.TextPreviewis translated to theStringalgorithm, so existing callers continue to work.prefix/suffixquery types (server 9.0+).prefixPreview/suffixPreview(andsubstringPreview) working on servers before 9.0 — to be dropped later in DRIVERS-3548.Notes
Stringenum member is declared after the existingTextPreviewalias soTextPreviewkeeps its released ordinal.https://jira.mongodb.org/browse/CSHARP-5984 (DRIVERS-3321)