Skip to content

feat(agentos): OIDC/Keycloak auth, DB-backed RBAC, ownership, refresh new home#26

Merged
abhi-bhat-lyzr merged 1 commit into
deployfrom
feat/agentos-auth-rbac-refresh
Jun 5, 2026
Merged

feat(agentos): OIDC/Keycloak auth, DB-backed RBAC, ownership, refresh new home#26
abhi-bhat-lyzr merged 1 commit into
deployfrom
feat/agentos-auth-rbac-refresh

Conversation

@abhi-bhat-lyzr
Copy link
Copy Markdown
Collaborator

Replace the shared-password gate with a full auth/authorization stack and restructure the server routes.

Authentication (BFF):

  • OIDC code+PKCE flow via Keycloak (Okta federated); tokens stay server-side, browser gets an httpOnly signed session-snapshot cookie. jose JWKS verify.
  • Reactive token refresh: short session cookie + server-held rotating refresh token; POST /auth/refresh re-signs the session on 401. SPA does single-flight refresh-and-retry, falling back to SSO sign-in when the refresh token is dead.

Authorization (DB-backed RBAC):

  • Code-defined permission catalog + roles collection (role -> permissions, editable in Settings -> Roles), resolvePermissions + authorize(perm) per route.
  • AGENTOS_DEFAULT_ROLE / AGENTOS_BOOTSTRAP_ADMINS / AGENTOS_DEV_AUTH.

Ownership / tenancy:

  • Resources stamped with ownerGroup + ownerUser; strict canRead/canWrite hard isolation (creator or owner-group; admins see all).

Groups: read-only Settings -> Groups sourced from Keycloak Admin API.

API keys: carry roleIds (capability) and group (tenancy) orthogonally, with a mint-time escalation guard; harness introspection echoes both.

Routes: buildApp() composition, versioned /agentos/api/v1/* dashboard, nested agents router, trust-boundary groups (service / dashboard / observability), asyncHandler + standardized error envelope.

SPA:

  • AuthContext + useAuth; SSO-only LoginPage; design-system fix (body bg/fg).
  • New personalized-workspace home (KPI tiles + agents/sessions/schedules).
  • RBAC-gate every create/delete control across registry, sessions, schedules, policies, evals, and API keys.

Summary

Type of change

  • Bug fix (no API change)
  • New feature (additive — opt-in or new export, no existing-behavior change)
  • Breaking change (requires major version bump on affected packages)
  • Docs / CI / tooling only

Verification

  • pnpm -r build clean
  • pnpm -r typecheck clean
  • pnpm -r test clean (note any flaky tests in the comment)
  • If a plug-in: runConformanceSuite() passes (paste report below)

Versioning

  • pnpm changeset was run for any change to a published package
  • N/A — internal-only change

Notes for the reviewer

…, new home

Replace the shared-password gate with a full auth/authorization stack and
restructure the server routes.

Authentication (BFF):
- OIDC code+PKCE flow via Keycloak (Okta federated); tokens stay server-side,
  browser gets an httpOnly signed session-snapshot cookie. jose JWKS verify.
- Reactive token refresh: short session cookie + server-held rotating refresh
  token; POST /auth/refresh re-signs the session on 401. SPA does single-flight
  refresh-and-retry, falling back to SSO sign-in when the refresh token is dead.

Authorization (DB-backed RBAC):
- Code-defined permission catalog + roles collection (role -> permissions,
  editable in Settings -> Roles), resolvePermissions + authorize(perm) per route.
- AGENTOS_DEFAULT_ROLE / AGENTOS_BOOTSTRAP_ADMINS / AGENTOS_DEV_AUTH.

Ownership / tenancy:
- Resources stamped with ownerGroup + ownerUser; strict canRead/canWrite hard
  isolation (creator or owner-group; admins see all).

Groups: read-only Settings -> Groups sourced from Keycloak Admin API.

API keys: carry roleIds (capability) and group (tenancy) orthogonally, with a
mint-time escalation guard; harness introspection echoes both.

Routes: buildApp() composition, versioned /agentos/api/v1/* dashboard, nested
agents router, trust-boundary groups (service / dashboard / observability),
asyncHandler + standardized error envelope.

SPA:
- AuthContext + useAuth; SSO-only LoginPage; design-system fix (body bg/fg).
- New personalized-workspace home (KPI tiles + agents/sessions/schedules).
- RBAC-gate every create/delete control across registry, sessions, schedules,
  policies, evals, and API keys.
@abhi-bhat-lyzr abhi-bhat-lyzr merged commit 7269790 into deploy Jun 5, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant