fix(git-http): log access-hook denial detail to stdout #161
Reference in New Issue
Block a user
Delete Branch "fix-git-http-log-403-detail"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
When the access-hook returned non-zero, git-http piped its stderr into the 403 body sent back to the agent's git client but never logged it locally. Operators saw
"GET /repo.git/info/refs?... 403 -"indocker logswith no explanation and had to shell into the sidecar to re-run the hook by hand.This change routes the hook's stderr/stdout through the existing
log_messagechannel before sending the 403:Why now
Surfaced today while diagnosing a failed clone from inside a claude-dev bottle. Docker showed only
403 -; the actual cause (ssh: connect to host gitea.dideric.is port 30009: Connection refusedfrom the access-hook's upstream fetch) was only visible after manually invoking/etc/git-gate/access-hookinside the sidecar.Test plan
pytest tests/unit/test_git_http_backend.py— 8/8 pass, including two new teststest_access_hook_denial_is_logged_to_stdout— stderr message appears on stdout and in 403 bodytest_access_hook_denial_without_output_logs_exit_code— empty-output denials still log the exit codetest_smolmachines_pty_resizestdin failure): 867 pass🤖 Generated with Claude Code
b5b694acb8tof427d35e72