auth0
auth0 · Auth0 Management API client for PostgreSQL.
Overview
PostgreSQL · 10, 11, 12, 13, 14, 15, 16, 17, 18
| Relationships | |
|---|---|
| Requires | http |
Usage
Sources:
auth0 is a SQL client for selected Auth0 Authentication and Management API operations. It sends HTTPS requests from PostgreSQL through the required http extension, so a query can create, read, or update Auth0 users and trigger a password-change message.
Core Workflow
Create the dependency and extension, then store the tenant settings for the current database role. The SQL implementation uses set_config; the differently named setters shown in the README are not part of version 0.1.
get_api_token() performs the client-credentials exchange when the cached token is empty or expired. get_user(), get_user_by_email(), create_user(), and update_user() call the Management API; change_password_prompt() calls the database-connections endpoint.
Operational Boundaries
Configuration and cached access tokens are written as per-role PostgreSQL settings by ALTER ROLE, not kept in an external secret store. Restrict access to the role and system catalogs, and plan explicit secret rotation. The functions perform synchronous outbound network calls inside a database backend; API latency, rate limits, TLS/DNS failures, and Auth0 permissions therefore affect SQL execution.
The implementation constructs some request paths from caller text and does not expose a general-purpose Auth0 API. Grant execution only to trusted roles, validate identifiers and JSON payloads in the application, and test HTTP status/error behavior before relying on it in a transaction.