prevent write actions in the Git handler - #220
Open
jakecoffman wants to merge 4 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Restricts proxy-provided Git credentials to read-only operations.
Changes:
- Blocks Git write requests with a clear 403 response.
- Allows upload-pack and LFS downloads.
- Adds coverage for Git and GitHub API request methods.
Show a summary per file
| File | Description |
|---|---|
internal/handlers/github_api_test.go |
Tests read-only API authentication. |
internal/handlers/git_server.go |
Classifies and blocks write operations. |
internal/handlers/git_server_test.go |
Tests allowed, blocked, and retry behavior. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 3/3 changed files
- Comments generated: 3
- Review effort level: Balanced
jakecoffman
marked this pull request as ready for review
August 21, 2026 14:36
jeffwidman
approved these changes
Aug 21, 2026
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.
What are you trying to accomplish?
We never give Dependabot write access tokens in production, however someone else may be using this Proxy and not realize the danger. So we can block write actions in the handler to make it safer.
I would still suggest giving read-only tokens to the proxy just-in-case, but the objective of this Proxy is to make it safe to run external code, so any write actions should be blocked.
Anything you want to highlight for special attention from reviewers?
I'm adding a specific message when blocking the request so if somehow this does cause any production issues, customers will find this PR:
How will you know you've accomplished your goal?
I have run an interactive test locally with a real Git server and is successfully blocks all the write attempts I made.
Checklist