Skip to content

feat: add auth provider packages (cloud, workos, better-auth)#13172

Open
rphansen91 wants to merge 7 commits intoauth-rbac-core-serverfrom
auth-providers
Open

feat: add auth provider packages (cloud, workos, better-auth)#13172
rphansen91 wants to merge 7 commits intoauth-rbac-core-serverfrom
auth-providers

Conversation

@rphansen91
Copy link
Contributor

Summary

  • @mastra/auth-cloud (new): Mastra Cloud authentication with PKCE OAuth flow, session management, and role-based access control
  • @mastra/auth-workos (expanded): Full auth provider with SSO, RBAC, SCIM directory sync, and admin portal support
  • @mastra/auth-better-auth (expanded): Support for new EE auth interfaces (IUserProvider, ISessionProvider, ISSOProvider)

Context

PR 2 of 3 in the auth/RBAC split. Depends on #13163 (auth core + server RBAC). These are standalone auth provider packages — each is a self-contained npm package with its own tests.

PR 1 (Core + Server + Adapters) ──┬──> PR 2 (Auth Providers) ← this PR
                                   └──> PR 3 (UI + E2E)

Verification

  • cd auth/cloud && pnpm test — cloud auth tests pass
  • cd auth/workos && pnpm test — workos tests pass
  • pnpm build:packages — all packages build cleanly

🤖 Generated with Claude Code

Add standalone auth provider packages with RBAC support:
- @mastra/auth-cloud: PKCE OAuth flow, session management, and role-based access control for Mastra Cloud
- @mastra/auth-workos: Full auth provider with SSO, RBAC, SCIM directory sync, and admin portal
- @mastra/auth-better-auth: Expanded to support EE auth interfaces (IUserProvider, ISessionProvider, ISSOProvider)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@changeset-bot
Copy link

changeset-bot bot commented Feb 18, 2026

🦋 Changeset detected

Latest commit: 44c10f3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@mastra/auth-cloud Minor
@mastra/auth-workos Minor
@mastra/auth-better-auth Patch

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

@vercel
Copy link

vercel bot commented Feb 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mastra-docs-1.x Building Building Preview, Comment Feb 19, 2026 4:54am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
mastra-docs Skipped Skipped Feb 19, 2026 4:54am

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 18, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch auth-providers

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@socket-security
Copy link

socket-security bot commented Feb 18, 2026

No dependency changes detected. Learn more about Socket for GitHub.

👍 No dependency changes detected in pull request

rphansen91 and others added 4 commits February 18, 2026 14:16
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>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 18, 2026

🚨 Redirect Validation Failed

The redirect validation found issues in vercel.json (duplicate sources or broken destination links).

Action Required: Review and fix the redirect configuration.

📋 View workflow logs for details

authenticateToken used request.header() (Hono-specific) but the auth
middleware passes c.req.raw (standard Web Request). Use 'raw' in
request detection to unwrap HonoRequest, then read headers via the
standard request.headers.get() API — matching Cloud and WorkOS
providers which already do this correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel vercel bot temporarily deployed to Preview – mastra-docs February 19, 2026 04:54 Inactive
@vercel vercel bot temporarily deployed to Preview – mastra-docs-1.x February 19, 2026 04:54 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments