Skip to content

Commit 0946ce4

Browse files
authored
Merge branch 'main' into patch-1
2 parents 1f6ed61 + 0e87943 commit 0946ce4

File tree

20 files changed

+229
-36
lines changed

20 files changed

+229
-36
lines changed

.github/workflows/codeql.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,20 @@ jobs:
4242

4343
steps:
4444
- name: Checkout repository
45-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
45+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4646

4747
# Initializes the CodeQL tools for scanning.
4848
- name: Initialize CodeQL
49-
uses: github/codeql-action/init@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
49+
uses: github/codeql-action/init@df559355d593797519d70b90fc8edd5db049e7a2 # v3.29.9
5050
with:
5151
languages: ${{ matrix.language }}
5252

5353
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
5454
# If this step fails, then you should remove it and run the build manually
5555
- name: Autobuild
56-
uses: github/codeql-action/autobuild@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
56+
uses: github/codeql-action/autobuild@df559355d593797519d70b90fc8edd5db049e7a2 # v3.29.9
5757

5858
- name: Perform CodeQL Analysis
59-
uses: github/codeql-action/analyze@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
59+
uses: github/codeql-action/analyze@df559355d593797519d70b90fc8edd5db049e7a2 # v3.29.9
6060
with:
6161
category: "/language:${{matrix.language}}"

.github/workflows/coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- run: pip install nox coverage
3232

3333
- name: Checkout base branch
34-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
34+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3535
with:
3636
ref: ${{ github.base_ref }}
3737

@@ -44,7 +44,7 @@ jobs:
4444
coverage erase
4545
4646
- name: Checkout PR branch
47-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
47+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4848
with:
4949
ref: ${{ github.event.pull_request.head.sha }}
5050
repository: ${{ github.event.pull_request.head.repo.full_name }}

.github/workflows/labels.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
issues: write
2929
pull-requests: write
3030
steps:
31-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
31+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3232
- uses: micnncim/action-label-syncer@3abd5ab72fda571e69fffd97bd4e0033dd5f495c # v1.3.0
3333
env:
3434
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
run: pip install nox
3434

3535
- name: Checkout code
36-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
36+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3737

3838
- name: Run nox lint session
3939
run: nox --sessions lint

.github/workflows/scorecard.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ jobs:
3535

3636
steps:
3737
- name: "Checkout code"
38-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
38+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3939
with:
4040
persist-credentials: false
4141

4242
- name: "Run analysis"
43-
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
43+
uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
4444
with:
4545
results_file: results.sarif
4646
results_format: sarif
@@ -65,6 +65,6 @@ jobs:
6565

6666
# Upload the results to GitHub's code scanning dashboard.
6767
- name: "Upload to code-scanning"
68-
uses: github/codeql-action/upload-sarif@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
68+
uses: github/codeql-action/upload-sarif@df559355d593797519d70b90fc8edd5db049e7a2 # v3.29.9
6969
with:
7070
sarif_file: resultsFiltered.sarif

.github/workflows/tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
pull-requests: write
4545
steps:
4646
- name: Checkout code
47-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
47+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4848

4949
- name: Setup Python ${{ matrix.python-version }}
5050
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
@@ -56,15 +56,15 @@ jobs:
5656

5757
- id: auth
5858
name: Authenticate to Google Cloud
59-
uses: google-github-actions/auth@ba79af03959ebeac9769e648f473a284504d9193 # v2.1.10
59+
uses: google-github-actions/auth@b7593ed2efd1c1617e1b0254da33b86225adb2a5 # v2.1.12
6060
with:
6161
workload_identity_provider: ${{ vars.PROVIDER_NAME }}
6262
service_account: ${{ vars.SERVICE_ACCOUNT }}
6363
access_token_lifetime: 600s
6464

6565
- id: secrets
6666
name: Get secrets
67-
uses: google-github-actions/get-secretmanager-secrets@a8440875e1c2892062aef9061228d4f1af8f919b # v2.2.3
67+
uses: google-github-actions/get-secretmanager-secrets@50ec04d56ddf2740b0bde82926cc742f90e06d2b # v2.2.4
6868
with:
6969
secrets: |-
7070
MYSQL_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_CONNECTION_NAME
@@ -153,7 +153,7 @@ jobs:
153153
pull-requests: write
154154
steps:
155155
- name: Checkout code
156-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
156+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
157157

158158
- name: Setup Python ${{ matrix.python-version }}
159159
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
@@ -167,7 +167,7 @@ jobs:
167167
name: Authenticate to Google Cloud
168168
# only needed for Flakybot on periodic (schedule) and continuous (push) events
169169
if: ${{ github.event_name == 'schedule' || github.event_name == 'push' }}
170-
uses: google-github-actions/auth@ba79af03959ebeac9769e648f473a284504d9193 # v2.1.10
170+
uses: google-github-actions/auth@b7593ed2efd1c1617e1b0254da33b86225adb2a5 # v2.1.12
171171
with:
172172
workload_identity_provider: ${{ vars.PROVIDER_NAME }}
173173
service_account: ${{ vars.SERVICE_ACCOUNT }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ dist/
88
.idea
99
.coverage
1010
sponge_log.xml
11+
.envrc
12+
*.iml

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## [1.18.4](https://github.com/GoogleCloudPlatform/cloud-sql-python-connector/compare/v1.18.3...v1.18.4) (2025-08-12)
4+
5+
6+
### Bug Fixes
7+
8+
* bump dependencies to latest ([#1317](https://github.com/GoogleCloudPlatform/cloud-sql-python-connector/issues/1317)) ([6ebfac6](https://github.com/GoogleCloudPlatform/cloud-sql-python-connector/commit/6ebfac67199b44ab517af7ab57027c64c784f1a1))
9+
10+
## [1.18.3](https://github.com/GoogleCloudPlatform/cloud-sql-python-connector/compare/v1.18.2...v1.18.3) (2025-07-11)
11+
12+
13+
### Bug Fixes
14+
15+
* suppress lint check for _scopes property ([#1308](https://github.com/GoogleCloudPlatform/cloud-sql-python-connector/issues/1308)) ([821245c](https://github.com/GoogleCloudPlatform/cloud-sql-python-connector/commit/821245c1911fb970e3409b3e249698937a8b7867))
16+
317
## [1.18.2](https://github.com/GoogleCloudPlatform/cloud-sql-python-connector/compare/v1.18.1...v1.18.2) (2025-05-20)
418

519

build.sh

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2025 Google LLC.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http=//www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# Set SCRIPT_DIR to the current directory of this file.
18+
SCRIPT_DIR=$(cd -P "$(dirname "$0")" >/dev/null 2>&1 && pwd)
19+
SCRIPT_FILE="${SCRIPT_DIR}/$(basename "$0")"
20+
21+
##
22+
## Local Development
23+
##
24+
## These functions should be used to run the local development process
25+
##
26+
27+
if [[ ! -d venv ]] ; then
28+
echo "./venv not found. Setting up venv"
29+
python3 -m venv "$PWD/venv"
30+
fi
31+
source "$PWD/venv/bin/activate"
32+
33+
if which pip3 ; then
34+
PIP_CMD=pip3
35+
elif which pip ; then
36+
PIP_CMD=pip
37+
else
38+
echo "pip not found. Please add pip to your path."
39+
exit 1
40+
fi
41+
if ! which nox ; then
42+
$PIP_CMD install nox
43+
fi
44+
45+
46+
47+
## clean - Cleans the build output
48+
function clean() {
49+
if [[ -d '.tools' ]] ; then
50+
rm -rf .tools
51+
fi
52+
}
53+
54+
## build - Builds the project without running tests.
55+
function build() {
56+
nox --sessions build
57+
}
58+
59+
## test - Runs local unit tests.
60+
function test() {
61+
nox --sessions unit --python=3.13
62+
}
63+
64+
## e2e - Runs end-to-end integration tests.
65+
function e2e() {
66+
if [[ ! -f .envrc ]] ; then
67+
write_e2e_env .envrc
68+
fi
69+
source .envrc
70+
nox --sessions system --python=3.13
71+
}
72+
73+
## fix - Fixes code format.
74+
function fix() {
75+
nox --sessions format
76+
}
77+
78+
## lint - runs the linters
79+
function lint() {
80+
# Check the commit includes a go.mod that is fully
81+
# up to date.
82+
nox --sessions lint
83+
}
84+
85+
## deps - updates project dependencies to latest
86+
function deps() {
87+
echo "Todo: deps"
88+
exit 1
89+
}
90+
91+
# write_e2e_env - Loads secrets from the gcloud project and writes
92+
# them to target/e2e.env to run e2e tests.
93+
function write_e2e_env(){
94+
# All secrets used by the e2e tests in the form <env_name>=<secret_name>
95+
secret_vars=(
96+
MYSQL_CONNECTION_NAME=MYSQL_CONNECTION_NAME
97+
MYSQL_USER=MYSQL_USER
98+
MYSQL_USER_IAM=MYSQL_USER_IAM_GO
99+
MYSQL_PASS=MYSQL_PASS
100+
MYSQL_DB=MYSQL_DB
101+
MYSQL_MCP_CONNECTION_NAME=MYSQL_MCP_CONNECTION_NAME
102+
MYSQL_MCP_PASS=MYSQL_MCP_PASS
103+
POSTGRES_CONNECTION_NAME=POSTGRES_CONNECTION_NAME
104+
POSTGRES_USER=POSTGRES_USER
105+
POSTGRES_USER_IAM=POSTGRES_USER_IAM_GO
106+
POSTGRES_PASS=POSTGRES_PASS
107+
POSTGRES_DB=POSTGRES_DB
108+
POSTGRES_CAS_CONNECTION_NAME=POSTGRES_CAS_CONNECTION_NAME
109+
POSTGRES_CAS_PASS=POSTGRES_CAS_PASS
110+
POSTGRES_CUSTOMER_CAS_CONNECTION_NAME=POSTGRES_CUSTOMER_CAS_CONNECTION_NAME
111+
POSTGRES_CUSTOMER_CAS_PASS=POSTGRES_CUSTOMER_CAS_PASS
112+
POSTGRES_CUSTOMER_CAS_DOMAIN_NAME=POSTGRES_CUSTOMER_CAS_DOMAIN_NAME
113+
POSTGRES_CUSTOMER_CAS_INVALID_DOMAIN_NAME=POSTGRES_CUSTOMER_CAS_INVALID_DOMAIN_NAME
114+
POSTGRES_MCP_CONNECTION_NAME=POSTGRES_MCP_CONNECTION_NAME
115+
POSTGRES_MCP_PASS=POSTGRES_MCP_PASS
116+
SQLSERVER_CONNECTION_NAME=SQLSERVER_CONNECTION_NAME
117+
SQLSERVER_USER=SQLSERVER_USER
118+
SQLSERVER_PASS=SQLSERVER_PASS
119+
SQLSERVER_DB=SQLSERVER_DB
120+
QUOTA_PROJECT=QUOTA_PROJECT
121+
)
122+
123+
if [[ -z "$TEST_PROJECT" ]] ; then
124+
echo "Set TEST_PROJECT environment variable to the project containing"
125+
echo "the e2e test suite secrets."
126+
exit 1
127+
fi
128+
129+
echo "Getting test secrets from $TEST_PROJECT into $1"
130+
{
131+
for env_name in "${secret_vars[@]}" ; do
132+
env_var_name="${env_name%%=*}"
133+
secret_name="${env_name##*=}"
134+
set -x
135+
val=$(gcloud secrets versions access latest --project "$TEST_PROJECT" --secret="$secret_name")
136+
echo "export $env_var_name='$val'"
137+
done
138+
} > "$1"
139+
140+
}
141+
142+
## help - prints the help details
143+
##
144+
function help() {
145+
# This will print the comments beginning with ## above each function
146+
# in this file.
147+
148+
echo "build.sh <command> <arguments>"
149+
echo
150+
echo "Commands to assist with local development and CI builds."
151+
echo
152+
echo "Commands:"
153+
echo
154+
grep -e '^##' "$SCRIPT_FILE" | sed -e 's/##/ /'
155+
}
156+
157+
set -euo pipefail
158+
159+
# Check CLI Arguments
160+
if [[ "$#" -lt 1 ]] ; then
161+
help
162+
exit 1
163+
fi
164+
165+
cd "$SCRIPT_DIR"
166+
167+
"$@"
168+

google/cloud/sql/connector/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
import aiohttp
2323
from cryptography.hazmat.backends import default_backend
2424
from cryptography.x509 import load_pem_x509_certificate
25-
2625
from google.auth.credentials import TokenState
2726
from google.auth.transport import requests
27+
2828
from google.cloud.sql.connector.connection_info import ConnectionInfo
2929
from google.cloud.sql.connector.connection_name import ConnectionName
3030
from google.cloud.sql.connector.exceptions import AutoIAMAuthNotSupported

0 commit comments

Comments
 (0)