Skip to main content

Auth helpers for ARP components (OIDC client credentials and token exchange).

Project description

ARP Auth

Auth helpers for ARP components. This package provides a small, dependency-free OIDC client for client-credentials and token-exchange flows (Keycloak-friendly).

Install

pip install arp-auth

Quick start (client credentials)

from arp_auth import AuthClient, AuthClientConfig

config = AuthClientConfig(
    issuer="http://localhost:8080/realms/arp-dev",
    client_id="arp-run-gateway",
    client_secret="arp-run-gateway-secret",
)
client = AuthClient(config)

token = client.client_credentials(audience="arp-run-coordinator")
print(token.access_token)

Token exchange

from arp_auth import AuthClient, AuthClientConfig

client = AuthClient(
    AuthClientConfig(
        issuer="http://localhost:8080/realms/arp-dev",
        client_id="arp-run-gateway",
        client_secret="arp-run-gateway-secret",
    )
)

exchanged = client.exchange_token(
    subject_token="<incoming-user-jwt>",
    audience="arp-run-coordinator",
)
print(exchanged.access_token)

Environment-based config

Use AuthClient.from_env() with:

  • ARP_AUTH_ISSUER (example: http://localhost:8080/realms/arp-dev)
  • ARP_AUTH_CLIENT_ID
  • ARP_AUTH_CLIENT_SECRET
  • ARP_AUTH_TOKEN_ENDPOINT (optional override; defaults to issuer + /protocol/openid-connect/token)
  • ARP_AUTH_AUDIENCE or ARP_AUTH_SERVICE_ID (optional default audience)
  • ARP_AUTH_TIMEOUT_SECS (optional; default 10)

Notes

  • This library does not cache or refresh tokens automatically; callers should cache tokens and refresh based on expires_in in TokenResponse.
  • For local dev, use arp-sts-keycloak to stand up a Keycloak realm with ARP clients.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arp_auth-0.2.1.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

arp_auth-0.2.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file arp_auth-0.2.1.tar.gz.

File metadata

  • Download URL: arp_auth-0.2.1.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for arp_auth-0.2.1.tar.gz
Algorithm Hash digest
SHA256 d8cf49f9e98d649e806dcdc2a7af10a5a2b91399b22a2d8e13a2834e9dae1e51
MD5 2ed0a88126d1cd58445413788e8410ea
BLAKE2b-256 6572abbe5c9d66eb84d1415a0521d48b4328ff872a8636702cc58ff683e9ec8e

See more details on using hashes here.

Provenance

The following attestation bundles were made for arp_auth-0.2.1.tar.gz:

Publisher: release.yml on AgentRuntimeProtocol/ARP_Auth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arp_auth-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: arp_auth-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for arp_auth-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 12d11fb090f1ab4723e8f84230a9bf52ad93788e5dda0dab020a6fd9be2c41a3
MD5 ad7e01cfe8fbfc9679c653b26fa1b653
BLAKE2b-256 784602b0b767c2de5eadb0867923c52f1f190cb18d0e2ac52823b9f09b015ed3

See more details on using hashes here.

Provenance

The following attestation bundles were made for arp_auth-0.2.1-py3-none-any.whl:

Publisher: release.yml on AgentRuntimeProtocol/ARP_Auth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page