cloud-sql-python-connector 1.11.0__tar.gz → 1.12.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.
- {cloud-sql-python-connector-1.11.0 → cloud_sql_python_connector-1.12.0}/PKG-INFO +11 -2
- {cloud-sql-python-connector-1.11.0 → cloud_sql_python_connector-1.12.0}/cloud_sql_python_connector.egg-info/PKG-INFO +11 -2
- {cloud-sql-python-connector-1.11.0 → cloud_sql_python_connector-1.12.0}/cloud_sql_python_connector.egg-info/requires.txt +1 -0
- {cloud-sql-python-connector-1.11.0 → cloud_sql_python_connector-1.12.0}/google/cloud/sql/connector/connection_info.py +5 -4
- {cloud-sql-python-connector-1.11.0 → cloud_sql_python_connector-1.12.0}/google/cloud/sql/connector/connector.py +2 -2
- {cloud-sql-python-connector-1.11.0 → cloud_sql_python_connector-1.12.0}/google/cloud/sql/connector/utils.py +9 -7
- {cloud-sql-python-connector-1.11.0 → cloud_sql_python_connector-1.12.0}/google/cloud/sql/connector/version.py +1 -1
- {cloud-sql-python-connector-1.11.0 → cloud_sql_python_connector-1.12.0}/setup.py +1 -0
- {cloud-sql-python-connector-1.11.0 → cloud_sql_python_connector-1.12.0}/LICENSE +0 -0
- {cloud-sql-python-connector-1.11.0 → cloud_sql_python_connector-1.12.0}/README.md +0 -0
- {cloud-sql-python-connector-1.11.0 → cloud_sql_python_connector-1.12.0}/cloud_sql_python_connector.egg-info/SOURCES.txt +0 -0
- {cloud-sql-python-connector-1.11.0 → cloud_sql_python_connector-1.12.0}/cloud_sql_python_connector.egg-info/dependency_links.txt +0 -0
- {cloud-sql-python-connector-1.11.0 → cloud_sql_python_connector-1.12.0}/cloud_sql_python_connector.egg-info/not-zip-safe +0 -0
- {cloud-sql-python-connector-1.11.0 → cloud_sql_python_connector-1.12.0}/cloud_sql_python_connector.egg-info/top_level.txt +0 -0
- {cloud-sql-python-connector-1.11.0 → cloud_sql_python_connector-1.12.0}/google/cloud/sql/connector/__init__.py +0 -0
- {cloud-sql-python-connector-1.11.0 → cloud_sql_python_connector-1.12.0}/google/cloud/sql/connector/asyncpg.py +0 -0
- {cloud-sql-python-connector-1.11.0 → cloud_sql_python_connector-1.12.0}/google/cloud/sql/connector/client.py +0 -0
- {cloud-sql-python-connector-1.11.0 → cloud_sql_python_connector-1.12.0}/google/cloud/sql/connector/enums.py +0 -0
- {cloud-sql-python-connector-1.11.0 → cloud_sql_python_connector-1.12.0}/google/cloud/sql/connector/exceptions.py +0 -0
- {cloud-sql-python-connector-1.11.0 → cloud_sql_python_connector-1.12.0}/google/cloud/sql/connector/instance.py +0 -0
- {cloud-sql-python-connector-1.11.0 → cloud_sql_python_connector-1.12.0}/google/cloud/sql/connector/lazy.py +0 -0
- {cloud-sql-python-connector-1.11.0 → cloud_sql_python_connector-1.12.0}/google/cloud/sql/connector/pg8000.py +0 -0
- {cloud-sql-python-connector-1.11.0 → cloud_sql_python_connector-1.12.0}/google/cloud/sql/connector/py.typed +0 -0
- {cloud-sql-python-connector-1.11.0 → cloud_sql_python_connector-1.12.0}/google/cloud/sql/connector/pymysql.py +0 -0
- {cloud-sql-python-connector-1.11.0 → cloud_sql_python_connector-1.12.0}/google/cloud/sql/connector/pytds.py +0 -0
- {cloud-sql-python-connector-1.11.0 → cloud_sql_python_connector-1.12.0}/google/cloud/sql/connector/rate_limiter.py +0 -0
- {cloud-sql-python-connector-1.11.0 → cloud_sql_python_connector-1.12.0}/google/cloud/sql/connector/refresh_utils.py +0 -0
- {cloud-sql-python-connector-1.11.0 → cloud_sql_python_connector-1.12.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cloud-sql-python-connector
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.12.0
|
|
4
4
|
Summary: The Cloud SQL Python Connector is a library that can be used alongside a database driver to allow users with sufficient permissions to connect to a Cloud SQL database without having to manually allowlist IPs or manage SSL certificates.
|
|
5
5
|
Home-page: https://github.com/GoogleCloudPlatform/cloud-sql-python-connector
|
|
6
6
|
Author: Google LLC
|
|
@@ -18,11 +18,20 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.12
|
|
19
19
|
Requires-Python: >=3.8
|
|
20
20
|
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: aiofiles
|
|
23
|
+
Requires-Dist: aiohttp
|
|
24
|
+
Requires-Dist: cryptography>=42.0.0
|
|
25
|
+
Requires-Dist: Requests
|
|
26
|
+
Requires-Dist: google-auth>=2.28.0
|
|
21
27
|
Provides-Extra: pymysql
|
|
28
|
+
Requires-Dist: PyMySQL>=1.1.0; extra == "pymysql"
|
|
22
29
|
Provides-Extra: pg8000
|
|
30
|
+
Requires-Dist: pg8000>=1.31.1; extra == "pg8000"
|
|
23
31
|
Provides-Extra: pytds
|
|
32
|
+
Requires-Dist: python-tds>=1.15.0; extra == "pytds"
|
|
24
33
|
Provides-Extra: asyncpg
|
|
25
|
-
|
|
34
|
+
Requires-Dist: asyncpg>=0.29.0; extra == "asyncpg"
|
|
26
35
|
|
|
27
36
|
<p align="center">
|
|
28
37
|
<a href="https://cloud.google.com/blog/topics/developers-practitioners/how-connect-cloud-sql-using-python-easy-way">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cloud-sql-python-connector
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.12.0
|
|
4
4
|
Summary: The Cloud SQL Python Connector is a library that can be used alongside a database driver to allow users with sufficient permissions to connect to a Cloud SQL database without having to manually allowlist IPs or manage SSL certificates.
|
|
5
5
|
Home-page: https://github.com/GoogleCloudPlatform/cloud-sql-python-connector
|
|
6
6
|
Author: Google LLC
|
|
@@ -18,11 +18,20 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.12
|
|
19
19
|
Requires-Python: >=3.8
|
|
20
20
|
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: aiofiles
|
|
23
|
+
Requires-Dist: aiohttp
|
|
24
|
+
Requires-Dist: cryptography>=42.0.0
|
|
25
|
+
Requires-Dist: Requests
|
|
26
|
+
Requires-Dist: google-auth>=2.28.0
|
|
21
27
|
Provides-Extra: pymysql
|
|
28
|
+
Requires-Dist: PyMySQL>=1.1.0; extra == "pymysql"
|
|
22
29
|
Provides-Extra: pg8000
|
|
30
|
+
Requires-Dist: pg8000>=1.31.1; extra == "pg8000"
|
|
23
31
|
Provides-Extra: pytds
|
|
32
|
+
Requires-Dist: python-tds>=1.15.0; extra == "pytds"
|
|
24
33
|
Provides-Extra: asyncpg
|
|
25
|
-
|
|
34
|
+
Requires-Dist: asyncpg>=0.29.0; extra == "asyncpg"
|
|
26
35
|
|
|
27
36
|
<p align="center">
|
|
28
37
|
<a href="https://cloud.google.com/blog/topics/developers-practitioners/how-connect-cloud-sql-using-python-easy-way">
|
|
@@ -17,9 +17,10 @@ from __future__ import annotations
|
|
|
17
17
|
from dataclasses import dataclass
|
|
18
18
|
import logging
|
|
19
19
|
import ssl
|
|
20
|
-
from tempfile import TemporaryDirectory
|
|
21
20
|
from typing import Any, Dict, Optional, TYPE_CHECKING
|
|
22
21
|
|
|
22
|
+
from aiofiles.tempfile import TemporaryDirectory
|
|
23
|
+
|
|
23
24
|
from google.cloud.sql.connector.exceptions import CloudSQLIPTypeError
|
|
24
25
|
from google.cloud.sql.connector.exceptions import TLSVersionError
|
|
25
26
|
from google.cloud.sql.connector.utils import write_to_file
|
|
@@ -45,7 +46,7 @@ class ConnectionInfo:
|
|
|
45
46
|
expiration: datetime.datetime
|
|
46
47
|
context: Optional[ssl.SSLContext] = None
|
|
47
48
|
|
|
48
|
-
def create_ssl_context(self, enable_iam_auth: bool = False) -> ssl.SSLContext:
|
|
49
|
+
async def create_ssl_context(self, enable_iam_auth: bool = False) -> ssl.SSLContext:
|
|
49
50
|
"""Constructs a SSL/TLS context for the given connection info.
|
|
50
51
|
|
|
51
52
|
Cache the SSL context to ensure we don't read from disk repeatedly when
|
|
@@ -83,8 +84,8 @@ class ConnectionInfo:
|
|
|
83
84
|
# tmpdir and its contents are automatically deleted after the CA cert
|
|
84
85
|
# and ephemeral cert are loaded into the SSLcontext. The values
|
|
85
86
|
# need to be written to files in order to be loaded by the SSLContext
|
|
86
|
-
with TemporaryDirectory() as tmpdir:
|
|
87
|
-
ca_filename, cert_filename, key_filename = write_to_file(
|
|
87
|
+
async with TemporaryDirectory() as tmpdir:
|
|
88
|
+
ca_filename, cert_filename, key_filename = await write_to_file(
|
|
88
89
|
tmpdir, self.server_ca_cert, self.client_cert, self.private_key
|
|
89
90
|
)
|
|
90
91
|
context.load_cert_chain(cert_filename, keyfile=key_filename)
|
|
@@ -365,14 +365,14 @@ class Connector:
|
|
|
365
365
|
if driver in ASYNC_DRIVERS:
|
|
366
366
|
return await connector(
|
|
367
367
|
ip_address,
|
|
368
|
-
conn_info.create_ssl_context(enable_iam_auth),
|
|
368
|
+
await conn_info.create_ssl_context(enable_iam_auth),
|
|
369
369
|
**kwargs,
|
|
370
370
|
)
|
|
371
371
|
# synchronous drivers are blocking and run using executor
|
|
372
372
|
connect_partial = partial(
|
|
373
373
|
connector,
|
|
374
374
|
ip_address,
|
|
375
|
-
conn_info.create_ssl_context(enable_iam_auth),
|
|
375
|
+
await conn_info.create_ssl_context(enable_iam_auth),
|
|
376
376
|
**kwargs,
|
|
377
377
|
)
|
|
378
378
|
return await self._loop.run_in_executor(None, connect_partial)
|
|
@@ -13,8 +13,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
"""
|
|
16
|
+
|
|
16
17
|
from typing import Tuple
|
|
17
18
|
|
|
19
|
+
import aiofiles
|
|
18
20
|
from cryptography.hazmat.backends import default_backend
|
|
19
21
|
from cryptography.hazmat.primitives import serialization
|
|
20
22
|
from cryptography.hazmat.primitives.asymmetric import rsa
|
|
@@ -57,7 +59,7 @@ async def generate_keys() -> Tuple[bytes, str]:
|
|
|
57
59
|
return priv_key, pub_key
|
|
58
60
|
|
|
59
61
|
|
|
60
|
-
def write_to_file(
|
|
62
|
+
async def write_to_file(
|
|
61
63
|
dir_path: str, serverCaCert: str, ephemeralCert: str, priv_key: bytes
|
|
62
64
|
) -> Tuple[str, str, str]:
|
|
63
65
|
"""
|
|
@@ -68,12 +70,12 @@ def write_to_file(
|
|
|
68
70
|
cert_filename = f"{dir_path}/cert.pem"
|
|
69
71
|
key_filename = f"{dir_path}/priv.pem"
|
|
70
72
|
|
|
71
|
-
with open(ca_filename, "w+") as ca_out:
|
|
72
|
-
ca_out.write(serverCaCert)
|
|
73
|
-
with open(cert_filename, "w+") as ephemeral_out:
|
|
74
|
-
ephemeral_out.write(ephemeralCert)
|
|
75
|
-
with open(key_filename, "wb") as priv_out:
|
|
76
|
-
priv_out.write(priv_key)
|
|
73
|
+
async with aiofiles.open(ca_filename, "w+") as ca_out:
|
|
74
|
+
await ca_out.write(serverCaCert)
|
|
75
|
+
async with aiofiles.open(cert_filename, "w+") as ephemeral_out:
|
|
76
|
+
await ephemeral_out.write(ephemeralCert)
|
|
77
|
+
async with aiofiles.open(key_filename, "wb") as priv_out:
|
|
78
|
+
await priv_out.write(priv_key)
|
|
77
79
|
|
|
78
80
|
return (ca_filename, cert_filename, key_filename)
|
|
79
81
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|