Repository navigation
[log] Add debug logging to OIDC provider error paths - #16485
Conversation
Co-authored-by: Copilot <[email protected]>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
Two OIDC logging sites can expose JWTs or echoed credentials by writing response-body errors to debug stderr without secret sanitization.
1 open issue
What changed in this PR
Adds debug diagnostics to the GitHub Actions OIDC token provider, reusing the existing logOIDC logger without changing token acquisition or caching behavior.
Changes:
- Logs token acquisition, HTTP request, and response-processing failures.
- Adds diagnostics for malformed JWTs and missing expiry claims.
| File | Description |
|---|---|
internal/oidc/provider.go |
Adds seven debug log calls across token acquisition and JWT expiry parsing. |
Review effort: Max (dynamic)
| } | ||
| body, err := httputil.ReadResponseBodyStrict(resp, http.StatusOK, "OIDC token request") | ||
| if err != nil { | ||
| logOIDC.Printf("OIDC token response rejected: audience=%s, err=%v", audience, err) |
There was a problem hiding this comment.
Updated in 0850394: the response-rejection log now includes only the audience and HTTP status, and the acquisition-failure log omits the raw error.
|
@copilot address review feedback |
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE No write leaked through mcpg in this run. Part B is
|

Adds 7 debug log calls to
internal/oidc/provider.go, reusing the existinglogOIDClogger (oidc:provider).New logs cover previously silent failure paths:
TokenfetchTokenfetchTokenexpclaim inextractJWTExpiryLog arguments contain only the audience, error, and lengths, with no side effects. The token value, request token, and JWT payload are never logged.
Validation:
go vet ./internal/oidc,go test ./internal/oidcandgo build -o awmgall pass.Candidates were limited to files not yet in the cache. Most unlogged files are in packages that
internal/loggerimports (util,sanitize,syncutil,tty), so adding logging there would create import cycles. That leftoidc/provider.go.