snout_oauth
snout_oauth · Offline ES256 JWT validator library for PostgreSQL OAuth authentication
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 102118 | snout_oauth | snout_oauth | 0.1.0 | SEC | Apache-2.0 | Rust |
PostgreSQL · 18
Usage
Sources:
snout_oauth 0.1.0 is a PostgreSQL 18 OAuth validator for Snout-issued database tokens. It validates JWTs against a local public JWKS file; it neither contacts an issuer over HTTP nor installs SQL objects.
Core Workflow
Operational Boundaries
Set the issuer, project audience and public-key file before enabling OAuth authentication. The file must contain public EC P-256 keys; private keys are rejected. Tokens must pass issuer, audience, signature, expiry and lifetime checks, carry token_use equal to db, and bind db_role to the requested database role. This is not a general-purpose validator for arbitrary OIDC tokens.
Reload server configuration and authentication rules after changes. The library is loaded on demand by oauth_validator_libraries; shared preload is optional, and no CREATE EXTENSION step is supported. The control file is for development tooling only. Role mapping can be delegated because the validator checks the database role itself. Restrict matching HBA rules to intended networks and users.
Key files are reread when their identity or metadata changes; replace them atomically for rotation. Default clock leeway is 30 seconds and maximum token lifetime is one day. Empty required settings fail authentication. PostgreSQL 18 OAuth-capable clients are required.