Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit 0632123

Browse files
authored
Merge branch 'main' into patch-1
2 parents 3c20dc7 + f32301a commit 0632123

33 files changed

Lines changed: 414 additions & 115 deletions

.github/workflows/unittest.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
on:
16+
pull_request:
17+
branches:
18+
- main
19+
20+
permissions:
21+
contents: read
22+
23+
name: unittest
24+
jobs:
25+
unit:
26+
runs-on: ubuntu-22.04
27+
strategy:
28+
matrix:
29+
python: ['3.8']
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
- name: Setup Python
34+
uses: actions/setup-python@v5
35+
with:
36+
python-version: ${{ matrix.python }}
37+
- name: Install nox
38+
run: |
39+
python -m pip install --upgrade setuptools pip wheel
40+
python -m pip install nox
41+
- name: Run unit tests
42+
env:
43+
COVERAGE_FILE: .coverage-${{ matrix.python }}
44+
run: |
45+
nox -s unit-${{ matrix.python }}
46+
- name: Upload coverage results
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: coverage-artifact-${{ matrix.python }}
50+
path: .coverage-${{ matrix.python }}
51+
include-hidden-files: true
52+
53+
cover:
54+
runs-on: ubuntu-latest
55+
needs:
56+
- unit
57+
steps:
58+
- name: Checkout
59+
uses: actions/checkout@v4
60+
- name: Setup Python
61+
uses: actions/setup-python@v5
62+
with:
63+
python-version: "3.13"
64+
- name: Install coverage
65+
run: |
66+
python -m pip install --upgrade setuptools pip wheel
67+
python -m pip install coverage
68+
- name: Download coverage results
69+
uses: actions/download-artifact@v4
70+
with:
71+
path: .coverage-results/
72+
- name: Report coverage results
73+
run: |
74+
find .coverage-results -type f -name '*.zip' -exec unzip {} \;
75+
coverage combine .coverage-results/**/.coverage*
76+
coverage report --show-missing --fail-under=99

.librarian/state.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:39628f6e89c9cad27973b9a39a50f7052bec0435ee58c7027b4fa6b655943e31
1+
image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:b8058df4c45e9a6e07f6b4d65b458d0d059241dd34c814f151c8bf6b89211209
22
libraries:
33
- id: google-auth
4-
version: 2.45.0
4+
version: 2.47.0
55
last_generated_commit: 102d9f92ac6ed649a61efd9b208e4d1de278e9bb
66
apis: []
77
source_roots:

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,40 @@
44

55
[1]: https://pypi.org/project/google-auth/#history
66

7+
## [2.47.0](https://github.com/googleapis/google-auth-library-python/compare/v2.46.0...v2.47.0) (2026-01-06)
8+
9+
10+
### Features
11+
12+
* drop `cachetools` dependency in favor of simple local implementation (#1590) ([5c07e1c4f52bc77a1b16fa3b7b3c5269c242f6f4](https://github.com/googleapis/google-auth-library-python/commit/5c07e1c4f52bc77a1b16fa3b7b3c5269c242f6f4))
13+
14+
15+
### Bug Fixes
16+
17+
* Python 3.8 support (#1918) ([60dc20014a35ec4ba71e8065b9a33ecbdbeca97a](https://github.com/googleapis/google-auth-library-python/commit/60dc20014a35ec4ba71e8065b9a33ecbdbeca97a))
18+
19+
## [2.46.0](https://github.com/googleapis/google-auth-library-python/compare/v2.45.0...v2.46.0) (2026-01-05)
20+
21+
22+
### Documentation
23+
24+
* update urllib3 docstrings for v2 compatibility (#1903) ([3f1aeea2d1014ea1d244a4c3470e52d74d55404b](https://github.com/googleapis/google-auth-library-python/commit/3f1aeea2d1014ea1d244a4c3470e52d74d55404b))
25+
26+
27+
### Features
28+
29+
* Recognize workload certificate config in has_default_client_cert_source for mTLS for Agentic Identities (#1907) ([0b9107d573123e358c347ffa067637f992af61b4](https://github.com/googleapis/google-auth-library-python/commit/0b9107d573123e358c347ffa067637f992af61b4))
30+
31+
32+
### Bug Fixes
33+
34+
* add types to default and verify_token and Request __init__ based on comments in the source code. (#1588) ([59a5f588f7793b59d923a4185c8c07738da618f7](https://github.com/googleapis/google-auth-library-python/commit/59a5f588f7793b59d923a4185c8c07738da618f7))
35+
* fix the document of secure_authorized_session (#1536) ([5d0014707fc359782df5ccfcaa75fd372fe9dce3](https://github.com/googleapis/google-auth-library-python/commit/5d0014707fc359782df5ccfcaa75fd372fe9dce3))
36+
* remove setup.cfg configuration for creating universal wheels (#1693) ([c767531ce05a89002d109f595187aff1fcaacfb7](https://github.com/googleapis/google-auth-library-python/commit/c767531ce05a89002d109f595187aff1fcaacfb7))
37+
* use .read() instead of .content.read() in aiohttp transport (#1899) ([12f4470f808809e8abf1141f98d88ab720c3899b](https://github.com/googleapis/google-auth-library-python/commit/12f4470f808809e8abf1141f98d88ab720c3899b))
38+
* raise RefreshError for missing token in impersonated credentials (#1897) ([94d04e090fdfc61926dd32bc1d65f8820b9cede5](https://github.com/googleapis/google-auth-library-python/commit/94d04e090fdfc61926dd32bc1d65f8820b9cede5))
39+
* Fix test coverage for mtls_helper (#1886) ([02e71631fe275d93825c2e957e830773e75133f7](https://github.com/googleapis/google-auth-library-python/commit/02e71631fe275d93825c2e957e830773e75133f7))
40+
741
## [2.45.0](https://github.com/googleapis/google-auth-library-python/compare/v2.44.0...v2.45.0) (2025-12-15)
842

943

CONTRIBUTING.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ A few notes on making changes to ``google-auth-library-python``.
1919
using ``nox -s docs``.
2020

2121
- The change must work fully on the following CPython versions:
22-
3.7, 3.8, 3.9, 3.10, 3.11, 3.12 and 3.13 across macOS, Linux, and Windows.
22+
3.8, 3.9, 3.10, 3.11, 3.12, 3.13 and 3.14 across macOS, Linux, and Windows.
2323

2424
- The codebase *must* have 100% test statement coverage after each commit.
2525
You can test coverage via ``nox -e cover``.

README.rst

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,16 @@ Note that the extras pyopenssl and enterprise_cert should not be used together b
3535

3636
Supported Python Versions
3737
^^^^^^^^^^^^^^^^^^^^^^^^^
38-
Python >= 3.7
38+
Python >= 3.8
3939

4040
**NOTE**:
41-
Python 3.7 was marked as `unsupported`_ by the python community in June 2023.
42-
We recommend that all developers upgrade to Python 3.8 and newer as soon as
43-
they can. Support for Python 3.7 will be removed from this library after
44-
January 1 2024. Previous releases that support Python 3.7 will continue to be available
45-
for download, but releases after January 1 2024 will only target Python 3.8 and
46-
newer.
41+
Python 3.8 and Python 3.9 were marked as `unsupported`_ by the python community in
42+
October 2024 and October 2025, respectively.
43+
We recommend that all developers upgrade to Python 3.10 and newer as soon as
44+
they can. Support for end-of-life Python runtimes will be removed from this
45+
library in future updates.
46+
Previous releases that support end-of-life Python versions will continue to be available
47+
for download, but future releases will only target supported versions.
4748

4849
.. _unsupported: https://devguide.python.org/versions/#unsupported-versions
4950

@@ -58,6 +59,10 @@ Unsupported Python Versions
5859
- Python 3.6: The last version of this library with support for Python 3.6
5960
was `google.auth == 2.22.0`.
6061

62+
- Python 3.7: The last version of this library with support for Python 3.7
63+
was `google.auth == 2.45.0`.
64+
65+
6166
Documentation
6267
-------------
6368

google/auth/__init__.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,17 @@ class Python37DeprecationWarning(DeprecationWarning): # pragma: NO COVER
4141
pass
4242

4343

44-
# Checks if the current runtime is Python 3.7.
45-
if sys.version_info.major == 3 and sys.version_info.minor == 7: # pragma: NO COVER
46-
message = (
47-
"After January 1, 2024, new releases of this library will drop support "
48-
"for Python 3.7."
49-
)
50-
warnings.warn(message, Python37DeprecationWarning)
44+
# Raise warnings for deprecated versions
45+
eol_message = """
46+
You are using a Python version {} past its end of life. Google will update
47+
google-auth with critical bug fixes on a best-effort basis, but not
48+
with any other fixes or features. Please upgrade your Python version,
49+
and then update google-auth.
50+
"""
51+
if sys.version_info.major == 3 and sys.version_info.minor == 8: # pragma: NO COVER
52+
warnings.warn(eol_message.format("3.8"), FutureWarning)
53+
elif sys.version_info.major == 3 and sys.version_info.minor == 9: # pragma: NO COVER
54+
warnings.warn(eol_message.format("3.9"), FutureWarning)
5155

5256
# Set default logging handler to avoid "No handler found" warnings.
5357
logging.getLogger(__name__).addHandler(logging.NullHandler())

google/auth/_cache.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from collections import OrderedDict
16+
17+
18+
class LRUCache(dict):
19+
def __init__(self, maxsize):
20+
super().__init__()
21+
self._order = OrderedDict()
22+
self.maxsize = maxsize
23+
24+
def clear(self):
25+
super().clear()
26+
self._order.clear()
27+
28+
def get(self, key, default=None):
29+
try:
30+
value = super().__getitem__(key)
31+
self._update(key)
32+
return value
33+
except KeyError:
34+
return default
35+
36+
def __getitem__(self, key):
37+
value = super().__getitem__(key)
38+
self._update(key)
39+
return value
40+
41+
def __setitem__(self, key, value):
42+
maxsize = self.maxsize
43+
if maxsize <= 0:
44+
return
45+
if key not in self:
46+
while len(self) >= maxsize:
47+
self.popitem()
48+
super().__setitem__(key, value)
49+
self._update(key)
50+
51+
def __delitem__(self, key):
52+
super().__delitem__(key)
53+
del self._order[key]
54+
55+
def popitem(self):
56+
"""Remove and return the least recently used key-value pair."""
57+
key, _ = self._order.popitem(last=False)
58+
return key, super().pop(key)
59+
60+
def _update(self, key):
61+
try:
62+
self._order.move_to_end(key)
63+
except KeyError:
64+
self._order[key] = None

google/auth/_default.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
1717
Implements application default credentials and project ID detection.
1818
"""
19+
from __future__ import annotations
1920

20-
from collections.abc import Sequence
2121
import io
2222
import json
2323
import logging
2424
import os
25-
from typing import Optional, TYPE_CHECKING
25+
from typing import Optional, Sequence, TYPE_CHECKING
2626
import warnings
2727

2828
from google.auth import environment_vars

google/auth/_helpers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,8 @@ def is_python_3():
334334
Returns:
335335
bool: True if the Python interpreter is Python 3 and False otherwise.
336336
"""
337-
return sys.version_info > (3, 0)
337+
338+
return sys.version_info > (3, 0) # pragma: NO COVER
338339

339340

340341
def _hash_sensitive_info(data: Union[dict, list]) -> Union[dict, list, str]:

google/auth/compute_engine/credentials.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def _retrieve_info(self, request):
123123
def _metric_header_for_usage(self):
124124
return metrics.CRED_TYPE_SA_MDS
125125

126-
def _refresh_token(self, request):
126+
def _perform_refresh_token(self, request):
127127
"""Refresh the access token and scopes.
128128
129129
Args:

0 commit comments

Comments
 (0)