Repository navigation
feat(oauth): the vault's /git as a second OAuth audience (CONTINUE-PUSH-NON-SLIP-SELECTION, server) - #10026
Open
olety wants to merge 3 commits into
Open
feat(oauth): the vault's /git as a second OAuth audience (CONTINUE-PUSH-NON-SLIP-SELECTION, server)#10026olety wants to merge 3 commits into
olety wants to merge 3 commits into
Conversation
… door CONTINUE-PUSH-NON-SLIP-SELECTION (lead ruling B, Sat 21 Nov 04:3x): a second OAuth audience. A sign-in naming /mcp and /git pushes with stock git through the git door, its access token one static header, once the owner granted its agent git_push on the repo; its refreshed token pushes again. A sign-in naming /mcp alone (every ChatGPT or Claude connector) reaches no smart-HTTP or LFS request; one naming /git alone reaches no MCP endpoint; a read-tier one is refused at the push gate for want of core:write. /git serves its own RFC 9728 document. An authorize request naming a resource twice, or another, is sent back with invalid_target. Red on main: the authorize door takes one resource, so every sign-in naming /git is refused and /.well-known/oauth-protected-resource/git is 404.
CONTINUE-PUSH-NON-SLIP-SELECTION (lead ruling B, Sat 21 Nov 04:3x: "only a
token that asked for git may push, through the same git_push permission
check as today; tokens for ChatGPT or Claude connectors still reach
nothing else"), the server part.
- One sign-in may name several RFC 8707 resources, each one of the
vault's own (`ProtectedResource`: {origin}/mcp, {origin}/git) and none
twice; any other answers invalid_target. The authorize door reads its
query as pairs, so `resource` may repeat while every other parameter
still comes once.
- The request, its code and its token family keep every resource named:
`resource` stays the first, `further_resources` holds the rest
(#[serde(default)], skipped when empty). Stored change: keep: every
held row decodes and reads as before, and a row naming one resource
encodes as before. A token request's resource must be one the sign-in
named; a token resolves only on a resource its sign-in named.
- The binding door's swap (FIX 4902 slice C) also runs at the git door,
/git/{repo}/ then info/refs, git-upload-pack, git-receive-pack or
info/lfs/... (a lease's door is none): a bearer OAuth access token that
resolves on /git goes on as the slip the server holds for it with a
fresh holder proof per request, so stock git pushes with the token as
one static header. The gate (core:write, unrestricted record scope,
registered principal) and the git_push admission are unchanged; the
owner grants the sign-in's agent git_push as any holder. A token that
does not resolve answers 401 invalid_token naming the /git metadata, in
the door's own refusal shape.
- GET /.well-known/oauth-protected-resource/git serves /git's document;
the managed route table lists it as public.
- The owner's ask names the resources the sign-in asks.
|
Automatic reviews are disabled for this repository. Configure in Code Review Settings. |
|
Warning Review limit reached
This review includes 14 billable files and costs up to $3.50.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 37 minutes for your next included review. View limit details
|
…n text Review #10026 round 1 P1: a token that does not resolve at `/git/{repo}/info/refs`, `git-upload-pack` or `git-receive-pack` answered the binding door's JSON error, while the git gate answers a request it does not authenticate in plain text, which a git client shows. Smart HTTP now answers 401 (or 500 when the token could not be judged) as plain text, with the same `WWW-Authenticate` challenge; the LFS door keeps its JSON envelope. The served test asserts both. The test's registered redirect URI, which nothing listens on, carries the fixed-port lint's allow with its reason (ratchet test_lint_fixed_port back to 123).
This branch has not been deployed
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.
[CONTINUE-PUSH-NON-SLIP-SELECTION] PR 1 of 2: the vault's
/gitas a second OAuth audience (server)Lead ruling CONTINUE-PUSH-NON-SLIP-SELECTION = B (Sat 21 Nov 04:3x): "a second door audience.
oneiron hosted loginasks for both MCP and git; only a token that asked for git may push, through the same git_push permission check as today; tokens for ChatGPT or Claude connectors still reach nothing else."This PR is the server part. No client names
/gityet, so nothing changes for any existing client. PR 2 (the CLI:hosted loginnames both resources, andcontinue --cloudpushes on an OAuth selection) follows, after the open ASK CONTINUE-PUSH-GIT-TIER on the tierhosted loginasks for.What changes
/oauth/authorizetakesresourceseveral times. Each value must be one of the vault's own (ProtectedResource:{origin}/mcp,{origin}/git), and none may repeat; any other answersinvalid_target, as before. The query is read as pairs, so every other parameter still comes at most once (a repeat still reads as no request).PendingAuthorization,IssuedCodeandTokenFamilykeepresource(the first named) and gainfurther_resources(the rest;#[serde(default, skip_serializing_if = "Vec::is_empty")]). A token request'sresourcemust be one the sign-in named.resolve_oauth_access_tokenresolves a token only on a resource its sign-in named (TokenFamily::names_resource, exact match).mcp_gateway::oauth_call) also runs at/git/{repo}/+info/refs|git-upload-pack|git-receive-pack|info/lfs/.... A lease's door is excluded, since a lease is its own credential. A bearer OAuth access token that resolves on/gitgoes on as the slip the server holds for it, with a fresh holder proof on each request. So stock git can push with the token as one static header: the several requests of one push each get their own proof. The git gate (core:write, an unrestricted record scope, a registered principal) andgit_pushadmission are unchanged. The owner grants the sign-in's agentgit_pushwithvault.repo.git_push.mint, as for any holder (the agent is a live PERSON). A token that does not resolve answers 401 withWWW-Authenticate: Bearer error="invalid_token", resource_metadata="{origin}/.well-known/oauth-protected-resource/git", in the door's own body shape (text for smart-HTTP, the envelope for LFS).GET /.well-known/oauth-protected-resource/gitserves/git's RFC 9728 document, which names the same authorization server./mcp's document and the bare path are unchanged. The managed route table lists the new path as public.resources).Who may do what (substrate behind grants)
No new verb. The push is the same
git_pushadmission every slip push passes. A token of a sign-in that named/mcpalone (every ChatGPT or Claude connector) resolves at no git door, and one that named/gitalone resolves at no MCP endpoint.Stored change: keep
Every held row decodes and reads as before: the three side tables are
Named(msgpack maps), and the new field defaults to empty. A row naming one resource encodes byte for byte as before. NoSTORAGE_ABI_VERSIONchange.Tests (
crates/oneiron-server/tests/oauth_git_audience_served.rs, red on main at cc50edb, green on the head)a_sign_in_naming_git_pushes_through_the_git_door: sign in with/mcp+/gitat full, the owner mintsgit_push, stockgit pushwith one static bearer header lands; the refreshed token pushes again.a_sign_in_naming_mcp_alone_reaches_no_git_door: receive-pack and upload-pack advertisements and the LFS batch answer 401invalid_tokennaming/git's metadata; stock git push lands nothing.a_token_reaches_mcp_only_when_its_sign_in_named_it: the/mcp+/gittoken handshakes at/mcp; a/git-only token gets 401invalid_tokenat/mcpand/mcp/tool-first.a_read_tier_git_sign_in_is_refused_at_the_push_gate: 403insufficient scopewith a Grant, the same gate as every slip.the_git_resource_serves_its_metadata.a_sign_in_naming_a_resource_twice_or_another_is_refused:invalid_target.Run:
RUSTFLAGS="--cfg oneiron_test_support" cargo test --locked -p oneiron-server --all-features --features oneiron/test-support --test oauth_git_audience_served(stockgitwithhttp-backendon PATH). The proofs are booked after the merge.