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

## 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.3.tar.gz (28.5 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.3-py3-none-any.whl (27.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: noauth-0.1.3.tar.gz
  • Upload date:
  • Size: 28.5 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.3.tar.gz
Algorithm Hash digest
SHA256 63da2dfe3825d01563cdc03af61ef6f4235376c0998ffd330212e239299a35a6
MD5 ab7af7a10ce0562e60887591859cad63
BLAKE2b-256 7c76e8e49f8f5d959963ba8987f795e0ab6bd835309aa8bc3b7390b96c7933cf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: noauth-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 27.3 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ecde4d14e0286e4a590432797c53e3bac6022eb5e96c3bd449dae2cad7348a32
MD5 d38ac15e2b5a18ca62c5e17d938ce022
BLAKE2b-256 16b27dbb5c540c4242f709ab2433c7c2059e1bb501b2e17eea64f23b2265049e

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