libmongocrypt-helper 1.13.2.0.1001 → 1.14.0.0.1001

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. checksums.yaml +4 -4
  2. data/ext/libmongocrypt/libmongocrypt/CHANGELOG.md +8 -0
  3. data/ext/libmongocrypt/libmongocrypt/CMakeLists.txt +5 -1
  4. data/ext/libmongocrypt/libmongocrypt/CODEOWNERS +4 -1
  5. data/ext/libmongocrypt/libmongocrypt/Earthfile +18 -17
  6. data/ext/libmongocrypt/libmongocrypt/README.md +8 -8
  7. data/ext/libmongocrypt/libmongocrypt/bindings/python/CHANGELOG.rst +7 -0
  8. data/ext/libmongocrypt/libmongocrypt/bindings/python/CONTRIBUTING.md +34 -0
  9. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/asynchronous/state_machine.py +6 -2
  10. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/binding.py +18 -2
  11. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/mongocrypt.py +9 -1
  12. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/options.py +14 -0
  13. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/synchronous/state_machine.py +6 -2
  14. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/version.py +1 -1
  15. data/ext/libmongocrypt/libmongocrypt/bindings/python/sbom.json +8 -8
  16. data/ext/libmongocrypt/libmongocrypt/bindings/python/scripts/libmongocrypt-version.txt +1 -0
  17. data/ext/libmongocrypt/libmongocrypt/bindings/python/{release.sh → scripts/release.sh} +9 -3
  18. data/ext/libmongocrypt/libmongocrypt/bindings/python/{synchro.py → scripts/synchro.py} +16 -9
  19. data/ext/libmongocrypt/libmongocrypt/bindings/python/scripts/synchro.sh +8 -0
  20. data/ext/libmongocrypt/libmongocrypt/bindings/python/scripts/update-version.sh +27 -0
  21. data/ext/libmongocrypt/libmongocrypt/bindings/python/scripts/update_binding.py +78 -0
  22. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/test_mongocrypt.py +15 -0
  23. data/ext/libmongocrypt/libmongocrypt/doc/releasing.md +25 -18
  24. data/ext/libmongocrypt/libmongocrypt/etc/calc_release_version.py +39 -13
  25. data/ext/libmongocrypt/libmongocrypt/etc/calc_release_version_selftest.sh +1 -1
  26. data/ext/libmongocrypt/libmongocrypt/etc/cyclonedx.sbom.json +2 -2
  27. data/ext/libmongocrypt/libmongocrypt/kms-message/CMakeLists.txt +1 -1
  28. data/ext/libmongocrypt/libmongocrypt/kms-message/src/hexlify.c +5 -0
  29. data/ext/libmongocrypt/libmongocrypt/kms-message/src/hexlify.h +1 -1
  30. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_azure_request.c +1 -1
  31. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_gcp_request.c +1 -1
  32. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_reader_writer.c +4 -2
  33. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_request.c +1 -2
  34. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message_private.h +5 -1
  35. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_request.c +1 -1
  36. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_request_opt.c +1 -1
  37. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_request_str.c +2 -8
  38. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_request_str.h +9 -0
  39. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_response_parser.c +0 -1
  40. data/ext/libmongocrypt/libmongocrypt/kms-message/src/sort.c +7 -3
  41. data/ext/libmongocrypt/libmongocrypt/kms-message/src/sort.h +2 -0
  42. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kmip_reader_writer.c +8 -1
  43. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_assert.h +5 -4
  44. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_azure_online.c +1 -1
  45. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_gcp_online.c +1 -1
  46. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_kmip_request.c +4 -0
  47. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_kmip_response.c +3 -0
  48. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_kmip_response_parser.c +4 -0
  49. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_online_util.c +1 -1
  50. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_online_util.h +1 -1
  51. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_request.c +39 -39
  52. data/ext/libmongocrypt/libmongocrypt/src/crypto/libcrypto.c +235 -65
  53. data/ext/libmongocrypt/libmongocrypt/src/crypto/none.c +1 -1
  54. data/ext/libmongocrypt/libmongocrypt/src/csfle-markup.cpp +4 -2
  55. data/ext/libmongocrypt/libmongocrypt/src/mc-dec128.h +2 -2
  56. data/ext/libmongocrypt/libmongocrypt/src/mc-dec128.test.cpp +2 -2
  57. data/ext/libmongocrypt/libmongocrypt/src/mc-efc-private.h +1 -4
  58. data/ext/libmongocrypt/libmongocrypt/src/mc-efc.c +9 -11
  59. data/ext/libmongocrypt/libmongocrypt/src/mc-fle-blob-subtype-private.h +1 -0
  60. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-encryption-placeholder-private.h +10 -8
  61. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-encryption-placeholder.c +167 -176
  62. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload-v2.c +6 -17
  63. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload.c +6 -17
  64. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload-private-v2.h +1 -1
  65. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload-v2.c +25 -26
  66. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload.c +2 -1
  67. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-text-payload-private.h +122 -0
  68. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-text-payload.c +477 -0
  69. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-private-v2.h +1 -3
  70. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-v2.c +28 -43
  71. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload.c +6 -17
  72. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev-v2.c +6 -5
  73. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev.c +13 -10
  74. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-common.c +3 -2
  75. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-rfds.c +7 -6
  76. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-tag-and-encrypted-metadata-block.c +4 -3
  77. data/ext/libmongocrypt/libmongocrypt/src/mc-optional-private.h +1 -1
  78. data/ext/libmongocrypt/libmongocrypt/src/mc-parse-utils-private.h +27 -0
  79. data/ext/libmongocrypt/libmongocrypt/src/mc-parse-utils.c +48 -0
  80. data/ext/libmongocrypt/libmongocrypt/src/mc-range-edge-generation-private.h +5 -5
  81. data/ext/libmongocrypt/libmongocrypt/src/mc-range-edge-generation.c +15 -20
  82. data/ext/libmongocrypt/libmongocrypt/src/mc-range-encoding-private.h +4 -6
  83. data/ext/libmongocrypt/libmongocrypt/src/mc-range-encoding.c +9 -18
  84. data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover-generator.template.h +4 -5
  85. data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover-private.h +5 -9
  86. data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover.c +14 -19
  87. data/ext/libmongocrypt/libmongocrypt/src/mc-rangeopts-private.h +2 -4
  88. data/ext/libmongocrypt/libmongocrypt/src/mc-rangeopts.c +109 -119
  89. data/ext/libmongocrypt/libmongocrypt/src/mc-reader-private.h +2 -2
  90. data/ext/libmongocrypt/libmongocrypt/src/mc-reader.c +4 -2
  91. data/ext/libmongocrypt/libmongocrypt/src/mc-schema-broker-private.h +0 -3
  92. data/ext/libmongocrypt/libmongocrypt/src/mc-schema-broker.c +4 -14
  93. data/ext/libmongocrypt/libmongocrypt/src/mc-str-encode-string-sets-private.h +1 -1
  94. data/ext/libmongocrypt/libmongocrypt/src/mc-str-encode-string-sets.c +3 -3
  95. data/ext/libmongocrypt/libmongocrypt/src/mc-text-search-str-encode-private.h +8 -1
  96. data/ext/libmongocrypt/libmongocrypt/src/mc-text-search-str-encode.c +78 -2
  97. data/ext/libmongocrypt/libmongocrypt/src/mc-tokens-private.h +34 -16
  98. data/ext/libmongocrypt/libmongocrypt/src/mc-tokens.c +66 -74
  99. data/ext/libmongocrypt/libmongocrypt/src/mc-writer-private.h +1 -1
  100. data/ext/libmongocrypt/libmongocrypt/src/mc-writer.c +4 -2
  101. data/ext/libmongocrypt/libmongocrypt/src/mlib/error.h +1 -1
  102. data/ext/libmongocrypt/libmongocrypt/src/mlib/int128.h +12 -1
  103. data/ext/libmongocrypt/libmongocrypt/src/mlib/int128.test.cpp +5 -0
  104. data/ext/libmongocrypt/libmongocrypt/src/mlib/path.h +5 -5
  105. data/ext/libmongocrypt/libmongocrypt/src/mlib/path.test.c +2 -5
  106. data/ext/libmongocrypt/libmongocrypt/src/mlib/str.h +65 -58
  107. data/ext/libmongocrypt/libmongocrypt/src/mlib/str.test.c +3 -3
  108. data/ext/libmongocrypt/libmongocrypt/src/mlib/thread.h +1 -1
  109. data/ext/libmongocrypt/libmongocrypt/src/mlib/user-check.h +1 -1
  110. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-collinfo-private.h +1 -1
  111. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-collinfo.c +4 -0
  112. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ciphertext-private.h +1 -1
  113. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-crypto-private.h +4 -4
  114. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-crypto.c +29 -25
  115. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-datakey.c +3 -2
  116. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-decrypt.c +6 -3
  117. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-encrypt.c +48 -58
  118. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-rewrap-many-datakey.c +12 -0
  119. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx.c +5 -13
  120. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-dll-private.h +19 -2
  121. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-broker.c +9 -9
  122. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-marking-private.h +3 -4
  123. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-marking.c +285 -89
  124. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-opts-private.h +0 -2
  125. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-opts.c +0 -1
  126. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-private.h +1 -1
  127. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-util.c +4 -1
  128. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt.c +47 -31
  129. data/ext/libmongocrypt/libmongocrypt/src/os_posix/os_dll.c +2 -0
  130. data/ext/libmongocrypt/libmongocrypt/src/os_posix/os_mutex.c +1 -1
  131. data/ext/libmongocrypt/libmongocrypt/src/os_win/os_dll.c +3 -1
  132. data/ext/libmongocrypt/libmongocrypt/src/os_win/os_mutex.c +1 -1
  133. data/ext/libmongocrypt/libmongocrypt/src/unicode/case-fold-map.c +1 -1
  134. data/ext/libmongocrypt/libmongocrypt/src/unicode/diacritic-fold-map.c +1 -1
  135. data/ext/libmongocrypt/libmongocrypt/src/unicode/fold.c +1 -1
  136. data/ext/libmongocrypt/libmongocrypt/test/crypt_shared-stub.cpp +0 -14
  137. data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/encrypted-field-config-map.json +6 -1
  138. data/ext/libmongocrypt/libmongocrypt/test/data/explicit-decrypt/FLE2InsertUpdatePayloadV2-RangeV2.json +8 -0
  139. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date-v2/encrypted-field-map.json +1 -1
  140. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date-v2/encrypted-payload.json +6 -4
  141. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date-v2/mongocryptd-reply.json +1 -1
  142. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision-v2/encrypted-field-map.json +1 -1
  143. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision-v2/encrypted-payload.json +6 -4
  144. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision-v2/mongocryptd-reply.json +2 -2
  145. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-v2/encrypted-field-map.json +1 -1
  146. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-v2/encrypted-payload.json +6 -4
  147. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-v2/mongocryptd-reply.json +1 -1
  148. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision-v2/encrypted-payload.json +14 -6
  149. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-v2/encrypted-field-map.json +1 -1
  150. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-v2/encrypted-payload.json +6 -4
  151. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-v2/mongocryptd-reply.json +1 -1
  152. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32-v2/encrypted-field-map.json +1 -1
  153. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32-v2/encrypted-payload.json +6 -4
  154. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32-v2/mongocryptd-reply.json +1 -1
  155. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64-v2/encrypted-field-map.json +1 -1
  156. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64-v2/encrypted-payload.json +6 -4
  157. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64-v2/mongocryptd-reply.json +1 -1
  158. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/double/encrypted-payload-v2.json +1 -1
  159. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/double-precision/encrypted-payload-v2.json +1 -1
  160. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32/encrypted-payload-v2.json +1 -1
  161. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-openinterval/encrypted-payload-v2.json +1 -1
  162. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date-v2/encrypted-field-map.json +1 -1
  163. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date-v2/encrypted-payload.json +6 -4
  164. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date-v2/mongocryptd-reply.json +1 -1
  165. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision-v2/encrypted-field-map.json +1 -1
  166. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision-v2/encrypted-payload.json +6 -4
  167. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision-v2/mongocryptd-reply.json +1 -1
  168. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-v2/encrypted-field-map.json +1 -1
  169. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-v2/encrypted-payload.json +6 -4
  170. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-v2/mongocryptd-reply.json +1 -1
  171. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision-v2/encrypted-payload.json +14 -6
  172. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-v2/encrypted-field-map.json +1 -1
  173. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-v2/encrypted-payload.json +6 -4
  174. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-v2/mongocryptd-reply.json +1 -1
  175. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32-v2/encrypted-field-map.json +1 -1
  176. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32-v2/encrypted-payload.json +3 -3
  177. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32-v2/mongocryptd-reply.json +1 -1
  178. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64-v2/encrypted-field-map.json +1 -1
  179. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64-v2/encrypted-payload.json +6 -4
  180. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64-v2/mongocryptd-reply.json +1 -1
  181. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double/encrypted-payload-v2.json +1 -1
  182. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double-precision/encrypted-payload-v2.json +1 -1
  183. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32/encrypted-payload-v2.json +1 -1
  184. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/sparsity-2/encrypted-payload-v2.json +1 -1
  185. data/ext/libmongocrypt/libmongocrypt/test/data/tokens/mc.json +8 -0
  186. data/ext/libmongocrypt/libmongocrypt/test/data/tokens/server.json +8 -0
  187. data/ext/libmongocrypt/libmongocrypt/test/example-state-machine.c +5 -5
  188. data/ext/libmongocrypt/libmongocrypt/test/test-dll.cpp +11 -5
  189. data/ext/libmongocrypt/libmongocrypt/test/test-gcp-auth.c +2 -2
  190. data/ext/libmongocrypt/libmongocrypt/test/test-mc-efc.c +9 -11
  191. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-encryption-placeholder.c +18 -29
  192. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-find-equality-payload-v2.c +1 -1
  193. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-find-range-payload-v2.c +2 -18
  194. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-find-text-payload.c +320 -0
  195. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iup-v2.c +2 -17
  196. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iup.c +1 -1
  197. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-rfds.c +8 -5
  198. data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-edge-generation.c +6 -10
  199. data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-encoding.c +29 -33
  200. data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-mincover.c +12 -20
  201. data/ext/libmongocrypt/libmongocrypt/test/test-mc-rangeopts.c +5 -20
  202. data/ext/libmongocrypt/libmongocrypt/test/test-mc-reader.c +5 -5
  203. data/ext/libmongocrypt/libmongocrypt/test/test-mc-text-search-str-encode.c +147 -18
  204. data/ext/libmongocrypt/libmongocrypt/test/test-mc-tokens.c +35 -14
  205. data/ext/libmongocrypt/libmongocrypt/test/test-mc-writer.c +10 -10
  206. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert-match-bson.c +3 -7
  207. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert.h +36 -24
  208. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-buffer.c +4 -4
  209. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-cache.c +2 -2
  210. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ciphertext.c +13 -13
  211. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-cleanup.c +49 -55
  212. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-compact.c +64 -67
  213. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-hooks.c +18 -18
  214. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-std-hooks.c +4 -0
  215. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto.c +4 -3
  216. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-csfle-lib.c +13 -3
  217. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-decrypt.c +31 -13
  218. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-encrypt.c +35 -52
  219. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-rewrap-many-datakey.c +28 -1
  220. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-setopt.c +50 -91
  221. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-datakey.c +1 -1
  222. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-dll.c +7 -4
  223. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-endpoint.c +1 -1
  224. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kek.c +1 -1
  225. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-key-cache.c +3 -5
  226. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kms-ctx.c +2 -2
  227. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-local-kms.c +1 -1
  228. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-log.c +2 -2
  229. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-marking.c +527 -225
  230. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-status.c +1 -1
  231. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt.c +45 -56
  232. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt.h +12 -3
  233. data/ext/libmongocrypt/libmongocrypt/test/test-named-kms-providers.c +11 -11
  234. data/ext/libmongocrypt/libmongocrypt/test/test-unicode-fold.c +6 -2
  235. data/ext/libmongocrypt/libmongocrypt/test/util/HELP.autogen +1 -1
  236. data/ext/libmongocrypt/libmongocrypt/test/util/csfle.c +1 -1
  237. data/ext/libmongocrypt/libmongocrypt/test/util/util.c +5 -5
  238. data/ext/libmongocrypt/libmongocrypt/test/util/util.h +7 -6
  239. data/lib/libmongocrypt_helper/version.rb +2 -2
  240. metadata +17 -13
  241. data/ext/libmongocrypt/libmongocrypt/bindings/python/libmongocrypt-version.txt +0 -1
  242. data/ext/libmongocrypt/libmongocrypt/bindings/python/strip_header.py +0 -50
  243. data/ext/libmongocrypt/libmongocrypt/bindings/python/update-sbom.sh +0 -14
  244. data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/success/encrypted-payload.json +0 -29
  245. data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/encrypted-payload.json +0 -29
  246. data/ext/libmongocrypt/libmongocrypt/test/data/explicit-decrypt/FLE2EqualityIndexedValueV2.json +0 -8
  247. data/ext/libmongocrypt/libmongocrypt/test/data/explicit-decrypt/FLE2RangeIndexedValueV2.json +0 -8
  248. /data/ext/libmongocrypt/libmongocrypt/bindings/python/{build-manylinux-wheel.sh → scripts/build-manylinux-wheel.sh} +0 -0
  249. /data/ext/libmongocrypt/libmongocrypt/test/data/explicit-decrypt/{FLE2InsertUpdatePayload-with-edges.json → FLE2InsertUpdatePayload-RangeV1.json} +0 -0
  250. /data/ext/libmongocrypt/libmongocrypt/test/data/explicit-decrypt/{FLE2InsertUpdatePayload-with-edges-V2.json → FLE2InsertUpdatePayloadV2-RangeV1.json} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: baf822be923fbdd64028517f349c49776bcd49fc71a20b2625bb0e7f947db6ee
4
- data.tar.gz: d54d214ba2f0bbab4ad98adb1eb36ec4f1bd301eda8835e02a8f211c787a925a
3
+ metadata.gz: 197853e4c5046361f1d1de43cfb17680ebbc2ffb124fb28335987dae0ef1a574
4
+ data.tar.gz: 96bccae1037132b830c908db7a5664f6d019dd16e173dcdd615e91a9b41bd1e7
5
5
  SHA512:
6
- metadata.gz: d834c0a45d8f3bdd61e6031f9bb9ef2f66dee31c1155c8ac15b33b22cba6267b6cfc714235c0a93e010a701535ee3e8615276af62239e30d764d4adac10b69f6
7
- data.tar.gz: 63e6f9acb70f94690bd11edd415fbfffabb5051c8c5c59b6ddaeeb809e0f423f24297f0541ca3f1e8e3e496b66beaae2fea7b05add2d4dd16af44aa1615b398a
6
+ metadata.gz: 76e6da0aa60bcc18568e4d0fde151a064887789ade68ef0e98da3d51b1c408f5ea9b6311f95a4a77422df1a7fd74c3550c0335e2d8b352b8c14d7af7a7dddad4
7
+ data.tar.gz: 4c61332a072aafdfc09034fa3f305637ffd8e3276186101261b6d4a09ea7340966d783093f43ed5067ec3489f23e42eea04436e51eb49ae69bdf098c8a0be38b
@@ -1,4 +1,12 @@
1
1
  # ChangeLog
2
+ ## 1.14.0
3
+ ### Fixed
4
+ - Fix building against libbson with extra alignment enabled (`ENABLE_EXTRA_ALIGNMENT=ON`).
5
+ - Retry KMS encrypt request for context created by `mongocrypt_ctx_rewrap_many_datakey_init`.
6
+ ### Improvements
7
+ - Improve performance of OpenSSL crypto operations.
8
+ - Improve error for incorrect path to crypt_shared library.
9
+
2
10
  ## 1.13.2
3
11
  ### Notes
4
12
  - Bump downloaded libbson version from 1.28.1 to 1.30.3. Fixes a CMake configure error on macOS with CMake 4.
@@ -108,6 +108,7 @@ set (MONGOCRYPT_SOURCES
108
108
  src/mc-fle2-encryption-placeholder.c
109
109
  src/mc-fle2-find-equality-payload.c
110
110
  src/mc-fle2-find-equality-payload-v2.c
111
+ src/mc-fle2-find-text-payload.c
111
112
  src/mc-fle2-payload-iev.c
112
113
  src/mc-fle2-payload-iev-v2.c
113
114
  src/mc-fle2-payload-uev.c
@@ -115,6 +116,7 @@ set (MONGOCRYPT_SOURCES
115
116
  src/mc-fle2-payload-uev-v2.c
116
117
  src/mc-fle2-rfds.c
117
118
  src/mc-fle2-tag-and-encrypted-metadata-block.c
119
+ src/mc-parse-utils.c
118
120
  src/mc-range-edge-generation.c
119
121
  src/mc-range-mincover.c
120
122
  src/mc-range-encoding.c
@@ -469,6 +471,7 @@ set (TEST_MONGOCRYPT_SOURCES
469
471
  test/test-mc-fle2-encryption-placeholder.c
470
472
  test/test-mc-fle2-find-equality-payload-v2.c
471
473
  test/test-mc-fle2-find-range-payload-v2.c
474
+ test/test-mc-fle2-find-text-payload.c
472
475
  test/test-mc-fle2-payload-iev.c
473
476
  test/test-mc-fle2-payload-iev-v2.c
474
477
  test/test-mc-fle2-payload-iup.c
@@ -533,6 +536,8 @@ target_compile_definitions (test-mongocrypt PRIVATE
533
536
  "TEST_MONGOCRYPT_OUTPUT_PATH=\"$<TARGET_FILE:test-mongocrypt>\""
534
537
  # Tell test-mongocrypt whether we have a real csfle library for testing
535
538
  TEST_MONGOCRYPT_HAVE_REAL_CRYPT_SHARED_LIB=$<BOOL:${MONGOCRYPT_TESTING_CRYPT_SHARED_FILE}>
539
+ # Tell test-mongocrypt the path of the libmongocrypt shared library for testing.
540
+ "TEST_MONGOCRYPT_MONGOCRYPT_SHARED_PATH=\"$<TARGET_FILE:mongocrypt>\""
536
541
  )
537
542
 
538
543
  add_test (
@@ -712,4 +717,3 @@ install (
712
717
  COMPONENT
713
718
  Devel
714
719
  )
715
-
@@ -1,4 +1,7 @@
1
1
  # Code Owners will automatically be added as reviewers on PRs
2
2
 
3
+ # Listing code owners is required by DRIVERS-3098
4
+ * @mongodb/dbx-c-cxx
5
+
3
6
  # Python Bindings
4
- bindings/python @mongodb/dbx-python
7
+ bindings/python @mongodb/dbx-python
@@ -50,15 +50,16 @@
50
50
  # • sles15 - OpenSUSE Leap 15.0
51
51
  # • alpine - Alpine Linux 3.18
52
52
  #
53
- # When adding new environments, always pull from a fully-qualified image ID:
53
+ # When adding new environments, prefer an unqualified image ID with a version:
54
54
  # • DO NOT: "ubuntu"
55
55
  # • DO NOT: "ubuntu:latest"
56
- # • DO NOT: "ubuntu:22.10"
57
- # • DO: "artifactory.corp.mongodb.com/dockerhub/library/ubuntu:22.10"
56
+ # • DO NOT: "docker.io/library/ubuntu:22.10"
57
+ # • DO: "ubuntu:22.10"
58
+ # Use of an unqualified image ID may enable separate registry in CI and local development.
58
59
  # ###
59
60
 
60
61
  VERSION --use-cache-command 0.6
61
- FROM artifactory.corp.mongodb.com/dockerhub/library/alpine:3.16
62
+ FROM alpine:3.16
62
63
  WORKDIR /s
63
64
 
64
65
  init:
@@ -125,24 +126,24 @@ ALPINE_SETUP:
125
126
 
126
127
  env.c6:
127
128
  # A CentOS 6 environment.
128
- FROM +init --base=artifactory.corp.mongodb.com/dockerhub/library/centos:6
129
+ FROM +init --base=centos:6
129
130
  DO +CENTOS6_SETUP
130
131
 
131
132
  env.c7:
132
133
  # A CentOS 7 environment.
133
- FROM +init --base=artifactory.corp.mongodb.com/dockerhub/library/centos:7
134
+ FROM +init --base=centos:7
134
135
  DO +REDHAT_SETUP
135
136
 
136
137
  env.rl8:
137
138
  # CentOS 8 is cancelled. Use RockyLinux 8 for our RHEL 8 environment.
138
- FROM +init --base=artifactory.corp.mongodb.com/dockerhub/library/rockylinux:8
139
+ FROM +init --base=rockylinux:8
139
140
  DO +REDHAT_SETUP
140
141
 
141
142
  # Utility command for Ubuntu environments
142
143
  ENV_UBUNTU:
143
144
  COMMAND
144
145
  ARG --required version
145
- FROM +init --base=artifactory.corp.mongodb.com/dockerhub/library/ubuntu:$version
146
+ FROM +init --base=ubuntu:$version
146
147
  DO +DEBIAN_SETUP
147
148
 
148
149
  env.u14:
@@ -167,19 +168,19 @@ env.u22:
167
168
 
168
169
  env.amzn1:
169
170
  # An Amazon "1" environment. (AmazonLinux 2018)
170
- FROM +init --base=artifactory.corp.mongodb.com/dockerhub/library/amazonlinux:2018.03
171
+ FROM +init --base=amazonlinux:2018.03
171
172
  DO +AMZ_SETUP
172
173
 
173
174
  env.amzn2:
174
175
  # An AmazonLinux 2 environment
175
- FROM +init --base=artifactory.corp.mongodb.com/dockerhub/library/amazonlinux:2
176
+ FROM +init --base=amazonlinux:2
176
177
  DO +AMZ_SETUP
177
178
 
178
179
  # Utility command for Debian setup
179
180
  ENV_DEBIAN:
180
181
  COMMAND
181
182
  ARG --required version
182
- FROM +init --base=artifactory.corp.mongodb.com/dockerhub/library/debian:$version
183
+ FROM +init --base=debian:$version
183
184
  IF [ $version = "9.2" ]
184
185
  # Update source list for archived Debian stretch packages.
185
186
  # Refer: https://unix.stackexchange.com/a/743865/260858
@@ -208,11 +209,11 @@ env.deb12:
208
209
 
209
210
  env.sles15:
210
211
  # An OpenSUSE Leap 15.0 environment.
211
- FROM +init --base=artifactory.corp.mongodb.com/dockerhub/opensuse/leap:15.0
212
+ FROM +init --base=opensuse/leap:15.0
212
213
  DO +SLES_SETUP
213
214
 
214
215
  env.alpine:
215
- FROM +init --base=artifactory.corp.mongodb.com/dockerhub/library/alpine:3.18
216
+ FROM +init --base=alpine:3.18
216
217
  DO +ALPINE_SETUP
217
218
 
218
219
  # Utility: Warm-up obtaining CMake and Ninja for the build. This is usually
@@ -259,7 +260,7 @@ BUILD_EXAMPLE_STATE_MACHINE:
259
260
  RUN cd /s && /s/example-state-machine
260
261
 
261
262
  rpm-build:
262
- FROM +init --base artifactory.corp.mongodb.com/dockerhub/fedora:38
263
+ FROM +init --base fedora:38
263
264
  GIT CLONE https://src.fedoraproject.org/rpms/libmongocrypt.git /R
264
265
  # Install the packages listed by "BuildRequires" and rpm-build:
265
266
  RUN __install $(awk '/^BuildRequires:/ { print $2 }' /R/libmongocrypt.spec) \
@@ -275,7 +276,7 @@ rpm-build:
275
276
 
276
277
  rpm-install-runtime:
277
278
  # Install the runtime RPM
278
- FROM +init --base artifactory.corp.mongodb.com/dockerhub/fedora:38
279
+ FROM +init --base fedora:38
279
280
  COPY +rpm-build/RPMS /tmp/libmongocrypt-rpm/
280
281
  RUN dnf makecache
281
282
  RUN __install $(find /tmp/libmongocrypt-rpm/ -name 'libmongocrypt-1.*.rpm')
@@ -325,7 +326,7 @@ deb-build:
325
326
 
326
327
  deb-install-runtime:
327
328
  # Install the runtime deb package
328
- FROM +init --base=artifactory.corp.mongodb.com/dockerhub/library/debian:unstable
329
+ FROM +init --base=debian:unstable
329
330
  COPY +deb-build/debs/libmongocrypt0*.deb /tmp/lmc.deb
330
331
  RUN __install /tmp/lmc.deb
331
332
 
@@ -354,7 +355,7 @@ packaging-full-test:
354
355
  BUILD +rpm-runtime-test
355
356
 
356
357
  check-format:
357
- FROM +init --base=artifactory.corp.mongodb.com/dockerhub/python:3.11.2-slim-buster
358
+ FROM +init --base=python:3.11.2-slim-buster
358
359
  RUN __install build-essential # To install `make` to install clang-format.
359
360
  RUN pip install pipx
360
361
  COPY etc/format* /X/etc/
@@ -103,7 +103,7 @@ See [releasing](./doc/releasing.md).
103
103
  Distribution packages (i.e., .deb/.rpm) are built and published for several Linux distributions. The installation of these packages for supported platforms is documented here.
104
104
 
105
105
  ### Unstable Development Distribution Packages ###
106
- To install the latest unstable development package, change `1.13` to `development` in the package URLs listed in the subsequent instructions. For example, `https://libmongocrypt.s3.amazonaws.com/apt/ubuntu <release>/libmongocrypt/1.13` in the instructions would become `https://libmongocrypt.s3.amazonaws.com/apt/ubuntu <release>/libmongocrypt/development`. Do not use the unstable version of libmongocrypt in a production environment.
106
+ To install the latest unstable development package, change `1.14` to `development` in the package URLs listed in the subsequent instructions. For example, `https://libmongocrypt.s3.amazonaws.com/apt/ubuntu <release>/libmongocrypt/1.14` in the instructions would become `https://libmongocrypt.s3.amazonaws.com/apt/ubuntu <release>/libmongocrypt/development`. Do not use the unstable version of libmongocrypt in a production environment.
107
107
 
108
108
  ### .deb Packages (Debian and Ubuntu) ###
109
109
 
@@ -144,13 +144,13 @@ sudo sh -c 'curl -s --location https://pgp.mongodb.com/libmongocrypt.asc | gpg -
144
144
  Second, create a list entry for the repository. For Ubuntu systems (be sure to change `<release>` to `xenial`, `bionic`, `focal`, or `jammy`, as appropriate to your system):
145
145
 
146
146
  ```
147
- echo "deb https://libmongocrypt.s3.amazonaws.com/apt/ubuntu <release>/libmongocrypt/1.13 universe" | sudo tee /etc/apt/sources.list.d/libmongocrypt.list
147
+ echo "deb https://libmongocrypt.s3.amazonaws.com/apt/ubuntu <release>/libmongocrypt/1.14 universe" | sudo tee /etc/apt/sources.list.d/libmongocrypt.list
148
148
  ```
149
149
 
150
150
  For Debian systems (be sure to change `<release>` to `stretch`, `buster`, `bullseye`, or `bookworm` as appropriate to your system):
151
151
 
152
152
  ```
153
- echo "deb https://libmongocrypt.s3.amazonaws.com/apt/debian <release>/libmongocrypt/1.13 main" | sudo tee /etc/apt/sources.list.d/libmongocrypt.list
153
+ echo "deb https://libmongocrypt.s3.amazonaws.com/apt/debian <release>/libmongocrypt/1.14 main" | sudo tee /etc/apt/sources.list.d/libmongocrypt.list
154
154
  ```
155
155
 
156
156
  #### Package installation ####
@@ -172,7 +172,7 @@ Create the file `/etc/yum.repos.d/libmongocrypt.repo` with contents:
172
172
  ```
173
173
  [libmongocrypt]
174
174
  name=libmongocrypt repository
175
- baseurl=https://libmongocrypt.s3.amazonaws.com/yum/redhat/$releasever/libmongocrypt/1.13/x86_64
175
+ baseurl=https://libmongocrypt.s3.amazonaws.com/yum/redhat/$releasever/libmongocrypt/1.14/x86_64
176
176
  gpgcheck=1
177
177
  enabled=1
178
178
  gpgkey=https://pgp.mongodb.com/libmongocrypt.asc
@@ -191,7 +191,7 @@ Create the file `/etc/yum.repos.d/libmongocrypt.repo` with contents:
191
191
  ```
192
192
  [libmongocrypt]
193
193
  name=libmongocrypt repository
194
- baseurl=https://libmongocrypt.s3.amazonaws.com/yum/amazon/2023/libmongocrypt/1.13/x86_64
194
+ baseurl=https://libmongocrypt.s3.amazonaws.com/yum/amazon/2023/libmongocrypt/1.14/x86_64
195
195
  gpgcheck=1
196
196
  enabled=1
197
197
  gpgkey=https://pgp.mongodb.com/libmongocrypt.asc
@@ -210,7 +210,7 @@ Create the file `/etc/yum.repos.d/libmongocrypt.repo` with contents:
210
210
  ```
211
211
  [libmongocrypt]
212
212
  name=libmongocrypt repository
213
- baseurl=https://libmongocrypt.s3.amazonaws.com/yum/amazon/2/libmongocrypt/1.13/x86_64
213
+ baseurl=https://libmongocrypt.s3.amazonaws.com/yum/amazon/2/libmongocrypt/1.14/x86_64
214
214
  gpgcheck=1
215
215
  enabled=1
216
216
  gpgkey=https://pgp.mongodb.com/libmongocrypt.asc
@@ -229,7 +229,7 @@ Create the file `/etc/yum.repos.d/libmongocrypt.repo` with contents:
229
229
  ```
230
230
  [libmongocrypt]
231
231
  name=libmongocrypt repository
232
- baseurl=https://libmongocrypt.s3.amazonaws.com/yum/amazon/2013.03/libmongocrypt/1.13/x86_64
232
+ baseurl=https://libmongocrypt.s3.amazonaws.com/yum/amazon/2013.03/libmongocrypt/1.14/x86_64
233
233
  gpgcheck=1
234
234
  enabled=1
235
235
  gpgkey=https://pgp.mongodb.com/libmongocrypt.asc
@@ -252,7 +252,7 @@ sudo rpm --import https://pgp.mongodb.com/libmongocrypt.asc
252
252
  Second, add the repository (be sure to change `<release>` to `12` or `15`, as appropriate to your system):
253
253
 
254
254
  ```
255
- sudo zypper addrepo --gpgcheck "https://libmongocrypt.s3.amazonaws.com/zypper/suse/<release>/libmongocrypt/1.13/x86_64" libmongocrypt
255
+ sudo zypper addrepo --gpgcheck "https://libmongocrypt.s3.amazonaws.com/zypper/suse/<release>/libmongocrypt/1.14/x86_64" libmongocrypt
256
256
  ```
257
257
 
258
258
  Finally, install the libmongocrypt packages:
@@ -1,6 +1,13 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ Changes in Version 1.13.0
5
+ -------------------------
6
+
7
+ - Bundle libmongocrypt 1.13.1 in release wheels.
8
+ - Add support for the ``key_expiration_ms`` option to ``MongoCryptOptions``.
9
+ - Add support for ``$lookup`` in CSFLE and QE.
10
+
4
11
  Changes in Version 1.12.0
5
12
  -------------------------
6
13
 
@@ -0,0 +1,34 @@
1
+ # Contributing to PyMongoCrypt
2
+
3
+ ## Asyncio considerations
4
+ PyMongoCrypt adds asyncio capability by modifying the source files in */asynchronous to */synchronous using [unasync](https://github.com/python-trio/unasync/) and some custom transforms.
5
+
6
+ Where possible, edit the code in `*/asynchronous/*.py` and not the synchronous files. You can run `pre-commit run --all-files synchro` before running tests if you are testing synchronous code.
7
+
8
+ To prevent the synchro hook from accidentally overwriting code, it first checks to see whether a sync version of a file is changing and not its async counterpart, and will fail. In the unlikely scenario that you want to override this behavior, first export `OVERRIDE_SYNCHRO_CHECK=1`.
9
+
10
+ Sometimes, the synchro hook will fail and introduce changes many previously unmodified files. This is due to static Python errors, such as missing imports, incorrect syntax, or other fatal typos. To resolve these issues, run `pre-commit run --all-files --hook-stage manual ruff` and fix all reported errors before running the synchro hook again.
11
+
12
+ ## Updating the libmongocrypt bindings
13
+
14
+ To update the libmongocrypt bindings in `pymongocrypt/binding.py`, run the following script:
15
+
16
+ ```bash
17
+ python scripts/update_binding.py
18
+ ```
19
+
20
+ ## Update the bundled version of libmongocrypt
21
+
22
+ To update the bundled version of libmongocrypt, run the following script:
23
+
24
+ ```bash
25
+ bash script/update-version.sh <new-version>
26
+ ```
27
+
28
+ This will set the version in `scripts/libmongocrypt-version.sh` and update `sbom.json` to reflect
29
+ the new vendored version of `libmongocrypt`.
30
+
31
+ ## Building wheels
32
+
33
+ To build wheels, run `scripts/release.sh`. It will build the appropriate wheel for the current system
34
+ on Windows and MacOS. If docker is available on Linux or MacOS, it will build the manylinux wheels.
@@ -46,7 +46,7 @@ class AsyncMongoCryptCallback(ABC):
46
46
  - `filter`: The filter to pass to listCollections.
47
47
 
48
48
  :Returns:
49
- The first document from the listCollections command response as BSON.
49
+ The all or first document from the listCollections command response as BSON.
50
50
  """
51
51
 
52
52
  @abstractmethod
@@ -125,7 +125,11 @@ async def run_state_machine(ctx, callback):
125
125
  list_colls_filter = ctx.mongo_operation()
126
126
  coll_info = await callback.collection_info(ctx.database, list_colls_filter)
127
127
  if coll_info:
128
- ctx.add_mongo_operation_result(coll_info)
128
+ if isinstance(coll_info, list):
129
+ for i in coll_info:
130
+ ctx.add_mongo_operation_result(i)
131
+ else:
132
+ ctx.add_mongo_operation_result(coll_info)
129
133
  ctx.complete_mongo_operation()
130
134
  elif state == lib.MONGOCRYPT_CTX_NEED_MONGO_MARKINGS:
131
135
  mongocryptd_cmd = ctx.mongo_operation()
@@ -29,9 +29,10 @@ def _parse_version(version):
29
29
 
30
30
  ffi = cffi.FFI()
31
31
 
32
- # Generated with strip_header.py
32
+ # Start embedding from update_binding.py
33
33
  ffi.cdef(
34
- """/*
34
+ """
35
+ /*
35
36
  * Copyright 2019-present MongoDB, Inc.
36
37
  *
37
38
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -323,6 +324,16 @@ bool mongocrypt_setopt_log_handler(mongocrypt_t *crypt, mongocrypt_log_fn_t log_
323
324
  */
324
325
  bool mongocrypt_setopt_retry_kms(mongocrypt_t *crypt, bool enable);
325
326
 
327
+ /**
328
+ * Enable support for multiple collection schemas. Required to support $lookup.
329
+ *
330
+ * @param[in] crypt The @ref mongocrypt_t object.
331
+ * @pre @ref mongocrypt_init has not been called on @p crypt.
332
+ * @returns A boolean indicating success. If false, an error status is set.
333
+ * Retrieve it with @ref mongocrypt_ctx_status
334
+ */
335
+ bool mongocrypt_setopt_enable_multiple_collinfo(mongocrypt_t *crypt);
336
+
326
337
  /**
327
338
  * Configure an AWS KMS provider on the @ref mongocrypt_t object.
328
339
  *
@@ -1466,8 +1477,13 @@ bool mongocrypt_setopt_key_expiration(mongocrypt_t *crypt, uint64_t cache_expira
1466
1477
 
1467
1478
  /// String constants for setopt_query_type
1468
1479
  // DEPRECATED: Support "rangePreview" has been removed in favor of "range".
1480
+ /// NOTE: "substringPreview" is experimental and may be removed in a future non-major release.
1481
+ /// NOTE: "suffixPreview" is experimental and may be removed in a future non-major release.
1482
+ /// NOTE: "prefixPreview" is experimental and may be removed in a future non-major release.
1483
+
1469
1484
  """
1470
1485
  )
1486
+ # End embedding from update_binding.py
1471
1487
 
1472
1488
 
1473
1489
  def _to_string(cdata):
@@ -96,6 +96,9 @@ class MongoCrypt:
96
96
  if self.__opts.bypass_query_analysis:
97
97
  lib.mongocrypt_setopt_bypass_query_analysis(self.__crypt)
98
98
 
99
+ if self.__opts.enable_multiple_collinfo:
100
+ lib.mongocrypt_setopt_enable_multiple_collinfo(self.__crypt)
101
+
99
102
  # Prefer using the native crypto binding when we know it's available.
100
103
  try:
101
104
  crypto_available = lib.mongocrypt_is_crypto_available()
@@ -149,10 +152,15 @@ class MongoCrypt:
149
152
  if any([on_demand_aws, on_demand_gcp, on_demand_azure]):
150
153
  lib.mongocrypt_setopt_use_need_kms_credentials_state(self.__crypt)
151
154
 
152
- # Enable KMS retry when available, libmongocrypt >= 1.12.0,
155
+ # Enable KMS retry and key_expiration_ms when available, libmongocrypt >= 1.12.0,
153
156
  try:
154
157
  if not lib.mongocrypt_setopt_retry_kms(self.__crypt, True):
155
158
  self.__raise_from_status()
159
+ if self.__opts.key_expiration_ms is not None:
160
+ if not lib.mongocrypt_setopt_key_expiration(
161
+ self.__crypt, self.__opts.key_expiration_ms
162
+ ):
163
+ self.__raise_from_status()
156
164
  except AttributeError:
157
165
  # libmongocrypt < 1.12
158
166
  pass
@@ -11,6 +11,8 @@ class MongoCryptOptions:
11
11
  crypt_shared_lib_path=None,
12
12
  crypt_shared_lib_required=False,
13
13
  bypass_encryption=False,
14
+ key_expiration_ms=None,
15
+ enable_multiple_collinfo=False,
14
16
  ):
15
17
  """Options for :class:`MongoCrypt`.
16
18
 
@@ -53,6 +55,11 @@ class MongoCryptOptions:
53
55
  - `crypt_shared_lib_required`: Whether to require a crypt_shared
54
56
  library.
55
57
  - `bypass_encryption`: Whether to bypass encryption.
58
+ - `key_expiration_ms` (int): The cache expiration time for data
59
+ encryption keys. Defaults to 60000. 0 means keys never expire.
60
+
61
+ .. versionadded:: 1.13
62
+ Added the ``key_expiration_ms`` parameter.
56
63
 
57
64
  .. versionremoved:: 1.11
58
65
  Removed the ``enable_range_v2`` parameter.
@@ -136,6 +143,11 @@ class MongoCryptOptions:
136
143
  encrypted_fields_map, bytes
137
144
  ):
138
145
  raise TypeError("encrypted_fields_map must be bytes or None")
146
+ if key_expiration_ms is not None:
147
+ if not isinstance(key_expiration_ms, int):
148
+ raise TypeError("key_expiration_ms must be int or None")
149
+ if key_expiration_ms < 0:
150
+ raise ValueError("key_expiration_ms must be >=0 or None")
139
151
 
140
152
  self.kms_providers = kms_providers
141
153
  self.schema_map = schema_map
@@ -144,6 +156,8 @@ class MongoCryptOptions:
144
156
  self.crypt_shared_lib_path = crypt_shared_lib_path
145
157
  self.crypt_shared_lib_required = crypt_shared_lib_required
146
158
  self.bypass_encryption = bypass_encryption
159
+ self.key_expiration_ms = key_expiration_ms
160
+ self.enable_multiple_collinfo = enable_multiple_collinfo
147
161
 
148
162
 
149
163
  class ExplicitEncryptOpts:
@@ -46,7 +46,7 @@ class MongoCryptCallback(ABC):
46
46
  - `filter`: The filter to pass to listCollections.
47
47
 
48
48
  :Returns:
49
- The first document from the listCollections command response as BSON.
49
+ The all or first document from the listCollections command response as BSON.
50
50
  """
51
51
 
52
52
  @abstractmethod
@@ -125,7 +125,11 @@ def run_state_machine(ctx, callback):
125
125
  list_colls_filter = ctx.mongo_operation()
126
126
  coll_info = callback.collection_info(ctx.database, list_colls_filter)
127
127
  if coll_info:
128
- ctx.add_mongo_operation_result(coll_info)
128
+ if isinstance(coll_info, list):
129
+ for i in coll_info:
130
+ ctx.add_mongo_operation_result(i)
131
+ else:
132
+ ctx.add_mongo_operation_result(coll_info)
129
133
  ctx.complete_mongo_operation()
130
134
  elif state == lib.MONGOCRYPT_CTX_NEED_MONGO_MARKINGS:
131
135
  mongocryptd_cmd = ctx.mongo_operation()
@@ -12,6 +12,6 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- __version__ = "1.13.0.dev0"
15
+ __version__ = "1.14.0.dev0"
16
16
 
17
17
  _MIN_LIBMONGOCRYPT_VERSION = "1.8.0"
@@ -1,31 +1,31 @@
1
1
  {
2
2
  "components": [
3
3
  {
4
- "bom-ref": "pkg:github/mongodb/libmongocrypt@1.12.0",
4
+ "bom-ref": "pkg:github/mongodb/libmongocrypt@1.13.1",
5
5
  "externalReferences": [
6
6
  {
7
7
  "type": "distribution",
8
- "url": "https://github.com/mongodb/libmongocrypt/archive/refs/tags/1.12.0.tar.gz"
8
+ "url": "https://github.com/mongodb/libmongocrypt/archive/refs/tags/1.13.1.tar.gz"
9
9
  },
10
10
  {
11
11
  "type": "website",
12
- "url": "https://github.com/mongodb/libmongocrypt/tree/1.12.0"
12
+ "url": "https://github.com/mongodb/libmongocrypt/tree/1.13.1"
13
13
  }
14
14
  ],
15
15
  "group": "mongodb",
16
16
  "name": "libmongocrypt",
17
- "purl": "pkg:github/mongodb/libmongocrypt@1.12.0",
17
+ "purl": "pkg:github/mongodb/libmongocrypt@1.13.1",
18
18
  "type": "library",
19
- "version": "1.12.0"
19
+ "version": "1.13.1"
20
20
  }
21
21
  ],
22
22
  "dependencies": [
23
23
  {
24
- "ref": "pkg:github/mongodb/libmongocrypt@1.12.0"
24
+ "ref": "pkg:github/mongodb/libmongocrypt@1.13.1"
25
25
  }
26
26
  ],
27
27
  "metadata": {
28
- "timestamp": "2024-12-30T18:25:06.574241+00:00",
28
+ "timestamp": "2025-04-01T19:53:54.393395+00:00",
29
29
  "tools": [
30
30
  {
31
31
  "externalReferences": [
@@ -68,7 +68,7 @@
68
68
  }
69
69
  ]
70
70
  },
71
- "serialNumber": "urn:uuid:5e81b4d2-1313-43dd-9ec0-b958d0d71bca",
71
+ "serialNumber": "urn:uuid:a5e0a753-031f-43e3-ac20-f39b878c46e1",
72
72
  "version": 1,
73
73
  "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
74
74
  "bomFormat": "CycloneDX",
@@ -15,14 +15,19 @@
15
15
  set -o xtrace # Write all commands first to stderr
16
16
  set -o errexit # Exit the script with error if any of the commands fail
17
17
 
18
+ SCRIPT_DIR=$(dirname ${BASH_SOURCE:-$0})
19
+
18
20
  # The libmongocrypt git revision release to embed in our wheels.
19
- LIBMONGOCRYPT_VERSION=$(cat ./libmongocrypt-version.txt)
21
+ LIBMONGOCRYPT_VERSION=$(cat $SCRIPT_DIR/libmongocrypt-version.txt)
20
22
  REVISION=$(git rev-list -n 1 $LIBMONGOCRYPT_VERSION)
21
23
  # The libmongocrypt release branch.
22
- BRANCH="r1.12"
24
+ MINOR_VERSION=$(echo $LIBMONGOCRYPT_VERSION | cut -d. -f1,2)
25
+ BRANCH="r${MINOR_VERSION}"
23
26
  # The python executable to use.
24
27
  PYTHON=${PYTHON:-python}
25
28
 
29
+ pushd $SCRIPT_DIR/..
30
+
26
31
  # Clean slate.
27
32
  rm -rf dist .venv build libmongocrypt pymongocrypt/*.so pymongocrypt/*.dll pymongocrypt/*.dylib
28
33
 
@@ -48,7 +53,7 @@ function build_wheel() {
48
53
  function build_manylinux_wheel() {
49
54
  python -m pip install unasync
50
55
  docker pull $1
51
- docker run --rm -v `pwd`:/python $1 /python/build-manylinux-wheel.sh
56
+ docker run --rm -v `pwd`:/python $1 /python/scripts/build-manylinux-wheel.sh
52
57
  # Sudo is needed to remove the files created by docker.
53
58
  sudo rm -rf build libmongocrypt pymongocrypt/*.so pymongocrypt/*.dll pymongocrypt/*.dylib
54
59
  }
@@ -126,3 +131,4 @@ if [ $(command -v docker) ]; then
126
131
  fi
127
132
 
128
133
  ls -ltr dist
134
+ popd
@@ -12,6 +12,8 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
+ import os
16
+ import sys
15
17
  from os import listdir
16
18
  from pathlib import Path
17
19
 
@@ -27,12 +29,14 @@ replacements = {
27
29
  "aclose": "close",
28
30
  }
29
31
 
30
- _base = "pymongocrypt"
32
+ ROOT = Path(__file__).absolute().parent.parent
33
+
34
+ _base = ROOT / "pymongocrypt"
31
35
 
32
36
  async_files = [
33
- f"./{_base}/asynchronous/{f}"
34
- for f in listdir("pymongocrypt/asynchronous")
35
- if (Path(_base) / "asynchronous" / f).is_file()
37
+ f"{_base}/asynchronous/{f}"
38
+ for f in listdir(f"{_base}/asynchronous")
39
+ if (_base / "asynchronous" / f).is_file()
36
40
  ]
37
41
 
38
42
 
@@ -40,20 +44,23 @@ unasync_files(
40
44
  async_files,
41
45
  [
42
46
  Rule(
43
- fromdir="/pymongocrypt/asynchronous/",
44
- todir="/pymongocrypt/synchronous/",
47
+ fromdir=f"{_base}/asynchronous/",
48
+ todir=f"{_base}/synchronous/",
45
49
  additional_replacements=replacements,
46
50
  )
47
51
  ],
48
52
  )
49
53
 
50
54
  sync_files = [
51
- f"./{_base}/synchronous/{f}"
52
- for f in listdir("pymongocrypt/synchronous")
53
- if (Path(_base) / "synchronous" / f).is_file()
55
+ f"{_base}/synchronous/{f}"
56
+ for f in listdir(f"{_base}/synchronous")
57
+ if (_base / "synchronous" / f).is_file()
54
58
  ]
55
59
 
60
+ modified_files = [f"./{f}" for f in sys.argv[1:]]
56
61
  for file in sync_files:
62
+ if file in modified_files and "OVERRIDE_SYNCHRO_CHECK" not in os.environ:
63
+ raise ValueError(f"Refusing to overwrite {file}")
57
64
  with open(file, "r+") as f:
58
65
  lines = f.readlines()
59
66
  for i in range(len(lines)):
@@ -0,0 +1,8 @@
1
+ #!/bin/bash
2
+
3
+ set -eu
4
+
5
+ SCRIPT_DIR=$(dirname ${BASH_SOURCE:-$0})
6
+
7
+ python $SCRIPT_DIR/synchro.py "$@"
8
+ python -m ruff check $SCRIPT_DIR/../pymongocrypt/synchronous --fix --silent