Skip to content

app/: the OAuth server for MCP clients (sc-8900) - #57

Merged
ndbroadbent merged 4 commits into
mainfrom
laravel-oauth
Dec 2, 2026
Merged

ndbroadbent merged 4 commits into
mainfrom
laravel-oauth

Conversation

@ndbroadbent

Copy link
Copy Markdown
Member

Stacked on #55. It wires oauth-provider-laravel for the MCP server, configured like today's server.

  • OAuthServiceProvider uses our own Users provider. The service name is "VisualCI", and issued tokens are prefixed vca_ (access), vcr_ (refresh) and vcs_ (client secrets), as today, distinct from personal (vcu_) and project (vci_) tokens.
  • The issuer and resource come from OAUTH_ISSUER and OAUTH_RESOURCES at deploy time: the app's URL and <mcp url>/mcp.
  • GET /login is the page the consent step's Authenticate sends a signed-out person to: one link each for GitHub and GitLab. After sign-in they come back to the consent page through url.intended.
  • auth::oauth::Tokens is the guard for the MCP routes, for visualci features: .middleware(RequireToken::new()).middleware(Authenticate::via::<auth::oauth::Tokens>()).
  • mcp scope only for now. Today's admin scope must go to staff alone, and the package's consent step grants whatever a client asks for. It needs a consent hook in oauth-provider-laravel before the admin endpoint moves over.
  • The package's own consent page view is used until the web app's is ported.

Test: the authorization server's metadata answers, and the consent page sends a signed-out person to /login, which offers GitHub sign-in. All 17 app tests pass, and clippy is clean.

@visualci-com

visualci-com Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

VisualCI

docspring/visualci · build #287 · 331 unchanged · no changes

This PR vs base: 2 changed since #204, across 7 builds

Updated as builds change. Agents can review with VisualCI's MCP tools.

…vel with our Users provider, the service name VisualCI, today's vca_/vcr_/vcs_ prefixes and the mcp scope; GET /login (the page Authenticate sends a signed-out person to, with GitHub and GitLab sign-in) and sign-in back to the page that sent them (url.intended); auth::oauth::Tokens for the MCP routes' guard
… are the MCP host's and the consent page the app host's /oauth/authorize, as today's server (OAUTH_ISSUER, OAUTH_AUTHORIZATION_ENDPOINT, from oauth-provider-laravel at DocSpring/oauth-provider-laravel-rs#1 until its release); production won't boot when they don't match the hosts; a token's subject (and the session's ID) is the person's pid, never their row ID; tested with all four hosts
@ndbroadbent
ndbroadbent merged commit a61f6ff into main Dec 2, 2026
11 checks passed
@ndbroadbent
ndbroadbent deleted the laravel-oauth branch December 2, 2026 15:18
ndbroadbent added a commit that referenced this pull request Dec 2, 2026
…rgo couldn't read the manifest and main's app job failed)
ndbroadbent added a commit that referenced this pull request Dec 2, 2026
… (sc-8900) (#58)

* Auth review follow-ups (sc-8900): /auth/session as today (name, avatar, the one organization) with CORS for the site's exact origin alone and no-store; /auth/providers lists the configured forges; tokens' last_used_at written at most once a minute; a project token stays a member of its own project (can review, as today), documented and tested

* Sign-in, review fixes: the site's signed-in hint (vci_signed_in, plain and readable by its script, on the site's domain) is set at sign-in, renewed or cleared by /auth/session and cleared at logout, as today's; /auth/providers and /login offer a forge only when its OAuth application has its ID and its secret

* Test: OAuth discovery expects the tests' APP_URL (https://app.visualci.test, since #59)

* app/Cargo.toml: one tracing entry (#57's merge listed it twice, so cargo couldn't read the manifest and main's app job failed)
ndbroadbent added a commit that referenced this pull request Dec 2, 2026
ndbroadbent added a commit that referenced this pull request Dec 2, 2026
)

* app/: the person's own page (sc-8900): GET /api/ui/me (who they are, their organizations and roles, pending invitations, email choices, the heard-about question), email choices, an organization's billing email (admins), 'How did you hear about VisualCI?'; the team's email about each new sign-up through the outbox (reply-to the person), once answered or ten minutes after sign-up, every minute with a heartbeat (VISUALCI_SIGNUPS_HEARTBEAT) that fails when one waits over 40 minutes

* Me, review fixes: /me says which forges people can sign in with (an OAuth application with its ID and secret), as today's; staff who aren't in an organization can't change its billing email; the sign-ups heartbeat fails when the database can't answer

* Test: a signed-out /api/ui/me asks for JSON, as the React app does (a page request goes to /login since #57)

* /me: each organization's usage (plan, credits this month, packs, reloads, the open source pool) from the domain's credits::usage, as today's (#71); the sc-8900 gate

* Rebased on main: Cargo.lock resolved from main's, and the boot checks and dependencies merged
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