intrnl.cloud
Architecture

Organization tenancy

Tenant context, authorization, row-level security, immutable identifiers, and tenant isolation.
v1 design baseline. This page specifies intended behavior. Delivery and validation are tracked in the implementation plan; it is not a claim that the platform is already implemented.

Organization is the root tenant

Every tenant-owned resource includes an immutable organization_id.

Examples:

applications
environments
source_repositories
builds
deployments
database_instances
kv_namespaces
secrets
ip_lists
access_policies
identity_providers
audit_events
usage_records

A user may belong to multiple organizations and explicitly switch the active tenant in Filament.

Filament provides tenant-oriented UI and routing primitives, but its documentation makes clear that tenancy is security-sensitive and that application developers remain responsible for correctly enforcing it. Its canAccessTenant() check is specifically necessary to prevent a user from guessing another tenant’s identifier. Filament tenancy

Filament tenancy is therefore a UI and routing convenience—not the sole security boundary.

Defense-in-depth tenancy controls

Use all of the following:

  1. Explicit TenantContext passed to application services.
  2. Laravel policies for every resource.
  3. Mandatory organization filtering in repositories/query objects.
  4. PostgreSQL row-level security for tenant-owned tables.
  5. Composite unique constraints containing organization_id.
  6. Queue jobs containing and revalidating tenant context.
  7. Object-storage keys prefixed by opaque organization/application IDs.
  8. Runtime cluster commands scoped to an organization and cluster.
  9. Cross-tenant integration tests and property tests.
  10. Separate administrative database role for migrations and maintenance.

For PostgreSQL RLS, each web/job transaction should set a local organization context. Normal application database roles must not bypass RLS.

Identifier strategy

Use ULIDs or UUIDv7 internally.

Human-readable slugs are routing/display values, not authorization boundaries.

org_01K...
app_01K...
env_01K...
dep_01K...

An organization app may display:

Example Organization / Equipment Requests

while its underlying repository, object-storage prefix, and database binding use immutable IDs.