Pangolin implements a secure authentication system based on JSON Web Tokens (JWT) and Role-Based Access Control (RBAC).
- Login: Users authenticate against the
/api/v1/users/loginendpoint using their credentials.- Root Login: Omit
tenant-idor set tonull - Tenant-Scoped Login: Include
tenant-idwith tenant UUID
- Root Login: Omit
- Token Issuance: Upon successful authentication, the server returns a signed JWT.
- API Key Authentication (Service Users): Machine accounts use a static API key passed in the
X-API-Keyheader.X-API-Key: <your-api-key>
Root Login:
curl -X POST http://localhost:8080/api/v1/users/login \
-H "Content-Type: application/json" \
-d '{"username":"admin","password":"password","tenant-id":null}'Tenant-Scoped Login (for users with duplicate usernames across tenants):
curl -X POST http://localhost:8080/api/v1/users/login \
-H "Content-Type: application/json" \
-d '{"username":"user","password":"pass123","tenant-id":"<tenant-uuid>"}'Important
Use tenant-id (kebab-case), not tenant_id (underscore).
A "Root User" is configured via environment variables to bootstrap the system. This user has full administrative privileges.
PANGOLIN_ROOT_USER: Username for the root user.PANGOLIN_ROOT_PASSWORD: Password for the root user.
Pangolin supports the following roles:
- Root: Full system access. Can manage tenants, users, and system configuration.
- TenantAdmin: Tenant-level administration. Can manage warehouses, catalogs, and users within a tenant.
- TenantUser: Standard access. Can read/write data based on catalog permissions.
Note
When using the API directly (e.g., creating users), these roles must be specified in kebab-case: root, tenant-admin, tenant-user.
Service users are intended for machine-to-machine communication (CI/CD, automated scripts). They do not use JWT tokens; instead, they use a persistent API key.
curl http://localhost:8080/api/v1/catalogs \
-H "X-API-Key: pgl_key_abc123..." \
-H "X-Pangolin-Tenant: <tenant-uuid>"Tip
API keys are only displayed once upon creation. If lost, the key must be rotated via the /api/v1/service-users/{id}/rotate endpoint.
For temporary programmatic access by human users, you can generate long-lived JWT tokens:
Tokens can be revoked for security:
- Self-revoke:
POST /api/v1/auth/revoke- Revoke your current token - Admin-revoke:
POST /api/v1/auth/revoke/{token_id}- Revoke any token (admin only)
Pangolin supports OAuth providers (Google, GitHub, etc.):
- Navigate to
/oauth/authorize/{provider}(e.g.,/oauth/authorize/google) - Complete OAuth flow with provider
- Receive JWT token upon successful authentication
The API is protected by authentication middleware that:
- Validates the JWT signature.
- Extracts user claims (ID, Role, Tenant).
- Enforces role-based access policies for specific endpoints.
For direct S3 access (e.g., from engines like Spark or Trino), Pangolin provides a credential vending mechanism. See Security & Vending for details.