feat(agentos): OIDC/Keycloak auth, DB-backed RBAC, ownership, refresh new home#26
Merged
Merged
Conversation
…, 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the shared-password gate with a full auth/authorization stack and restructure the server routes.
Authentication (BFF):
Authorization (DB-backed RBAC):
Ownership / tenancy:
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:
Summary
Type of change
Verification
pnpm -r buildcleanpnpm -r typecheckcleanpnpm -r testclean (note any flaky tests in the comment)runConformanceSuite()passes (paste report below)Versioning
pnpm changesetwas run for any change to a published packageNotes for the reviewer