git-remote-entire: stamp HTTP User-Agent on outbound requests

main

Commit

pjbgf3mo ago

The helper already advertises itself via the git protocol pkt-line agent= capability (commit-stamped), but every HTTP request it makes — info/refs, upload-pack/receive-pack POSTs, well-known discovery, STS exchanges, refresh-token rotations — went out with Go's default "Go-http-client/1.1", making the helper invisible in upstream access logs and indistinguishable from any other Go client hitting the data plane.

Add httpclient.UserAgentTransport, a small RoundTripper wrapper that stamps User-Agent on each outbound request, and wire it into both the auth-side *http.Client and the transport.Proxy so every credentialled hop from the helper carries "git-remote-entire/<version>". The wrapper sits outside the httpdebug RoundTripper so the debug log captures the same headers the wire sees. UserAgent on transport.Config is optional — empty falls back to Go's default, which keeps the existing tests that don't care about identity working unchanged.

Format is version-stamped (binary/version) to match the conventional form the rest of the entire HTTP clients use; the git protocol agent stays commit-stamped where it is, since the two serve different correlation needs and changing it risks breaking server-side log analysis.

Assisted-by: Claude Opus 4.7 noreply@anthropic.com Signed-off-by: Paulo Gomes paulo@entire.io Entire-Checkpoint: 77b0105f5529

Checkpoints

Add User Agent to Git Remote Helper

Claude CodeOpus 4.7[1m]
View session
Checkpoint 1