-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
54eff94
commit ec411e3
Showing
3 changed files
with
406 additions
and
0 deletions.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
source/client-side-encryption/etc/test-templates/keyCache.yml.template
This file contains 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,68 @@ | ||
runOn: | ||
- minServerVersion: "4.1.10" | ||
database_name: &database_name "default" | ||
collection_name: &collection_name "default" | ||
|
||
data: [] | ||
json_schema: {{schema()}} | ||
key_vault_data: [{{key()}}] | ||
|
||
tests: | ||
- description: "Insert with deterministic encryption, then find it" | ||
clientOptions: | ||
autoEncryptOpts: | ||
kmsProviders: | ||
aws: {} # Credentials filled in from environment. | ||
keyExpirationMS: 1 | ||
operations: | ||
- name: insertOne | ||
arguments: | ||
document: &doc0 { _id: 1, encrypted_string: "string0" } | ||
- name: wait | ||
object: testRunner | ||
arguments: | ||
ms: 2 | ||
- name: find | ||
arguments: | ||
filter: { _id: 1 } | ||
result: [*doc0] | ||
expectations: | ||
# Auto encryption will request the collection info. | ||
- command_started_event: | ||
command: | ||
listCollections: 1 | ||
filter: | ||
name: *collection_name | ||
command_name: listCollections | ||
# Then key is fetched from the key vault. | ||
- command_started_event: | ||
command: | ||
find: datakeys | ||
filter: {"$or": [{"_id": {"$in": [ {{key()["_id"]}} ] }}, {"keyAltNames": {"$in": []}}]} | ||
$db: keyvault | ||
readConcern: { level: "majority" } | ||
command_name: find | ||
- command_started_event: | ||
command: | ||
insert: *collection_name | ||
documents: | ||
- &doc0_encrypted { _id: 1, encrypted_string: {{ciphertext("string0", field="encrypted_string")}} } | ||
ordered: true | ||
command_name: insert | ||
- command_started_event: | ||
command: | ||
find: *collection_name | ||
filter: { _id: 1 } | ||
command_name: find | ||
- command_started_event: | ||
command: | ||
find: datakeys | ||
filter: {"$or": [{"_id": {"$in": [ {{key()["_id"]}} ] }}, {"keyAltNames": {"$in": []}}]} | ||
$db: keyvault | ||
readConcern: { level: "majority" } | ||
command_name: find | ||
outcome: | ||
collection: | ||
# Outcome is checked using a separate MongoClient without auto encryption. | ||
data: | ||
- *doc0_encrypted |
270 changes: 270 additions & 0 deletions
270
source/client-side-encryption/tests/legacy/keyCache.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.