Skip to content
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

DRIVERS-2310 Include encryptFields in expected FLE2 test command #1205

Merged
merged 3 commits into from
May 3, 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
158 changes: 150 additions & 8 deletions source/client-side-encryption/tests/fle2-CreateCollection.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,24 @@
{
"command_started_event": {
"command": {
"create": "encryptedCollection"
"create": "encryptedCollection",
"encryptedFields": {
"escCollection": "encryptedCollection.esc",
"eccCollection": "encryptedCollection.ecc",
"ecocCollection": "encryptedCollection.ecoc",
"fields": [
{
"path": "firstName",
"bsonType": "string",
"keyId": {
"$binary": {
"subType": "04",
"base64": "AAAAAAAAAAAAAAAAAAAAAA=="
}
}
}
]
}
},
"command_name": "create",
"database_name": "default"
Expand Down Expand Up @@ -343,7 +360,27 @@
{
"command_started_event": {
"command": {
"create": "encryptedCollection"
"create": "encryptedCollection",
"encryptedFields": {
"fields": [
{
"path": "firstName",
"bsonType": "string",
"keyId": {
"$binary": {
"subType": "04",
"base64": "AAAAAAAAAAAAAAAAAAAAAA=="
}
},
"queries": {
"queryType": "equality",
"contention": {
"$numberLong": "0"
}
}
}
]
}
},
"command_name": "create",
"database_name": "default"
Expand Down Expand Up @@ -563,7 +600,27 @@
{
"command_started_event": {
"command": {
"create": "encryptedCollection"
"create": "encryptedCollection",
"encryptedFields": {
"fields": [
{
"path": "firstName",
"bsonType": "string",
"keyId": {
"$binary": {
"subType": "04",
"base64": "AAAAAAAAAAAAAAAAAAAAAA=="
}
},
"queries": {
"queryType": "equality",
"contention": {
"$numberLong": "0"
}
}
}
]
}
},
"command_name": "create",
"database_name": "default"
Expand Down Expand Up @@ -793,7 +850,24 @@
{
"command_started_event": {
"command": {
"create": "encryptedCollection"
"create": "encryptedCollection",
"encryptedFields": {
"escCollection": "encryptedCollection.esc",
"eccCollection": "encryptedCollection.ecc",
"ecocCollection": "encryptedCollection.ecoc",
"fields": [
{
"path": "firstName",
"bsonType": "string",
"keyId": {
"$binary": {
"subType": "04",
"base64": "AAAAAAAAAAAAAAAAAAAAAA=="
}
}
}
]
}
},
"command_name": "create",
"database_name": "default"
Expand Down Expand Up @@ -1055,7 +1129,24 @@
{
"command_started_event": {
"command": {
"create": "encryptedCollection"
"create": "encryptedCollection",
"encryptedFields": {
"escCollection": "encryptedCollection.esc",
"eccCollection": "encryptedCollection.ecc",
"ecocCollection": "encryptedCollection.ecoc",
"fields": [
{
"path": "firstName",
"bsonType": "string",
"keyId": {
"$binary": {
"subType": "04",
"base64": "AAAAAAAAAAAAAAAAAAAAAA=="
}
}
}
]
}
},
"command_name": "create",
"database_name": "default"
Expand Down Expand Up @@ -1247,7 +1338,24 @@
{
"command_started_event": {
"command": {
"create": "encryptedCollection"
"create": "encryptedCollection",
"encryptedFields": {
"escCollection": "encryptedCollection.esc",
"eccCollection": "encryptedCollection.ecc",
"ecocCollection": "encryptedCollection.ecoc",
"fields": [
{
"path": "firstName",
"bsonType": "string",
"keyId": {
"$binary": {
"subType": "04",
"base64": "AAAAAAAAAAAAAAAAAAAAAA=="
}
}
}
]
}
},
"command_name": "create",
"database_name": "default"
Expand Down Expand Up @@ -1572,7 +1680,24 @@
{
"command_started_event": {
"command": {
"create": "encryptedCollection"
"create": "encryptedCollection",
"encryptedFields": {
"escCollection": "encryptedCollection.esc",
"eccCollection": "encryptedCollection.ecc",
"ecocCollection": "encryptedCollection.ecoc",
"fields": [
{
"path": "firstName",
"bsonType": "string",
"keyId": {
"$binary": {
"subType": "04",
"base64": "AAAAAAAAAAAAAAAAAAAAAA=="
}
}
}
]
}
},
"command_name": "create",
"database_name": "default"
Expand Down Expand Up @@ -1840,7 +1965,24 @@
{
"command_started_event": {
"command": {
"create": "encryptedCollection"
"create": "encryptedCollection",
"encryptedFields": {
"escCollection": "encryptedCollection.esc",
"eccCollection": "encryptedCollection.ecc",
"ecocCollection": "encryptedCollection.ecoc",
"fields": [
{
"path": "firstName",
"bsonType": "string",
"keyId": {
"$binary": {
"subType": "04",
"base64": "AAAAAAAAAAAAAAAAAAAAAA=="
}
}
}
]
}
},
"command_name": "create",
"database_name": "default"
Expand Down
24 changes: 16 additions & 8 deletions source/client-side-encryption/tests/fle2-CreateCollection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ tests:
kmsProviders:
aws: {} # Credentials filled in from environment.
encryptedFieldsMap:
default.encryptedCollection: {
default.encryptedCollection: &encrypted_fields0 {
"escCollection": "encryptedCollection.esc",
"eccCollection": "encryptedCollection.ecc",
"ecocCollection": "encryptedCollection.ecoc",
Expand Down Expand Up @@ -107,6 +107,7 @@ tests:
- command_started_event:
command:
create: "encryptedCollection"
encryptedFields: *encrypted_fields0
command_name: create
database_name: *database_name
# Index on __safeContents__ is then created.
Expand All @@ -125,7 +126,7 @@ tests:
kmsProviders:
aws: {} # Credentials filled in from environment.
encryptedFieldsMap:
default.encryptedCollection: {
default.encryptedCollection: &encrypted_fields1 {
"fields": [
{
"path": "firstName",
Expand Down Expand Up @@ -222,6 +223,7 @@ tests:
- command_started_event:
command:
create: "encryptedCollection"
encryptedFields: *encrypted_fields1
command_name: create
database_name: *database_name
# Index on __safeContents__ is then created.
Expand All @@ -240,7 +242,7 @@ tests:
kmsProviders:
aws: {} # Credentials filled in from environment.
encryptedFieldsMap:
default.encryptedCollection: {
default.encryptedCollection: &encrypted_fields2 {
"fields": [
{
"path": "firstName",
Expand Down Expand Up @@ -362,6 +364,7 @@ tests:
- command_started_event:
command:
create: "encryptedCollection"
encryptedFields: *encrypted_fields2
command_name: create
database_name: *database_name
# Index on __safeContents__ is then created.
Expand Down Expand Up @@ -404,7 +407,7 @@ tests:
encryptedFieldsMap:
# encryptedCollection has encryptedCollection.esc as the escCollection.
# encryptedCollection.esc has encryptedCollection as the escCollection.
default.encryptedCollection: {
default.encryptedCollection: &encrypted_fields3 {
"escCollection": "encryptedCollection.esc",
"eccCollection": "encryptedCollection.ecc",
"ecocCollection": "encryptedCollection.ecoc",
Expand Down Expand Up @@ -508,6 +511,7 @@ tests:
- command_started_event:
command:
create: "encryptedCollection"
encryptedFields: *encrypted_fields3
command_name: create
database_name: *database_name
# Index on __safeContents__ is then created.
Expand Down Expand Up @@ -580,7 +584,7 @@ tests:
kmsProviders:
aws: {} # Credentials filled in from environment.
encryptedFieldsMap:
default.encryptedCollection: {
default.encryptedCollection: &encrypted_fields4 {
"escCollection": "encryptedCollection.esc",
"eccCollection": "encryptedCollection.ecc",
"ecocCollection": "encryptedCollection.ecoc",
Expand Down Expand Up @@ -673,6 +677,7 @@ tests:
- command_started_event:
command:
create: "encryptedCollection"
encryptedFields: *encrypted_fields4
command_name: create
database_name: *database_name
# Index on __safeContents__ is then created.
Expand Down Expand Up @@ -712,7 +717,7 @@ tests:
object: database
arguments:
collection: "encryptedCollection"
encryptedFields: {
encryptedFields: &encrypted_fields5 {
"escCollection": "encryptedCollection.esc",
"eccCollection": "encryptedCollection.ecc",
"ecocCollection": "encryptedCollection.ecoc",
Expand Down Expand Up @@ -795,6 +800,7 @@ tests:
- command_started_event:
command:
create: "encryptedCollection"
encryptedFields: *encrypted_fields5
command_name: create
database_name: *database_name
# Index on __safeContents__ is then created.
Expand Down Expand Up @@ -924,7 +930,7 @@ tests:
object: database
arguments:
collection: "encryptedCollection"
encryptedFields: {
encryptedFields: &encrypted_fields6 {
"escCollection": "encryptedCollection.esc",
"eccCollection": "encryptedCollection.ecc",
"ecocCollection": "encryptedCollection.ecoc",
Expand Down Expand Up @@ -998,6 +1004,7 @@ tests:
- command_started_event:
command:
create: "encryptedCollection"
encryptedFields: *encrypted_fields6
command_name: create
database_name: *database_name
# Index on __safeContents__ is then created.
Expand Down Expand Up @@ -1062,7 +1069,7 @@ tests:
object: database
arguments:
collection: "encryptedCollection"
encryptedFields: {
encryptedFields: &encrypted_fields7 {
"escCollection": "encryptedCollection.esc",
"eccCollection": "encryptedCollection.ecc",
"ecocCollection": "encryptedCollection.ecoc",
Expand Down Expand Up @@ -1167,6 +1174,7 @@ tests:
- command_started_event:
command:
create: "encryptedCollection"
encryptedFields: *encrypted_fields7
command_name: create
database_name: *database_name
# Index on __safeContents__ is then created.
Expand Down