This release is a pre-release and may not be stable for production use.
Swarmauri Auth IDP Gitea
Gitea OAuth 2.0, OAuth 2.1, and OIDC 1.0 login and app-client flows packaged for the Swarmauri ecosystem.
Features
- PKCE-enabled authorization code flows with signed state payloads and resilient retries.
- Automatic profile enrichment using the Gitea REST API with email fallbacks.
- Optional private-key JWT client authentication for high-assurance machine-to-machine use.
- OIDC support that validates ID tokens and gracefully falls back to UserInfo claims.
- ComponentBase-registered classes for discovery through Swarmauri plugin entry points.
Installation
pip
pip install swarmauri_auth_idp_gitea
uv (project)
uv add swarmauri_auth_idp_gitea
uv (environment)
uv pip install swarmauri_auth_idp_gitea
Usage
Instantiate the login classes with your Gitea base URL, client credentials, and redirect URI.
Persist the signed state returned by auth_url and supply it to the exchange step.
from pydantic import SecretBytes, SecretStr
from swarmauri_auth_idp_gitea import GiteaOAuth21Login
login = GiteaOAuth21Login(
base_url="https://gitea.example.com",
client_id="example-client-id",
client_secret=SecretStr("example-secret"),
redirect_uri="https://example.com/callback",
state_secret=SecretBytes(b"super-secret-state-key"),
)
# Within an async context:
# auth_payload = await login.auth_url()
# identity = await login.exchange_and_identity(code, auth_payload["state"])
print(login.client_id)
Expected Workflow
- Call
auth_url()and redirect the user agent to Gitea's authorization endpoint. - Persist the returned state and verify it during the callback to prevent tampering.
- Call
exchange_and_identity()(orexchange()for the OIDC login) to normalize user claims. - Use the normalized payload to create sessions, audit events, or downstream tokens.
App client classes expose access_token() for service-to-service integrations using either
client secrets or private-key JWT assertions.
Entry Points
The distribution registers the following entry points:
swarmauri.auth_idp:GiteaOAuth20Loginswarmauri.auth_idp:GiteaOAuth21Loginswarmauri.auth_idp:GiteaOIDC10Loginswarmauri.auth_idp:GiteaOAuth20AppClientswarmauri.auth_idp:GiteaOAuth21AppClientswarmauri.auth_idp:GiteaOIDC10AppClient
Contributing
To contribute to swarmauri-sdk, review the guidelines for contributing covering development workflow, testing, and coding standards.
Metadata
Release files for swarmauri_auth_idp_gitea 0.11.0.dev2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| swarmauri_auth_idp_gitea-0.11.0.dev2.tar.gz | 11.8 kB | Without provenance | Details for swarmauri_auth_idp_gitea-0.11.0.dev2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| swarmauri_auth_idp_gitea-0.11.0.dev2-py3-none-any.whl | Python 3 | none | any | Details for swarmauri_auth_idp_gitea-0.11.0.dev2-py3-none-any.whl |
Total release size: 28.3 kB
Release files / swarmauri_auth_idp_gitea-0.11.0.dev2.tar.gz
| Download URL | swarmauri_auth_idp_gitea-0.11.0.dev2.tar.gz |
|---|---|
| Size | 11.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
94df604e763bd0829e83ed57175d5666581170433da0a952017256b61dce0644
|
|
BLAKE2b-256 checksum How to use checksums |
35b457b964c470a21f08ec25b2891573776ffe422c20e03c30a46857eceb30b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / swarmauri_auth_idp_gitea-0.11.0.dev2-py3-none-any.whl
| Download URL | swarmauri_auth_idp_gitea-0.11.0.dev2-py3-none-any.whl |
|---|---|
| Size | 16.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c6fa10774d8055ffec47dd3c133db40b97da5924d8865cacff156f307f116aec
|
|
BLAKE2b-256 checksum How to use checksums |
a3e7385c170689299210e63629b103cb1c92d738c007eb8cd822b75a0ca735ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for swarmauri_auth_idp_gitea 0.11.0.dev2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.