Compare commits

...

8 Commits
master ... v4.4

Author SHA1 Message Date
Shane Harvey
1e8d8612ad BUMP 4.4.2.dev0 2023-07-12 14:02:56 -04:00
Shane Harvey
aab9bcb4e1
BUMP 4.4.1 (#1299) 2023-07-12 13:58:29 -04:00
Shane Harvey
724dee8e11 PYTHON-3818 Create unique key vault index in auto QE example (#1300)
(cherry picked from commit fd760c2b66)
2023-07-10 15:10:58 -04:00
Shane Harvey
61dca84cd4 PYTHON-3762 Remove global code owners (#1256)
(cherry picked from commit 424e6c46fa)
2023-07-10 12:40:15 -04:00
Shane Harvey
fb7e522316 PYTHON-3800 Add test for SRV URI with uppercase hostname (#1293)
(cherry picked from commit 1d7f2ea1c8)
2023-07-07 10:16:38 -04:00
Iris
c7432db957
PYTHON-3798 add error checking and visit for _type_marker_str (#1291) 2023-07-06 08:51:41 -07:00
qkrwjdan
32b2b32780 PYTHON-3800 Add lower() to node when validate hosts of srv records (#1289)
(cherry picked from commit 7d7118bde4)
2023-07-06 11:43:21 -04:00
sleepyStick
8212683a13 BUMP 4.4.1.dev0 2023-07-03 10:31:39 -07:00
7 changed files with 42 additions and 6 deletions

2
.github/CODEOWNERS vendored
View File

@ -1,2 +0,0 @@
# Global owner for repo
* @blink1073 @NoahStapp @ShaneHarvey

View File

@ -469,7 +469,9 @@ static int _load_python_objects(PyObject* module) {
struct module_state *state = GETSTATE(module);
/* Python str for faster _type_marker check */
state->_type_marker_str = PyUnicode_FromString("_type_marker");
if (!(state->_type_marker_str = PyUnicode_FromString("_type_marker"))) {
return 1;
}
if (_load_object(&state->Binary, "bson.binary", "Binary") ||
_load_object(&state->Code, "bson.code", "Code") ||
@ -3043,6 +3045,7 @@ static int _cbson_traverse(PyObject *m, visitproc visit, void *arg) {
Py_VISIT(GETSTATE(m)->MaxKey);
Py_VISIT(GETSTATE(m)->UTC);
Py_VISIT(GETSTATE(m)->REType);
Py_VISIT(GETSTATE(m)->_type_marker_str);
return 0;
}

View File

@ -1,6 +1,27 @@
Changelog
=========
Changes in Version 4.4.1
------------------------
Version 4.4.1 fixes the following bugs:
- Fixed a bug where pymongo would raise a ``ConfigurationError: Invalid SRV host``
error when connecting to a "mongodb+srv://" URI that included capital letters
in the SRV hosts returned from DNS. (`PYTHON-3800`_).
- Fixed a minor reference counting bug in the C extension (`PYTHON-3798`_).
Issues Resolved
...............
See the `PyMongo 4.4.1 release notes in JIRA`_ for the list of resolved issues
in this release.
.. _PYTHON-3798: https://jira.mongodb.org/browse/PYTHON-3798
.. _PYTHON-3800: https://jira.mongodb.org/browse/PYTHON-3800
.. _PyMongo 4.4.1 release notes in JIRA: https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&version=36329
Changes in Version 4.4
-----------------------

View File

@ -633,6 +633,12 @@ as demonstrated by the following example::
)
key_vault = key_vault_client["keyvault"]["datakeys"]
key_vault.drop()
# Ensure that two data keys cannot share the same keyAltName.
key_vault.create_index(
"keyAltNames",
unique=True,
partialFilterExpression={"keyAltNames": {"$exists": True}},
)
key1_id = client_encryption.create_data_key("local", key_alt_names=["firstName"])
key2_id = client_encryption.create_data_key("local", key_alt_names=["lastName"])

View File

@ -15,7 +15,7 @@
"""Current version of PyMongo."""
from typing import Tuple, Union
version_tuple: Tuple[Union[int, str], ...] = (4, 4, 0)
version_tuple: Tuple[Union[int, str], ...] = (4, 4, 2, ".dev0")
def get_version_string() -> str:

View File

@ -108,7 +108,7 @@ class _SrvResolver:
# Validate hosts
for node in nodes:
try:
nlist = node[0].split(".")[1:][-self.__slen :]
nlist = node[0].lower().split(".")[1:][-self.__slen :]
except Exception:
raise ConfigurationError(f"Invalid SRV host: {node[0]}")
if self.__plist != nlist:

View File

@ -21,7 +21,7 @@ import sys
sys.path[0:0] = [""]
from test import client_context, unittest
from test import IntegrationTest, client_context, unittest
from test.utils import wait_until
from pymongo.common import validate_read_preference_tags
@ -186,5 +186,13 @@ class TestParsingErrors(unittest.TestCase):
)
class TestCaseInsensitive(IntegrationTest):
@unittest.skipUnless(_HAVE_DNSPYTHON, "DNS tests require the dnspython module")
def test_connect_case_insensitive(self):
client = MongoClient("mongodb+srv://TEST1.TEST.BUILD.10GEN.cc/")
self.addCleanup(client.close)
self.assertGreater(len(client.topology_description.server_descriptions()), 1)
if __name__ == "__main__":
unittest.main()