CORE / 01Open-source component

Amsonia Core

The open-source foundation inside Amsonia: tenant-safe authorization that keeps policy, data boundaries, and operational evidence inside code you control.

Authorization is infrastructure.

Amsonia Core treats tenant isolation and delegated access as security boundaries, not conventions left to each handler. It provides a standalone Go API, PostgreSQL adapter and migrations, an in-memory adapter for tests, an operator CLI, and a React administration console.

Built for one specific job.

Core fits Go/PostgreSQL teams building multi-tenant SaaS that want RBAC and tenant storage isolation to share one inspectable, self-hosted boundary. The host still authenticates end users, selects the active tenant, loads business resources, and maps operations to permissions.

It is not an OAuth/OIDC identity provider, a general-purpose relationship graph, or a hosted authorization control plane. That narrower boundary is intentional.

01 / TENANCY

Signed context

Tenant context is bound per transaction and invalid context yields no tenant rows.

02 / POLICY

Delegated RBAC

Permission catalogs, scoped grants, immutable role versions, and grant-cycle protection.

03 / SESSION

Admin identity

Argon2id credentials, lockout, rotating refresh sessions, and one-time bootstrap.

04 / EVIDENCE

Audit history

Append-only events make policy changes and authorization operations reviewable.

Small surfaces. Explicit adapters.

The reusable kernel is separated from storage and HTTP composition. Teams can start with the in-memory adapter, run the complete PostgreSQL implementation, or extend the published interfaces without importing the commercial application.

cmd/api          standalone HTTP API
cmd/amsonia      migrations and administrator CLI
postgres         adapter, migrations, and RLS tests
memory           in-memory adapter for tests
internal/coreapp identity, session, tenant, and HTTP composition
web              React management console
openapi          versioned HTTP contract

Protect application-owned rows

postgres.Store.RunTenant can also wrap host business-table queries when those tables opt into the same signed RLS policy. The public invoice example proves two-tenant reads without tenant predicates, rejected cross-tenant writes, and zero visible rows for forged context.

Choose by boundary, not feature count.

ApproachBest fitData isolation
Amsonia CoreGo SaaS tenant RBAC, sessions, auditSigned context plus forced PostgreSQL RLS
Policy libraryApplication-specific RBAC or ABACDesigned separately by the application
Relationship serviceFine-grained object graphsApplication database remains separate
Identity platformLogin, federation, user lifecycleDepends on product and integration

Core is deliberately smaller than Amsonia.

Core includes identity, sessions, tenants, memberships, roles, permissions, authorization decisions, and policy audit. Billing, commerce, AI, education, messaging, media, and white-label operations remain in Amsonia Platform.

Evaluate the public evidence.