Authorization header. This page explains how to obtain a token, how to use it, and how long-lived API keys work.
Pass the token
Include your token on every request:Get a token
InfraAudit uses Supabase Auth. Your access token is a signed JWT issued by your Supabase project. There are three ways to obtain one.1
Option 1: Sign in via the Supabase client
Use the Supabase JavaScript SDK if you’re building a browser or Node.js integration:
2
Option 2: Sign in via the InfraAudit API
POST your credentials to Response:
/api/login to receive a token directly:3
Option 3: Use the CLI
The CLI stores the token automatically after login:The token is saved to
~/.infraudit/config.yaml and used by all subsequent CLI commands.Use the token in requests
API keys
For non-interactive use cases such as CI/CD pipelines and automated scripts, create a long-lived API key instead of using a session token. Create an API key in the web UI: navigate to Settings → API Keys and click New key. Create an API key via the API:Authorization: Bearer header as session tokens.
Token format
Tokens are Supabase JWTs signed with either:- ES256 — ECDSA with a key pair managed by Supabase, verified via JWKS at
{SUPABASE_URL}/auth/v1/.well-known/jwks.json - HS256 — HMAC using
SUPABASE_JWT_SECRET