libmongocrypt-helper 1.8.0.0.1001 → 1.11.0.0.1001

Sign up to get free protection for your applications and to get access to all the features.
Files changed (385) hide show
  1. checksums.yaml +4 -4
  2. data/ext/libmongocrypt/libmongocrypt/CHANGELOG.md +33 -0
  3. data/ext/libmongocrypt/libmongocrypt/CMakeLists.txt +12 -1
  4. data/ext/libmongocrypt/libmongocrypt/CODEOWNERS +1 -4
  5. data/ext/libmongocrypt/libmongocrypt/Earthfile +151 -3
  6. data/ext/libmongocrypt/libmongocrypt/README.md +36 -40
  7. data/ext/libmongocrypt/libmongocrypt/bindings/cs/CMakeLists.txt +1 -0
  8. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Driver.snk +0 -0
  9. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/AssemblyInfo.cs +2 -2
  10. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/Binary.cs +16 -2
  11. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CryptClientFactory.cs +8 -4
  12. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/Library.cs +10 -0
  13. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/LibraryLoader.cs +81 -44
  14. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/MongoDB.Libmongocrypt.csproj +2 -1
  15. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/MongoDB.Libmongocrypt.Test.csproj +2 -0
  16. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test32/MongoDB.Libmongocrypt.Test32.csproj +2 -0
  17. data/ext/libmongocrypt/libmongocrypt/bindings/cs/README.md +3 -0
  18. data/ext/libmongocrypt/libmongocrypt/bindings/cs/Scripts/build.cake +21 -26
  19. data/ext/libmongocrypt/libmongocrypt/bindings/cs/Scripts/build.config +3 -0
  20. data/ext/libmongocrypt/libmongocrypt/bindings/cs/Scripts/build.sh +0 -0
  21. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/benchmarks/build.gradle.kts +28 -0
  22. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/benchmarks/src/main/java/com/mongodb/crypt/benchmark/BenchmarkRunner.java +217 -0
  23. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/benchmarks/src/main/resources/keyDocument.json +24 -0
  24. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/build.gradle.kts +21 -6
  25. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/gradle/wrapper/gradle-wrapper.jar +0 -0
  26. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/gradle/wrapper/gradle-wrapper.properties +1 -1
  27. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/gradlew +154 -108
  28. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/gradlew.bat +7 -18
  29. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/settings.gradle.kts +1 -0
  30. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/CAPI.java +41 -6
  31. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/CAPIHelper.java +5 -5
  32. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/CipherCallback.java +27 -1
  33. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoCryptImpl.java +34 -19
  34. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoExplicitEncryptOptions.java +6 -4
  35. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/resources/META-INF/native-image/jni-config.json +180 -0
  36. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/resources/META-INF/native-image/reflect-config.json +134 -0
  37. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/java/com/mongodb/crypt/capi/MongoCryptTest.java +44 -2
  38. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit-v2/int32/encrypted-payload.json +1 -1
  39. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit-v2/int32/rangeopts.json +3 -0
  40. data/ext/libmongocrypt/libmongocrypt/bindings/node/README.md +4 -900
  41. data/ext/libmongocrypt/libmongocrypt/bindings/python/CHANGELOG.rst +60 -0
  42. data/ext/libmongocrypt/libmongocrypt/bindings/python/README.rst +41 -20
  43. data/ext/libmongocrypt/libmongocrypt/bindings/python/RELEASE.rst +6 -24
  44. data/ext/libmongocrypt/libmongocrypt/bindings/python/build-manylinux-wheel.sh +4 -13
  45. data/ext/libmongocrypt/libmongocrypt/bindings/python/hatch_build.py +36 -0
  46. data/ext/libmongocrypt/libmongocrypt/bindings/python/libmongocrypt-version.txt +1 -0
  47. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/__init__.py +2 -2
  48. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/asynchronous/auto_encrypter.py +61 -0
  49. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/asynchronous/credentials.py +156 -0
  50. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/asynchronous/explicit_encrypter.py +156 -0
  51. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/asynchronous/state_machine.py +149 -0
  52. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/auto_encrypter.py +2 -46
  53. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/binary.py +14 -17
  54. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/binding.py +107 -61
  55. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/compat.py +6 -4
  56. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/credentials.py +2 -121
  57. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/crypto.py +31 -20
  58. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/errors.py +2 -2
  59. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/explicit_encrypter.py +2 -233
  60. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/mongocrypt.py +168 -238
  61. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/options.py +265 -0
  62. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/state_machine.py +2 -141
  63. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/synchronous/auto_encrypter.py +61 -0
  64. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/synchronous/credentials.py +156 -0
  65. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/synchronous/explicit_encrypter.py +156 -0
  66. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/synchronous/state_machine.py +149 -0
  67. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/version.py +2 -2
  68. data/ext/libmongocrypt/libmongocrypt/bindings/python/pyproject.toml +118 -0
  69. data/ext/libmongocrypt/libmongocrypt/bindings/python/release.sh +97 -61
  70. data/ext/libmongocrypt/libmongocrypt/bindings/python/{test-requirements.txt → requirements-test.txt} +4 -1
  71. data/ext/libmongocrypt/libmongocrypt/bindings/python/requirements.txt +4 -0
  72. data/ext/libmongocrypt/libmongocrypt/bindings/python/sbom.json +76 -0
  73. data/ext/libmongocrypt/libmongocrypt/bindings/python/strip_header.py +6 -7
  74. data/ext/libmongocrypt/libmongocrypt/bindings/python/synchro.py +64 -0
  75. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/__init__.py +1 -0
  76. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/collection-info.json +1 -1
  77. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/command.json +1 -1
  78. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/compact/success/encrypted-payload.json +21 -21
  79. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/encrypted-command-reply.json +1 -1
  80. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/encrypted-field-config-map.json +1 -1
  81. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/fle2-find-range-explicit-v2/int32/encrypted-payload.json +1 -1
  82. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/fle2-find-range-explicit-v2/int32/rangeopts.json +3 -0
  83. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/fle2-find-rangePreview-explicit/int32/rangeopts.json +11 -0
  84. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/fle2-find-rangePreview-explicit/int32/value-to-encrypt.json +20 -0
  85. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/key-document-azure.json +1 -1
  86. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/key-document-gcp.json +1 -1
  87. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/key-document.json +1 -1
  88. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/key-filter.json +1 -1
  89. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/list-collections-filter.json +1 -1
  90. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/mongocryptd-command.json +1 -1
  91. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/mongocryptd-reply.json +1 -1
  92. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/schema-map.json +1 -1
  93. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/performance/keyDocument.json +24 -0
  94. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/performance/perf_test.py +165 -0
  95. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/test_binding.py +8 -12
  96. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/test_crypto.py +9 -11
  97. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/test_mongocrypt.py +988 -340
  98. data/ext/libmongocrypt/libmongocrypt/bindings/python/update-sbom.sh +14 -0
  99. data/ext/libmongocrypt/libmongocrypt/cmake/FetchMongoC.cmake +19 -1
  100. data/ext/libmongocrypt/libmongocrypt/cmake/ImportBSON.cmake +23 -0
  101. data/ext/libmongocrypt/libmongocrypt/cmake/IntelDFP.cmake +19 -227
  102. data/ext/libmongocrypt/libmongocrypt/cmake/Patch.cmake +54 -0
  103. data/ext/libmongocrypt/libmongocrypt/doc/img/cli-icon.png +0 -0
  104. data/ext/libmongocrypt/libmongocrypt/doc/img/reference-targets.png +0 -0
  105. data/ext/libmongocrypt/libmongocrypt/doc/releasing.md +153 -0
  106. data/ext/libmongocrypt/libmongocrypt/etc/calc_release_version.py +61 -28
  107. data/ext/libmongocrypt/libmongocrypt/etc/calc_release_version_selftest.sh +73 -0
  108. data/ext/libmongocrypt/libmongocrypt/etc/cyclonedx.sbom.json +108 -0
  109. data/ext/libmongocrypt/libmongocrypt/etc/format.sh +1 -1
  110. data/ext/libmongocrypt/libmongocrypt/etc/libbson-remove-GCC-diagnostic-pragma.patch +27 -0
  111. data/ext/libmongocrypt/libmongocrypt/etc/mongo-inteldfp-alpine-arm-fix.patch +17 -0
  112. data/ext/libmongocrypt/libmongocrypt/etc/packager.py +120 -91
  113. data/ext/libmongocrypt/libmongocrypt/etc/purls.txt +14 -0
  114. data/ext/libmongocrypt/libmongocrypt/etc/repo_config.yaml +56 -0
  115. data/ext/libmongocrypt/libmongocrypt/etc/silk-create-asset-group.sh +70 -0
  116. data/ext/libmongocrypt/libmongocrypt/etc/ssdlc_compliance_report.md +37 -0
  117. data/ext/libmongocrypt/libmongocrypt/etc/third_party_vulnerabilities.md +42 -0
  118. data/ext/libmongocrypt/libmongocrypt/integrating.md +18 -1
  119. data/ext/libmongocrypt/libmongocrypt/kms-message/CMakeLists.txt +11 -3
  120. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_gcp_request.c +1 -1
  121. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_reader_writer.c +17 -0
  122. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_reader_writer_private.h +6 -0
  123. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_request.c +211 -1
  124. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_response.c +163 -0
  125. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_tag_type_private.h +2 -1
  126. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_kmip_request.h +17 -0
  127. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_kmip_response.h +6 -0
  128. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_port.c +3 -2
  129. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_request.c +4 -2
  130. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_request_str.c +2 -2
  131. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kmip_reader_writer.c +23 -2
  132. data/ext/libmongocrypt/libmongocrypt/src/crypto/libcrypto.c +13 -10
  133. data/ext/libmongocrypt/libmongocrypt/src/mc-dec128.h +1 -1
  134. data/ext/libmongocrypt/libmongocrypt/src/mc-efc-private.h +16 -2
  135. data/ext/libmongocrypt/libmongocrypt/src/mc-efc.c +94 -6
  136. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-encryption-placeholder-private.h +15 -5
  137. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-encryption-placeholder.c +114 -53
  138. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload-private-v2.h +1 -1
  139. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload-private.h +1 -1
  140. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload-v2.c +2 -2
  141. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload.c +2 -2
  142. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload-private-v2.h +21 -6
  143. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload-private.h +5 -5
  144. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload-v2.c +38 -2
  145. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload.c +1 -1
  146. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-private-v2.h +20 -7
  147. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-private.h +8 -8
  148. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-v2.c +89 -1
  149. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev-v2.c +3 -3
  150. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev.c +1 -23
  151. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-rfds-private.h +4 -3
  152. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-rfds.c +15 -12
  153. data/ext/libmongocrypt/libmongocrypt/src/mc-optional-private.h +11 -0
  154. data/ext/libmongocrypt/libmongocrypt/src/mc-range-edge-generation-private.h +16 -6
  155. data/ext/libmongocrypt/libmongocrypt/src/mc-range-edge-generation.c +64 -22
  156. data/ext/libmongocrypt/libmongocrypt/src/mc-range-encoding-private.h +23 -4
  157. data/ext/libmongocrypt/libmongocrypt/src/mc-range-encoding.c +359 -65
  158. data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover-generator.template.h +26 -14
  159. data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover-private.h +17 -6
  160. data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover.c +31 -13
  161. data/ext/libmongocrypt/libmongocrypt/src/mc-rangeopts-private.h +16 -3
  162. data/ext/libmongocrypt/libmongocrypt/src/mc-rangeopts.c +259 -63
  163. data/ext/libmongocrypt/libmongocrypt/src/mc-tokens-private.h +40 -24
  164. data/ext/libmongocrypt/libmongocrypt/src/mc-tokens.c +57 -13
  165. data/ext/libmongocrypt/libmongocrypt/src/mlib/int128.h +17 -0
  166. data/ext/libmongocrypt/libmongocrypt/src/mlib/int128.test.cpp +5 -0
  167. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-binary-private.h +0 -5
  168. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-buffer.c +5 -7
  169. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-key.c +1 -0
  170. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-oauth-private.h +16 -18
  171. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-oauth.c +105 -76
  172. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-crypto.c +9 -3
  173. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-datakey.c +170 -89
  174. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-decrypt.c +5 -5
  175. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-encrypt.c +505 -124
  176. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-private.h +31 -6
  177. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx.c +81 -13
  178. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-dll-private.h +7 -0
  179. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kek-private.h +5 -1
  180. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kek.c +161 -103
  181. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-broker-private.h +2 -7
  182. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-broker.c +191 -69
  183. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key.c +1 -1
  184. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kms-ctx-private.h +50 -15
  185. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kms-ctx.c +365 -69
  186. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-marking-private.h +2 -1
  187. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-marking.c +200 -107
  188. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-opts-private.h +50 -5
  189. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-opts.c +591 -15
  190. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-private.h +6 -13
  191. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-util.c +3 -2
  192. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt.c +47 -234
  193. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt.h +75 -24
  194. data/ext/libmongocrypt/libmongocrypt/src/os_posix/os_dll.c +18 -2
  195. data/ext/libmongocrypt/libmongocrypt/src/os_win/os_dll.c +4 -0
  196. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/bypassQueryAnalysis/payload.json +53 -0
  197. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/jsonSchema/cmd-to-mongocryptd.json +23 -0
  198. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/jsonSchema/cmd.json +20 -0
  199. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/simple/cmd-to-mongocryptd.json +50 -0
  200. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/simple/cmd.json +20 -0
  201. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/simple/collinfo.json +44 -0
  202. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/simple/encrypted-field-map.json +24 -0
  203. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/simple/encrypted-payload-pattern.json +53 -0
  204. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/simple/mongocryptd-reply.json +62 -0
  205. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/unencrypted/cmd-to-mongocryptd.json +30 -0
  206. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/unencrypted/cmd.json +17 -0
  207. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/unencrypted/mongocryptd-reply.json +39 -0
  208. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/unencrypted/payload.json +21 -0
  209. data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/missing-key-id/collinfo.json +20 -0
  210. data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/no-fields/collinfo.json +9 -0
  211. data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/no-fields/encrypted-payload.json +4 -0
  212. data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/success/cmd.json +1 -0
  213. data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/success/collinfo.json +63 -0
  214. data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/success/encrypted-field-config-map.json +61 -0
  215. data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/success/encrypted-payload-range-v2.json +37 -0
  216. data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/success/encrypted-payload.json +29 -0
  217. data/ext/libmongocrypt/libmongocrypt/test/data/compact/anchor-pad/cmd.json +1 -0
  218. data/ext/libmongocrypt/libmongocrypt/test/data/compact/anchor-pad/collinfo.json +64 -0
  219. data/ext/libmongocrypt/libmongocrypt/test/data/compact/anchor-pad/encrypted-payload-range-v2.json +105 -0
  220. data/ext/libmongocrypt/libmongocrypt/test/data/compact/anchor-pad/encrypted-payload.json +30 -0
  221. data/ext/libmongocrypt/libmongocrypt/test/data/compact/no-range/cmd.json +1 -0
  222. data/ext/libmongocrypt/libmongocrypt/test/data/compact/no-range/collinfo.json +49 -0
  223. data/ext/libmongocrypt/libmongocrypt/test/data/compact/no-range/encrypted-field-config-map.json +47 -0
  224. data/ext/libmongocrypt/libmongocrypt/test/data/compact/no-range/encrypted-payload.json +23 -0
  225. data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/collinfo.json +15 -0
  226. data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/encrypted-field-config-map.json +10 -0
  227. data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/encrypted-payload-range-v2.json +104 -0
  228. data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/encrypted-payload.json +6 -0
  229. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-csfle/collinfo.json +4 -4
  230. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-csfle/encrypted-payload.json +3 -3
  231. data/ext/libmongocrypt/libmongocrypt/test/data/kms-azure/decrypt-response.txt +16 -0
  232. data/ext/libmongocrypt/libmongocrypt/test/data/kms-azure/encrypt-response.txt +16 -0
  233. data/ext/libmongocrypt/libmongocrypt/test/data/kms-azure/oauth-response.txt +19 -0
  234. data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/find/cmd.json +9 -0
  235. data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/find/encrypted-field-map.json +19 -0
  236. data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/find/encrypted-payload.json +62 -0
  237. data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/find/mongocryptd-reply.json +69 -0
  238. data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/insert/cmd.json +11 -0
  239. data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/insert/encrypted-field-map.json +19 -0
  240. data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/insert/encrypted-payload.json +40 -0
  241. data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/insert/mongocryptd-reply.json +47 -0
  242. data/ext/libmongocrypt/libmongocrypt/test/data/range-edge-generation/edges_decimal128.cstruct +1 -1
  243. data/ext/libmongocrypt/libmongocrypt/test/data/range-edge-generation/edges_double.cstruct +8637 -7958
  244. data/ext/libmongocrypt/libmongocrypt/test/data/range-edge-generation/edges_int32.cstruct +5522 -1382
  245. data/ext/libmongocrypt/libmongocrypt/test/data/range-edge-generation/edges_int64.cstruct +5042 -1262
  246. data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_decimal128.cstruct +1 -1
  247. data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_decimal128_precision.cstruct +1 -1
  248. data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_double.cstruct +1 -1
  249. data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_double_precision.cstruct +2 -2
  250. data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_int32.cstruct +1 -1
  251. data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_int64.cstruct +1 -1
  252. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-find-int32/cmd.json +8 -0
  253. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-find-int32/encrypted-field-map.json +19 -0
  254. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-find-int32/encrypted-payload.json +53 -0
  255. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-find-int32/mongocryptd-reply.json +58 -0
  256. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-insert-int32/cmd.json +11 -0
  257. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-insert-int32/encrypted-field-map.json +19 -0
  258. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-insert-int32/encrypted-payload.json +40 -0
  259. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-insert-int32/mongocryptd-reply.json +45 -0
  260. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/explicit-find-int32/expected.json +26 -0
  261. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/explicit-find-int32/to-encrypt.json +20 -0
  262. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/explicit-find-int32-defaults/expected.json +26 -0
  263. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/explicit-find-int32-defaults/to-encrypt.json +20 -0
  264. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/explicit-insert-double/expected.json +8 -0
  265. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/explicit-insert-int32/expected.json +8 -0
  266. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/explicit-insert-int32-defaults/expected.json +8 -0
  267. data/ext/libmongocrypt/libmongocrypt/test/data/tokens/README.md +7 -4
  268. data/ext/libmongocrypt/libmongocrypt/test/data/tokens/mc.json +9 -5
  269. data/ext/libmongocrypt/libmongocrypt/test/data/tokens/server.json +9 -5
  270. data/ext/libmongocrypt/libmongocrypt/test/example-state-machine.c +1 -0
  271. data/ext/libmongocrypt/libmongocrypt/test/test-gcp-auth.c +8 -8
  272. data/ext/libmongocrypt/libmongocrypt/test/test-mc-efc.c +6 -4
  273. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-find-range-payload-v2.c +43 -3
  274. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iup-v2.c +76 -0
  275. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-rfds.c +5 -5
  276. data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-edge-generation.c +89 -14
  277. data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-encoding.c +342 -76
  278. data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-mincover.c +94 -12
  279. data/ext/libmongocrypt/libmongocrypt/test/test-mc-rangeopts.c +205 -7
  280. data/ext/libmongocrypt/libmongocrypt/test/test-mc-tokens.c +49 -23
  281. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert-match-bson.c +16 -19
  282. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert-match-bson.h +22 -1
  283. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-cache-oauth.c +94 -11
  284. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-cleanup.c +374 -0
  285. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-compact.c +121 -42
  286. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-hooks.c +134 -4
  287. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-std-hooks.c +40 -0
  288. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-std-hooks.h +16 -0
  289. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-csfle-lib.c +11 -11
  290. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-decrypt.c +8 -5
  291. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-encrypt.c +922 -92
  292. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-rewrap-many-datakey.c +2 -2
  293. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-setopt.c +114 -12
  294. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-datakey.c +14 -9
  295. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kms-ctx.c +424 -3
  296. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-log.c +1 -1
  297. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-marking.c +447 -28
  298. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-opts.c +42 -0
  299. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-traverse-util.c +30 -26
  300. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-util.c +7 -0
  301. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-util.h +3 -0
  302. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt.c +66 -14
  303. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt.h +11 -0
  304. data/ext/libmongocrypt/libmongocrypt/test/test-named-kms-providers.c +2381 -0
  305. data/ext/libmongocrypt/libmongocrypt/test/util/HELP.autogen +3 -1
  306. data/ext/libmongocrypt/libmongocrypt/test/util/README.md +1 -0
  307. data/ext/libmongocrypt/libmongocrypt/test/util/csfle.c +4 -0
  308. data/ext/libmongocrypt/libmongocrypt/test/util/make_includes.py +1 -1
  309. data/ext/libmongocrypt/libmongocrypt/test/util/util.c +38 -3
  310. data/lib/libmongocrypt_helper/version.rb +2 -2
  311. metadata +112 -106
  312. checksums.yaml.gz.sig +0 -0
  313. data/ext/libmongocrypt/libmongocrypt/VERSION_CURRENT +0 -1
  314. data/ext/libmongocrypt/libmongocrypt/bindings/cs/cs.sln +0 -79
  315. data/ext/libmongocrypt/libmongocrypt/bindings/node/CHANGELOG.md +0 -105
  316. data/ext/libmongocrypt/libmongocrypt/bindings/node/LICENSE +0 -201
  317. data/ext/libmongocrypt/libmongocrypt/bindings/node/binding.gyp +0 -79
  318. data/ext/libmongocrypt/libmongocrypt/bindings/node/etc/README.hbs +0 -44
  319. data/ext/libmongocrypt/libmongocrypt/bindings/node/etc/build-static.sh +0 -36
  320. data/ext/libmongocrypt/libmongocrypt/bindings/node/index.d.ts +0 -641
  321. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/autoEncrypter.js +0 -420
  322. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/buffer_pool.js +0 -123
  323. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/clientEncryption.js +0 -821
  324. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/common.js +0 -98
  325. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/cryptoCallbacks.js +0 -87
  326. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/errors.js +0 -75
  327. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/index.js +0 -73
  328. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/mongocryptdManager.js +0 -66
  329. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/providers/aws.js +0 -26
  330. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/providers/azure.js +0 -178
  331. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/providers/gcp.js +0 -24
  332. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/providers/index.js +0 -54
  333. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/providers/utils.js +0 -39
  334. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/stateMachine.js +0 -492
  335. data/ext/libmongocrypt/libmongocrypt/bindings/node/package-lock.json +0 -15302
  336. data/ext/libmongocrypt/libmongocrypt/bindings/node/package.json +0 -100
  337. data/ext/libmongocrypt/libmongocrypt/bindings/node/src/mongocrypt.cc +0 -956
  338. data/ext/libmongocrypt/libmongocrypt/bindings/node/src/mongocrypt.h +0 -114
  339. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/autoEncrypter.test.js +0 -950
  340. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/buffer_pool.test.js +0 -91
  341. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/clientEncryption.test.js +0 -1093
  342. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/common.test.js +0 -94
  343. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/cryptoCallbacks.test.js +0 -240
  344. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/README.md +0 -5
  345. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/cmd.json +0 -6
  346. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/collection-info.json +0 -37
  347. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/encrypted-document-nested.json +0 -8
  348. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/encrypted-document.json +0 -11
  349. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/encryptedFields.json +0 -30
  350. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/key-document.json +0 -32
  351. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/key1-document.json +0 -30
  352. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/mongocryptd-reply.json +0 -18
  353. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/index.test.js +0 -45
  354. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/mongocryptdManager.test.js +0 -48
  355. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/providers/credentialsProvider.test.js +0 -551
  356. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/release.test.js +0 -66
  357. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/requirements.helper.js +0 -51
  358. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/stateMachine.test.js +0 -331
  359. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/tools/chai-addons.js +0 -8
  360. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/tools/mongodb_reporter.js +0 -325
  361. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/types/index.test-d.ts +0 -63
  362. data/ext/libmongocrypt/libmongocrypt/bindings/python/setup.py +0 -89
  363. data/ext/libmongocrypt/libmongocrypt/debian/build_snapshot.sh +0 -79
  364. data/ext/libmongocrypt/libmongocrypt/debian/changelog +0 -105
  365. data/ext/libmongocrypt/libmongocrypt/debian/compat +0 -1
  366. data/ext/libmongocrypt/libmongocrypt/debian/control +0 -41
  367. data/ext/libmongocrypt/libmongocrypt/debian/copyright +0 -129
  368. data/ext/libmongocrypt/libmongocrypt/debian/gbp.conf +0 -23
  369. data/ext/libmongocrypt/libmongocrypt/debian/libmongocrypt-dev.dirs +0 -2
  370. data/ext/libmongocrypt/libmongocrypt/debian/libmongocrypt-dev.install +0 -5
  371. data/ext/libmongocrypt/libmongocrypt/debian/libmongocrypt0.dirs +0 -1
  372. data/ext/libmongocrypt/libmongocrypt/debian/libmongocrypt0.install +0 -1
  373. data/ext/libmongocrypt/libmongocrypt/debian/rules +0 -46
  374. data/ext/libmongocrypt/libmongocrypt/debian/source/format +0 -1
  375. data/ext/libmongocrypt/libmongocrypt/debian/source/lintian-overrides +0 -3
  376. data/ext/libmongocrypt/libmongocrypt/debian/source/options +0 -1
  377. data/ext/libmongocrypt/libmongocrypt/debian/watch +0 -3
  378. data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/mongocryptd-reply.json +0 -72
  379. data.tar.gz.sig +0 -1
  380. metadata.gz.sig +0 -0
  381. /data/ext/libmongocrypt/libmongocrypt/{bindings/node/test/data/kms-decrypt-reply.txt → test/data/kms-aws/decrypt-response.txt} +0 -0
  382. /data/ext/libmongocrypt/libmongocrypt/{bindings/node/test/data/kms-encrypt-reply.txt → test/data/kms-aws/encrypt-response.txt} +0 -0
  383. /data/ext/libmongocrypt/libmongocrypt/test/data/{gcp-auth → kms-gcp}/decrypt-response.txt +0 -0
  384. /data/ext/libmongocrypt/libmongocrypt/test/data/{gcp-auth → kms-gcp}/encrypt-response.txt +0 -0
  385. /data/ext/libmongocrypt/libmongocrypt/test/data/{gcp-auth → kms-gcp}/oauth-response.txt +0 -0
@@ -1,641 +0,0 @@
1
- import type {
2
- MongoClient,
3
- BulkWriteResult,
4
- DeleteResult,
5
- FindCursor,
6
- Collection,
7
- Db,
8
- CreateCollectionOptions,
9
- Document,
10
- Binary,
11
- Long
12
- } from 'mongodb';
13
-
14
- export type ClientEncryptionDataKeyProvider = 'aws' | 'azure' | 'gcp' | 'local' | 'kmip';
15
-
16
- /**
17
- * The schema for a DataKey in the key vault collection.
18
- */
19
- export interface DataKey {
20
- _id: Binary;
21
- version?: number;
22
- keyAltNames?: string[];
23
- keyMaterial: Binary;
24
- creationDate: Date;
25
- updateDate: Date;
26
- status: number;
27
- masterKey: Document;
28
- }
29
-
30
- /**
31
- * An error indicating that something went wrong specifically with MongoDB Client Encryption
32
- */
33
- export class MongoCryptError extends Error {
34
- cause?: Error;
35
- }
36
-
37
- /**
38
- * @experimental Public Technical Preview
39
- * An error indicating that `ClientEncryption.createEncryptedCollection()` failed to create a collection
40
- */
41
- export class MongoCryptCreateEncryptedCollectionError extends MongoCryptError {
42
- /**
43
- * @experimental Public Technical Preview
44
- * The entire `encryptedFields` that was completed while attempting createEncryptedCollection
45
- */
46
- encryptedFields: Document;
47
- /** The error rejected from db.createCollection() */
48
- cause: Error;
49
- }
50
-
51
- /**
52
- * @experimental Public Technical Preview
53
- * An error indicating that `ClientEncryption.createEncryptedCollection()` failed to create data keys
54
- */
55
- export class MongoCryptCreateDataKeyError extends MongoCryptError {
56
- /**
57
- * @experimental Public Technical Preview
58
- * The partial `encryptedFields` that was completed while attempting createEncryptedCollection
59
- */
60
- encryptedFields: Document;
61
- /** The first error encountered when attempting to `createDataKey` */
62
- cause: Error;
63
- }
64
-
65
- /**
66
- * An error indicating that mongodb-client-encryption failed to auto-refresh Azure KMS credentials.
67
- */
68
- export class MongoCryptAzureKMSRequestError extends MongoCryptError {
69
- /* The body of the IMDS request that produced the error, if present. */
70
- body?: Document ;
71
- }
72
-
73
- export class MongoCryptKMSRequestNetworkTimeoutError extends MongoCryptError {}
74
-
75
- /**
76
- * A set of options for specifying a Socks5 proxy.
77
- */
78
- export interface ProxyOptions {
79
- proxyHost: string;
80
- proxyPort?: number;
81
- proxyUsername?: string;
82
- proxyPassword?: string;
83
- }
84
-
85
- export interface ClientEncryptionCreateDataKeyCallback {
86
- /**
87
- * @param error If present, indicates an error that occurred in the creation of the data key
88
- * @param dataKeyId If present, returns the id of the created data key
89
- */
90
- (error?: Error, dataKeyId?: Binary): void;
91
- }
92
-
93
- export interface ClientEncryptionEncryptCallback {
94
- /**
95
- * @param error If present, indicates an error that occurred in the process of encryption
96
- * @param result If present, is the encrypted result
97
- */
98
- (error?: Error, result?: Binary): void;
99
- }
100
-
101
- export interface ClientEncryptionDecryptCallback {
102
- /**
103
- * @param error If present, indicates an error that occurred in the process of decryption
104
- * @param result If present, is the decrypted result
105
- */
106
- (error?: Error, result?: any): void;
107
- }
108
-
109
- /**
110
- * Configuration options that are used by specific KMS providers during key generation, encryption, and decryption.
111
- */
112
- export interface KMSProviders {
113
- /**
114
- * Configuration options for using 'aws' as your KMS provider
115
- */
116
- aws?:
117
- | {
118
- /**
119
- * The access key used for the AWS KMS provider
120
- */
121
- accessKeyId: string;
122
-
123
- /**
124
- * The secret access key used for the AWS KMS provider
125
- */
126
- secretAccessKey: string;
127
-
128
- /**
129
- * An optional AWS session token that will be used as the
130
- * X-Amz-Security-Token header for AWS requests.
131
- */
132
- sessionToken?: string;
133
- }
134
- | Record<string, never>;
135
-
136
- /**
137
- * Configuration options for using 'local' as your KMS provider
138
- */
139
- local?: {
140
- /**
141
- * The master key used to encrypt/decrypt data keys.
142
- * A 96-byte long Buffer or base64 encoded string.
143
- */
144
- key: Buffer | string;
145
- };
146
-
147
- /**
148
- * Configuration options for using 'kmip' as your KMS provider
149
- */
150
- kmip?: {
151
- /**
152
- * The output endpoint string.
153
- * The endpoint consists of a hostname and port separated by a colon.
154
- * E.g. "example.com:123". A port is always present.
155
- */
156
- endpoint?: string;
157
- };
158
-
159
- /**
160
- * Configuration options for using 'azure' as your KMS provider
161
- */
162
- azure?:
163
- | {
164
- /**
165
- * The tenant ID identifies the organization for the account
166
- */
167
- tenantId: string;
168
-
169
- /**
170
- * The client ID to authenticate a registered application
171
- */
172
- clientId: string;
173
-
174
- /**
175
- * The client secret to authenticate a registered application
176
- */
177
- clientSecret: string;
178
-
179
- /**
180
- * If present, a host with optional port. E.g. "example.com" or "example.com:443".
181
- * This is optional, and only needed if customer is using a non-commercial Azure instance
182
- * (e.g. a government or China account, which use different URLs).
183
- * Defaults to "login.microsoftonline.com"
184
- */
185
- identityPlatformEndpoint?: string | undefined;
186
- }
187
- | {
188
- /**
189
- * If present, an access token to authenticate with Azure.
190
- */
191
- accessToken: string;
192
- }
193
- | Record<string, never>;
194
-
195
- /**
196
- * Configuration options for using 'gcp' as your KMS provider
197
- */
198
- gcp?:
199
- | {
200
- /**
201
- * The service account email to authenticate
202
- */
203
- email: string;
204
-
205
- /**
206
- * A PKCS#8 encrypted key. This can either be a base64 string or a binary representation
207
- */
208
- privateKey: string | Buffer;
209
-
210
- /**
211
- * If present, a host with optional port. E.g. "example.com" or "example.com:443".
212
- * Defaults to "oauth2.googleapis.com"
213
- */
214
- endpoint?: string | undefined;
215
- }
216
- | {
217
- /**
218
- * If present, an access token to authenticate with GCP.
219
- */
220
- accessToken: string;
221
- }
222
- | Record<string, never>;
223
- }
224
-
225
- /**
226
- * TLS options to use when connecting. The spec specifically calls out which insecure
227
- * tls options are not allowed:
228
- *
229
- * - tlsAllowInvalidCertificates
230
- * - tlsAllowInvalidHostnames
231
- * - tlsInsecure
232
- * - tlsDisableOCSPEndpointCheck
233
- * - tlsDisableCertificateRevocationCheck
234
- */
235
- export interface ClientEncryptionTlsOptions {
236
- /**
237
- * Specifies the location of a local .pem file that contains
238
- * either the client's TLS/SSL certificate and key or only the
239
- * client's TLS/SSL key when tlsCertificateFile is used to
240
- * provide the certificate.
241
- */
242
- tlsCertificateKeyFile?: string;
243
- /**
244
- * Specifies the password to de-crypt the tlsCertificateKeyFile.
245
- */
246
- tlsCertificateKeyFilePassword?: string;
247
- /**
248
- * Specifies the location of a local .pem file that contains the
249
- * root certificate chain from the Certificate Authority.
250
- * This file is used to validate the certificate presented by the
251
- * KMS provider.
252
- */
253
- tlsCAFile?: string;
254
- }
255
-
256
- /**
257
- * Additional settings to provide when creating a new `ClientEncryption` instance.
258
- */
259
- export interface ClientEncryptionOptions {
260
- /**
261
- * The namespace of the key vault, used to store encryption keys
262
- */
263
- keyVaultNamespace: string;
264
-
265
- /**
266
- * A MongoClient used to fetch keys from a key vault. Defaults to client.
267
- */
268
- keyVaultClient?: MongoClient | undefined;
269
-
270
- /**
271
- * Options for specific KMS providers to use
272
- */
273
- kmsProviders?: KMSProviders;
274
-
275
- /**
276
- * Optional callback to override KMS providers per-context.
277
- *
278
- * @deprecated Installing optional dependencies will automatically refresh kms
279
- * provider credentials.
280
- */
281
- onKmsProviderRefresh?: () => Promise<KMSProviders>;
282
-
283
- /**
284
- * Options for specifying a Socks5 proxy to use for connecting to the KMS.
285
- */
286
- proxyOptions?: ProxyOptions;
287
-
288
- /**
289
- * TLS options for kms providers to use.
290
- */
291
- tlsOptions?: { [kms in keyof KMSProviders]?: ClientEncryptionTlsOptions };
292
- }
293
-
294
- /**
295
- * Configuration options for making an AWS encryption key
296
- */
297
- export interface AWSEncryptionKeyOptions {
298
- /**
299
- * The AWS region of the KMS
300
- */
301
- region: string;
302
-
303
- /**
304
- * The Amazon Resource Name (ARN) to the AWS customer master key (CMK)
305
- */
306
- key: string;
307
-
308
- /**
309
- * An alternate host to send KMS requests to. May include port number.
310
- */
311
- endpoint?: string | undefined;
312
- }
313
-
314
- /**
315
- * Configuration options for making an AWS encryption key
316
- */
317
- export interface GCPEncryptionKeyOptions {
318
- /**
319
- * GCP project ID
320
- */
321
- projectId: string;
322
-
323
- /**
324
- * Location name (e.g. "global")
325
- */
326
- location: string;
327
-
328
- /**
329
- * Key ring name
330
- */
331
- keyRing: string;
332
-
333
- /**
334
- * Key name
335
- */
336
- keyName: string;
337
-
338
- /**
339
- * Key version
340
- */
341
- keyVersion?: string | undefined;
342
-
343
- /**
344
- * KMS URL, defaults to `https://www.googleapis.com/auth/cloudkms`
345
- */
346
- endpoint?: string | undefined;
347
- }
348
-
349
- /**
350
- * Configuration options for making an Azure encryption key
351
- */
352
- export interface AzureEncryptionKeyOptions {
353
- /**
354
- * Key name
355
- */
356
- keyName: string;
357
-
358
- /**
359
- * Key vault URL, typically `<name>.vault.azure.net`
360
- */
361
- keyVaultEndpoint: string;
362
-
363
- /**
364
- * Key version
365
- */
366
- keyVersion?: string | undefined;
367
- }
368
-
369
- /**
370
- * Options to provide when creating a new data key.
371
- */
372
- export interface ClientEncryptionCreateDataKeyProviderOptions {
373
- /**
374
- * Identifies a new KMS-specific key used to encrypt the new data key
375
- */
376
- masterKey?:
377
- | AWSEncryptionKeyOptions
378
- | AzureEncryptionKeyOptions
379
- | GCPEncryptionKeyOptions
380
- | undefined;
381
-
382
- /**
383
- * An optional list of string alternate names used to reference a key.
384
- * If a key is created with alternate names, then encryption may refer to the key by the unique alternate name instead of by _id.
385
- */
386
- keyAltNames?: string[] | undefined;
387
-
388
- /** @experimental */
389
- keyMaterial?: Buffer | Binary;
390
- }
391
-
392
- /** @experimental */
393
- export interface ClientEncryptionRewrapManyDataKeyProviderOptions {
394
- provider: ClientEncryptionDataKeyProvider;
395
- masterKey?:
396
- | AWSEncryptionKeyOptions
397
- | AzureEncryptionKeyOptions
398
- | GCPEncryptionKeyOptions
399
- | undefined;
400
- }
401
-
402
- /** @experimental */
403
- export interface ClientEncryptionRewrapManyDataKeyResult {
404
- /** The result of rewrapping data keys. If unset, no keys matched the filter. */
405
- bulkWriteResult?: BulkWriteResult;
406
- }
407
-
408
- /**
409
- * RangeOptions specifies index options for a Queryable Encryption field supporting "rangePreview" queries.
410
- * min, max, sparsity, and range must match the values set in the encryptedFields of the destination collection.
411
- * For double and decimal128, min/max/precision must all be set, or all be unset.
412
- */
413
- interface RangeOptions {
414
- min?: any;
415
- max?: any;
416
- sparsity: Long;
417
- precision?: number;
418
- }
419
-
420
- /**
421
- * Options to provide when encrypting data.
422
- */
423
- export interface ClientEncryptionEncryptOptions {
424
- /**
425
- * The algorithm to use for encryption.
426
- */
427
- algorithm:
428
- | 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'
429
- | 'AEAD_AES_256_CBC_HMAC_SHA_512-Random'
430
- | 'Indexed'
431
- | 'Unindexed'
432
- | 'RangePreview';
433
-
434
- /**
435
- * The id of the Binary dataKey to use for encryption
436
- */
437
- keyId?: Binary;
438
-
439
- /**
440
- * A unique string name corresponding to an already existing dataKey.
441
- */
442
- keyAltName?: string;
443
-
444
- /** @experimental Public Technical Preview: The contention factor. */
445
- contentionFactor?: bigint | number;
446
-
447
- /** @experimental Public Technical Preview: The query type supported */
448
- queryType?: 'equality' | 'rangePreview';
449
-
450
- /** @experimental Public Technical Preview: The index options for a Queryable Encryption field supporting "rangePreview" queries.*/
451
- rangeOptions?: RangeOptions;
452
- }
453
-
454
- /**
455
- * The public interface for explicit in-use encryption
456
- */
457
- export class ClientEncryption {
458
- /**
459
- * Create a new encryption instance.
460
- * @param client The client used for encryption
461
- * @param options Additional settings
462
- */
463
- constructor(client: MongoClient, options: ClientEncryptionOptions);
464
-
465
- /**
466
- * Creates a data key used for explicit encryption and inserts it into the key vault namespace
467
- * @param provider The KMS provider used for this data key. Must be `'aws'`, `'azure'`, `'gcp'`, or `'local'`
468
- */
469
- createDataKey(provider: ClientEncryptionDataKeyProvider): Promise<Binary>;
470
-
471
- /**
472
- * Creates a data key used for explicit encryption and inserts it into the key vault namespace
473
- * @param provider The KMS provider used for this data key. Must be `'aws'`, `'azure'`, `'gcp'`, or `'local'`
474
- * @param options Options for creating the data key
475
- */
476
- createDataKey(
477
- provider: ClientEncryptionDataKeyProvider,
478
- options: ClientEncryptionCreateDataKeyProviderOptions
479
- ): Promise<Binary>;
480
-
481
- /**
482
- * Creates a data key used for explicit encryption and inserts it into the key vault namespace
483
- * @param provider The KMS provider used for this data key. Must be `'aws'`, `'azure'`, `'gcp'`, or `'local'`
484
- * @param callback Callback to invoke when key is created
485
- */
486
- createDataKey(
487
- provider: ClientEncryptionDataKeyProvider,
488
- callback: ClientEncryptionCreateDataKeyCallback
489
- ): void;
490
-
491
- /**
492
- * Creates a data key used for explicit encryption and inserts it into the key vault namespace
493
- * @param provider The KMS provider used for this data key. Must be `'aws'`, `'azure'`, `'gcp'`, or `'local'`
494
- * @param options Options for creating the data key
495
- * @param callback Callback to invoke when key is created
496
- */
497
- createDataKey(
498
- provider: ClientEncryptionDataKeyProvider,
499
- options: ClientEncryptionCreateDataKeyProviderOptions,
500
- callback: ClientEncryptionCreateDataKeyCallback
501
- ): void;
502
-
503
- /**
504
- * Searches the keyvault for any data keys matching the provided filter. If there are matches, rewrapManyDataKey then attempts to re-wrap the data keys using the provided options.
505
- *
506
- * If no matches are found, then no bulk write is performed.
507
- */
508
- rewrapManyDataKey(
509
- filter: Document,
510
- options?: ClientEncryptionRewrapManyDataKeyProviderOptions
511
- ): Promise<ClientEncryptionRewrapManyDataKeyResult>;
512
-
513
- /**
514
- * Deletes the key with the provided id from the keyvault, if it exists.
515
- *
516
- * @param id - the id of the document to delete.
517
- */
518
- deleteKey(id: Binary): Promise<DeleteResult>;
519
-
520
- /**
521
- * Finds all the keys currently stored in the keyvault.
522
- *
523
- * This method will not throw.
524
- */
525
- getKeys(): FindCursor<DataKey>;
526
-
527
- /**
528
- * Finds a key in the keyvault with the specified key.
529
- *
530
- * @param id - the id of the document to delete.
531
- */
532
- getKey(id: Binary): Promise<DataKey | null>;
533
-
534
- /**
535
- * Finds a key in the keyvault which has the specified keyAltNames as a keyAltName.
536
- *
537
- * @param keyAltName - a potential keyAltName to search for in the keyAltNames array
538
- */
539
- getKeyByAltName(keyAltName: string): Promise<DataKey | null>;
540
-
541
- /**
542
- * Adds a keyAltName to a key identified by the provided `id`.
543
- *
544
- * This method resolves to/returns the *old* key value (prior to adding the new altKeyName).
545
- *
546
- * @param id - The id of the document to update.
547
- * @param keyAltName - a keyAltName to search for a key
548
- */
549
- addKeyAltName(id: Binary, keyAltName: string): Promise<DataKey | null>;
550
-
551
- /**
552
- * Adds a keyAltName to a key identified by the provided `id`.
553
- *
554
- * This method resolves to/returns the *old* key value (prior to removing the new altKeyName).
555
- *
556
- * If the removed keyAltName is the last keyAltName for that key, the `altKeyNames` property is unset from the document.
557
- *
558
- * @param id - the id of the document to update.
559
- * @param keyAltName - a keyAltName to search for a key
560
- */
561
- removeKeyAltName(id: Binary, keyAltName: string): Promise<DataKey | null>;
562
-
563
- /**
564
- * @experimental Public Technical Preview
565
- * A convenience method for creating an encrypted collection.
566
- * This method will create data keys for any encryptedFields that do not have a `keyId` defined
567
- * and then create a new collection with the full set of encryptedFields.
568
- *
569
- * @param db - A Node.js driver Db object with which to create the collection
570
- * @param name - The name of the new collection
571
- * @param options - Options for createDataKey and for createCollection. A provider and partially created encryptedFields **must** be provided.
572
- * @throws {MongoCryptCreateDataKeyForEncryptedCollectionError} - If part way through the process a createDataKey invocation fails, an error will be rejected that has the partial `encryptedFields` that were created.
573
- * @throws {MongoCryptCreateEncryptedCollectionError} - If creating the collection fails, an error will be rejected that has the entire `encryptedFields` that were created.
574
- */
575
- createEncryptedCollection<TSchema extends Document = Document>(
576
- db: Db,
577
- name: string,
578
- options: {
579
- provider: ClientEncryptionDataKeyProvider;
580
- createCollectionOptions: Omit<CreateCollectionOptions, 'encryptedFields'> & {
581
- encryptedFields: Document;
582
- };
583
- masterKey?: AWSEncryptionKeyOptions | AzureEncryptionKeyOptions | GCPEncryptionKeyOptions;
584
- }
585
- ): Promise<{ collection: Collection<TSchema>; encryptedFields: Document }>;
586
-
587
- /**
588
- * Explicitly encrypt a provided value.
589
- * Note that either options.keyId or options.keyAltName must be specified.
590
- * Specifying both options.keyId and options.keyAltName is considered an error.
591
- * @param value The value that you wish to serialize. Must be of a type that can be serialized into BSON
592
- * @param options
593
- */
594
- encrypt(value: any, options: ClientEncryptionEncryptOptions): Promise<Binary>;
595
-
596
- /**
597
- * Explicitly encrypt a provided value.
598
- * Note that either options.keyId or options.keyAltName must be specified.
599
- * Specifying both options.keyId and options.keyAltName is considered an error.
600
- * @param value The value that you wish to serialize. Must be of a type that can be serialized into BSON
601
- * @param options
602
- * @param callback Callback to invoke when value is encrypted
603
- */
604
- encrypt(
605
- value: any,
606
- options: ClientEncryptionEncryptOptions,
607
- callback: ClientEncryptionEncryptCallback
608
- ): void;
609
-
610
- /**
611
- * Encrypts a Match Expression or Aggregate Expression to query a range index.
612
- *
613
- * Only supported when queryType is "rangePreview" and algorithm is "RangePreview".
614
- *
615
- * @experimental The Range algorithm is experimental only. It is not intended for production use. It is subject to breaking changes.The aggregation or match expression you wish to encrypt. The value must be in the form
616
- *
617
- * The expression to encrypt must be one of the following:
618
- * 1. A Match Expression of this form:
619
- * `{$and: [{<field>: {$gt: <value1>}}, {<field>: {$lt: <value2> }}]}`
620
- * 2. An Aggregate Expression of this form:
621
- * `{$and: [{$gt: [<fieldpath>, <value1>]}, {$lt: [<fieldpath>, <value2>]}]}`
622
- *
623
- * `$gt` may also be `$gte`. `$lt` may also be `$lte`.
624
- */
625
- encryptExpression(value: Document, options: ClientEncryptionEncryptOptions): Promise<Document>;
626
-
627
- /**
628
- * Explicitly decrypt a provided encrypted value
629
- * @param value An encrypted value
630
- */
631
- decrypt(value: Buffer | Binary): Promise<any>;
632
-
633
- /**
634
- * Explicitly decrypt a provided encrypted value
635
- * @param value An encrypted value
636
- * @param callback Callback to invoke when value is decrypted
637
- */
638
- decrypt(value: Buffer | Binary, callback: ClientEncryptionDecryptCallback): void;
639
-
640
- static readonly libmongocryptVersion: string;
641
- }