GitLab OAuth 2.0 / OAuth 2.1 / OIDC 1.0 identity provider implementations for Swarmauri
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file swarmauri_auth_idp_gitlab-0.11.0.dev1.tar.gz.
File metadata
- Download URL: swarmauri_auth_idp_gitlab-0.11.0.dev1.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c4d1017bc4a01d3b3d24159a584dc989f1e3a0d1bef94d7c6572cedd36381a3
|
|
| MD5 |
0101dddf289ccfb9b484347b0840cfb5
|
|
| BLAKE2b-256 |
4fed6cb501d9b360cd157ba3518837f4ee7a4f008194a634fef1f5b49d866618
|
File details
Details for the file swarmauri_auth_idp_gitlab-0.11.0.dev1-py3-none-any.whl.
File metadata
- Download URL: swarmauri_auth_idp_gitlab-0.11.0.dev1-py3-none-any.whl
- Upload date:
- Size: 17.0 kB
- Tags: Python 3
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
577b59b7cc5f1fe4a27ce60f5f25472f15f545e1ce018c3d8a33720d3e452102
|
|
| MD5 |
6e8e115c791176909bad946f75aee02d
|
|
| BLAKE2b-256 |
737ee7bc65cbae5f3c99a6968726fa20807486ea3ef73238e009f1e2cb540b0d
|