mysqlx-connector-python 8.3.0__tar.gz → 9.0.0__tar.gz

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 (49) hide show
  1. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/CONTRIBUTING.rst +2 -2
  2. mysqlx-connector-python-9.0.0/INFO_BIN +2 -0
  3. mysqlx-connector-python-9.0.0/INFO_SRC +4 -0
  4. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/LICENSE.txt +49 -13
  5. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/README.rst +78 -13
  6. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/README.txt +5 -1
  7. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/__init__.py +5 -5
  8. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/authentication.py +5 -5
  9. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/charsets.py +5 -5
  10. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/connection.py +37 -27
  11. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/constants.py +10 -67
  12. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/crud.py +5 -5
  13. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/dbdoc.py +5 -5
  14. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/errorcode.py +5 -5
  15. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/errors.py +5 -5
  16. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/expr.py +8 -8
  17. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/helpers.py +8 -8
  18. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/locales/__init__.py +5 -5
  19. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/locales/eng/__init__.py +5 -5
  20. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/locales/eng/client_error.py +5 -5
  21. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/logger.py +5 -5
  22. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/protobuf/__init__.py +5 -5
  23. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/protobuf/mysqlx_connection_pb2.py +5 -5
  24. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/protobuf/mysqlx_crud_pb2.py +5 -5
  25. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/protobuf/mysqlx_cursor_pb2.py +5 -5
  26. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/protobuf/mysqlx_datatypes_pb2.py +5 -5
  27. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/protobuf/mysqlx_expect_pb2.py +5 -5
  28. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/protobuf/mysqlx_expr_pb2.py +5 -5
  29. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/protobuf/mysqlx_notice_pb2.py +5 -5
  30. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/protobuf/mysqlx_pb2.py +5 -5
  31. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/protobuf/mysqlx_prepare_pb2.py +5 -5
  32. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/protobuf/mysqlx_resultset_pb2.py +5 -5
  33. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/protobuf/mysqlx_session_pb2.py +5 -5
  34. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/protobuf/mysqlx_sql_pb2.py +5 -5
  35. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/protocol.py +5 -5
  36. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/result.py +5 -5
  37. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/statement.py +5 -5
  38. mysqlx-connector-python-9.0.0/mysqlx/tls_ciphers.py +168 -0
  39. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/types.py +28 -0
  40. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/utils.py +47 -5
  41. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/version.py +6 -6
  42. {mysqlx-connector-python-8.3.0/mysqlx_connector_python-8.3.0-py3.8.egg-info → mysqlx-connector-python-9.0.0/mysqlx_connector_python-9.0.0-py3.8.egg-info}/PKG-INFO +1 -1
  43. {mysqlx-connector-python-8.3.0/mysqlx_connector_python-8.3.0-py3.8.egg-info → mysqlx-connector-python-9.0.0/mysqlx_connector_python-9.0.0-py3.8.egg-info}/SOURCES.txt +2 -0
  44. {mysqlx-connector-python-8.3.0/mysqlx_connector_python-8.3.0-py3.8.egg-info → mysqlx-connector-python-9.0.0/mysqlx_connector_python-9.0.0-py3.8.egg-info}/requires.txt +2 -2
  45. mysqlx-connector-python-8.3.0/INFO_BIN +0 -2
  46. mysqlx-connector-python-8.3.0/INFO_SRC +0 -4
  47. {mysqlx-connector-python-8.3.0 → mysqlx-connector-python-9.0.0}/mysqlx/py.typed +0 -0
  48. {mysqlx-connector-python-8.3.0/mysqlx_connector_python-8.3.0-py3.8.egg-info → mysqlx-connector-python-9.0.0/mysqlx_connector_python-9.0.0-py3.8.egg-info}/dependency_links.txt +0 -0
  49. {mysqlx-connector-python-8.3.0/mysqlx_connector_python-8.3.0-py3.8.egg-info → mysqlx-connector-python-9.0.0/mysqlx_connector_python-9.0.0-py3.8.egg-info}/top_level.txt +0 -0
@@ -23,7 +23,7 @@ Contributing to this project is easy. You just need to follow these steps.
23
23
 
24
24
  - Make sure you have a user account at `bugs.mysql.com <https://bugs.mysql.com>`_. You will need to reference this user account when you submit your Oracle Contributor Agreement (a.k.a. OCA).
25
25
  - Sign the Oracle Contributor Agreement. You can find instructions for doing that at the `OCA Page <https://oca.opensource.oracle.com/>`_.
26
- - Develop your pull request. Make sure you are aware of the `requirements <https://dev.mysql.com/doc/dev/connector-python/8.0/requirements.html>`_ for the project.
26
+ - Develop your pull request. Make sure you are aware of the `requirements <https://dev.mysql.com/doc/dev/connector-python/requirements.html>`_ for the project.
27
27
  - Validate your pull request by including tests that sufficiently cover the functionality you are adding.
28
28
  - Verify that the entire test suite passes with your code applied.
29
29
  - Submit your pull request. While you can submit the pull request via `GitHub <https://github.com/mysql/mysql-connector-python/pulls>`_, you can also submit it directly via `bugs.mysql.com <https://bugs.mysql.com>`_.
@@ -35,7 +35,7 @@ Setting Up a Development Environment
35
35
 
36
36
  The following tips provide all the technical directions you should follow when writing code and before actually submitting your contribution.
37
37
 
38
- 1) Make sure you have the necessary `prerequisites <https://dev.mysql.com/doc/dev/connector-python/8.0/installation.html#prerequisites>`_ for building the project and `Pylint <https://www.pylint.org/>`_ for static code analysis
38
+ 1) Make sure you have the necessary `prerequisites <https://dev.mysql.com/doc/dev/connector-python/installation.html#prerequisites>`_ for building the project and `Pylint <https://www.pylint.org/>`_ for static code analysis
39
39
 
40
40
  2) Clone MySQL Connector/Python
41
41
 
@@ -0,0 +1,2 @@
1
+ build-date: 2024-06-16 09:03:52
2
+ os-info: Linux-5.4.17-2136.328.3.el7uek.x86_64-x86_64-with-glibc2.17
@@ -0,0 +1,4 @@
1
+ version: 9.0.0
2
+ branch: release/9.0.0
3
+ commit: 59817f3de42d98ac2875a14ea265d77bd0ac3805
4
+ short: 59817f3
@@ -1,6 +1,6 @@
1
1
  Licensing Information User Manual
2
2
 
3
- MySQL Connector/Python 8.3.0 Community
3
+ MySQL Connector/Python 9.0.0 Community
4
4
  __________________________________________________________________
5
5
 
6
6
  Introduction
@@ -8,25 +8,25 @@ Introduction
8
8
  This License Information User Manual contains Oracle's product license
9
9
  and other licensing information, including licensing information for
10
10
  third-party software which may be included in this distribution of
11
- MySQL Connector/Python 8.3.0 Community.
11
+ MySQL Connector/Python 9.0.0 Community.
12
12
 
13
- Last updated: November 2023
13
+ Last updated: May 2024
14
14
 
15
15
  Licensing Information
16
16
 
17
- This release of MySQL Connector/Python 8.3.0 Community is brought to
17
+ This release of MySQL Connector/Python 9.0.0 Community is brought to
18
18
  you by the MySQL team at Oracle. This software is released under
19
19
  version 2 of the GNU General Public License (GPLv2), as set forth
20
20
  below, with the following additional permissions:
21
21
 
22
- This distribution of MySQL Connector/Python 8.3.0 Community is
23
- distributed with certain software (including but not limited to
24
- OpenSSL) that is licensed under separate terms, as designated in a
25
- particular file or component or in the license documentation. Without
26
- limiting your rights under the GPLv2, the authors of MySQL hereby grant
27
- you an additional permission to link the program and your derivative
28
- works with the separately licensed software that they have included
29
- with the program.
22
+ This distribution of MySQL Connector/Python 9.0.0 Community is designed
23
+ to work with certain software (including but not limited to OpenSSL)
24
+ that is licensed under separate terms, as designated in a particular
25
+ file or component or in the license documentation. Without limiting
26
+ your rights under the GPLv2, the authors of MySQL hereby grant you an
27
+ additional permission to link the program and your derivative works
28
+ with the separately licensed software that they have either included
29
+ with the program or referenced in the documentation.
30
30
 
31
31
  Without limiting the foregoing grant of rights under the GPLv2 and
32
32
  additional permission as to separately licensed software, this
@@ -34,7 +34,7 @@ Licensing Information
34
34
  a copy of which is reproduced below and can also be found along with
35
35
  its FAQ at http://oss.oracle.com/licenses/universal-foss-exception.
36
36
 
37
- Copyright (c) 2012, 2023, Oracle and/or its affiliates.
37
+ Copyright (c) 2012, 2024, Oracle and/or its affiliates.
38
38
 
39
39
  Election of GPLv2
40
40
 
@@ -642,6 +642,35 @@ of the input file used when generating it. This code is not
642
642
  standalone and requires a support library to be linked with it. This
643
643
  support library is itself covered by the above license.
644
644
 
645
+ 4th party - abseil-cpp
646
+ ----------------------
647
+
648
+ === Header in source files:
649
+ // Copyright 2017 The Abseil Authors.
650
+ //
651
+ // Licensed under the Apache License, Version 2.0 (the "License");
652
+ // you may not use this file except in compliance with the License.
653
+ // You may obtain a copy of the License at
654
+ //
655
+ // https://www.apache.org/licenses/LICENSE-2.0
656
+ //
657
+ // Unless required by applicable law or agreed to in writing, software
658
+ // distributed under the License is distributed on an "AS IS" BASIS,
659
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
660
+ // See the License for the specific language governing permissions and
661
+ // limitations under the License.
662
+ //
663
+ // This header file contains C++11 versions of standard <utility> header
664
+ // abstractions available within C++14 and C++17, and are designed to be
665
+ // drop-in replacement for code compliant with C++14 and C++17.
666
+
667
+ Apache License
668
+ Version 2.0, January 2004
669
+ https://www.apache.org/licenses/
670
+
671
+ A copy of the Apache License v2.0, January 2004 license can be found
672
+ in the 'Standard Licenses' section.
673
+
645
674
  ======================================================================
646
675
  ======================================================================
647
676
 
@@ -2114,6 +2143,13 @@ See Apache License v2.0, January 2004 in the
2114
2143
 
2115
2144
  OpenTelemetry C++
2116
2145
 
2146
+ You may be receiving a copy of the opentelemetry-cpp library with
2147
+ this MySQL product. The terms of the Oracle license do NOT apply
2148
+ to the opentelemetry-cpp library; it is licensed under the following
2149
+ license, separately from the Oracle programs you receive.
2150
+ If you do not wish to install this program, you may delete its files
2151
+ but the Oracle program might not operate properly or at all without it.
2152
+
2117
2153
  // Copyright The OpenTelemetry Authors
2118
2154
  // SPDX-License-Identifier: Apache-2.0
2119
2155
 
@@ -8,25 +8,86 @@ MySQL Connector/Python
8
8
  .. image:: https://img.shields.io/pypi/l/mysql-connector-python.svg
9
9
  :target: https://pypi.org/project/mysql-connector-python/
10
10
 
11
- MySQL Connector/Python enables Python programs to access MySQL databases, using an API that is compliant with the `Python Database API Specification v2.0 (PEP 249) <https://www.python.org/dev/peps/pep-0249/>`_. It also contains an implementation of the `X DevAPI <https://dev.mysql.com/doc/x-devapi-userguide/en>`_, an Application Programming Interface for working with the `MySQL Document Store <https://dev.mysql.com/doc/refman/8.0/en/document-store.html>`_.
11
+ MySQL Connector/Python enables Python programs to access MySQL databases, using
12
+ an API that is compliant with the `Python Database API Specification v2.0
13
+ (PEP 249) <https://www.python.org/dev/peps/pep-0249/>`_ - We refer to it as the
14
+ `Classic API <https://dev.mysql.com/doc/connector-python/en/connector-python-reference.html>`_.
15
+
16
+ It also contains an implementation of the `XDevAPI <https://dev.mysql.com/doc/x-devapi-userguide/en>`_
17
+ - An Application Programming Interface for working with the `MySQL Document Store
18
+ <https://dev.mysql.com/doc/refman/en/document-store.html>`_.
19
+
20
+ Features
21
+ --------
22
+
23
+ * `Asynchronous Connectivity <https://dev.mysql.com/doc/connector-python/en/connector-python-asyncio.html>`_
24
+ * `C-extension <https://dev.mysql.com/doc/connector-python/en/connector-python-cext.html>`_
25
+ * `Telemetry <https://dev.mysql.com/doc/connector-python/en/connector-python-opentelemetry.html>`_
26
+ * `XDevAPI <https://dev.mysql.com/doc/x-devapi-userguide/en>`_
27
+
12
28
 
13
29
  Installation
14
30
  ------------
15
31
 
16
32
  The recommended way to install Connector/Python is via `pip <https://pip.pypa.io/>`_.
17
33
 
18
- Make sure you have a recent `pip <https://pip.pypa.io/>`_ version installed on your system. If your system already has ``pip`` installed, you might need to update it. Or you can use the `standalone pip installer <https://pip.pypa.io/en/latest/installing/#installing-with-get-pip-py>`_.
34
+ Make sure you have a recent `pip <https://pip.pypa.io/>`_ version installed
35
+ on your system. If your system already has ``pip`` installed, you might need
36
+ to update it. Or you can use the `standalone pip installer <https://pip.pypa.io/en/latest/installation/>`_.
37
+
38
+ The *classic API* can be installed via pip as follows:
19
39
 
20
40
  .. code-block:: bash
21
41
 
22
- shell> pip install mysql-connector-python
42
+ $ pip install mysql-connector-python
43
+
44
+ , similarly, the *XDevAPI* can be installed with:
45
+
46
+ .. code-block:: bash
23
47
 
24
- Please refer to the `installation tutorial <https://dev.mysql.com/doc/dev/connector-python/8.0/installation.html>`_ for installation alternatives.
48
+ $ pip install mysqlx-connector-python
25
49
 
26
- Getting Started
27
- ---------------
50
+ Please refer to the `installation tutorial <https://dev.mysql.com/doc/dev/connector-python/installation.html>`_
51
+ for installation alternatives of the XDevAPI.
28
52
 
29
- Using the MySQL classic protocol:
53
+ ++++++++++++++++++++
54
+ Installation Options
55
+ ++++++++++++++++++++
56
+
57
+ Connector packages included in MySQL Connector/Python allow you to install
58
+ optional dependencies to unleash certain functionalities.
59
+
60
+ .. code-block:: bash
61
+
62
+ # 3rd party packages to unleash the telemetry functionality are installed
63
+ $ pip install mysql-connector-python[telemetry]
64
+
65
+ similarly, for the XDevAPI:
66
+
67
+ .. code-block:: bash
68
+
69
+ # 3rd party packages to unleash the compression functionality are installed
70
+ $ pip install mysqlx-connector-python[compression]
71
+
72
+ This installation option can be seen as a shortcut to install all the
73
+ dependencies needed by a particular feature. Mind that this is optional
74
+ and you are free to install the required dependencies by yourself.
75
+
76
+ Options for the Classic connector:
77
+
78
+ * dns-srv
79
+ * gssapi
80
+ * fido2
81
+ * telemetry
82
+
83
+ Options for the XDevAPI connector:
84
+
85
+ * dns-srv
86
+ * compression
87
+
88
+
89
+ Classic
90
+ -------
30
91
 
31
92
  .. code:: python
32
93
 
@@ -52,7 +113,9 @@ Using the MySQL classic protocol:
52
113
  # Close connection
53
114
  cnx.close()
54
115
 
55
- Using the MySQL X DevAPI:
116
+
117
+ XDevAPI
118
+ -------
56
119
 
57
120
  .. code:: python
58
121
 
@@ -83,8 +146,6 @@ Using the MySQL X DevAPI:
83
146
  session.close()
84
147
 
85
148
 
86
- Please refer to the `MySQL Connector/Python Developer Guide <https://dev.mysql.com/doc/connector-python/en/>`_ and the `MySQL Connector/Python X DevAPI Reference <https://dev.mysql.com/doc/dev/connector-python/>`_ for a complete usage guide.
87
-
88
149
  Additional Resources
89
150
  --------------------
90
151
 
@@ -94,14 +155,18 @@ Additional Resources
94
155
  - `MySQL Public Bug Tracker <https://bugs.mysql.com>`_
95
156
  - `Slack <https://mysqlcommunity.slack.com>`_ (`Sign-up <https://lefred.be/mysql-community-on-slack/>`_ required if you do not have an Oracle account)
96
157
  - `Stack Overflow <https://stackoverflow.com/questions/tagged/mysql-connector-python>`_
97
- - `InsideMySQL.com Connectors Blog <https://insidemysql.com/category/mysql-development/connectors/>`_
158
+ - `Oracle Blogs <https://blogs.oracle.com/search.html?q=connector-python>`_
159
+
98
160
 
99
161
  Contributing
100
162
  ------------
101
163
 
102
- There are a few ways to contribute to the Connector/Python code. Please refer to the `contributing guidelines <CONTRIBUTING.rst>`_ for additional information.
164
+ There are a few ways to contribute to the Connector/Python code. Please refer
165
+ to the `contributing guidelines <CONTRIBUTING.rst>`_ for additional information.
166
+
103
167
 
104
168
  License
105
169
  -------
106
170
 
107
- Please refer to the `README.txt <README.txt>`_ and `LICENSE.txt <LICENSE.txt>`_ files, available in this repository, for further details.
171
+ Please refer to the `README.txt <README.txt>`_ and `LICENSE.txt <LICENSE.txt>`_
172
+ files, available in this repository, for further details.
@@ -2,12 +2,16 @@ Copyright (c) 2009, 2024, Oracle and/or its affiliates.
2
2
 
3
3
  This is a release of MySQL Connector/Python, Oracle's Python driver for MySQL.
4
4
 
5
+ MySQL Connector/Python enables Python programs to access MySQL databases,
6
+ using an API that is compliant with the Python Database API Specification
7
+ v2.0 (PEP 249). It also contains an implementation of the XDevAPI.
8
+
5
9
  License information can be found in the LICENSE.txt file.
6
10
 
7
11
  This distribution may include materials developed by third parties. For license
8
12
  and attribution notices for these materials, please refer to the LICENSE.txt file.
9
13
 
10
- For more information on MySQL Connector/Python, visit
14
+ For more information on MySQL Connector/Python XDevAPI, visit
11
15
  https://dev.mysql.com/doc/dev/connector-python/
12
16
 
13
17
  For additional downloads and the source of MySQL Connector/Python, visit
@@ -1,16 +1,16 @@
1
- # Copyright (c) 2016, 2023, Oracle and/or its affiliates.
1
+ # Copyright (c) 2016, 2024, Oracle and/or its affiliates.
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or modify
4
4
  # it under the terms of the GNU General Public License, version 2.0, as
5
5
  # published by the Free Software Foundation.
6
6
  #
7
- # This program is also distributed with certain software (including
7
+ # This program is designed to work with certain software (including
8
8
  # but not limited to OpenSSL) that is licensed under separate terms,
9
9
  # as designated in a particular file or component or in included license
10
- # documentation. The authors of MySQL hereby grant you an
10
+ # documentation. The authors of MySQL hereby grant you an
11
11
  # additional permission to link the program and your derivative works
12
- # with the separately licensed software that they have included with
13
- # MySQL.
12
+ # with the separately licensed software that they have either included with
13
+ # the program or referenced in the documentation.
14
14
  #
15
15
  # Without limiting anything contained in the foregoing, this file,
16
16
  # which is part of MySQL Connector/Python, is also subject to the
@@ -1,16 +1,16 @@
1
- # Copyright (c) 2016, 2023, Oracle and/or its affiliates.
1
+ # Copyright (c) 2016, 2024, Oracle and/or its affiliates.
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or modify
4
4
  # it under the terms of the GNU General Public License, version 2.0, as
5
5
  # published by the Free Software Foundation.
6
6
  #
7
- # This program is also distributed with certain software (including
7
+ # This program is designed to work with certain software (including
8
8
  # but not limited to OpenSSL) that is licensed under separate terms,
9
9
  # as designated in a particular file or component or in included license
10
- # documentation. The authors of MySQL hereby grant you an
10
+ # documentation. The authors of MySQL hereby grant you an
11
11
  # additional permission to link the program and your derivative works
12
- # with the separately licensed software that they have included with
13
- # MySQL.
12
+ # with the separately licensed software that they have either included with
13
+ # the program or referenced in the documentation.
14
14
  #
15
15
  # Without limiting anything contained in the foregoing, this file,
16
16
  # which is part of MySQL Connector/Python, is also subject to the
@@ -1,18 +1,18 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
- # Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
3
+ # Copyright (c) 2013, 2024, Oracle and/or its affiliates.
4
4
  #
5
5
  # This program is free software; you can redistribute it and/or modify
6
6
  # it under the terms of the GNU General Public License, version 2.0, as
7
7
  # published by the Free Software Foundation.
8
8
  #
9
- # This program is also distributed with certain software (including
9
+ # This program is designed to work with certain software (including
10
10
  # but not limited to OpenSSL) that is licensed under separate terms,
11
11
  # as designated in a particular file or component or in included license
12
- # documentation. The authors of MySQL hereby grant you an
12
+ # documentation. The authors of MySQL hereby grant you an
13
13
  # additional permission to link the program and your derivative works
14
- # with the separately licensed software that they have included with
15
- # MySQL.
14
+ # with the separately licensed software that they have either included with
15
+ # the program or referenced in the documentation.
16
16
  #
17
17
  # Without limiting anything contained in the foregoing, this file,
18
18
  # which is part of MySQL Connector/Python, is also subject to the
@@ -1,16 +1,16 @@
1
- # Copyright (c) 2016, 2023, Oracle and/or its affiliates.
1
+ # Copyright (c) 2016, 2024, Oracle and/or its affiliates.
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or modify
4
4
  # it under the terms of the GNU General Public License, version 2.0, as
5
5
  # published by the Free Software Foundation.
6
6
  #
7
- # This program is also distributed with certain software (including
7
+ # This program is designed to work with certain software (including
8
8
  # but not limited to OpenSSL) that is licensed under separate terms,
9
9
  # as designated in a particular file or component or in included license
10
- # documentation. The authors of MySQL hereby grant you an
10
+ # documentation. The authors of MySQL hereby grant you an
11
11
  # additional permission to link the program and your derivative works
12
- # with the separately licensed software that they have included with
13
- # MySQL.
12
+ # with the separately licensed software that they have either included with
13
+ # the program or referenced in the documentation.
14
14
  #
15
15
  # Without limiting anything contained in the foregoing, this file,
16
16
  # which is part of MySQL Connector/Python, is also subject to the
@@ -39,8 +39,6 @@ try:
39
39
 
40
40
  SSL_AVAILABLE = True
41
41
  TLS_VERSIONS = {
42
- "TLSv1": ssl.PROTOCOL_TLSv1,
43
- "TLSv1.1": ssl.PROTOCOL_TLSv1_1,
44
42
  "TLSv1.2": ssl.PROTOCOL_TLSv1_2,
45
43
  }
46
44
  # TLSv1.3 included in PROTOCOL_TLS, but PROTOCOL_TLS is not included on 3.4
@@ -65,7 +63,6 @@ import socket
65
63
  import sys
66
64
  import threading
67
65
  import uuid
68
- import warnings
69
66
 
70
67
  from typing import Any, Callable, Dict, List, Mapping, Optional, Tuple, Type, Union
71
68
 
@@ -85,7 +82,6 @@ from urllib.parse import parse_qsl, unquote, urlparse
85
82
  from .authentication import MySQL41AuthPlugin, PlainAuthPlugin, Sha256MemoryAuthPlugin
86
83
  from .constants import (
87
84
  COMPRESSION_ALGORITHMS,
88
- DEPRECATED_TLS_VERSIONS,
89
85
  OPENSSL_CS_NAMES,
90
86
  SUPPORTED_TLS_VERSIONS,
91
87
  TLS_CIPHER_SUITES,
@@ -126,7 +122,12 @@ from .types import ColumnType, MessageType, ResultBaseType, StatementType
126
122
 
127
123
  sys.path.append("..")
128
124
 
129
- from .utils import linux_distribution
125
+ from .tls_ciphers import UNACCEPTABLE_TLS_CIPHERSUITES, UNACCEPTABLE_TLS_VERSIONS
126
+ from .utils import (
127
+ linux_distribution,
128
+ warn_ciphersuites_deprecated,
129
+ warn_tls_version_deprecated,
130
+ )
130
131
  from .version import LICENSE, VERSION
131
132
 
132
133
  DUPLICATED_IN_LIST_ERROR = (
@@ -139,7 +140,7 @@ TLS_VERSION_ERROR = (
139
140
  "TLS protocol version (should be one of {})."
140
141
  )
141
142
 
142
- TLS_VERSION_DEPRECATED_ERROR = (
143
+ TLS_VERSION_UNACCEPTABLE_ERROR = (
143
144
  "The given tls_version: '{}' are no longer allowed (should be one of {})."
144
145
  )
145
146
 
@@ -438,15 +439,11 @@ class SocketStream:
438
439
 
439
440
  self._is_ssl = True
440
441
 
441
- # Raise a deprecation warning if TLSv1 or TLSv1.1 is being used
442
- tls_version = self._socket.version()
443
- if tls_version in ("TLSv1", "TLSv1.1"):
444
- warn_msg = (
445
- f"This connection is using {tls_version} which is now "
446
- "deprecated and will be removed in a future release of "
447
- "MySQL Connector/Python"
448
- )
449
- warnings.warn(warn_msg, DeprecationWarning)
442
+ # Raise a deprecation warning if a deprecated TLS cipher or
443
+ # version is being used.
444
+ cipher, tls_version, _ = self._socket.cipher()
445
+ warn_tls_version_deprecated(tls_version)
446
+ warn_ciphersuites_deprecated(cipher, tls_version)
450
447
 
451
448
  def is_ssl(self) -> bool:
452
449
  """Verifies if SSL is being used.
@@ -1544,6 +1541,7 @@ class ConnectionPool(queue.Queue):
1544
1541
  """
1545
1542
 
1546
1543
  def __init__(self, name: str, **kwargs: Any) -> None:
1544
+ self.name: Optional[str] = None
1547
1545
  self._set_pool_name(name)
1548
1546
  self._open_sessions: int = 0
1549
1547
  self._connections_openned: List[PooledConnection] = []
@@ -3093,13 +3091,13 @@ def _validate_tls_versions(settings: Dict[str, Any]) -> None:
3093
3091
  )
3094
3092
 
3095
3093
  use_tls_versions = []
3096
- deprecated_tls_versions = []
3094
+ unacceptable_tls_versions = []
3097
3095
  not_tls_versions = []
3098
3096
  for tls_ver in tls_versions:
3099
3097
  if tls_ver in SUPPORTED_TLS_VERSIONS:
3100
3098
  use_tls_versions.append(tls_ver)
3101
- if tls_ver in DEPRECATED_TLS_VERSIONS:
3102
- deprecated_tls_versions.append(tls_ver)
3099
+ if tls_ver in UNACCEPTABLE_TLS_VERSIONS:
3100
+ unacceptable_tls_versions.append(tls_ver)
3103
3101
  else:
3104
3102
  not_tls_versions.append(tls_ver)
3105
3103
 
@@ -3108,12 +3106,11 @@ def _validate_tls_versions(settings: Dict[str, Any]) -> None:
3108
3106
  raise NotSupportedError(
3109
3107
  TLS_VER_NO_SUPPORTED.format(tls_versions, SUPPORTED_TLS_VERSIONS)
3110
3108
  )
3111
- use_tls_versions.sort()
3112
3109
  settings["tls-versions"] = use_tls_versions
3113
- elif deprecated_tls_versions:
3110
+ elif unacceptable_tls_versions:
3114
3111
  raise NotSupportedError(
3115
- TLS_VERSION_DEPRECATED_ERROR.format(
3116
- deprecated_tls_versions, SUPPORTED_TLS_VERSIONS
3112
+ TLS_VERSION_UNACCEPTABLE_ERROR.format(
3113
+ unacceptable_tls_versions, SUPPORTED_TLS_VERSIONS
3117
3114
  )
3118
3115
  )
3119
3116
  elif not_tls_versions:
@@ -3206,6 +3203,19 @@ def _validate_tls_ciphersuites(settings: Dict[str, Any]) -> None:
3206
3203
  "No valid cipher suite found in the 'tls-ciphersuites' list"
3207
3204
  )
3208
3205
 
3206
+ # raise an error when using an unacceptable cipher
3207
+ for cipher_as_ossl in translated_names:
3208
+ for tls_ver in SUPPORTED_TLS_VERSIONS[
3209
+ : SUPPORTED_TLS_VERSIONS.index(newer_tls_ver) + 1
3210
+ ]:
3211
+ if (
3212
+ cipher_as_ossl
3213
+ in UNACCEPTABLE_TLS_CIPHERSUITES.get(tls_ver, {}).values()
3214
+ ):
3215
+ raise NotSupportedError(
3216
+ f"Cipher {cipher_as_ossl} when used with {tls_ver} is unacceptable."
3217
+ )
3218
+
3209
3219
  settings["tls-ciphersuites"] = translated_names
3210
3220
 
3211
3221
 
@@ -1,16 +1,16 @@
1
- # Copyright (c) 2016, 2023, Oracle and/or its affiliates.
1
+ # Copyright (c) 2016, 2024, Oracle and/or its affiliates.
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or modify
4
4
  # it under the terms of the GNU General Public License, version 2.0, as
5
5
  # published by the Free Software Foundation.
6
6
  #
7
- # This program is also distributed with certain software (including
7
+ # This program is designed to work with certain software (including
8
8
  # but not limited to OpenSSL) that is licensed under separate terms,
9
9
  # as designated in a particular file or component or in included license
10
- # documentation. The authors of MySQL hereby grant you an
10
+ # documentation. The authors of MySQL hereby grant you an
11
11
  # additional permission to link the program and your derivative works
12
- # with the separately licensed software that they have included with
13
- # MySQL.
12
+ # with the separately licensed software that they have either included with
13
+ # the program or referenced in the documentation.
14
14
  #
15
15
  # Without limiting anything contained in the foregoing, this file,
16
16
  # which is part of MySQL Connector/Python, is also subject to the
@@ -30,6 +30,8 @@
30
30
 
31
31
  from enum import Enum
32
32
 
33
+ from . import tls_ciphers
34
+
33
35
 
34
36
  class Auth(Enum):
35
37
  """Enum to identify the authentication mechanisms."""
@@ -74,66 +76,11 @@ COMPRESSION_ALGORITHMS = {
74
76
  "zstd_stream": "zstd_stream",
75
77
  }
76
78
 
77
- TLS_VERSIONS = ["TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3"]
78
- SUPPORTED_TLS_VERSIONS = ["TLSv1.2", "TLSv1.3"]
79
- DEPRECATED_TLS_VERSIONS = ["TLSv1", "TLSv1.1"]
80
79
 
81
- # TLS v1.0 cipher suites IANI to OpenSSL name translation
82
- TLSV1_CIPHER_SUITES = {
83
- "TLS_RSA_WITH_NULL_MD5": "NULL-MD5",
84
- "TLS_RSA_WITH_NULL_SHA": "NULL-SHA",
85
- "TLS_RSA_WITH_RC4_128_MD5": "RC4-MD5",
86
- "TLS_RSA_WITH_RC4_128_SHA": "RC4-SHA",
87
- "TLS_RSA_WITH_IDEA_CBC_SHA": "IDEA-CBC-SHA",
88
- "TLS_RSA_WITH_3DES_EDE_CBC_SHA": "DES-CBC3-SHA",
89
- "TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA": "Not implemented.",
90
- "TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA": "Not implemented.",
91
- "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA": "DHE-DSS-DES-CBC3-SHA",
92
- "TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA": "DHE-RSA-DES-CBC3-SHA",
93
- "TLS_DH_anon_WITH_RC4_128_MD5": "ADH-RC4-MD5",
94
- "TLS_DH_anon_WITH_3DES_EDE_CBC_SHA": "ADH-DES-CBC3-SHA",
95
- # AES cipher suites from RFC3268, extending TLS v1.0
96
- "TLS_RSA_WITH_AES_128_CBC_SHA": "AES128-SHA",
97
- "TLS_RSA_WITH_AES_256_CBC_SHA": "AES256-SHA",
98
- "TLS_DH_DSS_WITH_AES_128_CBC_SHA": "DH-DSS-AES128-SHA",
99
- "TLS_DH_DSS_WITH_AES_256_CBC_SHA": "DH-DSS-AES256-SHA",
100
- "TLS_DH_RSA_WITH_AES_128_CBC_SHA": "DH-RSA-AES128-SHA",
101
- "TLS_DH_RSA_WITH_AES_256_CBC_SHA": "DH-RSA-AES256-SHA",
102
- "TLS_DHE_DSS_WITH_AES_128_CBC_SHA": "DHE-DSS-AES128-SHA",
103
- "TLS_DHE_DSS_WITH_AES_256_CBC_SHA": "DHE-DSS-AES256-SHA",
104
- "TLS_DHE_RSA_WITH_AES_128_CBC_SHA": "DHE-RSA-AES128-SHA",
105
- "TLS_DHE_RSA_WITH_AES_256_CBC_SHA": "DHE-RSA-AES256-SHA",
106
- "TLS_DH_anon_WITH_AES_128_CBC_SHA": "ADH-AES128-SHA",
107
- "TLS_DH_anon_WITH_AES_256_CBC_SHA": "ADH-AES256-SHA",
108
- # Camellia cipher suites from RFC4132, extending TLS v1.0
109
- "TLS_RSA_WITH_CAMELLIA_128_CBC_SHA": "CAMELLIA128-SHA",
110
- "TLS_RSA_WITH_CAMELLIA_256_CBC_SHA": "CAMELLIA256-SHA",
111
- "TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA": "DH-DSS-CAMELLIA128-SHA",
112
- "TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA": "DH-DSS-CAMELLIA256-SHA",
113
- "TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA": "DH-RSA-CAMELLIA128-SHA",
114
- "TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA": "DH-RSA-CAMELLIA256-SHA",
115
- "TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA": "DHE-DSS-CAMELLIA128-SHA",
116
- "TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA": "DHE-DSS-CAMELLIA256-SHA",
117
- "TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA": "DHE-RSA-CAMELLIA128-SHA",
118
- "TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA": "DHE-RSA-CAMELLIA256-SHA",
119
- "TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA": "ADH-CAMELLIA128-SHA",
120
- "TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA": "ADH-CAMELLIA256-SHA",
121
- # SEED cipher suites from RFC4162, extending TLS v1.0
122
- "TLS_RSA_WITH_SEED_CBC_SHA": "SEED-SHA",
123
- "TLS_DH_DSS_WITH_SEED_CBC_SHA": "DH-DSS-SEED-SHA",
124
- "TLS_DH_RSA_WITH_SEED_CBC_SHA": "DH-RSA-SEED-SHA",
125
- "TLS_DHE_DSS_WITH_SEED_CBC_SHA": "DHE-DSS-SEED-SHA",
126
- "TLS_DHE_RSA_WITH_SEED_CBC_SHA": "DHE-RSA-SEED-SHA",
127
- "TLS_DH_anon_WITH_SEED_CBC_SHA": "ADH-SEED-SHA",
128
- # GOST cipher suites from draft-chudov-cryptopro-cptls, extending TLS v1.0
129
- "TLS_GOSTR341094_WITH_28147_CNT_IMIT": "GOST94-GOST89-GOST89",
130
- "TLS_GOSTR341001_WITH_28147_CNT_IMIT": "GOST2001-GOST89-GOST89",
131
- "TLS_GOSTR341094_WITH_NULL_GOSTR3411": "GOST94-NULL-GOST94",
132
- "TLS_GOSTR341001_WITH_NULL_GOSTR3411": "GOST2001-NULL-GOST94",
133
- }
80
+ SUPPORTED_TLS_VERSIONS = (
81
+ tls_ciphers.APPROVED_TLS_VERSIONS + tls_ciphers.DEPRECATED_TLS_VERSIONS
82
+ )
134
83
 
135
- # TLS v1.1 cipher suites IANI to OpenSSL name translation
136
- TLSV1_1_CIPHER_SUITES = TLSV1_CIPHER_SUITES
137
84
 
138
85
  # TLS v1.2 cipher suites IANI to OpenSSL name translation
139
86
  TLSV1_2_CIPHER_SUITES = {
@@ -283,15 +230,11 @@ TLSV1_3_CIPHER_SUITES = {
283
230
  }
284
231
 
285
232
  TLS_CIPHER_SUITES = {
286
- "TLSv1": TLSV1_CIPHER_SUITES,
287
- "TLSv1.1": TLSV1_1_CIPHER_SUITES,
288
233
  "TLSv1.2": TLSV1_2_CIPHER_SUITES,
289
234
  "TLSv1.3": TLSV1_3_CIPHER_SUITES,
290
235
  }
291
236
 
292
237
  OPENSSL_CS_NAMES = {
293
- "TLSv1": TLSV1_CIPHER_SUITES.values(),
294
- "TLSv1.1": TLSV1_1_CIPHER_SUITES.values(),
295
238
  "TLSv1.2": TLSV1_2_CIPHER_SUITES.values(),
296
239
  "TLSv1.3": TLSV1_3_CIPHER_SUITES.values(),
297
240
  }
@@ -1,16 +1,16 @@
1
- # Copyright (c) 2016, 2023, Oracle and/or its affiliates.
1
+ # Copyright (c) 2016, 2024, Oracle and/or its affiliates.
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or modify
4
4
  # it under the terms of the GNU General Public License, version 2.0, as
5
5
  # published by the Free Software Foundation.
6
6
  #
7
- # This program is also distributed with certain software (including
7
+ # This program is designed to work with certain software (including
8
8
  # but not limited to OpenSSL) that is licensed under separate terms,
9
9
  # as designated in a particular file or component or in included license
10
- # documentation. The authors of MySQL hereby grant you an
10
+ # documentation. The authors of MySQL hereby grant you an
11
11
  # additional permission to link the program and your derivative works
12
- # with the separately licensed software that they have included with
13
- # MySQL.
12
+ # with the separately licensed software that they have either included with
13
+ # the program or referenced in the documentation.
14
14
  #
15
15
  # Without limiting anything contained in the foregoing, this file,
16
16
  # which is part of MySQL Connector/Python, is also subject to the