From 71e0c950e14854e35d280d64950f132a497ffaca Mon Sep 17 00:00:00 2001 From: thanhnguyen-mdb Date: Thu, 20 Nov 2025 15:02:46 -0600 Subject: [PATCH 1/4] PYTHON-5433 - Added SBOM update automation (#2617) --- .github/workflows/sbom.yml | 88 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 .github/workflows/sbom.yml diff --git a/.github/workflows/sbom.yml b/.github/workflows/sbom.yml new file mode 100644 index 000000000..fcf39902d --- /dev/null +++ b/.github/workflows/sbom.yml @@ -0,0 +1,88 @@ +name: Generate SBOM + +# This workflow uses cdxgen and publishes an sbom.json artifact. +# It runs on manual trigger or when package files change on main branch, +# and creates a PR with the updated SBOM. +# Internal documentation: go/sbom-scope + +on: + workflow_dispatch: {} + push: + branches: ['master'] + paths: + - 'pyproject.toml' + - 'requirements.txt' + +permissions: + contents: write + pull-requests: write + +jobs: + sbom: + name: Generate SBOM and Create PR + runs-on: ubuntu-latest + concurrency: + group: sbom-${{ github.ref }} + cancel-in-progress: false + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Generate SBOM + run: | + python -m venv .venv + source .venv/bin/activate + pip install -r requirements.txt + pip install . + npx @cyclonedx/cdxgen -t python --exclude "uv.lock" --exclude "requirements/**" --exclude "requirements.txt" --spec-version 1.5 --no-validate --json-pretty -o sbom.json + env: + FETCH_LICENSE: true + + - name: Upload SBOM artifact + uses: actions/upload-artifact@v4 + with: + name: sbom + path: sbom.json + if-no-files-found: error + + - name: Create Pull Request + uses: peter-evans/create-pull-request@b4733b9419fd47bbfa1807b15627e17cd70b5b22 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: 'chore: Update SBOM after dependency changes' + branch: auto-update-sbom-${{ github.run_id }} + delete-branch: true + title: 'chore: Update SBOM' + body: | + ## Automated SBOM Update + + This PR was automatically generated because dependency manifest files changed. + + ### Changes + - Updated `sbom.json` to reflect current dependencies + + ### Verification + The SBOM was generated using cdxgen with the current Python environment. + + ### Triggered by + - Commit: ${{ github.sha }} + - Workflow run: ${{ github.run_id }} + + --- + _This PR was created automatically by the [SBOM workflow](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})_ + labels: | + sbom + automated + dependencies + + - name: Cleanup + if: always() + run: rm -rf .venv From 47da699a8737cd63f9b51a3549c7bcf633c99838 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 20 Nov 2025 18:41:46 -0600 Subject: [PATCH 2/4] chore: Update SBOM (#2619) Co-authored-by: blink1073 <2096628+blink1073@users.noreply.github.com> --- sbom.json | 166 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 157 insertions(+), 9 deletions(-) diff --git a/sbom.json b/sbom.json index 56e27f536..d2e02eeb7 100644 --- a/sbom.json +++ b/sbom.json @@ -1,11 +1,159 @@ { - "metadata": { - "timestamp": "2024-05-02T17:36:12.698229+00:00" + "bomFormat": "CycloneDX", + "specVersion": "1.5", + "serialNumber": "urn:uuid:f91a87bf-a37f-4c1e-805f-142f60b2c960", + "version": 1, + "metadata": { + "timestamp": "2025-11-20T21:30:34Z", + "tools": { + "components": [ + { + "group": "@cyclonedx", + "name": "cdxgen", + "version": "11.11.0", + "purl": "pkg:npm/%40cyclonedx/cdxgen@11.11.0", + "type": "application", + "bom-ref": "pkg:npm/@cyclonedx/cdxgen@11.11.0", + "author": "OWASP Foundation", + "publisher": "OWASP Foundation" + } + ] }, - "components": [], - "serialNumber": "urn:uuid:9876a8a6-060e-486f-b128-910aecf0fe7b", - "version": 1, - "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json", - "bomFormat": "CycloneDX", - "specVersion": "1.5" - } \ No newline at end of file + "authors": [ + { + "name": "OWASP Foundation" + } + ], + "lifecycles": [ + { + "phase": "build" + } + ], + "component": { + "name": "pymongo", + "description": "PyMongo - the Official MongoDB Python driver", + "authors": [ + { + "name": "The MongoDB Python Team" + } + ], + "tags": [ + "bson", + "gridfs", + "mongo", + "mongodb", + "pymongo" + ], + "properties": [ + { + "name": "cdx:pypi:requiresPython", + "value": ">=3.9" + }, + { + "name": "SrcFile", + "value": "/home/runner/work/mongo-python-driver/mongo-python-driver/pyproject.toml" + } + ], + "type": "application", + "bom-ref": "pkg:pypi/pymongo@latest", + "purl": "pkg:pypi/pymongo@latest", + "version": "latest", + "licenses": [ + { + "license": { + "id": "Apache-2.0", + "url": "https://opensource.org/licenses/Apache-2.0" + } + } + ] + }, + "properties": [ + { + "name": "cdx:bom:componentTypes", + "value": "pypi" + }, + { + "name": "cdx:bom:componentSrcFiles", + "value": "pyproject.toml" + } + ] + }, + "components": [ + { + "group": "", + "name": "pymongo", + "version": "latest", + "purl": "pkg:pypi/pymongo@latest", + "type": "library", + "bom-ref": "pkg:pypi/pymongo@latest", + "properties": [ + { + "name": "SrcFile", + "value": "pyproject.toml" + } + ], + "evidence": { + "identity": { + "field": "purl", + "confidence": 1, + "methods": [ + { + "technique": "instrumentation", + "confidence": 1, + "value": "/home/runner/work/mongo-python-driver/mongo-python-driver/.venv" + } + ] + } + } + }, + { + "author": "Bob Halley ", + "group": "", + "name": "dnspython", + "version": "2.8.0", + "description": "DNS toolkit", + "licenses": [ + { + "license": { + "id": "ISC", + "url": "https://opensource.org/licenses/ISC" + } + } + ], + "purl": "pkg:pypi/dnspython@2.8.0", + "type": "library", + "bom-ref": "pkg:pypi/dnspython@2.8.0", + "properties": [ + { + "name": "SrcFile", + "value": "pyproject.toml" + } + ], + "evidence": { + "identity": { + "field": "purl", + "confidence": 1, + "methods": [ + { + "technique": "instrumentation", + "confidence": 1, + "value": "/home/runner/work/mongo-python-driver/mongo-python-driver/.venv" + } + ] + } + } + } + ], + "dependencies": [ + { + "ref": "pkg:pypi/dnspython@2.8.0", + "dependsOn": [] + }, + { + "ref": "pkg:pypi/pymongo@latest", + "dependsOn": [ + "pkg:pypi/dnspython@2.8.0" + ] + } + ] +} \ No newline at end of file From 0c5eec790b6b0e87c010696ae3470653465d3535 Mon Sep 17 00:00:00 2001 From: "mongodb-drivers-pr-bot[bot]" <147046816+mongodb-drivers-pr-bot[bot]@users.noreply.github.com> Date: Fri, 21 Nov 2025 11:13:29 -0500 Subject: [PATCH 3/4] [Spec Resync] 11-10-2025 (#2609) Co-authored-by: Cloud User Co-authored-by: Noah Stapp Co-authored-by: Jib --- .evergreen/remove-unimplemented-tests.sh | 2 +- .evergreen/spec-patch/PYTHON-5445.patch | 26 + .evergreen/spec-patch/PYTHON-5559.patch | 815 ++++++++++++++++++ .../etc/data/lookup/schema-non-csfle.json | 3 + .../spec/unified/fle2v2-CreateCollection.json | 2 +- ...v2-validatorAndPartialFieldExpression.json | 4 +- 6 files changed, 848 insertions(+), 4 deletions(-) create mode 100644 .evergreen/spec-patch/PYTHON-5445.patch create mode 100644 .evergreen/spec-patch/PYTHON-5559.patch create mode 100644 test/client-side-encryption/etc/data/lookup/schema-non-csfle.json diff --git a/.evergreen/remove-unimplemented-tests.sh b/.evergreen/remove-unimplemented-tests.sh index 88ef137f8..9e049de31 100755 --- a/.evergreen/remove-unimplemented-tests.sh +++ b/.evergreen/remove-unimplemented-tests.sh @@ -41,7 +41,7 @@ rm $PYMONGO/test/index_management/index-rawdata.json rm $PYMONGO/test/collection_management/modifyCollection-*.json # PYTHON-5248 - Remove support for MongoDB 4.0 -find /$PYMONGO /test -type f -name 'pre-42-*.json' -delete +find /$PYMONGO/test -type f -name 'pre-42-*.json' -delete # PYTHON-3359 - Remove Database and Collection level timeout override rm $PYMONGO/test/csot/override-collection-timeoutMS.json diff --git a/.evergreen/spec-patch/PYTHON-5445.patch b/.evergreen/spec-patch/PYTHON-5445.patch new file mode 100644 index 000000000..4ff67399b --- /dev/null +++ b/.evergreen/spec-patch/PYTHON-5445.patch @@ -0,0 +1,26 @@ +diff --git a/test/auth/legacy/connection-string.json b/test/auth/legacy/connection-string.json +index 3a099c813..8982b61d5 100644 +--- a/test/auth/legacy/connection-string.json ++++ b/test/auth/legacy/connection-string.json +@@ -440,6 +440,21 @@ + } + } + }, ++ { ++ "description": "should throw an exception if username provided (MONGODB-AWS)", ++ "uri": "mongodb://user@localhost.com/?authMechanism=MONGODB-AWS", ++ "valid": false ++ }, ++ { ++ "description": "should throw an exception if username and password provided (MONGODB-AWS)", ++ "uri": "mongodb://user:pass@localhost.com/?authMechanism=MONGODB-AWS", ++ "valid": false ++ }, ++ { ++ "description": "should throw an exception if AWS_SESSION_TOKEN provided (MONGODB-AWS)", ++ "uri": "mongodb://localhost/?authMechanism=MONGODB-AWS&authMechanismProperties=AWS_SESSION_TOKEN:token", ++ "valid": false ++ }, + { + "description": "should recognise the mechanism with test environment (MONGODB-OIDC)", + "uri": "mongodb://localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:test", diff --git a/.evergreen/spec-patch/PYTHON-5559.patch b/.evergreen/spec-patch/PYTHON-5559.patch new file mode 100644 index 000000000..29ad8d482 --- /dev/null +++ b/.evergreen/spec-patch/PYTHON-5559.patch @@ -0,0 +1,815 @@ +diff --git a/test/sessions/snapshot-sessions.json b/test/sessions/snapshot-sessions.json +index 260f8b6f4..8f806ea75 100644 +--- a/test/sessions/snapshot-sessions.json ++++ b/test/sessions/snapshot-sessions.json +@@ -988,6 +988,810 @@ + } + } + ] ++ }, ++ { ++ "description": "Find operation with snapshot and snapshot time", ++ "operations": [ ++ { ++ "name": "find", ++ "object": "collection0", ++ "arguments": { ++ "session": "session0", ++ "filter": {} ++ }, ++ "expectResult": [ ++ { ++ "_id": 1, ++ "x": 11 ++ }, ++ { ++ "_id": 2, ++ "x": 11 ++ } ++ ] ++ }, ++ { ++ "name": "getSnapshotTime", ++ "object": "session0", ++ "saveResultAsEntity": "savedSnapshotTime" ++ }, ++ { ++ "name": "insertOne", ++ "object": "collection0", ++ "arguments": { ++ "document": { ++ "_id": 3, ++ "x": 33 ++ } ++ } ++ }, ++ { ++ "name": "createEntities", ++ "object": "testRunner", ++ "arguments": { ++ "entities": [ ++ { ++ "session": { ++ "id": "session2", ++ "client": "client0", ++ "sessionOptions": { ++ "snapshot": true, ++ "snapshotTime": "savedSnapshotTime" ++ } ++ } ++ } ++ ] ++ } ++ }, ++ { ++ "name": "find", ++ "object": "collection0", ++ "arguments": { ++ "session": "session2", ++ "filter": {} ++ }, ++ "expectResult": [ ++ { ++ "_id": 1, ++ "x": 11 ++ }, ++ { ++ "_id": 2, ++ "x": 11 ++ } ++ ] ++ }, ++ { ++ "name": "find", ++ "object": "collection0", ++ "arguments": { ++ "session": "session2", ++ "filter": {} ++ }, ++ "expectResult": [ ++ { ++ "_id": 1, ++ "x": 11 ++ }, ++ { ++ "_id": 2, ++ "x": 11 ++ } ++ ] ++ }, ++ { ++ "name": "find", ++ "object": "collection0", ++ "arguments": { ++ "filter": {} ++ }, ++ "expectResult": [ ++ { ++ "_id": 1, ++ "x": 11 ++ }, ++ { ++ "_id": 2, ++ "x": 11 ++ }, ++ { ++ "_id": 3, ++ "x": 33 ++ } ++ ] ++ } ++ ], ++ "expectEvents": [ ++ { ++ "client": "client0", ++ "events": [ ++ { ++ "commandStartedEvent": { ++ "command": { ++ "find": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$exists": false ++ } ++ } ++ }, ++ "databaseName": "database0" ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "find": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$matchesEntity": "savedSnapshotTime" ++ } ++ } ++ }, ++ "databaseName": "database0" ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "find": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$matchesEntity": "savedSnapshotTime" ++ } ++ } ++ }, ++ "databaseName": "database0" ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "find": "collection0", ++ "readConcern": { ++ "$$exists": false ++ } ++ }, ++ "databaseName": "database0" ++ } ++ } ++ ] ++ } ++ ] ++ }, ++ { ++ "description": "Distinct operation with snapshot and snapshot time", ++ "operations": [ ++ { ++ "name": "distinct", ++ "object": "collection0", ++ "arguments": { ++ "session": "session0", ++ "filter": {}, ++ "fieldName": "x" ++ }, ++ "expectResult": [ ++ 11 ++ ] ++ }, ++ { ++ "name": "getSnapshotTime", ++ "object": "session0", ++ "saveResultAsEntity": "savedSnapshotTime" ++ }, ++ { ++ "name": "insertOne", ++ "object": "collection0", ++ "arguments": { ++ "document": { ++ "_id": 3, ++ "x": 33 ++ } ++ } ++ }, ++ { ++ "name": "createEntities", ++ "object": "testRunner", ++ "arguments": { ++ "entities": [ ++ { ++ "session": { ++ "id": "session2", ++ "client": "client0", ++ "sessionOptions": { ++ "snapshot": true, ++ "snapshotTime": "savedSnapshotTime" ++ } ++ } ++ } ++ ] ++ } ++ }, ++ { ++ "name": "distinct", ++ "object": "collection0", ++ "arguments": { ++ "session": "session2", ++ "filter": {}, ++ "fieldName": "x" ++ }, ++ "expectResult": [ ++ 11 ++ ] ++ }, ++ { ++ "name": "distinct", ++ "object": "collection0", ++ "arguments": { ++ "session": "session2", ++ "filter": {}, ++ "fieldName": "x" ++ }, ++ "expectResult": [ ++ 11 ++ ] ++ }, ++ { ++ "name": "distinct", ++ "object": "collection0", ++ "arguments": { ++ "filter": {}, ++ "fieldName": "x" ++ }, ++ "expectResult": [ ++ 11, ++ 33 ++ ] ++ } ++ ], ++ "expectEvents": [ ++ { ++ "client": "client0", ++ "events": [ ++ { ++ "commandStartedEvent": { ++ "command": { ++ "distinct": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$exists": false ++ } ++ } ++ }, ++ "databaseName": "database0" ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "distinct": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$matchesEntity": "savedSnapshotTime" ++ } ++ } ++ }, ++ "databaseName": "database0" ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "distinct": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$matchesEntity": "savedSnapshotTime" ++ } ++ } ++ }, ++ "databaseName": "database0" ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "distinct": "collection0", ++ "readConcern": { ++ "$$exists": false ++ } ++ }, ++ "databaseName": "database0" ++ } ++ } ++ ] ++ } ++ ] ++ }, ++ { ++ "description": "Aggregate operation with snapshot and snapshot time", ++ "operations": [ ++ { ++ "name": "aggregate", ++ "object": "collection0", ++ "arguments": { ++ "session": "session0", ++ "pipeline": [ ++ { ++ "$match": { ++ "_id": 1 ++ } ++ } ++ ] ++ }, ++ "expectResult": [ ++ { ++ "_id": 1, ++ "x": 11 ++ } ++ ] ++ }, ++ { ++ "name": "getSnapshotTime", ++ "object": "session0", ++ "saveResultAsEntity": "savedSnapshotTime" ++ }, ++ { ++ "name": "findOneAndUpdate", ++ "object": "collection0", ++ "arguments": { ++ "filter": { ++ "_id": 1 ++ }, ++ "update": { ++ "$inc": { ++ "x": 1 ++ } ++ }, ++ "returnDocument": "After" ++ }, ++ "expectResult": { ++ "_id": 1, ++ "x": 12 ++ } ++ }, ++ { ++ "name": "createEntities", ++ "object": "testRunner", ++ "arguments": { ++ "entities": [ ++ { ++ "session": { ++ "id": "session2", ++ "client": "client0", ++ "sessionOptions": { ++ "snapshot": true, ++ "snapshotTime": "savedSnapshotTime" ++ } ++ } ++ } ++ ] ++ } ++ }, ++ { ++ "name": "aggregate", ++ "object": "collection0", ++ "arguments": { ++ "session": "session2", ++ "pipeline": [ ++ { ++ "$match": { ++ "_id": 1 ++ } ++ } ++ ] ++ }, ++ "expectResult": [ ++ { ++ "_id": 1, ++ "x": 11 ++ } ++ ] ++ }, ++ { ++ "name": "aggregate", ++ "object": "collection0", ++ "arguments": { ++ "session": "session2", ++ "pipeline": [ ++ { ++ "$match": { ++ "_id": 1 ++ } ++ } ++ ] ++ }, ++ "expectResult": [ ++ { ++ "_id": 1, ++ "x": 11 ++ } ++ ] ++ }, ++ { ++ "name": "aggregate", ++ "object": "collection0", ++ "arguments": { ++ "pipeline": [ ++ { ++ "$match": { ++ "_id": 1 ++ } ++ } ++ ] ++ }, ++ "expectResult": [ ++ { ++ "_id": 1, ++ "x": 12 ++ } ++ ] ++ } ++ ], ++ "expectEvents": [ ++ { ++ "client": "client0", ++ "events": [ ++ { ++ "commandStartedEvent": { ++ "command": { ++ "aggregate": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$exists": false ++ } ++ } ++ }, ++ "databaseName": "database0" ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "aggregate": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$matchesEntity": "savedSnapshotTime" ++ } ++ } ++ }, ++ "databaseName": "database0" ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "aggregate": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$matchesEntity": "savedSnapshotTime" ++ } ++ } ++ }, ++ "databaseName": "database0" ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "aggregate": "collection0", ++ "readConcern": { ++ "$$exists": false ++ } ++ }, ++ "databaseName": "database0" ++ } ++ } ++ ] ++ } ++ ] ++ }, ++ { ++ "description": "countDocuments operation with snapshot and snapshot time", ++ "operations": [ ++ { ++ "name": "countDocuments", ++ "object": "collection0", ++ "arguments": { ++ "session": "session0", ++ "filter": {} ++ }, ++ "expectResult": 2 ++ }, ++ { ++ "name": "getSnapshotTime", ++ "object": "session0", ++ "saveResultAsEntity": "savedSnapshotTime" ++ }, ++ { ++ "name": "insertOne", ++ "object": "collection0", ++ "arguments": { ++ "document": { ++ "_id": 3, ++ "x": 33 ++ } ++ } ++ }, ++ { ++ "name": "createEntities", ++ "object": "testRunner", ++ "arguments": { ++ "entities": [ ++ { ++ "session": { ++ "id": "session2", ++ "client": "client0", ++ "sessionOptions": { ++ "snapshot": true, ++ "snapshotTime": "savedSnapshotTime" ++ } ++ } ++ } ++ ] ++ } ++ }, ++ { ++ "name": "countDocuments", ++ "object": "collection0", ++ "arguments": { ++ "session": "session2", ++ "filter": {} ++ }, ++ "expectResult": 2 ++ }, ++ { ++ "name": "countDocuments", ++ "object": "collection0", ++ "arguments": { ++ "session": "session2", ++ "filter": {} ++ }, ++ "expectResult": 2 ++ }, ++ { ++ "name": "countDocuments", ++ "object": "collection0", ++ "arguments": { ++ "filter": {} ++ }, ++ "expectResult": 3 ++ } ++ ], ++ "expectEvents": [ ++ { ++ "client": "client0", ++ "events": [ ++ { ++ "commandStartedEvent": { ++ "command": { ++ "aggregate": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$exists": false ++ } ++ } ++ }, ++ "databaseName": "database0" ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "aggregate": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$matchesEntity": "savedSnapshotTime" ++ } ++ } ++ }, ++ "databaseName": "database0" ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "aggregate": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$matchesEntity": "savedSnapshotTime" ++ } ++ } ++ }, ++ "databaseName": "database0" ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "aggregate": "collection0", ++ "readConcern": { ++ "$$exists": false ++ } ++ }, ++ "databaseName": "database0" ++ } ++ } ++ ] ++ } ++ ] ++ }, ++ { ++ "description": "Mixed operation with snapshot and snapshotTime", ++ "operations": [ ++ { ++ "name": "find", ++ "object": "collection0", ++ "arguments": { ++ "session": "session0", ++ "filter": { ++ "_id": 1 ++ } ++ }, ++ "expectResult": [ ++ { ++ "_id": 1, ++ "x": 11 ++ } ++ ] ++ }, ++ { ++ "name": "getSnapshotTime", ++ "object": "session0", ++ "saveResultAsEntity": "savedSnapshotTime" ++ }, ++ { ++ "name": "findOneAndUpdate", ++ "object": "collection0", ++ "arguments": { ++ "filter": { ++ "_id": 1 ++ }, ++ "update": { ++ "$inc": { ++ "x": 1 ++ } ++ }, ++ "returnDocument": "After" ++ }, ++ "expectResult": { ++ "_id": 1, ++ "x": 12 ++ } ++ }, ++ { ++ "name": "createEntities", ++ "object": "testRunner", ++ "arguments": { ++ "entities": [ ++ { ++ "session": { ++ "id": "session2", ++ "client": "client0", ++ "sessionOptions": { ++ "snapshot": true, ++ "snapshotTime": "savedSnapshotTime" ++ } ++ } ++ } ++ ] ++ } ++ }, ++ { ++ "name": "find", ++ "object": "collection0", ++ "arguments": { ++ "filter": { ++ "_id": 1 ++ } ++ }, ++ "expectResult": [ ++ { ++ "_id": 1, ++ "x": 12 ++ } ++ ] ++ }, ++ { ++ "name": "aggregate", ++ "object": "collection0", ++ "arguments": { ++ "pipeline": [ ++ { ++ "$match": { ++ "_id": 1 ++ } ++ } ++ ], ++ "session": "session2" ++ }, ++ "expectResult": [ ++ { ++ "_id": 1, ++ "x": 11 ++ } ++ ] ++ }, ++ { ++ "name": "distinct", ++ "object": "collection0", ++ "arguments": { ++ "fieldName": "x", ++ "filter": {}, ++ "session": "session2" ++ }, ++ "expectResult": [ ++ 11 ++ ] ++ } ++ ], ++ "expectEvents": [ ++ { ++ "client": "client0", ++ "events": [ ++ { ++ "commandStartedEvent": { ++ "command": { ++ "find": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$exists": false ++ } ++ } ++ } ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "find": "collection0", ++ "readConcern": { ++ "$$exists": false ++ } ++ } ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "aggregate": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$matchesEntity": "savedSnapshotTime" ++ } ++ } ++ } ++ } ++ }, ++ { ++ "commandStartedEvent": { ++ "command": { ++ "distinct": "collection0", ++ "readConcern": { ++ "level": "snapshot", ++ "atClusterTime": { ++ "$$matchesEntity": "savedSnapshotTime" ++ } ++ } ++ } ++ } ++ } ++ ] ++ } ++ ] + } + ] + } diff --git a/test/client-side-encryption/etc/data/lookup/schema-non-csfle.json b/test/client-side-encryption/etc/data/lookup/schema-non-csfle.json new file mode 100644 index 000000000..3edd12c8f --- /dev/null +++ b/test/client-side-encryption/etc/data/lookup/schema-non-csfle.json @@ -0,0 +1,3 @@ +{ + "bsonType": "object" +} diff --git a/test/client-side-encryption/spec/unified/fle2v2-CreateCollection.json b/test/client-side-encryption/spec/unified/fle2v2-CreateCollection.json index 3dfb76c46..81a4c6173 100644 --- a/test/client-side-encryption/spec/unified/fle2v2-CreateCollection.json +++ b/test/client-side-encryption/spec/unified/fle2v2-CreateCollection.json @@ -554,7 +554,7 @@ }, { "name": "assertIndexNotExists", - "object": "db", + "object": "testRunner", "arguments": { "databaseName": "default", "collectionName": "encryptedCollection", diff --git a/test/client-side-encryption/spec/unified/fle2v2-validatorAndPartialFieldExpression.json b/test/client-side-encryption/spec/unified/fle2v2-validatorAndPartialFieldExpression.json index 54cc60a3b..8d6946440 100644 --- a/test/client-side-encryption/spec/unified/fle2v2-validatorAndPartialFieldExpression.json +++ b/test/client-side-encryption/spec/unified/fle2v2-validatorAndPartialFieldExpression.json @@ -108,7 +108,7 @@ }, { "name": "assertCollectionExists", - "object": "coll", + "object": "testRunner", "arguments": { "databaseName": "default", "collectionName": "encryptedCollection" @@ -248,7 +248,7 @@ }, { "name": "assertIndexExists", - "object": "coll", + "object": "testRunner", "arguments": { "databaseName": "default", "collectionName": "encryptedCollection", From a9c034426b4767f093ea9aca65220648ac4d24e6 Mon Sep 17 00:00:00 2001 From: Kevin Albertson Date: Fri, 21 Nov 2025 11:33:18 -0500 Subject: [PATCH 4/4] PYTHON-5647 extend `ALLOWED_HOSTS` (#2618) --- pymongo/auth_shared.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pymongo/auth_shared.py b/pymongo/auth_shared.py index 5a9a2b673..605dbf261 100644 --- a/pymongo/auth_shared.py +++ b/pymongo/auth_shared.py @@ -159,6 +159,8 @@ def _build_credentials_tuple( "localhost", "127.0.0.1", "::1", + "*.mongo.com", + "*.mongodbgov.net", ] allowed_hosts = properties.get("ALLOWED_HOSTS", default_allowed) if properties.get("ALLOWED_HOSTS", None) is not None and human_callback is None: