File: getKeys.yml

package info (click to toggle)
ruby-mongo 2.23.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,020 kB
  • sloc: ruby: 110,810; makefile: 5
file content (122 lines) | stat: -rw-r--r-- 3,640 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
description: getKeys

schemaVersion: "1.8"

runOnRequirements:
  - csfle: true

createEntities:
  - client:
      id: &client0 client0
      observeEvents:
        - commandStartedEvent
  - clientEncryption:
      id: &clientEncryption0 clientEncryption0
      clientEncryptionOpts:
        keyVaultClient: *client0
        keyVaultNamespace: keyvault.datakeys
        kmsProviders:
          local: { key: { $$placeholder: 1 } }
  - database:
      id: &database0 database0
      client: *client0
      databaseName: &database0Name keyvault
  - collection:
      id: &collection0 collection0
      database: *database0
      collectionName: &collection0Name datakeys

initialData:
  - databaseName: *database0Name
    collectionName: *collection0Name
    documents: []

tests:
  - description: getKeys with zero key documents
    operations:
      - name: getKeys
        object: *clientEncryption0
        expectResult: []
    expectEvents:
      - client: *client0
        events:
          - commandStartedEvent:
              databaseName: *database0Name
              command:
                find: *collection0Name
                filter: {}
                readConcern: { level: majority }

  - description: getKeys with single key documents
    operations:
      - name: createDataKey
        object: *clientEncryption0
        arguments:
          kmsProvider: local
          opts:
            keyAltNames: ["abc"]
        expectResult: { $$type: binData }
      - name: getKeys
        object: *clientEncryption0
        expectResult:
          - _id: { $$type: binData }
            keyAltNames: ["abc"]
            keyMaterial: { $$type: binData }
            creationDate: { $$type: date }
            updateDate: { $$type: date }
            status: { $$type: int }
            masterKey: { $$type: object }
    expectEvents:
      - client: *client0
        events:
          - commandStartedEvent:
              commandName: insert
          - commandStartedEvent:
              databaseName: *database0Name
              command:
                find: *collection0Name
                filter: {}
                readConcern: { level: majority }

  - description: getKeys with many key documents
    operations:
      - name: createDataKey
        object: *clientEncryption0
        arguments:
          kmsProvider: local
        expectResult: { $$type: binData }
      - name: createDataKey
        object: *clientEncryption0
        arguments:
          kmsProvider: local
        expectResult: { $$type: binData }
      - name: getKeys
        object: *clientEncryption0
        expectResult:
          # Cannot expect deterministic order of results, so only assert that
          # exactly two key documents are returned.
          - _id: { $$type: binData }
            keyMaterial: { $$type: binData }
            creationDate: { $$type: date }
            updateDate: { $$type: date }
            status: { $$type: int }
            masterKey: { $$type: object }
          - _id: { $$type: binData }
            keyMaterial: { $$type: binData }
            creationDate: { $$type: date }
            updateDate: { $$type: date }
            status: { $$type: int }
            masterKey: { $$type: object }
    expectEvents:
      - client: *client0
        events:
          - commandStartedEvent:
              commandName: insert
          - commandStartedEvent:
              commandName: insert
          - commandStartedEvent:
              databaseName: *database0Name
              command:
                find: *collection0Name
                filter: {}
                readConcern: { level: majority }