Refactor Azure OIDC provider to inherit shared token lifecycle from BaseOidcTokenProvider#3243
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the Azure OIDC token provider to reuse the shared BaseOidcTokenProvider lifecycle used by other OIDC providers, reducing duplicated initialization, shutdown, readiness, retry, and refresh scheduling logic.
Changes:
- Makes Azure
OidcTokenProviderextendBaseOidcTokenProvider. - Keeps Azure-specific token exchange and cached-token behavior behind base lifecycle hooks.
- Adds a regression test covering shutdown behavior before emergency refresh.
Show a summary per file
| File | Description |
|---|---|
containers/api-proxy/oidc-token-provider.js |
Refactors Azure OIDC provider to inherit shared lifecycle behavior and implement Azure-specific hooks. |
containers/api-proxy/oidc-token-provider.test.js |
Adds coverage ensuring getToken() after shutdown does not trigger a refresh. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
🔬 Smoke Test: Copilot BYOK (Offline) Mode
Running in BYOK offline mode ( Overall: FAIL — workflow template variables (
|
🔬 Smoke Test Results
Overall: FAIL — Pre-step outputs were not substituted into the workflow prompt. The smoke-data step likely did not run or its outputs were not passed to this job.
|
Smoke Test Results❌ Test 1 - GitHub API: FAIL (HTTP 401: authentication unavailable in sandbox) Overall: PARTIAL (2/3 passed)
|
Smoke TestPRs: fix: use gh CLI for reliable API access in issue duplication detector; Codex: remove Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
Chroot Smoke Test Results
Overall: ❌ FAILED — Python and Node.js versions differ between host and chroot.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Smoke Test: Gemini Engine Validation
Overall status: FAIL Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "localhost"See Network Configuration for more information.
|
Smoke Test: GitHub Actions Services Connectivity
Overall: FAIL —
|
OidcTokenProvider(Azure) had drift-prone duplicated lifecycle logic (initialize, readiness checks, shutdown, refresh scheduling, retry/sleep/state) already centralized inBaseOidcTokenProvider. This change aligns Azure with AWS/GCP by moving Azure onto the same base lifecycle path and keeping only Azure-specific token exchange behavior.Lifecycle consolidation
OidcTokenProvidernow extendsBaseOidcTokenProvider(super('oidc', config)).initialize(),isReady(),shutdown(),_scheduleRefresh(),_sleep()Azure-specific logic preserved via base hooks
_doRefresh()→ delegates to existing_refreshToken()_getCachedValue()→ returns_cachedToken_getInitSuccessLogContext()/_getInitFailureLogContext()for Azure log fields.Behavioral guard for shutdown semantics
shutdown().