fix(github): Handle GraphQL egress permissions#558
Merged
Conversation
Use the visible GitHub GraphQL request body to keep read-only POST queries on the installation-read grant while mutations, subscriptions, and unknown bodies continue to require user-write attribution. This prevents read-only gh issue list traffic from unnecessarily depending on requester OAuth credentials. Co-Authored-By: GPT-5 Codex <codex@openai.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
83f25ec to
eab0e57
Compare
Add a provider-owned egress response hook that preserves upstream responses by default and only rewrites when a plugin throws EgressAuthRequired. Use the hook in the GitHub plugin to annotate known GraphQL access errors returned in HTTP 200 response bodies, so failed commands receive a structured permission_denied signal without core GitHub special cases. Co-Authored-By: GPT-5 Codex <codex@openai.com>
eab0e57 to
dcd8317
Compare
Mask GraphQL string literals before classifying request operations so read queries with search text like mutation or subscription stay on installation-read credentials. Co-Authored-By: GPT-5 Codex <codex@openai.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6e61b5c. Configure here.
Classify the named GraphQL operation when operationName is provided so multi-operation documents cannot route a selected mutation through installation-read credentials. Co-Authored-By: GPT-5 Codex <codex@openai.com>
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 GraphQL egress now treats read-only query POSTs as installation-read and annotates GraphQL HTTP 200 access errors as permission_denied without rewriting provider responses. This keeps read commands on app installation credentials while preserving provider CLI output and giving Junior structured permission context when GitHub reports access failures in the response body.
Provider Response Hooks
Plugins can inspect response metadata and lazily read a bounded cloned body. Normal hook return preserves the original upstream response;
EgressAuthRequiredis the only response-hook path that rewrites to Junior's auth-required sentinel.GitHub GraphQL
The GitHub plugin owns all GraphQL response interpretation for
POST /graphql, classifying known access-shaped JSON errors such as repositoryNOT_FOUNDandResource not accessible by integrationas side-channel permission signals.Coverage
Integration coverage now exercises read-query installation tokens, mutation user-write auth, auth-required response-hook interruption, GraphQL access-error pass-through with
permission_denied, and successful GraphQL pass-through without a permission signal.