Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_auth_idp_gitlab Discord

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_idp entry 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

  1. Call auth_url() and redirect the browser to the returned URL.
  2. Persist the state and verify it during the callback handler.
  3. Exchange the authorization code through exchange_and_identity() to obtain tokens and profile metadata.
  4. Instantiate GitLabOAuth21AppClient or GitLabOIDC10AppClient to fetch service tokens for background jobs.

Entry Points

  • swarmauri.auth_idp:GitLabOAuth20Login
  • swarmauri.auth_idp:GitLabOAuth21Login
  • swarmauri.auth_idp:GitLabOIDC10Login
  • swarmauri.auth_idp:GitLabOAuth20AppClient
  • swarmauri.auth_idp:GitLabOAuth21AppClient
  • swarmauri.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)

Source distribution for swarmauri_auth_idp_gitlab 0.11.0.dev2
File Size Uploaded
swarmauri_auth_idp_gitlab-0.11.0.dev2.tar.gz 11.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for swarmauri_auth_idp_gitlab 0.11.0.dev2
File Interpreter ABI Platform
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}
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page