Skip to content

CDRIVER-4317 Add support for clientEncryption entity in unified test runner #975

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 14 commits into from
Apr 27, 2022
Merged
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
16 changes: 16 additions & 0 deletions src/libmongoc/tests/bsonutil/bson-match.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,20 @@ is_special_match (const bson_t *bson)
return true;
}

/* implements $$placeholder */
static bool
special_placeholder (bson_matcher_t *matcher,
const bson_t *assertion,
const bson_val_t *actual,
void *ctx,
const char *path,
bson_error_t *error)
{
/* Nothing to do (not an operator, just a reserved key value). The meaning
* and corresponding behavior of $$placeholder depends on context. */
return true;
}

/* implements $$exists */
static bool
special_exists (bson_matcher_t *matcher,
Expand Down Expand Up @@ -300,6 +314,8 @@ bson_matcher_new ()
{
bson_matcher_t *matcher = bson_malloc0 (sizeof (bson_matcher_t));
/* Add default special functions. */
bson_matcher_add_special (
matcher, "$$placeholder", special_placeholder, NULL);
bson_matcher_add_special (matcher, "$$exists", special_exists, NULL);
bson_matcher_add_special (matcher, "$$type", special_type, NULL);
bson_matcher_add_special (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"description": "kmsProviders-explicit_kms_credentials",
"schemaVersion": "1.8",
"runOnRequirements": [
{
"csfle": true
}
],
"createEntities": [
{
"client": {
"id": "client0"
}
},
{
"clientEncryption": {
"id": "clientEncryption0",
"clientEncryptionOpts": {
"keyVaultClient": "client0",
"keyVaultNamespace": "keyvault.datakeys",
"kmsProviders": {
"aws": {
"accessKeyId": "accessKeyId",
"secretAccessKey": "secretAccessKey"
},
"azure": {
"tenantId": "tenantId",
"clientId": "clientId",
"clientSecret": "clientSecret"
},
"gcp": {
"email": "email",
"privateKey": "cHJpdmF0ZUtleQo="
},
"kmip": {
"endpoint": "endpoint"
},
"local": {
"key": "a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5"
}
}
}
}
}
],
"tests": [
{
"description": "",
"operations": []
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"description": "kmsProviders-mixed_kms_credential_fields",
"schemaVersion": "1.8",
"runOnRequirements": [
{
"csfle": true
}
],
"createEntities": [
{
"client": {
"id": "client0"
}
},
{
"clientEncryption": {
"id": "clientEncryption0",
"clientEncryptionOpts": {
"keyVaultClient": "client0",
"keyVaultNamespace": "keyvault.datakeys",
"kmsProviders": {
"aws": {
"accessKeyId": "accessKeyId",
"secretAccessKey": {
"$$placeholder": 1
}
},
"azure": {
"tenantId": "tenantId",
"clientId": {
"$$placeholder": 1
},
"clientSecret": {
"$$placeholder": 1
}
},
"gcp": {
"email": "email",
"privateKey": {
"$$placeholder": 1
}
}
}
}
}
}
],
"tests": [
{
"description": "",
"operations": []
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"description": "kmsProviders-placeholder_kms_credentials",
"schemaVersion": "1.8",
"runOnRequirements": [
{
"csfle": true
}
],
"createEntities": [
{
"client": {
"id": "client0"
}
},
{
"clientEncryption": {
"id": "clientEncryption0",
"clientEncryptionOpts": {
"keyVaultClient": "client0",
"keyVaultNamespace": "keyvault.datakeys",
"kmsProviders": {
"aws": {
"accessKeyId": {
"$$placeholder": 1
},
"secretAccessKey": {
"$$placeholder": 1
}
},
"azure": {
"tenantId": {
"$$placeholder": 1
},
"clientId": {
"$$placeholder": 1
},
"clientSecret": {
"$$placeholder": 1
}
},
"gcp": {
"email": {
"$$placeholder": 1
},
"privateKey": {
"$$placeholder": 1
}
},
"kmip": {
"endpoint": {
"$$placeholder": 1
}
},
"local": {
"key": {
"$$placeholder": 1
}
}
}
}
}
}
],
"tests": [
{
"description": "",
"operations": []
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"description": "kmsProviders-unconfigured_kms",
"schemaVersion": "1.8",
"runOnRequirements": [
{
"csfle": true
}
],
"createEntities": [
{
"client": {
"id": "client0"
}
},
{
"clientEncryption": {
"id": "clientEncryption0",
"clientEncryptionOpts": {
"keyVaultClient": "client0",
"keyVaultNamespace": "keyvault.datakeys",
"kmsProviders": {
"aws": {},
"azure": {},
"gcp": {},
"kmip": {},
"local": {}
}
}
}
}
],
"tests": [
{
"description": "",
"operations": []
}
]
}
Loading