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,10 +1,70 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ Changes in Version 1.10.1
5
+ ------------------------
6
+
7
+ - Bundle libmongocrypt 1.10.1 in release wheels.
8
+
9
+ Changes in Version 1.10.0
10
+ ------------------------
11
+
12
+ - Add Python async support.
13
+ - Drop support for Python 3.7 and PyPy 3.8. Python >=3.8 or PyPy >=3.9 is now required.
14
+ - Add support for range-based Queryable Encryption with the new "range"
15
+ algorithm on MongoDB 8.0+. This replaces the experimental "rangePreview" algorithm.
16
+ - Add Secure Software Development Life Cycle automation to release process.
17
+ GitHub Releases for pymongocrypt now include a Software Bill of Materials, and signature
18
+ files corresponding to the distribution files released on PyPI.
19
+
20
+ Changes in Version 1.9.2
21
+ ------------------------
22
+
23
+ - Fix support for building source distributions with setuptools >= 70.
24
+
25
+
26
+ Changes in Version 1.9.1
27
+ ------------------------
28
+
29
+ - Fix bug in our release process which blocked uploading 1.9.0.
30
+
31
+ Changes in Version 1.9.0
32
+ ------------------------
33
+
34
+ - Add support for named KMS providers like "local:name1".
35
+ This feature requires libmongocrypt >= 1.9.0.
36
+ - Use libmongocrypt native crypto when available which results in 10-50x better performance.
37
+ On Linux, it is recommended to download the platform specific build and
38
+ set PYMONGOCRYPT_LIB to the crypto-enabled libmongocrypt.so.
39
+ - Bundle the crypto-enabled libmongocrypt builds in macOS and Windows wheels for better performance.
40
+ - Bundle libmongocrypt 1.9.0 in release wheels.
41
+
42
+ Changes in Version 1.8.0
43
+ ------------------------
44
+
45
+ - Update from manylinux2010 to manylinux2014 wheels.
46
+ - Bundle libmongocrypt 1.8.4 in release wheels.
47
+ - Add support for manylinux_2_28_aarch64 wheels.
48
+
49
+ Changes in Version 1.7.0
50
+ ------------------------
51
+
52
+ - Add support for Python 3.12 on MacOS and Linux.
53
+ - Update required cryptography version to >=2.5.
54
+
55
+ Changes in Version 1.6.1
56
+ ------------------------
57
+
58
+ - Bundle libmongocrypt 1.8.1 in release wheels.
59
+
4
60
  Changes in Version 1.6.0
5
61
  ------------------------
6
62
 
7
63
  - Drop support for Python 2 and Python <3.7. Python >=3.7 is now required.
64
+ - Bundle libmongocrypt 1.8.0 in release wheels.
65
+ - **Remove support for libmongocrypt <=1.8.0, libmongocrypt >=1.8.0
66
+ is now required.** Note this is only relevant for users that install from
67
+ source or use the ``PYMONGOCRYPT_LIB`` environment variable.
8
68
 
9
69
  Changes in Version 1.5.2
10
70
  ------------------------
@@ -13,7 +13,7 @@ Python wrapper library for libmongocrypt that supports client side encryption
13
13
  in drivers. PyMongoCrypt uses `cffi <https://pypi.org/project/cffi/>`_ and
14
14
  `cryptography <https://pypi.org/project/cryptography/>`_.
15
15
 
16
- PyMongoCrypt supports Python 3.7+ and PyPy3.7+.
16
+ PyMongoCrypt supports Python 3.8+ and PyPy3.9+.
17
17
 
18
18
  Support / Feedback
19
19
  ==================
@@ -77,7 +77,7 @@ PyMongoCrypt can be installed with `pip <http://pypi.python.org/pypi/pip>`_::
77
77
 
78
78
  $ python -m pip install pymongocrypt
79
79
  $ python -c "import pymongocrypt; print(pymongocrypt.libmongocrypt_version())"
80
- 1.2.1
80
+ 1.9.0
81
81
 
82
82
 
83
83
  PyMongoCrypt ships wheels for macOS, Windows, and manylinux2010 that include
@@ -102,7 +102,10 @@ First, install PyMongoCrypt from source::
102
102
  $ git clone git@github.com:mongodb/libmongocrypt.git
103
103
  $ python -m pip install ./libmongocrypt/bindings/python
104
104
 
105
- Next, install libmongocrypt.
105
+ Next, install libmongocrypt:
106
+
107
+ Installing libmongocrypt
108
+ ^^^^^^^^^^^^^^^^^^^^^^^^
106
109
 
107
110
  libmongocrypt is continuously built and published on evergreen.
108
111
  The latest tarball containing libmongocrypt built on all supported variants is
@@ -114,38 +117,56 @@ For example::
114
117
  $ curl -O https://s3.amazonaws.com/mciuploads/libmongocrypt/all/master/latest/libmongocrypt-all.tar.gz
115
118
  $ mkdir libmongocrypt-all && tar xzf libmongocrypt-all.tar.gz -C libmongocrypt-all
116
119
  $ ls libmongocrypt-all
117
- amazon2 rhel-62-64-bit rhel72-zseries-test ubuntu1604-arm64
118
- debian10 rhel-67-s390x suse12-64 ubuntu1804-64
119
- debian92 rhel-70-64-bit suse12-s390x ubuntu1804-arm64
120
- linux-64-amazon-ami rhel-71-ppc64el suse15-64 windows-test
121
- macos rhel-80-64-bit ubuntu1604
120
+ amazon2 debian92 rhel-80-64-bit rhel72-zseries-test ubuntu1804-arm64
121
+ amazon2-arm64 linux-64-amazon-ami rhel-81-ppc64el suse12-64 ubuntu2004-64
122
+ amazon2023 macos rhel-82-arm64 suse15-64 ubuntu2004-arm64
123
+ amazon2023-arm64 rhel-62-64-bit rhel-83-zseries ubuntu1604 ubuntu2204-64
124
+ debian10 rhel-70-64-bit rhel-91-64-bit ubuntu1604-arm64 ubuntu2204-arm64
125
+ debian11 rhel-71-ppc64el rhel-91-arm64 ubuntu1804-64 windows-test
122
126
 
123
127
  macOS::
124
128
 
125
129
  $ # Set PYMONGOCRYPT_LIB for macOS:
126
- $ export PYMONGOCRYPT_LIB=$(pwd)/libmongocrypt-all/macos/nocrypto/lib/libmongocrypt.dylib
130
+ $ export PYMONGOCRYPT_LIB=$(pwd)/libmongocrypt-all/macos/lib/libmongocrypt.dylib
127
131
  $ python -c "import pymongocrypt; print(pymongocrypt.libmongocrypt_version())"
128
- 1.2.1
132
+ 1.9.0
129
133
 
130
134
  Windows::
131
135
 
132
136
  $ # Set PYMONGOCRYPT_LIB for Windows:
133
- $ chmod +x $(pwd)/libmongocrypt-all/windows-test/nocrypto/bin/mongocrypt.dll
134
- $ export PYMONGOCRYPT_LIB=$(pwd)/libmongocrypt-all/windows-test/nocrypto/bin/mongocrypt.dll
137
+ $ chmod +x $(pwd)/libmongocrypt-all/windows-test/bin/mongocrypt.dll
138
+ $ export PYMONGOCRYPT_LIB=$(pwd)/libmongocrypt-all/windows-test/bin/mongocrypt.dll
135
139
  $ python -c "import pymongocrypt; print(pymongocrypt.libmongocrypt_version())"
136
- 1.2.1
140
+ 1.9.0
141
+
142
+ Linux: set the libmongocrypt build for your platform, for example for Ubuntu 22.04 x86_64::
137
143
 
138
- Linux::
144
+ $ # Set PYMONGOCRYPT_LIB for Ubuntu 22.04 x86_64:
145
+ $ export PYMONGOCRYPT_LIB=$(pwd)/libmongocrypt-all/ubuntu2204-64/lib/libmongocrypt.so
146
+ $ python -c "import pymongocrypt; print(pymongocrypt.libmongocrypt_version())"
147
+ 1.9.0
148
+ $ # Check that native crypto is enabled for better performance:
149
+ $ python -c 'from pymongocrypt.binding import lib;print(lib.mongocrypt_is_crypto_available())'
150
+ True
151
+
152
+ Note if your Linux platform is not available, the generic RHEL 6.2 x86_64 "nocrypto" build
153
+ should still be compatible however the "nocrypto" build will result in lower performance
154
+ for encryption and decryption::
139
155
 
140
156
  $ # Set PYMONGOCRYPT_LIB for RHEL 6.2 x86_64:
141
157
  $ export PYMONGOCRYPT_LIB=$(pwd)/libmongocrypt-all/rhel-62-64-bit/nocrypto/lib64/libmongocrypt.so
142
158
  $ python -c "import pymongocrypt; print(pymongocrypt.libmongocrypt_version())"
143
- 1.2.1
159
+ 1.9.0
160
+ $ python -c 'from pymongocrypt.binding import lib;print(lib.mongocrypt_is_crypto_available())'
161
+ False
162
+
163
+ Other methods of installation (brew, rpm, yum, apt-get, deb, etc...) are documented here:
164
+ https://www.mongodb.com/docs/manual/core/csfle/reference/libmongocrypt/#linux-installation
144
165
 
145
166
  Dependencies
146
167
  ============
147
168
 
148
- PyMongoCrypt supports Python 3.7+ and PyPy3.7+.
169
+ PyMongoCrypt supports Python 3.8+ and PyPy3.9+.
149
170
 
150
171
  PyMongoCrypt requires `cffi <https://pypi.org/project/cffi/>`_ and
151
172
  `cryptography <https://pypi.org/project/cryptography/>`_.
@@ -163,11 +184,11 @@ installed you will see an error like this:
163
184
  from pymongocrypt.binding import libmongocrypt_version, lib
164
185
  File "pymongocrypt/binding.py", line 803, in <module>
165
186
  lib = ffi.dlopen(os.environ.get('PYMONGOCRYPT_LIB', 'mongocrypt'))
166
- File "/.../lib/python3.7/site-packages/cffi/api.py", line 146, in dlopen
187
+ File "/.../lib/python3.8/site-packages/cffi/api.py", line 146, in dlopen
167
188
  lib, function_cache = _make_ffi_library(self, name, flags)
168
- File "/.../lib/python3.7/site-packages/cffi/api.py", line 828, in _make_ffi_library
189
+ File "/.../lib/python3.8/site-packages/cffi/api.py", line 828, in _make_ffi_library
169
190
  backendlib = _load_backend_lib(backend, libname, flags)
170
- File "/.../lib/python3.7/site-packages/cffi/api.py", line 823, in _load_backend_lib
191
+ File "/.../lib/python3.8/site-packages/cffi/api.py", line 823, in _load_backend_lib
171
192
  raise OSError(msg)
172
193
  OSError: ctypes.util.find_library() did not manage to locate a library called 'mongocrypt'
173
194
 
@@ -178,7 +199,7 @@ variables, like ``LD_LIBRARY_PATH``. For example::
178
199
 
179
200
  $ export PYMONGOCRYPT_LIB='/path/to/libmongocrypt.so'
180
201
  $ python -c "import pymongocrypt; print(pymongocrypt.libmongocrypt_version())"
181
- 1.2.1
202
+ 1.9.0
182
203
 
183
204
  Testing
184
205
  =======
@@ -41,7 +41,7 @@ Docker and a Windows machine.
41
41
  -REVISION=$(git rev-list -n 1 1.0.0)
42
42
  +REVISION=$(git rev-list -n 1 1.0.1)
43
43
 
44
- #. Add a changlog entry for this release in CHANGELOG.rst.
44
+ #. Add a changelog entry for this release in CHANGELOG.rst.
45
45
  #. Bump "__version__" in ``pymongocrypt/version.py``.
46
46
  #. After merging the PR, clone the repository and check out the commit
47
47
  with the version change.
@@ -51,25 +51,9 @@ Docker and a Windows machine.
51
51
  $ git tag -a "pymongocrypt-<version>" -m "pymongocrypt-<version"
52
52
  $ git push --tags
53
53
 
54
- #. Pushing a tag will trigger a release process in Evergreen which builds
55
- wheels for manylinux, macOS, and Windows. Wait for the "release-python-combine"
56
- task to complete and then download the "Release Python files all" archive. See:
57
- https://evergreen.mongodb.com/waterfall/libmongocrypt?bv_filter=release
58
- (requires auth)
59
-
60
- The contents should look like this::
61
-
62
- $ ls path/to/archive
63
- pymongocrypt-<version>.tar.gz
64
- pymongocrypt-<version>-py2.py3-none-manylinux2010_x86_64.whl
65
- pymongocrypt-<version>-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
66
- pymongocrypt-<version>-py2.py3-none-macosx_10_14_x86_64.whl
67
- pymongocrypt-<version>-py2.py3-none-macosx_11_0_universal2.whl
68
- pymongocrypt-<version>-py2.py3-none-win_amd64.whl
69
-
70
- #. Upload all the release packages to PyPI with twine::
71
-
72
- $ python3 -m twine upload dist/*
54
+ #. Pushing a tag will trigger the release process on GitHub Actions that will require a member
55
+ of the team to authorize the deployment. Navigate to https://github.com/mongodb/libmongocrypt/actions/workflows/release-python.yml
56
+ and wait for the publish to complete.
73
57
 
74
58
  #. Create a new PR against the same ticket to update version to a ``.dev0``
75
59
  version.
@@ -84,10 +68,10 @@ Manually Creating Wheels
84
68
  $ git clone git@github.com:mongodb/libmongocrypt.git
85
69
  $ cd libmongocrypt/bindings/python
86
70
  $ git checkout "pymongocrypt <release version number>"
87
- $ MACOS_TARGET=macos_x86_64 PYTHON=<python37> ./release.sh
71
+ $ MACOS_TARGET=macos_x86_64 PYTHON=<python38> ./release.sh
88
72
  $ PYTHON=<python310> ./release.sh
89
73
 
90
- Make sure to run using the official binaries for Python 3.7 and 3.10. You
74
+ Make sure to run using the official binaries for Python 3.8 and 3.10. You
91
75
  should end up with the same files created by Evergreen (except for the Windows wheel).
92
76
 
93
77
  #. To build the release package for Windows, launch a windows-64-vsMulti-small
@@ -103,5 +87,3 @@ Manually Creating Wheels
103
87
 
104
88
  $ ls dist
105
89
  pymongocrypt-<version>-py2.py3-none-win_amd64.whl
106
-
107
-
@@ -1,16 +1,7 @@
1
1
  #!/bin/bash -ex
2
2
  cd /python
3
3
 
4
- # Compile wheel
5
- # https://github.com/pypa/manylinux/issues/49
6
- rm -rf build
7
- /opt/python/cp37-cp37m/bin/python setup.py bdist_wheel
8
-
9
- # Audit wheels and write manylinux tag
10
- for whl in dist/*.whl; do
11
- # Skip already built manylinux wheels.
12
- if [[ "$whl" != *"manylinux"* ]]; then
13
- auditwheel repair $whl -w dist
14
- rm $whl
15
- fi
16
- done
4
+ mkdir /tmp/wheelhouse
5
+ /opt/python/cp38-cp38/bin/python -m build --wheel --outdir /tmp/wheelhouse
6
+ # Audit wheels and repair manylinux tags
7
+ auditwheel repair /tmp/wheelhouse/*.whl -w dist
@@ -0,0 +1,36 @@
1
+ """A custom hatch build hook for pymongo."""
2
+ from __future__ import annotations
3
+
4
+ import os
5
+ import sys
6
+ from pathlib import Path
7
+
8
+ from hatchling.builders.hooks.plugin.interface import BuildHookInterface
9
+
10
+
11
+ class CustomHook(BuildHookInterface):
12
+ """The pymongocrypt build hook."""
13
+
14
+ def initialize(self, version, build_data):
15
+ """Initialize the hook."""
16
+ if self.target_name == "sdist":
17
+ return
18
+
19
+ # Ensure wheel is marked as binary.
20
+ # On linux, we use auditwheel to set the name.
21
+ if sys.platform == "darwin":
22
+ os.environ["MACOSX_DEPLOYMENT_TARGET"] = "11.0"
23
+ build_data["tag"] = "py3-none-macosx_11_0_universal2"
24
+ patt = ".dylib"
25
+ elif os.name == "nt":
26
+ build_data["tag"] = "py3-none-win_amd64"
27
+ patt = ".dll"
28
+ else:
29
+ patt = ".so"
30
+
31
+ here = Path(__file__).parent.resolve()
32
+ dpath = here / "pymongocrypt"
33
+ for fpath in dpath.glob(f"*{patt}"):
34
+ relpath = os.path.relpath(fpath, here)
35
+ build_data["artifacts"].append(relpath)
36
+ build_data["force_include"][relpath] = relpath
@@ -12,5 +12,5 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- from pymongocrypt.binding import libmongocrypt_version, lib
16
- from pymongocrypt.version import __version__
15
+ from pymongocrypt.binding import lib, libmongocrypt_version # noqa: F401
16
+ from pymongocrypt.version import __version__ # noqa: F401
@@ -0,0 +1,61 @@
1
+ # Copyright 2024-present MongoDB, Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ from pymongocrypt.asynchronous.state_machine import run_state_machine
16
+ from pymongocrypt.mongocrypt import MongoCrypt
17
+
18
+
19
+ class AsyncAutoEncrypter:
20
+ def __init__(self, callback, mongo_crypt_opts):
21
+ """Encrypts and decrypts MongoDB commands.
22
+
23
+ This class is used by a driver to support automatic encryption and
24
+ decryption of MongoDB commands.
25
+
26
+ :Parameters:
27
+ - `callback`: A :class:`MongoCryptCallback`.
28
+ - `mongo_crypt_opts`: A :class:`MongoCryptOptions`.
29
+ """
30
+ self.callback = callback
31
+ self.mongocrypt = MongoCrypt(mongo_crypt_opts, callback)
32
+
33
+ async def encrypt(self, database, cmd):
34
+ """Encrypt a MongoDB command.
35
+
36
+ :Parameters:
37
+ - `database`: The database for this command.
38
+ - `cmd`: A MongoDB command as BSON.
39
+
40
+ :Returns:
41
+ The encrypted command.
42
+ """
43
+ with self.mongocrypt.encryption_context(database, cmd) as ctx:
44
+ return await run_state_machine(ctx, self.callback)
45
+
46
+ async def decrypt(self, response):
47
+ """Decrypt a MongoDB command response.
48
+
49
+ :Parameters:
50
+ - `response`: A MongoDB command response as BSON.
51
+
52
+ :Returns:
53
+ The decrypted command response.
54
+ """
55
+ with self.mongocrypt.decryption_context(response) as ctx:
56
+ return await run_state_machine(ctx, self.callback)
57
+
58
+ async def close(self):
59
+ """Cleanup resources."""
60
+ self.mongocrypt.close()
61
+ await self.callback.close()
@@ -0,0 +1,156 @@
1
+ # Copyright 2024-present MongoDB, Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ import os
15
+ from collections import namedtuple
16
+ from datetime import datetime, timedelta, timezone
17
+
18
+ try:
19
+ from pymongo_auth_aws.auth import aws_temp_credentials
20
+
21
+ _HAVE_AUTH_AWS = True
22
+ except ImportError:
23
+ _HAVE_AUTH_AWS = False
24
+
25
+ import httpx
26
+
27
+ from pymongocrypt.errors import MongoCryptError
28
+
29
+ _azure_creds = namedtuple("_azure_creds", ["access_token", "expires_utc"])
30
+ _azure_creds_cache = None
31
+
32
+
33
+ async def _get_gcp_credentials():
34
+ """Get on-demand GCP credentials"""
35
+ metadata_host = os.getenv("GCE_METADATA_HOST") or "metadata.google.internal"
36
+ url = (
37
+ "http://%s/computeMetadata/v1/instance/service-accounts/default/token"
38
+ % metadata_host
39
+ )
40
+
41
+ headers = {"Metadata-Flavor": "Google"}
42
+ client = httpx.AsyncClient()
43
+ try:
44
+ response = await client.get(url, headers=headers)
45
+ except Exception as e:
46
+ msg = "unable to retrieve GCP credentials: %s" % e
47
+ raise MongoCryptError(msg) from e
48
+ finally:
49
+ await client.aclose()
50
+
51
+ if response.status_code != 200:
52
+ msg = f"Unable to retrieve GCP credentials: expected StatusCode 200, got StatusCode: {response.status_code}. Response body:\n{response.content}"
53
+ raise MongoCryptError(msg)
54
+ try:
55
+ data = response.json()
56
+ except Exception as e:
57
+ raise MongoCryptError(
58
+ f"unable to retrieve GCP credentials: error reading response body\n{response.content}"
59
+ ) from e
60
+
61
+ if not data.get("access_token"):
62
+ msg = (
63
+ "unable to retrieve GCP credentials: got unexpected empty accessToken from GCP Metadata Server. Response body: %s"
64
+ % response.content
65
+ )
66
+ raise MongoCryptError(msg)
67
+
68
+ return {"accessToken": data["access_token"]}
69
+
70
+
71
+ async def _get_azure_credentials():
72
+ """Get on-demand Azure credentials"""
73
+ global _azure_creds_cache
74
+ # Credentials are considered expired when: Expiration - now < 1 mins.
75
+ creds = _azure_creds_cache
76
+ if creds:
77
+ if creds.expires_utc - datetime.now(tz=timezone.utc) < timedelta(seconds=60):
78
+ _azure_creds_cache = None
79
+ else:
80
+ return {"accessToken": creds.access_token}
81
+
82
+ url = "http://169.254.169.254/metadata/identity/oauth2/token"
83
+ url += "?api-version=2018-02-01"
84
+ url += "&resource=https://vault.azure.net"
85
+ headers = {"Metadata": "true", "Accept": "application/json"}
86
+ client = httpx.AsyncClient()
87
+ try:
88
+ response = await client.get(url, headers=headers)
89
+ except Exception as e:
90
+ msg = "Failed to acquire IMDS access token: %s" % e
91
+ raise MongoCryptError(msg) from e
92
+ finally:
93
+ await client.aclose()
94
+
95
+ if response.status_code != 200:
96
+ msg = "Failed to acquire IMDS access token."
97
+ raise MongoCryptError(msg)
98
+ try:
99
+ data = response.json()
100
+ except Exception as e:
101
+ raise MongoCryptError("Azure IMDS response must be in JSON format.") from e
102
+
103
+ for key in ["access_token", "expires_in"]:
104
+ if not data.get(key):
105
+ msg = "Azure IMDS response must contain %s, but was %s."
106
+ msg = msg % (key, response.content)
107
+ raise MongoCryptError(msg)
108
+
109
+ try:
110
+ expires_in = int(data["expires_in"])
111
+ except ValueError as e:
112
+ raise MongoCryptError(
113
+ 'Azure IMDS response must contain "expires_in" integer, but was %s.'
114
+ % response.content
115
+ ) from e
116
+
117
+ expires_utc = datetime.now(tz=timezone.utc) + timedelta(seconds=expires_in)
118
+ _azure_creds_cache = _azure_creds(data["access_token"], expires_utc)
119
+ return {"accessToken": data["access_token"]}
120
+
121
+
122
+ async def _ask_for_kms_credentials(kms_providers):
123
+ """Get on-demand kms credentials.
124
+
125
+ This is a separate function so it can be overridden in unit tests."""
126
+ global _azure_creds_cache
127
+ on_demand_aws = "aws" in kms_providers and not len(kms_providers["aws"])
128
+ on_demand_gcp = "gcp" in kms_providers and not len(kms_providers["gcp"])
129
+ on_demand_azure = "azure" in kms_providers and not len(kms_providers["azure"])
130
+
131
+ if not any([on_demand_aws, on_demand_gcp, on_demand_azure]):
132
+ return {}
133
+ creds = {}
134
+ if on_demand_aws:
135
+ if not _HAVE_AUTH_AWS:
136
+ raise RuntimeError(
137
+ "On-demand AWS credentials require pymongo-auth-aws: "
138
+ "install with: python -m pip install 'pymongo[aws]'"
139
+ )
140
+ aws_creds = aws_temp_credentials()
141
+ creds_dict = {
142
+ "accessKeyId": aws_creds.username,
143
+ "secretAccessKey": aws_creds.password,
144
+ }
145
+ if aws_creds.token:
146
+ creds_dict["sessionToken"] = aws_creds.token
147
+ creds["aws"] = creds_dict
148
+ if on_demand_gcp:
149
+ creds["gcp"] = await _get_gcp_credentials()
150
+ if on_demand_azure:
151
+ try:
152
+ creds["azure"] = await _get_azure_credentials()
153
+ except Exception:
154
+ _azure_creds_cache = None
155
+ raise
156
+ return creds