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.0.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.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: arp_auth-0.2.0.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.0.tar.gz
Algorithm Hash digest
SHA256 2521398612ce293c6ab1870c455c8e2d64826cd3b3765daa56f5ecd025037103
MD5 fac617b0263e598441fd37f6918e986b
BLAKE2b-256 dd1884f867e44557b05c0093e08f20d7078e82db0c8a371c3dbbf858e306b833

See more details on using hashes here.

Provenance

The following attestation bundles were made for arp_auth-0.2.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: arp_auth-0.2.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c883fcfcb9e529f6590dfa325c71b7702dfd546353e647def8918db5264cb0d4
MD5 845a387b2f168c41c3c5caa0f5b6bfe2
BLAKE2b-256 7658733fe48a3b163229abe036e28842cf586eb55ee0adc143a1cef6a7d5c5f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for arp_auth-0.2.0-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