Merge branch 'master' of github.com:mongodb/mongo-python-driver
This commit is contained in:
commit
cb075e5abf
55
.github/workflows/create-release-branch.yml
vendored
Normal file
55
.github/workflows/create-release-branch.yml
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
name: Create Release Branch
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
branch_name:
|
||||
description: The name of the new branch
|
||||
required: true
|
||||
version:
|
||||
description: The version to set on the branch
|
||||
required: true
|
||||
base_ref:
|
||||
description: The base reference for the branch
|
||||
push_changes:
|
||||
description: Whether to push the changes
|
||||
default: "true"
|
||||
|
||||
concurrency:
|
||||
group: create-branch-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -eux {0}
|
||||
|
||||
jobs:
|
||||
create-branch:
|
||||
environment: release
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: write
|
||||
outputs:
|
||||
version: ${{ steps.pre-publish.outputs.version }}
|
||||
steps:
|
||||
- uses: mongodb-labs/drivers-github-tools/secure-checkout@v2
|
||||
with:
|
||||
app_id: ${{ vars.APP_ID }}
|
||||
private_key: ${{ secrets.APP_PRIVATE_KEY }}
|
||||
- uses: mongodb-labs/drivers-github-tools/setup@v2
|
||||
with:
|
||||
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
|
||||
aws_region_name: ${{ vars.AWS_REGION_NAME }}
|
||||
aws_secret_id: ${{ secrets.AWS_SECRET_ID }}
|
||||
artifactory_username: ${{ vars.ARTIFACTORY_USERNAME }}
|
||||
- uses: mongodb-labs/drivers-github-tools/create-branch@v2
|
||||
id: create-branch
|
||||
with:
|
||||
branch_name: ${{ inputs.branch_name }}
|
||||
version: ${{ inputs.version }}
|
||||
base_ref: ${{ inputs.base_ref }}
|
||||
push_changes: ${{ inputs.push_changes }}
|
||||
version_bump_script: hatch version
|
||||
evergreen_project: mongo-python-driver-release
|
||||
release_workflow_path: ./.github/workflows/release-python.yml
|
||||
@ -617,25 +617,28 @@ def _parse_canonical_datetime(
|
||||
raise TypeError(f"Bad $date, extra field(s): {doc}")
|
||||
# mongoexport 2.6 and newer
|
||||
if isinstance(dtm, str):
|
||||
# Parse offset
|
||||
if dtm[-1] == "Z":
|
||||
dt = dtm[:-1]
|
||||
offset = "Z"
|
||||
elif dtm[-6] in ("+", "-") and dtm[-3] == ":":
|
||||
# (+|-)HH:MM
|
||||
dt = dtm[:-6]
|
||||
offset = dtm[-6:]
|
||||
elif dtm[-5] in ("+", "-"):
|
||||
# (+|-)HHMM
|
||||
dt = dtm[:-5]
|
||||
offset = dtm[-5:]
|
||||
elif dtm[-3] in ("+", "-"):
|
||||
# (+|-)HH
|
||||
dt = dtm[:-3]
|
||||
offset = dtm[-3:]
|
||||
else:
|
||||
dt = dtm
|
||||
offset = ""
|
||||
try:
|
||||
# Parse offset
|
||||
if dtm[-1] == "Z":
|
||||
dt = dtm[:-1]
|
||||
offset = "Z"
|
||||
elif dtm[-6] in ("+", "-") and dtm[-3] == ":":
|
||||
# (+|-)HH:MM
|
||||
dt = dtm[:-6]
|
||||
offset = dtm[-6:]
|
||||
elif dtm[-5] in ("+", "-"):
|
||||
# (+|-)HHMM
|
||||
dt = dtm[:-5]
|
||||
offset = dtm[-5:]
|
||||
elif dtm[-3] in ("+", "-"):
|
||||
# (+|-)HH
|
||||
dt = dtm[:-3]
|
||||
offset = dtm[-3:]
|
||||
else:
|
||||
dt = dtm
|
||||
offset = ""
|
||||
except IndexError as exc:
|
||||
raise ValueError(f"time data {dtm!r} does not match ISO-8601 datetime format") from exc
|
||||
|
||||
# Parse the optional factional seconds portion.
|
||||
dot_index = dt.rfind(".")
|
||||
@ -848,7 +851,7 @@ def _encode_datetimems(obj: Any, json_options: JSONOptions) -> dict:
|
||||
):
|
||||
return _encode_datetime(obj.as_datetime(), json_options)
|
||||
elif json_options.datetime_representation == DatetimeRepresentation.LEGACY:
|
||||
return {"$date": str(int(obj))}
|
||||
return {"$date": int(obj)}
|
||||
return {"$date": {"$numberLong": str(int(obj))}}
|
||||
|
||||
|
||||
|
||||
@ -28,6 +28,11 @@ PyMongo 4.11 brings a number of changes including:
|
||||
:meth:`~pymongo.asynchronous.mongo_client.AsyncMongoClient.bulk_write` now throw an error
|
||||
when ``ordered=True`` or ``verboseResults=True`` are used with unacknowledged writes.
|
||||
These are unavoidable breaking changes.
|
||||
- Fixed a bug in :const:`bson.json_util.dumps` where a :class:`bson.datetime_ms.DatetimeMS` would
|
||||
be incorrectly encoded as ``'{"$date": "X"}'`` instead of ``'{"$date": X}'`` when using the
|
||||
legacy MongoDB Extended JSON datetime representation.
|
||||
- Fixed a bug where :const:`bson.json_util.loads` would raise an IndexError when parsing an invalid
|
||||
``"$date"`` instead of a ValueError.
|
||||
|
||||
Issues Resolved
|
||||
...............
|
||||
|
||||
253
test/crud/unified/create-null-ids.json
Normal file
253
test/crud/unified/create-null-ids.json
Normal file
@ -0,0 +1,253 @@
|
||||
{
|
||||
"description": "create-null-ids",
|
||||
"schemaVersion": "1.0",
|
||||
"createEntities": [
|
||||
{
|
||||
"client": {
|
||||
"id": "client",
|
||||
"observeEvents": [
|
||||
"commandStartedEvent"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"database": {
|
||||
"id": "database",
|
||||
"client": "client",
|
||||
"databaseName": "crud_id"
|
||||
}
|
||||
},
|
||||
{
|
||||
"collection": {
|
||||
"id": "collection",
|
||||
"database": "database",
|
||||
"collectionName": "type_tests"
|
||||
}
|
||||
}
|
||||
],
|
||||
"initialData": [
|
||||
{
|
||||
"collectionName": "type_tests",
|
||||
"databaseName": "crud_id",
|
||||
"documents": []
|
||||
}
|
||||
],
|
||||
"tests": [
|
||||
{
|
||||
"description": "inserting _id with type null via insertOne",
|
||||
"operations": [
|
||||
{
|
||||
"name": "insertOne",
|
||||
"object": "collection",
|
||||
"arguments": {
|
||||
"document": {
|
||||
"_id": null
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "countDocuments",
|
||||
"object": "collection",
|
||||
"arguments": {
|
||||
"filter": {
|
||||
"_id": {
|
||||
"$type": "null"
|
||||
}
|
||||
}
|
||||
},
|
||||
"expectResult": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "inserting _id with type null via insertMany",
|
||||
"operations": [
|
||||
{
|
||||
"name": "insertMany",
|
||||
"object": "collection",
|
||||
"arguments": {
|
||||
"documents": [
|
||||
{
|
||||
"_id": null
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "countDocuments",
|
||||
"object": "collection",
|
||||
"arguments": {
|
||||
"filter": {
|
||||
"_id": {
|
||||
"$type": "null"
|
||||
}
|
||||
}
|
||||
},
|
||||
"expectResult": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "inserting _id with type null via updateOne",
|
||||
"operations": [
|
||||
{
|
||||
"name": "updateOne",
|
||||
"object": "collection",
|
||||
"arguments": {
|
||||
"filter": {
|
||||
"_id": null
|
||||
},
|
||||
"update": {
|
||||
"$unset": {
|
||||
"a": ""
|
||||
}
|
||||
},
|
||||
"upsert": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "countDocuments",
|
||||
"object": "collection",
|
||||
"arguments": {
|
||||
"filter": {
|
||||
"_id": {
|
||||
"$type": "null"
|
||||
}
|
||||
}
|
||||
},
|
||||
"expectResult": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "inserting _id with type null via updateMany",
|
||||
"operations": [
|
||||
{
|
||||
"name": "updateMany",
|
||||
"object": "collection",
|
||||
"arguments": {
|
||||
"filter": {
|
||||
"_id": null
|
||||
},
|
||||
"update": {
|
||||
"$unset": {
|
||||
"a": ""
|
||||
}
|
||||
},
|
||||
"upsert": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "countDocuments",
|
||||
"object": "collection",
|
||||
"arguments": {
|
||||
"filter": {
|
||||
"_id": {
|
||||
"$type": "null"
|
||||
}
|
||||
}
|
||||
},
|
||||
"expectResult": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "inserting _id with type null via replaceOne",
|
||||
"operations": [
|
||||
{
|
||||
"name": "replaceOne",
|
||||
"object": "collection",
|
||||
"arguments": {
|
||||
"filter": {},
|
||||
"replacement": {
|
||||
"_id": null
|
||||
},
|
||||
"upsert": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "countDocuments",
|
||||
"object": "collection",
|
||||
"arguments": {
|
||||
"filter": {
|
||||
"_id": {
|
||||
"$type": "null"
|
||||
}
|
||||
}
|
||||
},
|
||||
"expectResult": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "inserting _id with type null via bulkWrite",
|
||||
"operations": [
|
||||
{
|
||||
"name": "bulkWrite",
|
||||
"object": "collection",
|
||||
"arguments": {
|
||||
"requests": [
|
||||
{
|
||||
"insertOne": {
|
||||
"document": {
|
||||
"_id": null
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "countDocuments",
|
||||
"object": "collection",
|
||||
"arguments": {
|
||||
"filter": {
|
||||
"_id": {
|
||||
"$type": "null"
|
||||
}
|
||||
}
|
||||
},
|
||||
"expectResult": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "inserting _id with type null via clientBulkWrite",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "8.0"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "clientBulkWrite",
|
||||
"object": "client",
|
||||
"arguments": {
|
||||
"models": [
|
||||
{
|
||||
"insertOne": {
|
||||
"namespace": "crud_id.type_tests",
|
||||
"document": {
|
||||
"_id": null
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "countDocuments",
|
||||
"object": "collection",
|
||||
"arguments": {
|
||||
"filter": {
|
||||
"_id": {
|
||||
"$type": "null"
|
||||
}
|
||||
}
|
||||
},
|
||||
"expectResult": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -137,7 +137,7 @@ class TestJsonUtil(unittest.TestCase):
|
||||
'{"dt": { "$date" : "1970-01-01T00:00:00.000Z"}}',
|
||||
'{"dt": { "$date" : "1970-01-01T00:00:00.000000Z"}}',
|
||||
'{"dt": { "$date" : "1970-01-01T00:00:00Z"}}',
|
||||
'{"dt": {"$date": "1970-01-01T00:00:00.000"}}',
|
||||
'{"dt": { "$date" : "1970-01-01T00:00:00.000"}}',
|
||||
'{"dt": { "$date" : "1970-01-01T00:00:00"}}',
|
||||
'{"dt": { "$date" : "1970-01-01T00:00:00.000000"}}',
|
||||
'{"dt": { "$date" : "1969-12-31T16:00:00.000-0800"}}',
|
||||
@ -282,9 +282,9 @@ class TestJsonUtil(unittest.TestCase):
|
||||
opts = JSONOptions(
|
||||
datetime_representation=DatetimeRepresentation.LEGACY, json_mode=JSONMode.LEGACY
|
||||
)
|
||||
self.assertEqual('{"x": {"$date": "-1"}}', json_util.dumps(dat_min, json_options=opts))
|
||||
self.assertEqual('{"x": {"$date": -1}}', json_util.dumps(dat_min, json_options=opts))
|
||||
self.assertEqual(
|
||||
'{"x": {"$date": "' + str(int(dat_max["x"])) + '"}}',
|
||||
'{"x": {"$date": ' + str(int(dat_max["x"])) + "}}",
|
||||
json_util.dumps(dat_max, json_options=opts),
|
||||
)
|
||||
|
||||
@ -317,6 +317,25 @@ class TestJsonUtil(unittest.TestCase):
|
||||
json_util.loads(json_util.dumps(dat_max), json_options=opts)["x"],
|
||||
)
|
||||
|
||||
def test_parse_invalid_date(self):
|
||||
# These cases should raise ValueError, not IndexError.
|
||||
for invalid in [
|
||||
'{"dt": { "$date" : "1970-01-01T00:00:"}}',
|
||||
'{"dt": { "$date" : "1970-01-01T01:00"}}',
|
||||
'{"dt": { "$date" : "1970-01-01T01:"}}',
|
||||
'{"dt": { "$date" : "1970-01-01T01"}}',
|
||||
'{"dt": { "$date" : "1970-01-01T"}}',
|
||||
'{"dt": { "$date" : "1970-01-01"}}',
|
||||
'{"dt": { "$date" : "1970-01-"}}',
|
||||
'{"dt": { "$date" : "1970-01"}}',
|
||||
'{"dt": { "$date" : "1970-"}}',
|
||||
'{"dt": { "$date" : "1970"}}',
|
||||
'{"dt": { "$date" : "1"}}',
|
||||
'{"dt": { "$date" : ""}}',
|
||||
]:
|
||||
with self.assertRaisesRegex(ValueError, "does not match"):
|
||||
json_util.loads(invalid)
|
||||
|
||||
def test_regex_object_hook(self):
|
||||
# Extended JSON format regular expression.
|
||||
pat = "a*b"
|
||||
|
||||
@ -422,6 +422,11 @@
|
||||
},
|
||||
{
|
||||
"description": "commit is not retried after MaxTimeMSExpired error",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"serverless": "forbid"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"description": "commit-writeconcernerror",
|
||||
"schemaVersion": "1.3",
|
||||
"schemaVersion": "1.4",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"minServerVersion": "4.0",
|
||||
@ -414,6 +414,11 @@
|
||||
},
|
||||
{
|
||||
"description": "commitTransaction is not retried after UnknownReplWriteConcern error",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"serverless": "forbid"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -546,6 +551,11 @@
|
||||
},
|
||||
{
|
||||
"description": "commitTransaction is not retried after UnsatisfiableWriteConcern error",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"serverless": "forbid"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
@ -678,6 +688,11 @@
|
||||
},
|
||||
{
|
||||
"description": "commitTransaction is not retried after MaxTimeMSExpired error",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"serverless": "forbid"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"name": "failPoint",
|
||||
|
||||
@ -89,6 +89,11 @@
|
||||
"tests": [
|
||||
{
|
||||
"description": "commitTransaction fails after Interrupted",
|
||||
"runOnRequirements": [
|
||||
{
|
||||
"serverless": "forbid"
|
||||
}
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"object": "testRunner",
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
"tests": [
|
||||
{
|
||||
"description": "Valid auth options are parsed correctly (GSSAPI)",
|
||||
"uri": "mongodb://foo:bar@example.com/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:other,CANONICALIZE_HOST_NAME:true&authSource=$external",
|
||||
"uri": "mongodb://foo:bar@example.com/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:other,CANONICALIZE_HOST_NAME:forward,SERVICE_HOST:example.com&authSource=$external",
|
||||
"valid": true,
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
@ -11,7 +11,8 @@
|
||||
"authMechanism": "GSSAPI",
|
||||
"authMechanismProperties": {
|
||||
"SERVICE_NAME": "other",
|
||||
"CANONICALIZE_HOST_NAME": true
|
||||
"SERVICE_HOST": "example.com",
|
||||
"CANONICALIZE_HOST_NAME": "forward"
|
||||
},
|
||||
"authSource": "$external"
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "Too low zlibCompressionLevel causes a warning",
|
||||
@ -44,7 +44,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "Too high zlibCompressionLevel causes a warning",
|
||||
@ -53,7 +53,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "Too low wTimeoutMS causes a warning",
|
||||
@ -52,7 +52,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "Invalid journal causes a warning",
|
||||
@ -61,7 +61,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "Too low connectTimeoutMS causes a warning",
|
||||
@ -36,7 +36,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "Non-numeric heartbeatFrequencyMS causes a warning",
|
||||
@ -45,7 +45,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "Too low heartbeatFrequencyMS causes a warning",
|
||||
@ -54,7 +54,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "Non-numeric localThresholdMS causes a warning",
|
||||
@ -63,7 +63,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "Too low localThresholdMS causes a warning",
|
||||
@ -72,7 +72,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "Invalid retryWrites causes a warning",
|
||||
@ -81,7 +81,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "Non-numeric serverSelectionTimeoutMS causes a warning",
|
||||
@ -90,7 +90,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "Too low serverSelectionTimeoutMS causes a warning",
|
||||
@ -99,7 +99,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "Non-numeric socketTimeoutMS causes a warning",
|
||||
@ -108,7 +108,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "Too low socketTimeoutMS causes a warning",
|
||||
@ -117,7 +117,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "directConnection=true",
|
||||
@ -137,7 +137,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "directConnection=false",
|
||||
@ -168,7 +168,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "loadBalanced=true",
|
||||
@ -211,7 +211,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "loadBalanced=true with multiple hosts causes an error",
|
||||
@ -220,7 +220,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "loadBalanced=true with directConnection=true causes an error",
|
||||
@ -229,7 +229,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "loadBalanced=true with replicaSet causes an error",
|
||||
@ -238,7 +238,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "timeoutMS=0",
|
||||
@ -258,7 +258,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "Too low timeoutMS causes a warning",
|
||||
@ -267,7 +267,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "Too low maxIdleTimeMS causes a warning",
|
||||
@ -30,7 +30,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "maxPoolSize=0 does not error",
|
||||
@ -61,7 +61,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "maxConnecting<0 causes a warning",
|
||||
@ -70,7 +70,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -36,6 +36,21 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "Read preference tags are case sensitive",
|
||||
"uri": "mongodb://example.com/?readPreference=secondary&readPreferenceTags=dc:NY",
|
||||
"valid": true,
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {
|
||||
"readPreferenceTags": [
|
||||
{
|
||||
"dc": "NY"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "Invalid readPreferenceTags causes a warning",
|
||||
"uri": "mongodb://example.com/?readPreferenceTags=invalid",
|
||||
@ -43,7 +58,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "Non-numeric maxStalenessSeconds causes a warning",
|
||||
@ -52,7 +67,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "Too low maxStalenessSeconds causes a warning",
|
||||
@ -61,7 +76,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "SRV URI with srvMaxHosts",
|
||||
@ -38,7 +38,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "SRV URI with invalid type for srvMaxHosts",
|
||||
@ -47,7 +47,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "Non-SRV URI with srvMaxHosts",
|
||||
@ -56,7 +56,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "SRV URI with positive srvMaxHosts and replicaSet",
|
||||
@ -65,7 +65,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "SRV URI with positive srvMaxHosts and loadBalanced=true",
|
||||
@ -74,7 +74,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "SRV URI with positive srvMaxHosts and loadBalanced=false",
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsAllowInvalidCertificates is parsed correctly",
|
||||
@ -62,7 +62,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsInsecure is parsed correctly",
|
||||
@ -82,7 +82,7 @@
|
||||
"warning": true,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsInsecure and tlsAllowInvalidCertificates both present (and true) raises an error",
|
||||
@ -91,7 +91,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsInsecure and tlsAllowInvalidCertificates both present (and false) raises an error",
|
||||
@ -100,7 +100,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsAllowInvalidCertificates and tlsInsecure both present (and true) raises an error",
|
||||
@ -109,7 +109,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsAllowInvalidCertificates and tlsInsecure both present (and false) raises an error",
|
||||
@ -118,7 +118,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsInsecure and tlsAllowInvalidHostnames both present (and true) raises an error",
|
||||
@ -127,7 +127,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsInsecure and tlsAllowInvalidHostnames both present (and false) raises an error",
|
||||
@ -136,7 +136,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsAllowInvalidHostnames and tlsInsecure both present (and true) raises an error",
|
||||
@ -145,7 +145,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsAllowInvalidHostnames and tlsInsecure both present (and false) raises an error",
|
||||
@ -154,7 +154,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tls=true and ssl=true doesn't warn",
|
||||
@ -199,7 +199,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tls=true and ssl=false raises error",
|
||||
@ -208,7 +208,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "ssl=false and tls=true raises error",
|
||||
@ -217,7 +217,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "ssl=true and tls=false raises error",
|
||||
@ -226,7 +226,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsDisableCertificateRevocationCheck can be set to true",
|
||||
@ -259,7 +259,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsAllowInvalidCertificates=true and tlsDisableCertificateRevocationCheck=false raises an error",
|
||||
@ -268,7 +268,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsAllowInvalidCertificates=false and tlsDisableCertificateRevocationCheck=true raises an error",
|
||||
@ -277,7 +277,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsAllowInvalidCertificates and tlsDisableCertificateRevocationCheck both present (and false) raises an error",
|
||||
@ -286,7 +286,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsDisableCertificateRevocationCheck and tlsAllowInvalidCertificates both present (and true) raises an error",
|
||||
@ -295,7 +295,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsDisableCertificateRevocationCheck=true and tlsAllowInvalidCertificates=false raises an error",
|
||||
@ -304,7 +304,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsDisableCertificateRevocationCheck=false and tlsAllowInvalidCertificates=true raises an error",
|
||||
@ -313,7 +313,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsDisableCertificateRevocationCheck and tlsAllowInvalidCertificates both present (and false) raises an error",
|
||||
@ -322,7 +322,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsInsecure and tlsDisableCertificateRevocationCheck both present (and true) raises an error",
|
||||
@ -331,7 +331,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsInsecure=true and tlsDisableCertificateRevocationCheck=false raises an error",
|
||||
@ -340,7 +340,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsInsecure=false and tlsDisableCertificateRevocationCheck=true raises an error",
|
||||
@ -349,7 +349,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsInsecure and tlsDisableCertificateRevocationCheck both present (and false) raises an error",
|
||||
@ -358,7 +358,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsDisableCertificateRevocationCheck and tlsInsecure both present (and true) raises an error",
|
||||
@ -367,7 +367,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsDisableCertificateRevocationCheck=true and tlsInsecure=false raises an error",
|
||||
@ -376,7 +376,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsDisableCertificateRevocationCheck=false and tlsInsecure=true raises an error",
|
||||
@ -385,7 +385,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsDisableCertificateRevocationCheck and tlsInsecure both present (and false) raises an error",
|
||||
@ -394,7 +394,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsDisableCertificateRevocationCheck and tlsDisableOCSPEndpointCheck both present (and true) raises an error",
|
||||
@ -403,7 +403,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsDisableCertificateRevocationCheck=true and tlsDisableOCSPEndpointCheck=false raises an error",
|
||||
@ -412,7 +412,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsDisableCertificateRevocationCheck=false and tlsDisableOCSPEndpointCheck=true raises an error",
|
||||
@ -421,7 +421,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsDisableCertificateRevocationCheck and tlsDisableOCSPEndpointCheck both present (and false) raises an error",
|
||||
@ -430,7 +430,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsDisableOCSPEndpointCheck and tlsDisableCertificateRevocationCheck both present (and true) raises an error",
|
||||
@ -439,7 +439,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsDisableOCSPEndpointCheck=true and tlsDisableCertificateRevocationCheck=false raises an error",
|
||||
@ -448,7 +448,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsDisableOCSPEndpointCheck=false and tlsDisableCertificateRevocationCheck=true raises an error",
|
||||
@ -457,7 +457,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsDisableOCSPEndpointCheck and tlsDisableCertificateRevocationCheck both present (and false) raises an error",
|
||||
@ -466,7 +466,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsDisableOCSPEndpointCheck can be set to true",
|
||||
@ -499,7 +499,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsInsecure=true and tlsDisableOCSPEndpointCheck=false raises an error",
|
||||
@ -508,7 +508,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsInsecure=false and tlsDisableOCSPEndpointCheck=true raises an error",
|
||||
@ -517,7 +517,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsInsecure and tlsDisableOCSPEndpointCheck both present (and false) raises an error",
|
||||
@ -526,7 +526,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsDisableOCSPEndpointCheck and tlsInsecure both present (and true) raises an error",
|
||||
@ -535,7 +535,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsDisableOCSPEndpointCheck=true and tlsInsecure=false raises an error",
|
||||
@ -544,7 +544,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsDisableOCSPEndpointCheck=false and tlsInsecure=true raises an error",
|
||||
@ -553,7 +553,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsDisableOCSPEndpointCheck and tlsInsecure both present (and false) raises an error",
|
||||
@ -562,7 +562,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsAllowInvalidCertificates and tlsDisableOCSPEndpointCheck both present (and true) raises an error",
|
||||
@ -571,7 +571,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsAllowInvalidCertificates=true and tlsDisableOCSPEndpointCheck=false raises an error",
|
||||
@ -580,7 +580,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsAllowInvalidCertificates=false and tlsDisableOCSPEndpointCheck=true raises an error",
|
||||
@ -589,7 +589,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsAllowInvalidCertificates and tlsDisableOCSPEndpointCheck both present (and false) raises an error",
|
||||
@ -598,7 +598,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsDisableOCSPEndpointCheck and tlsAllowInvalidCertificates both present (and true) raises an error",
|
||||
@ -607,7 +607,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsDisableOCSPEndpointCheck=true and tlsAllowInvalidCertificates=false raises an error",
|
||||
@ -616,7 +616,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsDisableOCSPEndpointCheck=false and tlsAllowInvalidCertificates=true raises an error",
|
||||
@ -625,7 +625,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
},
|
||||
{
|
||||
"description": "tlsDisableOCSPEndpointCheck and tlsAllowInvalidCertificates both present (and false) raises an error",
|
||||
@ -634,7 +634,7 @@
|
||||
"warning": false,
|
||||
"hosts": null,
|
||||
"auth": null,
|
||||
"options": {}
|
||||
"options": null
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user