Metadata-Version: 2.5
Name: oqtopus-auth
Version: 0.2.0
Summary: Framework-agnostic authentication and authorization library for the OQTOPUS ecosystem, with optional FastAPI integration
Project-URL: documentation, https://oqtopus-auth.readthedocs.io/
Project-URL: repository, https://github.com/oqtopus-team/oqtopus-auth
Author-email: oqtopus-team <oqtopus-team@googlegroups.com>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: authentication,authorization,fastapi,jwt
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: <4.0,>=3.12
Requires-Dist: pydantic>=2.0.0
Requires-Dist: pyjwt[crypto]>=2.13.0
Provides-Extra: client
Requires-Dist: httpx2>=2.9.1; extra == 'client'
Provides-Extra: fastapi
Requires-Dist: fastapi>=0.136.1; extra == 'fastapi'
Description-Content-Type: text/markdown

<!-- markdownlint-disable MD041 -->
![OQTOPUS logo](./docs/asset/oqtopus-logo.png)

# OQTOPUS Auth

[![CI](https://github.com/oqtopus-team/oqtopus-auth/actions/workflows/ci.yaml/badge.svg)](https://github.com/oqtopus-team/oqtopus-auth/actions/workflows/ci.yaml)
[![codecov](https://codecov.io/gh/oqtopus-team/oqtopus-auth/graph/badge.svg?token=4XTC9HSSFV)](https://codecov.io/gh/oqtopus-team/oqtopus-auth)
[![pypi version](https://img.shields.io/pypi/v/oqtopus-auth.svg)](https://pypi.org/project/oqtopus-auth/)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![slack](https://img.shields.io/badge/slack-OQTOPUS-pink.svg?logo=slack&style=plastic)](https://join.slack.com/t/oqtopus/shared_invite/zt-3bpjb7yc3-Vg8IYSMY1m5wV3DR~TMSnw)

## Overview

**OQTOPUS Auth** is a framework-agnostic authentication and authorization
library for the OQTOPUS ecosystem. It ships pluggable authentication providers:

- `none` — authentication disabled (local development).
- `header` — trust a JWT injected by a trusted reverse proxy (e.g. oauth2-proxy,
  Cloudflare Access).
- `oidc` — verify an `Authorization: Bearer` token directly against the issuer's
  JWKS (`iss`/`exp`/`aud` or `client_id`) and optionally enforce an OAuth2
  `scope`; for services that are the resource server (M2M / client-credentials,
  or an API with no edge authorizer).

It also provides a role/permission model, an optional FastAPI integration, and a
client-credentials token provider for the *calling* side of an `oidc`-protected
service.

```shell
pip install oqtopus-auth
# with the FastAPI middleware and dependencies:
pip install "oqtopus-auth[fastapi]"
# with the client-credentials token provider (ClientCredentialsTokenProvider):
pip install "oqtopus-auth[client]"
```

## Documentation

- [Documentation Home](https://oqtopus-auth.readthedocs.io/)

## Citation

You can use the DOI to cite oqtopus-auth in your research.

[![DOI](https://zenodo.org/badge/1330600402.svg)](https://zenodo.org/badge/latestdoi/1330600402)

Citation information is also available in the [CITATION](https://github.com/oqtopus-team/oqtopus-auth/blob/main/CITATION.cff) file.

## Contact

You can contact us by creating an issue in this repository or by email:

- [oqtopus-team[at]googlegroups.com](mailto:oqtopus-team[at]googlegroups.com)

## License

oqtopus-auth is released under the [Apache License 2.0](LICENSE).
