Skip to content

Commit fe0815f

Browse files
committed
Merge remote-tracking branch 'remote.googleapis/google-auth-library-python/main' into migration.google-auth-library-python.migration.2026-03-02_19-53-29.migrate
2 parents c514f0d + 738c007 commit fe0815f

File tree

374 files changed

+65528
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

374 files changed

+65528
-0
lines changed

packages/google-auth/.coveragerc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[run]
2+
branch = True
3+
4+
[report]
5+
omit =
6+
*/samples/*
7+
*/conftest.py
8+
*/google-cloud-sdk/lib/*
9+
# NOTE: Temporarily disabling coverage for `_requests_base.py`.
10+
*/_requests_base.py
11+
exclude_lines =
12+
# Re-enable the standard pragma
13+
pragma: NO COVER
14+
# Ignore debug-only repr
15+
def __repr__
16+
# Don't complain if tests don't hit defensive assertion code:
17+
raise NotImplementedError

packages/google-auth/.flake8

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[flake8]
2+
ignore = E203, E266, E501, W503
3+
exclude =
4+
# Standard linting exemptions.
5+
__pycache__,
6+
.git,
7+
*.pyc,
8+
conf.py
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Code owners file.
2+
# This file controls who is tagged for review for any given pull request.
3+
#
4+
# For syntax help see:
5+
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax
6+
7+
# The @googleapis/googleapis-auth and @googleapis/cloud-sdk-python-team is the default owner for changes in this repo
8+
* @googleapis/googleapis-auth @googleapis/cloud-sdk-python-team
9+
google/auth/_default.py @googleapis/googleapis-auth @googleapis/aion-team @googleapis/cloud-sdk-python-team
10+
google/auth/aws.py @googleapis/googleapis-auth @googleapis/aion-team @googleapis/cloud-sdk-python-team
11+
google/auth/credentials.py @googleapis/googleapis-auth @googleapis/aion-team @googleapis/cloud-sdk-python-team
12+
google/auth/downscoped.py @googleapis/googleapis-auth @googleapis/aion-team @googleapis/cloud-sdk-python-team
13+
google/auth/external_account.py @googleapis/googleapis-auth @googleapis/aion-team @googleapis/cloud-sdk-python-team
14+
google/auth/external_account_authorized_user.py @googleapis/googleapis-auth @googleapis/aion-team @googleapis/cloud-sdk-python-team
15+
google/auth/identity_pool.py @googleapis/googleapis-auth @googleapis/aion-team @googleapis/cloud-sdk-python-team
16+
google/auth/pluggable.py @googleapis/googleapis-auth @googleapis/aion-team @googleapis/cloud-sdk-python-team
17+
google/auth/sts.py @googleapis/googleapis-auth @googleapis/aion-team @googleapis/cloud-sdk-python-team
18+
google/auth/impersonated_credentials.py @googleapis/googleapis-auth @googleapis/aion-team @googleapis/cloud-sdk-python-team
19+
tests/test__default.py @googleapis/googleapis-auth @googleapis/aion-team @googleapis/cloud-sdk-python-team
20+
tests/test_aws.py @googleapis/googleapis-auth @googleapis/aion-team @googleapis/cloud-sdk-python-team
21+
tests/test_credentials.py @googleapis/googleapis-auth @googleapis/aion-team @googleapis/cloud-sdk-python-team
22+
tests/test_downscoped.py @googleapis/googleapis-auth @googleapis/aion-team @googleapis/cloud-sdk-python-team
23+
tests/test_external_account.py @googleapis/googleapis-auth @googleapis/aion-team @googleapis/cloud-sdk-python-team
24+
tests/test_external_account_authorized_user.py @googleapis/googleapis-auth @googleapis/aion-team @googleapis/cloud-sdk-python-team
25+
tests/test_identity_pool.py @googleapis/googleapis-auth @googleapis/aion-team @googleapis/cloud-sdk-python-team
26+
tests/test_pluggable.py @googleapis/googleapis-auth @googleapis/aion-team @googleapis/cloud-sdk-python-team
27+
tests/test_sts.py @googleapis/googleapis-auth @googleapis/aion-team @googleapis/cloud-sdk-python-team
28+
tests/test_impersonated_credentials.py @googleapis/googleapis-auth @googleapis/aion-team @googleapis/cloud-sdk-python-team
29+
/samples/ @googleapis/googleapis-auth @googleapis/aion-team @googleapis/python-samples-owners @googleapis/cloud-sdk-python-team
30+
system_tests/secrets.tar.enc # Remove noise from test creds.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# How to Contribute
2+
3+
We'd love to accept your patches and contributions to this project. There are
4+
just a few small guidelines you need to follow.
5+
6+
## Contributor License Agreement
7+
8+
Contributions to this project must be accompanied by a Contributor License
9+
Agreement. You (or your employer) retain the copyright to your contribution;
10+
this simply gives us permission to use and redistribute your contributions as
11+
part of the project. Head over to <https://cla.developers.google.com/> to see
12+
your current agreements on file or to sign a new one.
13+
14+
You generally only need to submit a CLA once, so if you've already submitted one
15+
(even if it was for a different project), you probably don't need to do it
16+
again.
17+
18+
## Code reviews
19+
20+
All submissions, including submissions by project members, require review. We
21+
use GitHub pull requests for this purpose. Consult
22+
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
23+
information on using pull requests.
24+
25+
## Community Guidelines
26+
27+
This project follows [Google's Open Source Community
28+
Guidelines](https://opensource.google.com/conduct/).
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
5+
---
6+
7+
Thanks for stopping by to let us know something could be better!
8+
9+
**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response.
10+
11+
Please run down the following list and make sure you've tried the usual "quick fixes":
12+
13+
- Search the issues already opened: https://github.com/googleapis/google-auth-library-python/issues
14+
15+
If you are still having issues, please be sure to include as much information as possible:
16+
17+
#### Environment details
18+
19+
- OS:
20+
- Python version:
21+
- pip version:
22+
- `google-auth` version:
23+
24+
#### Steps to reproduce
25+
26+
1. ?
27+
2. ?
28+
29+
Making sure to follow these steps will guarantee the quickest resolution possible.
30+
31+
Thanks!
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this library
4+
5+
---
6+
7+
Thanks for stopping by to let us know something could be better!
8+
9+
**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response.
10+
11+
**Is your feature request related to a problem? Please describe.**
12+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
**Describe alternatives you've considered**
16+
A clear and concise description of any alternative solutions or features you've considered.
17+
**Additional context**
18+
Add any other context or screenshots about the feature request here.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
name: Support request
3+
about: If you have a support contract with Google, please create an issue in the Google Cloud Support console.
4+
5+
---
6+
7+
**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response.
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', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
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

packages/google-auth/.gitignore

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Build artifacts
2+
*.py[cod]
3+
__pycache__
4+
*.egg-info/
5+
build/
6+
dist/
7+
8+
# Documentation-related
9+
docs/_build
10+
11+
# Test files
12+
.nox/
13+
.tox/
14+
.cache/
15+
.pytest_cache/
16+
cert_path
17+
key_path
18+
19+
# Django test database
20+
db.sqlite3
21+
22+
# Coverage files
23+
.coverage
24+
coverage.xml
25+
*sponge_log.xml
26+
nosetests.xml
27+
htmlcov/
28+
29+
# Files with private / local data
30+
scripts/local_test_setup
31+
tests/data/key.json
32+
tests/data/key.p12
33+
tests/data/user-key.json
34+
system_tests/data/
35+
36+
# PyCharm configuration:
37+
.idea
38+
venv/
39+
40+
# Generated files
41+
pylintrc
42+
pylintrc.test
43+
pytype_output/
44+
45+
.python-version
46+
.DS_Store
47+
cert_path
48+
key_path
49+
env/
50+
.vscode/
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
# Copyright 2018 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -eo pipefail
17+
18+
if [[ -z "${PROJECT_ROOT:-}" ]]; then
19+
PROJECT_ROOT="github/google-auth-library-python"
20+
fi
21+
22+
cd "${PROJECT_ROOT}"
23+
24+
# Disable buffering, so that the logs stream through.
25+
export PYTHONUNBUFFERED=1
26+
27+
# Remove old nox
28+
python3 -m pip uninstall --yes --quiet nox-automation
29+
30+
# Install nox
31+
python3 -m pip install nox==2024.10.9
32+
python3 -m nox --version
33+
34+
# Setup service account credentials.
35+
export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json
36+
37+
# Setup project id.
38+
export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.txt")
39+
40+
# Activate gcloud with service account credentials
41+
gcloud auth activate-service-account --key-file=$GOOGLE_APPLICATION_CREDENTIALS
42+
gcloud config set project ${PROJECT_ID}
43+
44+
# Decrypt system test secrets
45+
./scripts/decrypt-secrets.sh
46+
47+
# Run system tests which use a different noxfile
48+
python3 -m nox -f system_tests/noxfile.py

0 commit comments

Comments
 (0)