Commit d61f10e
authored
[log] oidc: add debug logging to provider.go (#4246)
Adds `logOIDC` debug logging calls to `internal/oidc/provider.go` to
improve traceability for OIDC token lifecycle operations.
## Changes
**File modified:** `internal/oidc/provider.go` (4 new log calls)
| Location | Log call | Purpose |
|---|---|---|
| `NewProvider` | `logOIDC.Printf("Creating OIDC provider:
requestURL=%s, hasToken=%v", ...)` | Log provider initialization |
| `fetchToken` | `logOIDC.Printf("OIDC token HTTP response: status=%d,
bodyLen=%d", ...)` | Log HTTP response before error check |
| `extractJWTExpiry` | `logOIDC.Printf("Parsing JWT expiry:
partCount=%d, payloadLen=%d", ...)` | Log JWT parsing entry point |
| `extractJWTExpiry` | `logOIDC.Printf("JWT expiry parsed: exp=%d,
expiresAt=%s", ...)` | Log successful expiry extraction |
The `extractJWTExpiry` function previously had zero debug visibility —
these additions make it much easier to diagnose JWT parsing failures and
token expiry edge cases.
## Existing logger reused
The file already declares `var logOIDC = logger.New("oidc:provider")` —
no new logger was added.
Enable with: `DEBUG=oidc:* ./awmg --config config.toml`
## Validation
- `go build ./...` ✅
- `go vet ./...` ✅
- `go test ./internal/oidc/...` ✅ (all 10 tests pass)
- `go test ./internal/...` ✅ (one pre-existing unrelated failure in
`internal/config`)
> [!WARNING]
> <details>
> <summary><strong>1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
| 130 | + | |
129 | 131 | | |
130 | 132 | | |
131 | 133 | | |
| |||
161 | 163 | | |
162 | 164 | | |
163 | 165 | | |
| 166 | + | |
| 167 | + | |
164 | 168 | | |
165 | 169 | | |
166 | 170 | | |
| |||
186 | 190 | | |
187 | 191 | | |
188 | 192 | | |
189 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
190 | 196 | | |
0 commit comments