Skip to main content

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.

Metadata

Release files for arp-auth 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for arp-auth 0.2.1
File Size Uploaded Provenance Actions
arp_auth-0.2.1.tar.gz 5.9 kB With provenance Details for arp_auth-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for arp-auth 0.2.1
File Interpreter ABI Platform Actions
arp_auth-0.2.1-py3-none-any.whl Python 3 none any Details for arp_auth-0.2.1-py3-none-any.whl

Total release size: 11.7 kB

Release files / arp_auth-0.2.1.tar.gz

Download URL arp_auth-0.2.1.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d8cf49f9e98d649e806dcdc2a7af10a5a2b91399b22a2d8e13a2834e9dae1e51
BLAKE2b-256 checksum
How to use checksums
6572abbe5c9d66eb84d1415a0521d48b4328ff872a8636702cc58ff683e9ec8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 31, 2025.

Transparency log

Release files / arp_auth-0.2.1-py3-none-any.whl

Download URL arp_auth-0.2.1-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
12d11fb090f1ab4723e8f84230a9bf52ad93788e5dda0dab020a6fd9be2c41a3
BLAKE2b-256 checksum
How to use checksums
784602b0b767c2de5eadb0867923c52f1f190cb18d0e2ac52823b9f09b015ed3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 31, 2025.

Transparency log

Security for arp-auth 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for arp_auth-0.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 31, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files Full provenance

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