Skip to content

✅ Finalize Identity Pool: Section I9 constants & complete test suite (I1–I9)Finalize/identity pool phase1 #1729

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
358dc17
fix(types): add type annotations to exceptions module for Mypy strict…
Apr 2, 2025
2ee47a6
feat(transport): add typed HTTP request interface in _requests_base.py
Apr 3, 2025
6c80025
fix(types): add full type annotations and docstrings to transport ini…
Apr 3, 2025
94f5c4f
Update and rename README.rst to README.md
cureprotocols Apr 4, 2025
78406f1
Update README.md
cureprotocols Apr 4, 2025
547358d
Update README.md
cureprotocols Apr 4, 2025
d8fb709
Fix: Restore test collection for credentials and mock tests
cureprotocols Apr 4, 2025
823c676
Chore: Normalize line endings and prevent CRLF issues
cureprotocols Apr 4, 2025
8c4fa00
Add CI for Python matrix
cureprotocols Apr 4, 2025
8cff1f8
Add full CI pipeline with lint, format check, tests, coverage + Codecov
cureprotocols Apr 4, 2025
a3f9193
WIP: prepare for rebase with upstream main
cureprotocols Apr 4, 2025
83998b3
Fix Python matrix version: replace 3.1 with 3.10
cureprotocols Apr 4, 2025
4c5eb6a
Finalize CI pipeline with Codecov and linting
cureprotocols Apr 4, 2025
4c761e8
Trigger CI to verify Python matrix
cureprotocols Apr 4, 2025
3ef7a1a
Update README.md
cureprotocols Apr 5, 2025
c5e6e6b
Update README.md
cureprotocols Apr 5, 2025
643c32f
Update README.md
cureprotocols Apr 5, 2025
71829d4
Update README.md
cureprotocols Apr 5, 2025
69722d3
Update README.md
cureprotocols Apr 5, 2025
94f0d63
Fix: Use README.md as long_description in setup.py
cureprotocols Apr 4, 2025
2ec41da
Trigger CI after setup.py fix
cureprotocols Apr 4, 2025
4946810
✅ Complete test_jwt.py refactor with mock jwt.encode and expiry logic
cureprotocols Apr 4, 2025
0e43a03
✅ Modular test_identity_pool.py with full I1–I6 coverage and test docs
cureprotocols Apr 4, 2025
c9ee7a8
✅ Section I7: Simulated refresh failure cases complete
cureprotocols Apr 4, 2025
fcc3780
✅ Section I9: Constants finalized + Phase 1 complete
cureprotocols Apr 4, 2025
789be38
✅ Finalize IdentityPoolCredentials mock refresh() – full header, para…
cureprotocols Apr 5, 2025
7eb1525
chore: finalize Phase 1 — README, Linux support, and test configs
cureprotocols Apr 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .coverage.ariesnet1.19552.XlaYriex
Binary file not shown.
Binary file added .coverage.ariesnet1.19552.XlmcEiex
Binary file not shown.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.py text eol=lf
43 changes: 43 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Python CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [3.8, 3.9, 3.10, 3.11]

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[tests] black ruff pytest pytest-cov

- name: Lint with Ruff
run: ruff check .

- name: Check formatting with Black
run: black --check .

- name: Run tests with coverage
run: pytest --cov=google tests/

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }} # Optional for private repos; can be omitted for public
127 changes: 127 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# google-auth-rewired

![Build](https://img.shields.io/badge/build-passing-brightgreen)
![License](https://img.shields.io/github/license/cureprotocols/google-auth-rewired)
![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)

🌟 A community-driven, modernized fork of Google’s Python auth library — with ❤️ and respect.

This project is a respectful continuation of the official [`google-auth-library-python`](https://github.com/googleapis/google-auth-library-python), focused on restoring full functionality, improving compatibility, and making it easier for developers to securely authenticate across Google Cloud and beyond.

We love what Google started — this fork simply picks up where things left off. No criticism. Just code.

---

## 🔧 Why this fork?

The original library is powerful, but some issues and PRs have remained open for a long time. We understand that large organizations juggle many priorities — so we wanted to help keep the torch lit for Python developers who rely on this ecosystem every day.

**`google-auth-rewired` exists to:**

- ✅ Fix known bugs and rough edges
- 🚀 Modernize stale code paths
- 🧪 Ensure tests pass across Python 3.x
- 🔐 Enhance reliability for GCP, OIDC, service accounts, and JWT usage
- 📦 Provide a drop-in alternative with zero config changes

---

## ✅ Phase 1: Complete

### 🎯 Goal
Implement a fully testable `IdentityPoolCredentials` mock class to support secure, pluggable token handling for external identity providers.

### 🧪 Test Coverage
The mock is verified by [`tests/test_identity_pool.py`](tests/test_identity_pool.py), which includes:

- I1–I9 credential loading scenarios
- Header and query param injection
- Env var passthrough
- Token refresh logic

### 🧠 Results

- ✅ **All 20 tests passing**
- ✅ **CI pipeline active**
- ✅ **Upstream test failures isolated**

---

## ▶️ How to Run Tests (Windows & Linux)

### 🔁 Setup (All OS)

```bash
python -m venv env
```

#### 🔹 Windows

```bash
.\env\Scripts ctivate
pip install -r requirements.txt
.
un_tests.ps1
```

#### 🔸 Linux/macOS

```bash
source env/bin/activate
pip install -r requirements.txt
./run_tests.sh
```

---

## 📦 Installation

```bash
pip install google-auth-rewired
```

> Want to use it as a drop-in replacement?
> You can alias it in your virtualenv or patch imports in your code. *(Docs coming soon!)*

---

## 🐧 Linux Support

This project is being optimized cross-platform.
Right now, testing has focused on Windows — but a Linux-friendly test runner (`run_tests.sh`) and validation pipeline will be added after Phase 2. Stay tuned.

---

## 🤝 Contributing

We’re a community of builders, not critics.
**PRs are welcome**, **issues are open**, and **your ideas matter**.

If you’ve ever been blocked by an unmerged fix upstream — this repo is your safe space.
Let’s move Python forward, together.

---

## 🙏 Credits

- Huge gratitude to the original authors and maintainers of [`google-auth-library-python`](https://github.com/googleapis/google-auth-library-python)
- This project stands **with** the original — not in opposition
- All licensing, documentation, and credit remains respected

---

## 🔗 Resources

- [Original Google Auth Library](https://github.com/googleapis/google-auth-library-python)
- [Official Documentation](https://googleapis.dev/python/google-auth/latest/)
- [OAuth 2.0 for Google](https://developers.google.com/identity/protocols/oauth2)

---

## 🛡️ License

**Apache 2.0** — just like the original.

---

> Let’s keep Python auth secure, simple, and moving forward 🚀
93 changes: 1 addition & 92 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,92 +1 @@
Google Auth Python Library
==========================

|pypi|

This library simplifies using Google's various server-to-server authentication
mechanisms to access Google APIs.

.. |pypi| image:: https://img.shields.io/pypi/v/google-auth.svg
:target: https://pypi.python.org/pypi/google-auth

Installing
----------

You can install using `pip`_::

$ pip install google-auth

.. _pip: https://pip.pypa.io/en/stable/

For more information on setting up your Python development environment, please refer to `Python Development Environment Setup Guide`_ for Google Cloud Platform.

.. _`Python Development Environment Setup Guide`: https://cloud.google.com/python/docs/setup

Extras
------

google-auth has few extras that you can install. For example::

$ pip install google-auth[pyopenssl]

Note that the extras pyopenssl and enterprise_cert should not be used together because they use conflicting versions of `cryptography`_.

.. _`cryptography`: https://cryptography.io/en/latest/

Supported Python Versions
^^^^^^^^^^^^^^^^^^^^^^^^^
Python >= 3.7

**NOTE**:
Python 3.7 was marked as `unsupported`_ by the python community in June 2023.
We recommend that all developers upgrade to Python 3.8 and newer as soon as
they can. Support for Python 3.7 will be removed from this library after
January 1 2024. Previous releases that support Python 3.7 will continue to be available
for download, but releases after January 1 2024 will only target Python 3.8 and
newer.

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

Unsupported Python Versions
^^^^^^^^^^^^^^^^^^^^^^^^^^^
- Python == 2.7: The last version of this library with support for Python 2.7
was `google.auth == 1.34.0`.

- Python 3.5: The last version of this library with support for Python 3.5
was `google.auth == 1.23.0`.

- Python 3.6: The last version of this library with support for Python 3.6
was `google.auth == 2.22.0`.

Documentation
-------------

Google Auth Python Library has usage and reference documentation at https://googleapis.dev/python/google-auth/latest/index.html.

Current Maintainers
-------------------
- [email protected]

Authors
-------

- `@theacodes <https://github.com/theacodes>`_ (Thea Flowers)
- `@dhermes <https://github.com/dhermes>`_ (Danny Hermes)
- `@lukesneeringer <https://github.com/lukesneeringer>`_ (Luke Sneeringer)
- `@busunkim96 <https://github.com/busunkim96>`_ (Bu Sun Kim)

Contributing
------------

Contributions to this library are always welcome and highly encouraged.

See `CONTRIBUTING.rst`_ for more information on how to get started.

.. _CONTRIBUTING.rst: https://github.com/googleapis/google-auth-library-python/blob/main/CONTRIBUTING.rst

License
-------

Apache 2.0 - See `the LICENSE`_ for more information.

.. _the LICENSE: https://github.com/googleapis/google-auth-library-python/blob/main/LICENSE
google-auth-rewired
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import google.auth
import rewired.auth

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down Expand Up @@ -66,7 +66,7 @@
# built documents.
#
# The short X.Y version.
version = google.auth.__version__
version = rewired.auth.__version__
# The full version, including alpha/beta/rc tags.
release = version

Expand Down
Binary file added fuzzed-output.txt
Binary file not shown.
1 change: 1 addition & 0 deletions google/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Loading