Repository navigation
app/: auth::Principal, the auth seam for the Laravel Rust port (sc-8900) - #51
Merged
Merged
Conversation
…r, from the session or MCP OAuth token (with its client) or a personal (vcu_) or project (vci_) bearer token; Role, can(role, project), role_in, project_ids_visible, client() for attribution; InProject for the domain's models; users, identities, user_tokens, project_tokens and waitlist migrations; User and token models; GET /api/v1/whoami
ndbroadbent
force-pushed
the
laravel-auth
branch
from
December 2, 2026 12:45
9cd20a5 to
53b0d47
Compare
VisualCIdocspring/visualci · build #193 · 331 unchanged · no changes This PR vs base: nothing since #192, across 1 build Updated as builds change. Agents can review with VisualCI's MCP tools. |
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.
The auth seam for the Laravel Rust port (sc-8900), on top of the
app/scaffold (#50). This is whatvisualci featuresbuilds the API and MCP against.auth::Principal, an extractor any handler takes. It's a person or a project token. It's found from, in order:Authenticate::via::<OAuthTokens<…>>, whoseGrantnames the MCP client;vcu_…), which acts as its user;vci_…), for its project.Nobody found:
401.role_in(&impl InProject)reads the organization's membership. A project token is a member of its own project only.can(Role, &impl InProject).project_ids_visible().client()says what acted (web,mcpwith its client ID,tokenorproject_tokenwith the token's name), for review and upload attribution.InProject: the domain'sProjectmodel implements it (project ID and organization ID), so auth doesn't depend on those models.ProjectRefcovers callers that only have the IDs.PrincipalisAuthorizable, so policies can take it first.usersgainspid,avatar_url,staffandsignup_via(everyone signs in through a forge, sopasswordstays empty), plusidentities,user_tokens,project_tokensandwaitlist.project_tokens.project_idgets its foreign key once the domain tables exist.User,UserTokenandProjectToken. Tokens are stored as SHA-256 hex, the same as today's server.GET /api/v1/whoami: who the request acts for, and how.Tests (
app/tests/auth.rs):membershipstable until the domain migration lands), and a project token limited to its own project.Clippy and fmt are clean.