Nest Engineering Docs
Auth

Local development

Run, debug, and test Auth locally

Prerequisites

  • uv and Python 3.13.
  • GCP credentials with access to Secret Manager.

Required environment

export GCP_PROJECT_ID="..."
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account.json"

The service reads AUTH_API_KEY from Secret Manager. For local curl testing, fetch the secret value and export it in your shell.

Install dependencies

# From repo root
uv sync --all-packages

Run locally

# From repo root
uv run --package auth granian --interface asgi services.auth.main:app --host 0.0.0.0 --port 8080 --workers 1 --loop uvloop

Sanity checks

curl http://localhost:8080/api/v1/health

Example request

curl \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $AUTH_API_KEY" \
  -d '{"token": "JWT", "expected_aud": "AUD", "allowed_issuers": ["https://issuer.example"], "expected_nonce": null}' \
  http://localhost:8080/api/v1/jwt/verify

Tests

# From repo root
uv run --package auth pytest -q

Last updated on