-
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.
DRIVERS-2781 Add option to configure DEK cache lifetime (#1730)
- Loading branch information
1 parent
da04aff
commit ecce2ec
Showing
9 changed files
with
1,818 additions
and
1 deletion.
There are no files selected for viewing
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
69 changes: 69 additions & 0 deletions
69
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,69 @@ | ||
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 | ||
# The cache has expired and the key must be fetched again | ||
- 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.