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_IDARP_AUTH_CLIENT_SECRETARP_AUTH_TOKEN_ENDPOINT(optional override; defaults to issuer +/protocol/openid-connect/token)ARP_AUTH_AUDIENCEorARP_AUTH_SERVICE_ID(optional default audience)ARP_AUTH_TIMEOUT_SECS(optional; default10)
Notes
- This library does not cache or refresh tokens automatically; callers should cache tokens
and refresh based on
expires_ininTokenResponse. - For local dev, use
arp-sts-keycloakto stand up a Keycloak realm with ARP clients.
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8cf49f9e98d649e806dcdc2a7af10a5a2b91399b22a2d8e13a2834e9dae1e51
|
|
| MD5 |
2ed0a88126d1cd58445413788e8410ea
|
|
| BLAKE2b-256 |
6572abbe5c9d66eb84d1415a0521d48b4328ff872a8636702cc58ff683e9ec8e
|
Provenance
The following attestation bundles were made for arp_auth-0.2.1.tar.gz:
Publisher:
release.yml on AgentRuntimeProtocol/ARP_Auth
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
arp_auth-0.2.1.tar.gz -
Subject digest:
d8cf49f9e98d649e806dcdc2a7af10a5a2b91399b22a2d8e13a2834e9dae1e51 - Sigstore transparency entry: 786276152
- Sigstore integration time:
-
Permalink:
AgentRuntimeProtocol/ARP_Auth@fc75d21af355368963023cfacfe412dfec9c46e9 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/AgentRuntimeProtocol
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@fc75d21af355368963023cfacfe412dfec9c46e9 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12d11fb090f1ab4723e8f84230a9bf52ad93788e5dda0dab020a6fd9be2c41a3
|
|
| MD5 |
ad7e01cfe8fbfc9679c653b26fa1b653
|
|
| BLAKE2b-256 |
784602b0b767c2de5eadb0867923c52f1f190cb18d0e2ac52823b9f09b015ed3
|
Provenance
The following attestation bundles were made for arp_auth-0.2.1-py3-none-any.whl:
Publisher:
release.yml on AgentRuntimeProtocol/ARP_Auth
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
arp_auth-0.2.1-py3-none-any.whl -
Subject digest:
12d11fb090f1ab4723e8f84230a9bf52ad93788e5dda0dab020a6fd9be2c41a3 - Sigstore transparency entry: 786276155
- Sigstore integration time:
-
Permalink:
AgentRuntimeProtocol/ARP_Auth@fc75d21af355368963023cfacfe412dfec9c46e9 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/AgentRuntimeProtocol
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@fc75d21af355368963023cfacfe412dfec9c46e9 -
Trigger Event:
push
-
Statement type: