Px/

Introduction

Permix is a Go-based, dual-mode (SaaS + self-hosted) policy engine combining RBAC, ABAC, JWT validation, and multi-tenant management.

Edit this page on GitHub

Permix is a single-binary Go service that gives engineering teams a unified control plane for authorization decisions. It combines Casbin RBAC, a custom ABAC attribute engine, provider-agnostic JWT validation, and full multi-tenant SaaS infrastructure behind one low-latency decision API.

Capabilities#

FeatureDescription
RBAC via CasbinRole → domain → resource → action rules managed through a clean REST API
ABAC policy engineJSON condition trees with AND/OR logic, priority ordering, and enable/disable toggles
Provider-agnostic JWTValidates RS256 and ES256 tokens from any OIDC provider — Keycloak, Auth0, Okta, or your own
Per-issuer ValidatorCacheSaaS mode caches JWKS validators per issuer for zero-overhead multi-IdP resolution
Multi-tenant SaaSFull tenant provisioning, identity provider management, and tenant-scoped data isolation
Service API keysService-to-service authentication without OAuth2 client credentials
Java SDKSpring Boot and Quarkus integration via @Resource annotation — zero boilerplate
Health probes/healthz/live and /healthz/ready check database and Casbin engine readiness

Deployment modes#

The service boots into one of two modes set by the MODE env var (default: selfhost).

selfhostsaas
JWT validationSingle global JWKS URIPer-tenant ValidatorCache
Tenant isolationSingle implicit tenantFull multi-tenant DB scoping
Admin authAdmin API key headerX-Admin-Api-Key header
Identity providersConfigured via env varsManaged via /admin/tenants/{id}/identity-providers
Tenant managementN/AFull CRUD at /admin/tenants

Core concepts#

ConceptDescription
SubjectIdentity making the request — JWT sub, user ID, or service account
ResourceNamed entity being accessed (invoice:read, project:deploy, etc.)
ActionOperation attempted on a resource (read, write, approve, deploy)
DomainTenant or organisation scope for Casbin multi-tenant isolation
RBAC PolicyCasbin rule: (role, domain, resource, action) → allow/deny
ABAC PolicyJSON condition tree evaluated against namespaced request attributes
Service API KeyLong-lived credential for service-to-service calls without OAuth2

API surface#

rounded-md border px-1.5 py-0.5 font-mono text-[0.82em]
# Health probes — no auth
GET  /healthz/live
GET  /healthz/ready

# Decision
POST /api/v1/check
POST /api/v1/resources/access/check

# Resource management (JWT required)
POST   /api/v1/resources
POST   /api/v1/resources/list
GET    /api/v1/resources
GET    /api/v1/resources/{id}/policies
POST   /api/v1/resources/policies
PUT    /api/v1/resources/policies
DELETE /api/v1/resources/policies

# ABAC policy management (JWT required)
POST   /api/v1/abac/policies
GET    /api/v1/abac/policies
GET    /api/v1/abac/policies/{id}
PUT    /api/v1/abac/policies/{id}
DELETE /api/v1/abac/policies/{id}

# Service API keys (JWT required)
POST   /api/v1/service-api-keys
GET    /api/v1/service-api-keys
DELETE /api/v1/service-api-keys/{id}

# SaaS admin (X-Admin-Api-Key required)
POST   /admin/tenants
GET    /admin/tenants
POST   /admin/tenants/{id}/identity-providers
GET    /admin/tenants/{id}/identity-providers
DELETE /admin/tenants/{id}/identity-providers/{idpId}