Pre-release
This release is a pre-release and may not be stable for production use.
Swarmauri Auth IDP GitLab
GitLab OAuth 2.0 / OAuth 2.1 / OIDC 1.0 identity providers and app clients packaged for Swarmauri deployments.
Features
- Authorization Code flows with PKCE and HMAC-signed state payloads for GitLab SaaS or self-managed.
- Discovery-driven OAuth 2.1 & OIDC login that validates ID tokens and hydrates profile details.
- Client credentials helpers that support shared secrets and JWT assertions.
- Retry-aware HTTP integration with GitLab REST API v4 and OIDC endpoints.
- ComponentBase-compatible models registered under
swarmauri.auth_idpentry points.
Installation
pip
pip install swarmauri_auth_idp_gitlab
uv (project)
uv add swarmauri_auth_idp_gitlab
uv (environment)
uv pip install swarmauri_auth_idp_gitlab
Usage
import asyncio
from pydantic import SecretBytes, SecretStr
from swarmauri_auth_idp_gitlab import GitLabOAuth20Login
login = GitLabOAuth20Login(
base_url="https://gitlab.example",
client_id="gitlab-client-id",
client_secret=SecretStr("gitlab-client-secret"),
redirect_uri="https://app.example.com/callback",
state_secret=SecretBytes(b"replace-with-random-bytes"),
)
async def run_flow() -> None:
auth = await login.auth_url()
print(auth["url"])
# Redirect the browser to `auth["url"]`, then capture the callback `code` and `state`.
# Later, call `login.exchange_and_identity(code, state)` inside your callback handler.
asyncio.run(run_flow())
Workflow Summary
- Call
auth_url()and redirect the browser to the returned URL. - Persist the
stateand verify it during the callback handler. - Exchange the authorization code through
exchange_and_identity()to obtain tokens and profile metadata. - Instantiate
GitLabOAuth21AppClientorGitLabOIDC10AppClientto fetch service tokens for background jobs.
Entry Points
swarmauri.auth_idp:GitLabOAuth20Loginswarmauri.auth_idp:GitLabOAuth21Loginswarmauri.auth_idp:GitLabOIDC10Loginswarmauri.auth_idp:GitLabOAuth20AppClientswarmauri.auth_idp:GitLabOAuth21AppClientswarmauri.auth_idp:GitLabOIDC10AppClient
Contributing
To contribute to swarmauri-sdk, review the guidelines for contributing which cover development workflow, testing, and coding standards.
Metadata
Release files for swarmauri_auth_idp_gitlab 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 | |
|---|---|---|---|
| swarmauri_auth_idp_gitlab-0.11.0.dev2.tar.gz | 11.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| swarmauri_auth_idp_gitlab-0.11.0.dev2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.6 kB
Release files / swarmauri_auth_idp_gitlab-0.11.0.dev2.tar.gz
| Download URL | swarmauri_auth_idp_gitlab-0.11.0.dev2.tar.gz |
|---|---|
| Size | 11.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9e96856565b73b439e49d5601f2f4b905dbce2bf19442d5eaf1f969851d61fd0
|
|
BLAKE2b-256 checksum How to use checksums |
d4d4d5a675086a6ae15363294951e5f263c57271845cb18adc6d1f03af014cd2
|
| 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_gitlab-0.11.0.dev2-py3-none-any.whl
| Download URL | swarmauri_auth_idp_gitlab-0.11.0.dev2-py3-none-any.whl |
|---|---|
| Size | 17.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
49fbd2c30670c6d5123453e3f24af1c67c9a76af9e675f0c13c8ce21f905f4f6
|
|
BLAKE2b-256 checksum How to use checksums |
6ba280e03eff23ab0d11844c8e4d94ee26515e351841b63563e3cee97e9acbd2
|
| 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}
|