-
Notifications
You must be signed in to change notification settings - Fork 1.5k
JAVA-6168 JAVA-6244 JAVA-6196: QE prefix/suffix/substring GA + rename Text API to String #2010
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
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
6e390ac
mongodb-crypt: fix verifyCryptLibs gpg failure on deep checkout paths
nhachicha c4794ac
docs(JAVA-6168): design for QE prefix/suffix GA + Text->String rename
nhachicha b38210c
docs(JAVA-6168): implementation plan for QE prefix/suffix GA + Text->…
nhachicha 967af8a
feat(JAVA-6168): add StringOptions and deprecate TextOptions
nhachicha 6d36cc5
fix(JAVA-6168): default StringOptions/TextOptions sensitivity flags t…
nhachicha 9248174
feat(JAVA-6168): add EncryptOptions.stringOptions and deprecate textO…
nhachicha 5c2b157
fix(JAVA-6168): include options in EncryptOptions.toString and correc…
nhachicha 3d9dcd2
feat(JAVA-6168): resolve stringOptions with textOptions fallback in E…
nhachicha 283d278
docs(JAVA-6168): refer to String algorithm in MongoExplicitEncryptOpt…
nhachicha 818222a
test(JAVA-6168): rewrite QE string explicit-encryption prose test to GA
nhachicha 7b57f7e
test(JAVA-6168): add prose test case 11 and null-guard assertion
nhachicha 796a0ca
style(JAVA-6168): remove trailing blank line in EncryptOptionsHelper
nhachicha 1ed7978
build(JAVA-6168): upgrade libmongocrypt to 1.19.1
nhachicha 89b55e6
test(JAVA-6168): bump spec submodule to QE prefix/suffix GA tests
nhachicha ba33b03
Merge remote-tracking branch 'origin/main' into nh/qe/prefix
nhachicha 7e5ae58
build(JAVA-6244): upgrade libmongocrypt to 1.20.0 for QE GA substring
nhachicha 71981f8
test(JAVA-6244): implement QE GA substring (un-skip unified test, pro…
nhachicha 6b10fe9
chore: stop tracking internal design/plan docs (kept locally, gitigno…
nhachicha 5b91f0d
test(JAVA-6244): address Copilot review - substring GA docs, prose ca…
nhachicha 317ef2d
docs(JAVA-6244): describe MongoExplicitEncryptOptions.textOptions as …
nhachicha 676995e
test(JAVA-6244): gate GA substring cases by libmongocrypt 1.20+
nhachicha 5045c85
test(JAVA-6244): address Copilot - rename Text test class to String, …
nhachicha 71d8e8a
test(JAVA-6244): use primitive boolean for String/TextOptions sensiti…
nhachicha f39e5e2
docs(JAVA-6244): sync getQueryType javadoc, clarify @param and versio…
nhachicha d93d793
docs(JAVA-6244): make libmongocrypt signature-asset KDoc example vers…
nhachicha 97ad4a2
docs(JAVA-6244): fix stale gpg keyring comment in mongodb-crypt build
nhachicha 1791110
feat(JAVA-6244): mark GA String QE API stable (drop @Alpha)
nhachicha a97b8d2
test(JAVA-6244): gate substring cases on gaSupported only
nhachicha b8135a9
test(JAVA-6244): trim explanatory comments on substring ci-di cases 1…
nhachicha e452d7c
feat(JAVA-6244): address review - add StringOptions/TextOptions toStr…
nhachicha 0fc8bb7
Merge remote-tracking branch 'origin/main' into nh/qe/prefix
nhachicha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -68,3 +68,4 @@ driver-benchmarks/.factorypath | |
| # bin build directories | ||
| **/bin | ||
|
|
||
| docs/superpowers/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
192 changes: 192 additions & 0 deletions
192
driver-core/src/main/com/mongodb/client/model/vault/StringOptions.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,192 @@ | ||
| /* | ||
| * 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.lang.Nullable; | ||
| import org.bson.BsonDocument; | ||
|
|
||
| /** | ||
| * String options for a Queryable Encryption field that supports string queries (prefix, suffix, and substring). | ||
| * | ||
| * @since 5.9 | ||
| * @mongodb.server.release 8.2 | ||
| * @mongodb.driver.manual /core/queryable-encryption/ queryable encryption | ||
| */ | ||
| public class StringOptions { | ||
|
nhachicha marked this conversation as resolved.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note to reviewer: Class similar to
rozza marked this conversation as resolved.
|
||
| 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; | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return "StringOptions{" | ||
| + "caseSensitive=" + caseSensitive | ||
| + ", diacriticSensitive=" + diacriticSensitive | ||
| + ", prefixOptions=" + prefixOptions | ||
| + ", suffixOptions=" + suffixOptions | ||
| + ", substringOptions=" + substringOptions | ||
| + '}'; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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. | ||
| */ | ||
|
nhachicha marked this conversation as resolved.
nhachicha marked this conversation as resolved.
|
||
| @Deprecated | ||
| @Alpha(Reason.SERVER) | ||
| public class TextOptions { | ||
| private Boolean caseSensitive; | ||
| private Boolean diacriticSensitive; | ||
| private boolean caseSensitive; | ||
| private boolean diacriticSensitive; | ||
| @Nullable | ||
| private BsonDocument prefixOptions; | ||
| @Nullable | ||
|
|
@@ -184,4 +186,14 @@ public BsonDocument getSubstringOptions() { | |
| return substringOptions; | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| return "TextOptions{" | ||
| + "caseSensitive=" + caseSensitive | ||
| + ", diacriticSensitive=" + diacriticSensitive | ||
| + ", prefixOptions=" + prefixOptions | ||
| + ", suffixOptions=" + suffixOptions | ||
| + ", substringOptions=" + substringOptions | ||
| + '}'; | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.