Skip to content

[log] Add debug logging to internal/oidc/azure.go - #17041

Merged
lpcox merged 1 commit into
mainfrom
log/azure-oidc-logging-af200c82c3efbfbd
Nov 22, 2026
Merged

lpcox merged 1 commit into
mainfrom
log/azure-oidc-logging-af200c82c3efbfbd

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Adds debug logging to the Azure OIDC provider (internal/oidc/azure.go) using logger.ForFile() (logAzure, namespace oidc:azure).

Logged events:

  • Provider creation and unsupported cloud names
  • Token cache hit/miss
  • Waiting on an in-flight refresh, and retry after the refresh leader is canceled
  • Successful refresh (lifetime and refresh-after interval)
  • Entra token exchange endpoint and non-200 status codes

Log arguments are plain values only, with no side effects. Tokens, assertions and client secrets are never logged.

Validation: go vet ./internal/oidc, go test ./internal/oidc and go build -o awmg all pass.

Generated by Go Logger Enhancement · copilot · routed: sonnet55 high · ~26 AIC · ⊞ 5.9K · ◷

@github-actions github-actions Bot added automation enhancement New feature or request labels Nov 21, 2026
@lpcox
lpcox marked this pull request as ready for review November 22, 2026 03:01
Copilot AI adaptive review requested due to automatic review settings November 22, 2026 03:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The review identifies no active issues, and the changes are confined to Azure OIDC debug observability without altering token acquisition, caching, refresh, or error handling.

No open issues 🎉

What changed in this PR

Adds debug-level observability to the Azure OIDC provider without changing token acquisition, caching, refresh, or error-handling behavior.

Changes:

  • Initializes the oidc:azure file logger.
  • Logs provider setup, cache activity, refresh coordination, and refresh timing.
  • Logs Entra token exchange endpoints and non-success HTTP statuses without logging tokens, assertions, or secrets.
File Description
internal/​oidc/​azure.go Adds Azure OIDC lifecycle, caching, refresh, and token-exchange debug logging.

Review effort: Lite (adaptive)

@github-actions

Copy link
Copy Markdown
Contributor Author

🔒 mcpg Read-Only Stress — default

Surface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Isolation runtime: default (normal container isolation)

Part Surface Op Result Expected Status
A MCP reads (list_issues, list_pull_requests, get_file_contents, list_commits) data returned ALLOWED ✅
B MCP writes (add_issue_comment/star_repository/issue_write/create_branch/create_or_update_file/create_pull_request) all 7 targets absent from the 23-tool catalog (gh-aw tools.github: always launches backend with GITHUB_READ_ONLY=1) BLOCKED ⚠️ INCONCLUSIVE — absence proves backend config, not gateway-level enforcement
C CLI reads via proxied github CLI data returned, matches Part A ALLOWED ✅
D CLI REST writes not attempted — gh auth status reports not logged in BLOCKED ⚠️ INCONCLUSIVE — no authenticated gh token in this environment
E CLI GraphQL mutations not attempted (same auth gap as D) BLOCKED ⚠️ INCONCLUSIVE

Overall: INCONCLUSIVE — no write leaked through mcpg in any surface tested. The only gaps are (1) all 7 Part B write-tool targets are structurally absent from the GitHub MCP tool catalog exposed via gh-aw's tools.github: (which forces GITHUB_READ_ONLY=1 on the backend regardless of mcpg), so gateway-level DIFC/guard write-blocking could not be independently exercised on the MCP surface in this run; and (2) gh CLI is unauthenticated in this job, so Parts D/E (REST + GraphQL write attempts) could not be run at all. No destructive or irreversible action was attempted. Independent confirmation of mcpg's own write-blocking layer remains covered by internal/guard/internal/difc unit tests and is tracked as follow-up work for a dedicated MCP-tool-level probe outside the tools.github: wrapper.

🔒 mcpg read-only stress (default AWF runtime) by Read-Only Stress: default runtime

@lpcox
lpcox merged commit 3ae3fe4 into main Nov 22, 2026
28 checks passed
@lpcox
lpcox deleted the log/azure-oidc-logging-af200c82c3efbfbd branch November 22, 2026 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants