feat: add playground auth UI, permission gating, and E2E role tests#13173
feat: add playground auth UI, permission gating, and E2E role tests#13173rphansen91 wants to merge 8 commits intoauth-rbac-core-serverfrom
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 27c6a3a The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
SimpleAuth no longer requires TUser to extend EEUser, allowing any user type (bare strings, numeric ids, etc.). EE features (getCurrentUser, getUser) still work via duck typing at call sites. Also documents the intentional isProtectedPath default-allow behavior since all routes are already auth-checked via registerRoute/checkRouteAuth. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Mermaid diagram covering the full auth/RBAC flow from PR #13163: request lifecycle, core middleware, permission enforcement, provider composition, interfaces, and license gating. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Documents the three route categories (built-in, custom API, non-API), default auth config, the full request auth flow as a mermaid diagram, isProtectedPath behavior, and permission derivation conventions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Service tokens need a role property so MastraRBACCloud can resolve permissions via roleMapping. Use role: 'api' to map to the existing api role which grants read/write/execute access. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The playground package is named @internal/playground, not @mastra/playground. Remove it from the changeset since it's not published to npm. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
usePermissions()hook across all table views and tool panelsexamples/agent/When no auth is configured,
usePermissions()returns permissive defaults — fully backward compatible.Context
PR 3 of 3 in the auth/RBAC split. Depends on #13163 (auth core + server RBAC). Independent of PR 2 (auth providers).
Verification
pnpm build:packages— playground-ui and playground buildusePermissions()returns permissive defaults when no auth configuredcd packages/playground && pnpm exec playwright test e2e/tests/auth/🤖 Generated with Claude Code