Skip to main content

Centralized OAuth token service on Modal with encrypted storage and automatic refresh.

Project description

noauth

Centralized OAuth token service on Modal with encrypted storage and automatic refresh.

SDK install (GitHub)

Use this when you only want the client library (no Modal server deps). This install does not pull Modal.

uv pip install "git+https://github.com/thehumanworks/noauth.git"

Minimal usage:

from noauth.sdk import NoAuthClient

# Credentials can be provided via:
# 1. Explicit parameters (shown below)
# 2. Environment variables (NOAUTH_CLIENT_ID, NOAUTH_CLIENT_SECRET)
# 3. ~/.modal.toml file

client = NoAuthClient(
    base_url="https://<your-app>.modal.run",
    token_id="wk-...",
    token_secret="ws-...",
)
print(client.health().message)

# Store an OAuth credential
client.store_credential(
    "codex",
    "oauth",
    config={"client_id": "...", "token_url": "..."},
    tokens={"access_token": "...", "refresh_token": "..."},
)

# Get credentials
cred = client.get_credential("codex", "oauth")
print(cred.tokens.get("access_token"))

# List credentials
creds = client.list_credentials()
print([c.name for c in creds])

# Refresh OAuth tokens
client.refresh_credential("codex")

## CLI usage

```bash
# Health check
noauth health

# Get OAuth credential tokens
noauth get codex --kind oauth

# Get bearer credential value
noauth get api-key --kind bearer

# Store OAuth tokens (from JSON file)
noauth store codex ./tokens.json

# Store OAuth config + optional tokens
noauth store-credential codex --kind oauth --config ./config.json --tokens ./tokens.json

# Store bearer token
noauth store-credential api-key --kind bearer --value "secret"

# Refresh OAuth credential
noauth refresh codex

# List credentials
noauth list
noauth list --kind oauth

# Delete credential
noauth delete codex --kind oauth --force

## Doppler secrets

noauth can use Doppler as the credential store. Set `DOPPLER_TOKEN`, `DOPPLER_PROJECT`, and `DOPPLER_CONFIG` for the Modal app. When enabled, OAuth credentials are stored as JSON in Doppler under `CODEX_AUTH_JSON` and `GEMINI_AUTH_JSON`.

## Server install (Modal app)

Use this when you want to deploy the service:

```bash
uv pip install "git+https://github.com/thehumanworks/noauth.git#egg=noauth[server]"

Deploy:

uv run modal deploy -m noauth.app

Notes:

  • All endpoints require Modal Proxy Auth. Use a Proxy Auth token (wk-.../ws-...).
  • API/CLI tokens (ak-/as-) are not valid for proxy auth.

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

noauth-0.1.4.tar.gz (32.4 kB view details)

Uploaded Source

Built Distribution

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

noauth-0.1.4-py3-none-any.whl (31.9 kB view details)

Uploaded Python 3

File details

Details for the file noauth-0.1.4.tar.gz.

File metadata

  • Download URL: noauth-0.1.4.tar.gz
  • Upload date:
  • Size: 32.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for noauth-0.1.4.tar.gz
Algorithm Hash digest
SHA256 95de195f08c89e48d635063806e4a18767075416582a91975919b9afafd78a7e
MD5 29d57b1761854b93b8fa2a215b31e0c2
BLAKE2b-256 cc284320c05c5e5b754db9eab514fb100ebd02df741866e146ec6cac7006d391

See more details on using hashes here.

File details

Details for the file noauth-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: noauth-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 31.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for noauth-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e14736918cf06ce7e04c5ae20591c81eb3c98966020e36e7bbe2416a22745e01
MD5 3428b7f744e5a60084bcf43a6772944f
BLAKE2b-256 6e4db16402655541a4b1e28e310eed09848a1de9cbb77e5bd10b5ebc159758aa

See more details on using hashes here.

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