Skip to main content

RBAC Permission Matrix

Complete reference for STOA's role-based access control β€” roles, scopes, permissions, and tenant isolation.

Roles​

STOA defines 4 roles, managed in Keycloak as realm roles:

RoleScopeDescription
cpi-adminPlatformFull access to all tenants, all operations
tenant-adminTenantFull access to own tenant only
devopsTenantDeploy, promote, and manage within own tenant
viewerTenantRead-only access to own tenant

Role Hierarchy​

cpi-admin (platform-wide)
└── tenant-admin (tenant-scoped)
└── devops (deploy-scoped)
└── viewer (read-only)

Higher roles inherit all permissions of lower roles. A cpi-admin can do everything a viewer can, plus more.

OAuth Scopes​

The gateway maps roles to OAuth scopes for token-based authorization:

ScopeDescriptionRoles
stoa:readRead-only accessviewer, devops, tenant-admin, cpi-admin
stoa:writeCreate, update, deletedevops, tenant-admin, cpi-admin
stoa:adminPlatform administrationcpi-admin

Permission Matrix​

API Management​

Permissionviewerdevopstenant-admincpi-admin
List APIsReadReadReadRead (all tenants)
View API detailsReadReadReadRead (all tenants)
Create APIβ€”CreateCreateCreate (any tenant)
Update APIβ€”UpdateUpdateUpdate (any tenant)
Delete APIβ€”β€”DeleteDelete (any tenant)
Deploy APIβ€”DeployDeployDeploy (any tenant)
Promote APIβ€”PromotePromotePromote (any tenant)

Subscription Management​

Permissionviewerdevopstenant-admincpi-admin
List subscriptionsReadReadReadRead (all tenants)
Create subscriptionβ€”CreateCreateCreate
Approve subscriptionβ€”β€”ApproveApprove
Suspend subscriptionβ€”β€”SuspendSuspend
Revoke subscriptionβ€”β€”RevokeRevoke
Rotate API keyβ€”RotateRotateRotate

Consumer Management​

Permissionviewerdevopstenant-admincpi-admin
List consumersReadReadReadRead (all tenants)
Create consumerβ€”β€”CreateCreate
Update consumerβ€”β€”UpdateUpdate
Delete consumerβ€”β€”DeleteDelete
Bulk onboardβ€”β€”BulkBulk

Tenant Management​

Permissionviewerdevopstenant-admincpi-admin
List tenantsOwn onlyOwn onlyOwn onlyAll tenants
View tenant detailsOwn onlyOwn onlyOwn onlyAll tenants
Create tenantβ€”β€”β€”Create
Update tenantβ€”β€”β€”Update
Delete tenantβ€”β€”β€”Delete

MCP Tools​

Permissionviewerdevopstenant-admincpi-admin
List toolsReadReadReadRead
Invoke toolβ€”InvokeInvokeInvoke
Register tool (CRD)β€”β€”RegisterRegister

Platform Administration​

Permissionviewerdevopstenant-admincpi-admin
View audit logsReadReadReadRead (all tenants)
Manage usersβ€”β€”Own tenantAll tenants
Gateway adminβ€”β€”β€”Full access
Override read-only envβ€”β€”β€”Override

Tenant Isolation​

Tenant-scoped roles (tenant-admin, devops, viewer) are restricted to their own tenant:

  • A tenant-admin for tenant acme cannot see tenant globex resources
  • API queries automatically filter by the user's tenant_id claim
  • Cross-tenant access attempts return 403 Forbidden

Only cpi-admin can access resources across all tenants.

How Tenant Is Determined​

The user's tenant is extracted from the JWT token:

  1. tenant claim (custom claim in Keycloak) β€” primary source
  2. tenant-{id} role (realm role pattern) β€” fallback
  3. No tenant β€” only valid for cpi-admin (platform-wide access)

JWT Claims Structure​

STOA validates these JWT claims from Keycloak:

{
"sub": "user-uuid-123",
"preferred_username": "john.doe",
"email": "john.doe@acme.example.com",
"tenant": "acme",
"realm_access": {
"roles": ["tenant-admin", "offline_access"]
},
"scope": "openid stoa:read stoa:write",
"aud": ["stoa-mcp", "account"],
"iss": "https://auth.<YOUR_DOMAIN>/realms/stoa",
"exp": 1708000000,
"iat": 1707999000
}
ClaimRequiredPurpose
subYesUser identifier
expYesToken expiration
iatYesToken issued at
issYesToken issuer (Keycloak URL)
audYesAudience (must include client ID)
tenantNoTenant ID (required for tenant-scoped roles)
realm_access.rolesYesKeycloak realm roles
scopeNoOAuth scopes (space-separated)

Persona Examples​

Alex β€” Platform Admin (cpi-admin)​

Alex manages the entire STOA platform. She can:

  • Create and configure tenants
  • View all subscriptions across tenants
  • Access the gateway admin API
  • Override read-only production restrictions
  • View platform-wide audit logs

Bob β€” Tenant Admin (tenant-admin)​

Bob manages APIs for the acme tenant. He can:

  • Create, edit, and delete APIs in acme
  • Approve subscription requests for acme APIs
  • Manage consumers and their certificates
  • View audit logs for acme only
  • Cannot see resources in other tenants

Carol β€” DevOps Engineer (devops)​

Carol deploys and promotes APIs for acme. She can:

  • Create and update APIs in acme
  • Deploy APIs to staging and production
  • Rotate API keys for subscriptions
  • Cannot delete APIs or approve subscriptions
  • Cannot manage consumers

Dave β€” Viewer (viewer)​

Dave monitors API health for acme. He can:

  • Browse the API catalog and documentation
  • View subscription details and usage metrics
  • Read audit logs for acme
  • Cannot create, modify, or delete anything

Cookies and privacy

With your permission, we use cookies to measure visits and understand navigation to improve the site.

Learn more

Google Analytics measures visits and useful clicks. Microsoft Clarity provides masked interaction replays. No advertising use. Your choice is saved for six months. You can change or withdraw it at any time using the β€œCookies” button.

Read the audience measurement details