Skip to main content

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 verify access-token --state-dir "$STATE" --token-store "$STORE" --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;
  • short-lived RS256 access-token issuing;
  • local runtime token-store import/refresh/status/clear;
  • resource-side JWT/audience/scope verification.

Reserved for future versions:

  • ASGI/HTTP /oauth/token server (chatauth service run exits 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

chatauth-0.1.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

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

chatauth-0.1.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file chatauth-0.1.0.tar.gz.

File metadata

  • Download URL: chatauth-0.1.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for chatauth-0.1.0.tar.gz
Algorithm Hash digest
SHA256 eebd8b336b6e78d43df1a71f29d211a1fbcf1f7b1fb6311308bfcd9c546b0434
MD5 a9979d191f877f3312256f0822a42cba
BLAKE2b-256 6585027f5acd6ee0c9814e56b866eb93ef21b39dc7bd47716e5c2aaaf94ce6cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for chatauth-0.1.0.tar.gz:

Publisher: publish.yml on ChatArch/ChatAuth

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

File details

Details for the file chatauth-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: chatauth-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for chatauth-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 46967fd3970e1b3cd1854da912cd82da6b14d1ebe94024ec7f6b40b6f3b9f96e
MD5 534135a6116215a63779b844041584c5
BLAKE2b-256 10d068fd8b5a596acd6f04ecdc535c8d0a7130fe6796d8ce11715e13e6c8de0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for chatauth-0.1.0-py3-none-any.whl:

Publisher: publish.yml on ChatArch/ChatAuth

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