Repository navigation
feat(upstreams): an OAuth app's client secret, for GitHub (ADR-0069 addendum) - #381
Merged
Merged
Conversation
…ddendum) GitHub's MCP server names its authorization server, but GitHub registers no clients itself and wants a client secret at its token endpoint even with PKCE. An OAuth upstream may now carry one with its client id: - the hub sends it only to the token endpoint (code exchange, refresh); - the user's own goes into the keychain (`<name>#client`), never into upstreams.toml; reads answer `client_secret: true`; - a pool may name one: members' hubs get it with the list, the dashboard, the CLI and the audit log only say that one is set; - an edit without one keeps it, an empty one takes it away; - `devstack pool upstreams add --client-secret … --scope …`, and the dashboard's forms gained the client secret and the scopes. A token endpoint answering `200` with an `error` (GitHub) is a refusal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 30, 2026
Merged
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.
GitHub's MCP server (
api.githubcopilot.com/mcp) names its authorization server (github.com/login/oauth, PKCE S256), but GitHub registers no clients itself (noregistration_endpoint) and wants a client secret at its token endpoint even with PKCE. The hub sent none, so a pool'sgithubupstream could only log in with a token. This lets an OAuth upstream carry a client secret.Review card
Approved by the owner in the conversation on 2026-10-30: all four points.
ghCLI), and the hub sends it only to the token endpoint the upstream's metadata names (code exchange and refresh).upstreams.toml; the API takes it and only ever answers whether one is set.GET /v1/upstreams), their hubs keep it with the pool's list, and the dashboard, the CLI and the audit log show only that one is set. This is the one exception to "a pool's list holds no secret".auth: {kind: "oauth", client_id?, client_secret?, scopes?}on write; reads answerclient_secret: trueinstead of the value; an edit without a secret keeps the one set;devstack pool upstreams add --client-secret … --scope ….Decided on my own: the stored login keeps the secret for its refresh;
--scopein the CLI (a GitHub OAuth app without scopes gets public read access only); members' hubs keep a pool's secret inpool-upstreams.jsonbeside the list (point 1: not confidential); logging out keeps the client secret, removing the upstream or leaving OAuth drops it (keychain entry<name>#client); a secret is up to 1024 characters without spaces; an empty string (orfalse) takes it away. Found while building: GitHub refuses at its token endpoint with200and anerror, so any answer with anerroris now a refusal with that reason. The dashboard forms gained the scopes too: until now an edit there dropped them.What changed
devstack-node/src/upstreams.rs:PoolAuth::Oauth.client_secret;putkeeps it across a change without one;PoolUpstream::redacted()for anything that shows the list.devstack-hub/src/upstreams.rs:ClientSecret(serialises astrue,Debugredacted); the user's own secret in the keychain; sent with the code exchange and the refresh; token answers witherrorrefused.devstack-hub/src/pool.rs:/hub/pool/upstreamsanswers redacted.devstack pool upstreams add --client-secret … --scope …; the list says "a client secret" and the scopes.dashboard-api.md,pool.md(the GitHub recipe), ADR-0069 addendum 2026-10-30.Compatibility
githubentry can carry a secret.Tests
cargo clippy --workspace --all-targets -D warningsandcargo fmt --checkclean.cargo test -p devstack-hub -p devstack-node -p devstackgreen. New tests:upstreams.toml, the views orDebug;200with anerroris a refusal;vue-tscand vitest green (newoauthAuth.test.ts).🤖 Generated with Claude Code