ChatAuth
Self-hosted OAuth-style refresh-token auth service for ChatArch.
ChatAuth extracts the reusable idea from recent ChatCRS / CRS service discussions: a machine or service keeps a refresh token, exchanges it at an authorization service for a short-lived access token, and resource services verify that access token against the issuer's public key material.
ChatAuth does not imitate auth.openai.com or reproduce vendor-private token logic. It implements a small self-hosted issuer boundary for ChatArch-owned services.
Install
python -m pip install ChatAuth
Command tree
chatauth # Self-hosted OAuth-style refresh-token auth service for ChatArch.
├── --help # Show help.
├── --version # Show installed version.
├── --tree # Print the registered CLI tree.
├── health # Check local ChatAuth state health.
├── service # Local ChatAuth service lifecycle.
│ ├── init # Plan/create local state DB and signing key; writes only with --execute.
│ ├── run # Reserved ASGI service runner; currently non-zero.
│ └── doctor # Inspect local state/config/key metadata without secrets.
├── admin # Local admin operations.
│ ├── clients
│ ├── subjects
│ ├── grants
│ └── keys
├── token
│ ├── import-refresh
│ ├── status
│ ├── refresh
│ └── clear
└── verify
├── jwks
└── access-token
Local smoke
STATE=./.chatauth-state
STORE=./.runtime-token.json
HANDOFF=./.refresh-token.txt
chatauth service init --state-dir "$STATE" --issuer https://auth.example.test --execute
chatauth admin clients create demo --state-dir "$STATE" --audience chatarch.internal --scope agent:run --execute
chatauth admin subjects create machine:demo --state-dir "$STATE" --execute
CLIENT_ID=$(chatauth admin clients list --state-dir "$STATE" | python -c 'import json,sys; print(json.load(sys.stdin)["clients"][0]["client_id"])')
chatauth admin grants issue "$CLIENT_ID" machine:demo --state-dir "$STATE" --audience chatarch.internal --scope agent:run --handoff-file "$HANDOFF" --execute
chatauth token import-refresh --state-dir "$STATE" --token-store "$STORE" --from-file "$HANDOFF" --execute
chatauth token refresh --state-dir "$STATE" --token-store "$STORE" --execute
chatauth admin keys jwks --state-dir "$STATE" > ./.jwks.json
chatauth verify access-token --token-store "$STORE" --jwks-file ./.jwks.json --issuer https://auth.example.test --audience chatarch.internal --scope agent:run
CLI output intentionally reports booleans and metadata only. Raw refresh tokens are written only to explicit handoff/token-store files and are never printed by default.
Current scope
Implemented in 0.1.x:
- local SQLite state initialization and doctor;
- local RSA signing key generation and JWKS export;
- admin client/subject/refresh-grant creation;
- refresh-token hashing and rotation;
- client audience/scope enforcement when issuing refresh grants;
- short-lived RS256 access-token issuing;
- local runtime token-store import/refresh/status/clear;
- resource-side JWT/audience/scope verification from public JWKS without issuer private-key access.
Reserved for future versions:
- ASGI/HTTP
/oauth/tokenserver (chatauth service runexits non-zero for now); - full authorization-code / PKCE login UI;
- remote admin API and multi-key rotation workflows.
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 chatauth-0.1.1.tar.gz.
File metadata
- Download URL: chatauth-0.1.1.tar.gz
- Upload date:
- Size: 13.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f781bc107a8e0f8fde37435132f93b70983de413316525e799357995b97c6225
|
|
| MD5 |
290ce4d94bf54e0a31a950ab99f9c9b6
|
|
| BLAKE2b-256 |
f382bdb56ec1faac4056a3ccb26e6df15cd3313ba1b2ac84e886530bfc074508
|
Provenance
The following attestation bundles were made for chatauth-0.1.1.tar.gz:
Publisher:
publish.yml on ChatArch/ChatAuth
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chatauth-0.1.1.tar.gz -
Subject digest:
f781bc107a8e0f8fde37435132f93b70983de413316525e799357995b97c6225 - Sigstore transparency entry: 2430370066
- Sigstore integration time:
-
Permalink:
ChatArch/ChatAuth@e42523b94e7357f857f9a41f3c6711337a4c6b3a -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/ChatArch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e42523b94e7357f857f9a41f3c6711337a4c6b3a -
Trigger Event:
push
-
Statement type:
File details
Details for the file chatauth-0.1.1-py3-none-any.whl.
File metadata
- Download URL: chatauth-0.1.1-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86b6445bfcb011d7156c8e9470a7d2874eb38b6f819e157513517450db072958
|
|
| MD5 |
06b1a36c2c8158ab1b00e8361a75796b
|
|
| BLAKE2b-256 |
6087deb888a2d152a60d13b87900bde2028b6c6dec52c03fae3cf8f5433fd5ad
|
Provenance
The following attestation bundles were made for chatauth-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on ChatArch/ChatAuth
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chatauth-0.1.1-py3-none-any.whl -
Subject digest:
86b6445bfcb011d7156c8e9470a7d2874eb38b6f819e157513517450db072958 - Sigstore transparency entry: 2430370267
- Sigstore integration time:
-
Permalink:
ChatArch/ChatAuth@e42523b94e7357f857f9a41f3c6711337a4c6b3a -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/ChatArch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e42523b94e7357f857f9a41f3c6711337a4c6b3a -
Trigger Event:
push
-
Statement type: