Refactor API proxy providers to share OIDC/static auth adapter scaffold - #6608
Conversation
There was a problem hiding this comment.
Pull request overview
Centralizes duplicated OIDC/static-auth adapter construction while preserving provider-specific behavior.
Changes:
- Adds a shared OIDC-aware adapter factory.
- Migrates OpenAI, Anthropic, and Copilot providers.
- Adds focused factory tests for static and OIDC authentication paths.
Show a summary per file
| File | Description |
|---|---|
containers/api-proxy/adapter-factory.js |
Adds the shared adapter scaffold. |
containers/api-proxy/adapter-factory.test.js |
Tests static and OIDC factory behavior. |
containers/api-proxy/providers/openai.js |
Migrates OpenAI to the shared factory. |
containers/api-proxy/providers/anthropic.js |
Migrates Anthropic while retaining custom headers and responses. |
containers/api-proxy/providers/copilot.js |
Migrates Copilot while retaining dual-auth behavior. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Medium
|
✅ Copilot review passed with no inline comments. @copilot Add the |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
|
✅ Smoke Claude passed |
|
✅ Smoke Gemini completed. All facets verified. 💎 |
|
🔌 Smoke Services — All services reachable! ✅ |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ |
|
📰 VERDICT: Smoke Docker Sbx has concluded. All systems operational. This is a developing story. 🎤 |
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 |
|
✅ Contribution Check completed successfully! Contribution check complete — PR #6608 appears to follow the applicable guidelines in CONTRIBUTING.md. It includes targeted tests for the new shared adapter path, references related issue #6598, and keeps new code in the correct containers/api-proxy location. No comment needed. |
|
❌ Security Guard failed. Please review the logs for details. |
|
✅ Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓 |
|
✅ Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓 |
|
✅ Build Test Suite completed successfully! |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅ |
🤖 Smoke Test Results
Overall: PASS (core engine functional)
|
Smoke Test: Copilot BYOK (Direct) Mode ✅Test Results:
Status: PASS — Direct BYOK mode confirmed working
|
|
Smoke test: Copilot Network Isolation Egress Enforcement — EGRESS_RESULT allow=pass deny=pass
Overall: PASS Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "example.com"See Network Configuration for more information.
|
Smoke Test: Claude Engine Validation
Overall result: PASS ✅
|
Chroot Version Comparison Results
Overall: ❌ FAILED — Node.js version mismatch (host: v24.18.0, chroot: v22.23.1).
|
Smoke Test Results
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: API Proxy OpenTelemetry Tracing
Result: All scenarios pass. OTEL tracing integration is functional — module loads, spans are created with correct attributes (GenAI semantic conventions), env vars are forwarded,
|
|
✅ [Test Coverage] src/upstream-proxy.ts – port-out-of-range branch Overall: FAIL 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.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
|
Smoke Test Results for Direct BYOK Mode (Azure OpenAI, Foundry):
Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) Overall: FAIL
|
|
Running in direct BYOK mode (AWF_AUTH_TYPE=github-oidc + AWF_AUTH_AZURE_* + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) authenticated via Microsoft Entra Overall: PASS
|
🔍 Smoke Test: Docker Sbx Validation
Overall status: PARTIAL / INCONCLUSIVE
|
Smoke Test Results — Services Connectivity
Overall: FAIL —
|
OpenAI, Anthropic, and Copilot adapters were independently rebuilding the same OIDC/static-auth bootstrap path (auth scaffold, OIDC header strategy wiring, adapter method composition, and provider adapter assembly). This duplicated security-sensitive credential-selection behavior across three modules and increased drift risk.
Problem surface reduced
Shared scaffold extraction
createOidcAwareProviderAdapter(...)incontainers/api-proxy/adapter-factory.js.createProviderOidcHeaderStrategy)isEnabled, OIDC provider accessors)createAdapterMethods(...)+buildProviderAdapter(...)compositionProvider migrations
providers/openai.jsproviders/anthropic.jsproviders/copilot.jsFocused coverage for new shared path
containers/api-proxy/adapter-factory.test.jswith targeted tests for:getAuthHeaderspath and runtime method exposure