Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ public void create(final WriteConcern writeConcern, final BsonDocument createOpt
case "size":
createCollectionOptions.sizeInBytes(createOptions.getNumber("size").longValue());
break;
case "encryptedFields":
createCollectionOptions.encryptedFields(createOptions.getDocument("encryptedFields"));
break;
default:
throw new UnsupportedOperationException("Unsupported create collection option: " + option);
}
Expand Down
2 changes: 1 addition & 1 deletion driver-core/src/test/resources/specifications
Submodule specifications updated 20 files
+17 −1 .github/workflows/check_schema_version.sh
+219 −0 source/client-side-encryption/tests/unified/QE-Text-cleanupStructuredEncryptionData.json
+128 −0 source/client-side-encryption/tests/unified/QE-Text-cleanupStructuredEncryptionData.yml
+261 −0 source/client-side-encryption/tests/unified/QE-Text-compactStructuredEncryptionData.json
+137 −0 source/client-side-encryption/tests/unified/QE-Text-compactStructuredEncryptionData.yml
+338 −0 source/client-side-encryption/tests/unified/QE-Text-prefixPreview.json
+225 −0 source/client-side-encryption/tests/unified/QE-Text-prefixPreview.yml
+551 −0 source/client-side-encryption/tests/unified/QE-Text-substringPreview.json
+472 −0 source/client-side-encryption/tests/unified/QE-Text-substringPreview.yml
+338 −0 source/client-side-encryption/tests/unified/QE-Text-suffixPreview.json
+221 −0 source/client-side-encryption/tests/unified/QE-Text-suffixPreview.yml
+12 −0 source/faas-automated-testing/faas-automated-testing.md
+1,177 −0 source/unified-test-format/schema-1.25.json
+15 −1 source/unified-test-format/schema-latest.json
+27 −27 source/unified-test-format/tests/Makefile
+17 −0 source/unified-test-format/tests/invalid/runOnRequirement-csfle-minLibmongocryptVersion-pattern.json
+11 −0 source/unified-test-format/tests/invalid/runOnRequirement-csfle-minLibmongocryptVersion-pattern.yml
+17 −0 source/unified-test-format/tests/invalid/runOnRequirement-csfle-minLibmongocryptVersion-type.json
+11 −0 source/unified-test-format/tests/invalid/runOnRequirement-csfle-minLibmongocryptVersion-type.yml
+15 −4 source/unified-test-format/unified-test-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.mongodb.client.unified;

import com.mongodb.AutoEncryptionSettings;
import com.mongodb.ClientEncryptionSettings;
import com.mongodb.ClientSessionOptions;
import com.mongodb.ConnectionString;
Expand Down Expand Up @@ -87,8 +88,8 @@
public final class Entities {
private static final Set<String> SUPPORTED_CLIENT_ENTITY_OPTIONS = new HashSet<>(
asList(
"id", "uriOptions", "serverApi", "useMultipleMongoses", "observeEvents",
"observeLogMessages", "observeSensitiveCommands", "ignoreCommandMonitoringEvents"));
"id", "autoEncryptOpts", "uriOptions", "serverApi", "useMultipleMongoses", "storeEventsAsEntities",
"observeEvents", "observeLogMessages", "observeSensitiveCommands", "ignoreCommandMonitoringEvents"));
private final Set<String> entityNames = new HashSet<>();
private final Map<String, ExecutorService> threads = new HashMap<>();
private final Map<String, ArrayList<Future<?>>> tasks = new HashMap<>();
Expand Down Expand Up @@ -499,6 +500,59 @@ private void initClient(final BsonDocument entity, final String id,
}
clientSettingsBuilder.serverApi(serverApiBuilder.build());
}
if (entity.containsKey("autoEncryptOpts")) {
AutoEncryptionSettings.Builder builder = AutoEncryptionSettings.builder();
for (Map.Entry<String, BsonValue> entry : entity.getDocument("autoEncryptOpts").entrySet()) {
switch (entry.getKey()) {
case "bypassAutoEncryption":
builder.bypassAutoEncryption(entry.getValue().asBoolean().getValue());
break;
case "bypassQueryAnalysis":
builder.bypassQueryAnalysis(entry.getValue().asBoolean().getValue());
break;
case "schemaMap":
Map<String, BsonDocument> schemaMap = new HashMap<>();
for (Map.Entry<String, BsonValue> entries : entry.getValue().asDocument().entrySet()) {
schemaMap.put(entries.getKey(), entries.getValue().asDocument());
}
builder.schemaMap(schemaMap);
break;
case "encryptedFieldsMap":
Map<String, BsonDocument> encryptedFieldsMap = new HashMap<>();
for (Map.Entry<String, BsonValue> entries : entry.getValue().asDocument().entrySet()) {
encryptedFieldsMap.put(entries.getKey(), entries.getValue().asDocument());
}
builder.encryptedFieldsMap(encryptedFieldsMap);
break;
case "extraOptions":
Map<String, Object> extraOptions = new HashMap<>();
for (Map.Entry<String, BsonValue> extraOptionsEntry : entry.getValue().asDocument().entrySet()) {
switch (extraOptionsEntry.getKey()) {
case "mongocryptdBypassSpawn":
extraOptions.put(extraOptionsEntry.getKey(), extraOptionsEntry.getValue().asBoolean().getValue());
break;
default:
throw new UnsupportedOperationException("Unsupported extra encryption option: " + extraOptionsEntry.getKey());
}
}
builder.extraOptions(extraOptions);
break;
case "keyVaultNamespace":
builder.keyVaultNamespace(entry.getValue().asString().getValue());
break;
case "kmsProviders":
builder.kmsProviders(createKmsProvidersMap(entry.getValue().asDocument()));
break;
case "keyExpirationMS":
builder.keyExpiration(entry.getValue().asNumber().longValue(), TimeUnit.MILLISECONDS);
break;
default:
throw new UnsupportedOperationException("Unsupported client encryption option: " + entry.getKey());
}
}
clientSettingsBuilder.autoEncryptionSettings(builder.build());
}

MongoClientSettings clientSettings = clientSettingsBuilder.build();

if (entity.containsKey("observeLogMessages")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public abstract class UnifiedTest {
private static final Set<String> PRESTART_POOL_ASYNC_WORK_MANAGER_FILE_DESCRIPTIONS = Collections.singleton(
"wait queue timeout errors include details about checked out connections");

private static final String MAX_SUPPORTED_SCHEMA_VERSION = "1.22";
private static final String MAX_SUPPORTED_SCHEMA_VERSION = "1.23";
private static final List<Integer> MAX_SUPPORTED_SCHEMA_VERSION_COMPONENTS = Arrays.stream(MAX_SUPPORTED_SCHEMA_VERSION.split("\\."))
.map(Integer::parseInt)
.collect(Collectors.toList());
Expand Down