Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6e390ac
mongodb-crypt: fix verifyCryptLibs gpg failure on deep checkout paths
nhachicha Jun 29, 2026
c4794ac
docs(JAVA-6168): design for QE prefix/suffix GA + Text->String rename
nhachicha Jun 29, 2026
b38210c
docs(JAVA-6168): implementation plan for QE prefix/suffix GA + Text->…
nhachicha Jun 29, 2026
967af8a
feat(JAVA-6168): add StringOptions and deprecate TextOptions
nhachicha Jun 29, 2026
6d36cc5
fix(JAVA-6168): default StringOptions/TextOptions sensitivity flags t…
nhachicha Jun 29, 2026
9248174
feat(JAVA-6168): add EncryptOptions.stringOptions and deprecate textO…
nhachicha Jun 29, 2026
5c2b157
fix(JAVA-6168): include options in EncryptOptions.toString and correc…
nhachicha Jun 29, 2026
3d9dcd2
feat(JAVA-6168): resolve stringOptions with textOptions fallback in E…
nhachicha Jun 29, 2026
283d278
docs(JAVA-6168): refer to String algorithm in MongoExplicitEncryptOpt…
nhachicha Jun 29, 2026
818222a
test(JAVA-6168): rewrite QE string explicit-encryption prose test to GA
nhachicha Jun 29, 2026
7b57f7e
test(JAVA-6168): add prose test case 11 and null-guard assertion
nhachicha Jun 29, 2026
796a0ca
style(JAVA-6168): remove trailing blank line in EncryptOptionsHelper
nhachicha Jun 29, 2026
1ed7978
build(JAVA-6168): upgrade libmongocrypt to 1.19.1
nhachicha Jun 29, 2026
89b55e6
test(JAVA-6168): bump spec submodule to QE prefix/suffix GA tests
nhachicha Jun 29, 2026
ba33b03
Merge remote-tracking branch 'origin/main' into nh/qe/prefix
nhachicha Jul 4, 2026
7e5ae58
build(JAVA-6244): upgrade libmongocrypt to 1.20.0 for QE GA substring
nhachicha Jul 4, 2026
71981f8
test(JAVA-6244): implement QE GA substring (un-skip unified test, pro…
nhachicha Jul 4, 2026
6b10fe9
chore: stop tracking internal design/plan docs (kept locally, gitigno…
nhachicha Jul 4, 2026
5b91f0d
test(JAVA-6244): address Copilot review - substring GA docs, prose ca…
nhachicha Jul 4, 2026
317ef2d
docs(JAVA-6244): describe MongoExplicitEncryptOptions.textOptions as …
nhachicha Jul 4, 2026
676995e
test(JAVA-6244): gate GA substring cases by libmongocrypt 1.20+
nhachicha Jul 4, 2026
5045c85
test(JAVA-6244): address Copilot - rename Text test class to String, …
nhachicha Jul 4, 2026
71d8e8a
test(JAVA-6244): use primitive boolean for String/TextOptions sensiti…
nhachicha Jul 4, 2026
f39e5e2
docs(JAVA-6244): sync getQueryType javadoc, clarify @param and versio…
nhachicha Jul 4, 2026
d93d793
docs(JAVA-6244): make libmongocrypt signature-asset KDoc example vers…
nhachicha Jul 4, 2026
97ad4a2
docs(JAVA-6244): fix stale gpg keyring comment in mongodb-crypt build
nhachicha Jul 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,4 @@ driver-benchmarks/.factorypath
# bin build directories
**/bin

docs/superpowers/
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public class EncryptOptions {
private String queryType;
private RangeOptions rangeOptions;
private TextOptions textOptions;
private StringOptions stringOptions;

/**
* Construct an instance with the given algorithm.
Expand All @@ -54,12 +55,12 @@ public EncryptOptions(final String algorithm) {
* <li>Indexed</li>
* <li>Unindexed</li>
* <li>Range</li>
* <li>TextPreview</li>
* <li>String</li>
* </ul>
*
* <p>The "TextPreview" algorithm is in preview and should be used for experimental workloads only.
* These features are unstable and their security is not guaranteed until released as Generally Available (GA).
* The GA version of these features may not be backwards compatible with the preview version.</p>
* <p>The "String" algorithm supports Queryable Encryption prefix, suffix, and substring string queries.
* Use the "String" algorithm with query types "prefix"/"suffix"/"substring" (server 9.0+) or the deprecated
* aliases "prefixPreview"/"suffixPreview"/"substringPreview" (server 8.2 to pre-9.0).</p>
*
* @return the encryption algorithm
*/
Expand Down Expand Up @@ -149,8 +150,12 @@ public Long getContentionFactor() {
/**
* The QueryType.
*
* <p>Currently, we support only "equality", "range", "prefixPreview", "suffixPreview" or "substringPreview" queryType.</p>
* <p>It is an error to set queryType when the algorithm is not "Indexed", "Range" or "TextPreview".</p>
* <p>Currently, we support only "equality", "range", "prefix", "suffix", "substring", "prefixPreview",
* "suffixPreview" or "substringPreview" queryType.</p>
Comment on lines 150 to +154

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in f39e5e2. getQueryType()'s Javadoc now points to queryType(String) for the supported-types list, so the two can't drift apart.

* <p>The "prefix", "suffix", "substring", "prefixPreview", "suffixPreview" and "substringPreview" query types are
* only valid with the "String" algorithm. "prefixPreview"/"suffixPreview"/"substringPreview" are deprecated
* aliases supported for servers 8.2 to pre-9.0; use "prefix"/"suffix"/"substring" on server 9.0+.</p>
* <p>It is an error to set queryType when the algorithm is not "Indexed", "Range" or "String".</p>
Comment on lines +153 to +158

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in f39e5e2. getQueryType()'s Javadoc now points to queryType(String) for the supported-types list, so the two can't drift apart.

Comment on lines +153 to +158

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in f39e5e2. getQueryType()'s Javadoc now points to queryType(String) for the supported-types list, so the two can't drift apart.

* @param queryType the query type
* @return this
* @since 4.7
Expand All @@ -164,7 +169,7 @@ public EncryptOptions queryType(@Nullable final String queryType) {
/**
* Gets the QueryType.
*
* <p>Currently, we support only "equality" or "range" queryType.</p>
* <p>See {@link #queryType(String)} for the supported query types.</p>
* @see #queryType(String)
* @return the queryType or null
* @since 4.7
Expand Down Expand Up @@ -205,13 +210,15 @@ public RangeOptions getRangeOptions() {
/**
* The TextOptions
*
* <p>It is an error to set TextOptions when the algorithm is not "TextPreview".
* <p>It is an error to set TextOptions when the algorithm is not "String".
* @param textOptions the text options
Comment thread
nhachicha marked this conversation as resolved.
Comment thread
nhachicha marked this conversation as resolved.
* @return this
Comment thread
nhachicha marked this conversation as resolved.
* @since 5.6
* @mongodb.server.release 8.2
* @mongodb.driver.manual /core/queryable-encryption/ queryable encryption
* @deprecated Use {@link #stringOptions(StringOptions)} instead.
*/
@Deprecated
@Alpha(Reason.SERVER)
public EncryptOptions textOptions(@Nullable final TextOptions textOptions) {
this.textOptions = textOptions;
Expand All @@ -225,13 +232,45 @@ public EncryptOptions textOptions(@Nullable final TextOptions textOptions) {
* @since 5.6
* @mongodb.server.release 8.2
* @mongodb.driver.manual /core/queryable-encryption/ queryable encryption
* @deprecated Use {@link #getStringOptions()} instead.
*/
@Deprecated
@Alpha(Reason.SERVER)
@Nullable
public TextOptions getTextOptions() {
return textOptions;
}

/**
* The StringOptions
*
* <p>It is an error to set StringOptions when the algorithm is not "String".
* @param stringOptions the string options
* @return this
* @since 5.9
* @mongodb.server.release 8.2
* @mongodb.driver.manual /core/queryable-encryption/ queryable encryption
*/
@Alpha(Reason.SERVER)
public EncryptOptions stringOptions(@Nullable final StringOptions stringOptions) {
this.stringOptions = stringOptions;
return this;
}

/**
* Gets the StringOptions
* @see #stringOptions(StringOptions)
* @return the string options or null if not set
* @since 5.9
* @mongodb.server.release 8.2
* @mongodb.driver.manual /core/queryable-encryption/ queryable encryption
*/
@Alpha(Reason.SERVER)
@Nullable
public StringOptions getStringOptions() {
return stringOptions;
}

@Override
public String toString() {
return "EncryptOptions{"
Expand All @@ -241,6 +280,8 @@ public String toString() {
+ ", contentionFactor=" + contentionFactor
+ ", queryType='" + queryType + '\''
+ ", rangeOptions=" + rangeOptions
+ ", textOptions=" + textOptions
+ ", stringOptions=" + stringOptions
+ '}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
/*
* Copyright 2008-present MongoDB, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.mongodb.client.model.vault;

import com.mongodb.annotations.Alpha;
import com.mongodb.annotations.Reason;
import com.mongodb.lang.Nullable;
import org.bson.BsonDocument;

/**
* String options for a Queryable Encryption field that supports string queries (prefix, suffix, and substring).
*
* <p>Note: StringOptions is in Alpha and subject to backwards breaking changes.
*
* @since 5.9
* @mongodb.server.release 8.2
* @mongodb.driver.manual /core/queryable-encryption/ queryable encryption
*/
@Alpha(Reason.SERVER)
public class StringOptions {
private boolean caseSensitive;
private boolean diacriticSensitive;
@Nullable
private BsonDocument prefixOptions;
@Nullable
private BsonDocument suffixOptions;
@Nullable
private BsonDocument substringOptions;

/**
* Construct a new instance
*/
public StringOptions() {
}

/**
* @return true if string indexes for this field are case sensitive.
*/
public boolean getCaseSensitive() {
return caseSensitive;
}

/**
* Set case sensitivity
*
* @param caseSensitive true if string indexes are case sensitive
* @return this
*/
public StringOptions caseSensitive(final boolean caseSensitive) {
this.caseSensitive = caseSensitive;
return this;
}

/**
* @return true if string indexes are diacritic sensitive
*/
public boolean getDiacriticSensitive() {
return diacriticSensitive;
}

/**
* Set diacritic sensitivity
*
* @param diacriticSensitive true if string indexes are diacritic sensitive
* @return this
*/
public StringOptions diacriticSensitive(final boolean diacriticSensitive) {
this.diacriticSensitive = diacriticSensitive;
return this;
}

/**
* Set the prefix options.
*
* <p>Expected to be a {@link BsonDocument} in the format of:</p>
*
* <pre>
* {@code
* {
* // strMinQueryLength is the minimum allowed query length. Querying with a shorter string will error.
* strMinQueryLength: BsonInt32,
* // strMaxQueryLength is the maximum allowed query length. Querying with a longer string will error.
* strMaxQueryLength: BsonInt32
* }
* }
* </pre>
*
* @param prefixOptions the prefix options or null
* @return this
*/
public StringOptions prefixOptions(@Nullable final BsonDocument prefixOptions) {
this.prefixOptions = prefixOptions;
return this;
}

/**
* @see #prefixOptions(BsonDocument)
* @return the prefix options document or null
*/
@Nullable
public BsonDocument getPrefixOptions() {
return prefixOptions;
}

/**
* Set the suffix options.
*
* <p>Expected to be a {@link BsonDocument} in the format of:</p>
*
* <pre>
* {@code
* {
* // strMinQueryLength is the minimum allowed query length. Querying with a shorter string will error.
* strMinQueryLength: BsonInt32,
* // strMaxQueryLength is the maximum allowed query length. Querying with a longer string will error.
* strMaxQueryLength: BsonInt32
* }
* }
* </pre>
*
* @param suffixOptions the suffix options or null
* @return this
*/
public StringOptions suffixOptions(@Nullable final BsonDocument suffixOptions) {
this.suffixOptions = suffixOptions;
return this;
}

/**
* @see #suffixOptions(BsonDocument)
* @return the suffix options document or null
*/
@Nullable
public BsonDocument getSuffixOptions() {
return suffixOptions;
}

/**
* Set the substring options.
*
* <p>Expected to be a {@link BsonDocument} in the format of:</p>
*
* <pre>
* {@code
* {
* // strMaxLength is the maximum allowed length to insert. Inserting longer strings will error.
* strMaxLength: BsonInt32,
* // strMinQueryLength is the minimum allowed query length. Querying with a shorter string will error.
* strMinQueryLength: BsonInt32,
* // strMaxQueryLength is the maximum allowed query length. Querying with a longer string will error.
* strMaxQueryLength: BsonInt32
* }
* }
* </pre>
*
* @param substringOptions the substring options or null
* @return this
*/
public StringOptions substringOptions(@Nullable final BsonDocument substringOptions) {
this.substringOptions = substringOptions;
return this;
}

/**
* @see #substringOptions(BsonDocument)
* @return the substring options document or null
*/
@Nullable
public BsonDocument getSubstringOptions() {
return substringOptions;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@
* @since 5.6
* @mongodb.server.release 8.2
* @mongodb.driver.manual /core/queryable-encryption/ queryable encryption
* @deprecated Use {@link StringOptions} instead.
*/
Comment thread
nhachicha marked this conversation as resolved.
Comment on lines 29 to 33

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

TextOptions is the deprecated pre-rename type kept for backward compatibility, so it intentionally retains its "Text" naming/wording, and its @deprecated tag already points to StringOptions. :driver-core:javadoc builds clean, so leaving as-is.

@Deprecated
@Alpha(Reason.SERVER)
public class TextOptions {
private Boolean caseSensitive;
private Boolean diacriticSensitive;
private boolean caseSensitive;
private boolean diacriticSensitive;
@Nullable
private BsonDocument prefixOptions;
@Nullable
Expand Down
Loading