From a4c7a14b2f02b471a7bbe199a61947634134ad52 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 18 Nov 2025 09:05:03 -0600 Subject: [PATCH] PYTHON-5640 Bundle libmongocrypt 1.17.0 --- bindings/python/CONTRIBUTING.md | 2 +- bindings/python/pymongocrypt/binding.py | 20 ++++++++++++++++++- bindings/python/sbom.json | 16 +++++++-------- .../python/scripts/libmongocrypt-version.txt | 2 +- 4 files changed, 29 insertions(+), 11 deletions(-) diff --git a/bindings/python/CONTRIBUTING.md b/bindings/python/CONTRIBUTING.md index a1a598368..6216055a8 100644 --- a/bindings/python/CONTRIBUTING.md +++ b/bindings/python/CONTRIBUTING.md @@ -22,7 +22,7 @@ python scripts/update_binding.py To update the bundled version of libmongocrypt, run the following script: ```bash -bash script/update-version.sh +bash scripts/update-version.sh ``` This will set the version in `scripts/libmongocrypt-version.sh` and update `sbom.json` to reflect diff --git a/bindings/python/pymongocrypt/binding.py b/bindings/python/pymongocrypt/binding.py index 919ad49de..4f1975e50 100644 --- a/bindings/python/pymongocrypt/binding.py +++ b/bindings/python/pymongocrypt/binding.py @@ -260,6 +260,7 @@ def _parse_version(version): MONGOCRYPT_LOG_LEVEL_ERROR = 1, MONGOCRYPT_LOG_LEVEL_WARNING = 2, MONGOCRYPT_LOG_LEVEL_INFO = 3, + MONGOCRYPT_LOG_LEVEL_TRACE = 4 } mongocrypt_log_level_t; /** @@ -1133,7 +1134,24 @@ def _parse_version(version): bool mongocrypt_kms_ctx_feed(mongocrypt_kms_ctx_t *kms, mongocrypt_binary_t *bytes); /** - * Indicate a network-level failure. + * Feed bytes from the KMS response. + * + * Feeding more bytes than what has been returned in @ref + * mongocrypt_kms_ctx_bytes_needed is an error. + * + * @param[in] kms The @ref mongocrypt_kms_ctx_t. + * @param[in] bytes The bytes to feed. The viewed data is copied. It is valid to + * destroy @p bytes with @ref mongocrypt_binary_destroy immediately after. + * @param[out] should_retry Whether the KMS request should be retried. Retry in-place + * without calling @ref mongocrypt_kms_ctx_fail. + * @returns A boolean indicating success. If false, an error status is set. + * Retrieve it with @ref mongocrypt_kms_ctx_status + */ +bool mongocrypt_kms_ctx_feed_with_retry(mongocrypt_kms_ctx_t *kms, mongocrypt_binary_t *bytes, bool *should_retry); + +/** + * Indicate a network error. Discards all data fed to this KMS context with @ref mongocrypt_kms_ctx_feed. + * The @ref mongocrypt_kms_ctx_t may be reused. * * @param[in] kms The @ref mongocrypt_kms_ctx_t. * @return A boolean indicating whether the failed request may be retried. diff --git a/bindings/python/sbom.json b/bindings/python/sbom.json index e7161b912..a590fcaf7 100644 --- a/bindings/python/sbom.json +++ b/bindings/python/sbom.json @@ -1,31 +1,31 @@ { "components": [ { - "bom-ref": "pkg:github/mongodb/libmongocrypt@1.15.1", + "bom-ref": "pkg:github/mongodb/libmongocrypt@1.17.0", "externalReferences": [ { "type": "distribution", - "url": "https://github.com/mongodb/libmongocrypt/archive/1.15.1.tar.gz" + "url": "https://github.com/mongodb/libmongocrypt/archive/refs/tags/1.17.0.tar.gz" }, { "type": "website", - "url": "https://github.com/mongodb/libmongocrypt/tree/1.15.1" + "url": "https://github.com/mongodb/libmongocrypt/tree/1.17.0" } ], "group": "mongodb", "name": "libmongocrypt", - "purl": "pkg:github/mongodb/libmongocrypt@1.15.1", + "purl": "pkg:github/mongodb/libmongocrypt@1.17.0", "type": "library", - "version": "1.15.1" + "version": "1.17.0" } ], "dependencies": [ { - "ref": "pkg:github/mongodb/libmongocrypt@1.15.1" + "ref": "pkg:github/mongodb/libmongocrypt@1.17.0" } ], "metadata": { - "timestamp": "2025-08-20T16:31:16.275568+00:00", + "timestamp": "2025-11-18T15:04:33.207498+00:00", "tools": [ { "externalReferences": [ @@ -68,7 +68,7 @@ } ] }, - "serialNumber": "urn:uuid:198741f4-51bf-4d57-a447-fc3217294b87", + "serialNumber": "urn:uuid:4884d162-e375-43fe-898f-2e743c74d1d3", "version": 1, "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json", "bomFormat": "CycloneDX", diff --git a/bindings/python/scripts/libmongocrypt-version.txt b/bindings/python/scripts/libmongocrypt-version.txt index ace44233b..092afa15d 100644 --- a/bindings/python/scripts/libmongocrypt-version.txt +++ b/bindings/python/scripts/libmongocrypt-version.txt @@ -1 +1 @@ -1.15.1 +1.17.0