refactor: deduplicate OIDC auth env var mappings via shared constant - #5640
Conversation
Add OIDC_AUTH_ENV_MAPPING and OIDC_AUTH_ENV_VARS to api-proxy-env-constants.ts as the single source of truth for the config-field↔env-var relationships. Updated consumers: - build-config.ts: uses OIDC_AUTH_ENV_MAPPING to populate config from env/options - api-proxy-env-config.ts: uses OIDC_AUTH_ENV_VARS for pickEnvVars and OIDC_AUTH_ENV_MAPPING for config→env projection This eliminates ~40 repeated env/config mappings on the credential path. Closes #5621 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (2 files)
Coverage comparison generated by |
There was a problem hiding this comment.
Pull request overview
This PR reduces duplication on the API-proxy/OIDC credential path by introducing a shared mapping for OIDC auth config fields ↔ environment variables, then reusing that mapping when (1) building WrapperConfig and (2) projecting config/env into the api-proxy sidecar environment.
Changes:
- Add shared OIDC auth descriptors (
OIDC_AUTH_ENV_MAPPING) and derived env var list (OIDC_AUTH_ENV_VARS). - Refactor
build-config.tsto populate OIDC-relatedWrapperConfigfields from env/CLI using the shared mapping. - Refactor
api-proxy-env-config.tsto forward OIDC env vars and apply config→env overrides using the shared mapping.
Show a summary per file
| File | Description |
|---|---|
src/api-proxy-env-constants.ts |
Introduces shared OIDC auth mapping/constants to serve as a single source of truth. |
src/commands/build-config.ts |
Uses the shared mapping to assemble OIDC-related config fields from CLI/env inputs. |
src/services/api-proxy-env-config.ts |
Uses the shared mapping/list to forward OIDC env vars and apply config-file overrides when building sidecar env. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Low
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
✅ Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓 |
|
✅ Smoke Claude passed |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅ |
|
✅ Build Test Suite completed successfully! |
|
🔌 Smoke Services — All services reachable! ✅ |
|
✅ Contribution Check completed successfully! Contribution guidelines check complete for PR #5640: all applicable CONTRIBUTING.md requirements appear satisfied; no comment needed. |
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
✅ Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓 |
|
✅ Smoke Gemini completed. All facets verified. 💎 |
|
🚀 Security Guard has started processing this pull request |
Smoke Test: Claude Engine Validation
Overall result: PASS
|
🔥 AWF Smoke Test — Auth mode: PAT (COPILOT_GITHUB_TOKEN)
Overall: PASS cc @lpcox
|
Smoke Test: Copilot BYOK ✅
Status: PASS | Mode: Direct BYOK cc @lpcox
|
🔥 Smoke Test Results — PR #5640PR: refactor: deduplicate OIDC auth env var mappings via shared constant
Overall: PASS (2/2 verifiable tests passed)
|
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
|
|
refactor: deduplicate OIDC auth env var mappings via shared constant 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.
|
🔭 Smoke Test: API Proxy OpenTelemetry Tracing
All scenarios pass. OTEL tracing integration is fully implemented and tested. This PR's OIDC refactor does not affect the OTEL code paths.
|
Chroot Version Comparison Results
Overall: ❌ Not all tests passed — Python and Node.js versions differ between host and chroot environment.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Gemini Engine 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.
|
|
refactor: deduplicate OIDC auth env var mappings via shared constant MCP connectivity: ✅ Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) Overall: PASS CC @lpcox
|
Smoke Test: Services Connectivity
Overall: FAIL All checks timed out. The AWF agent container (
|
Summary
Eliminate ~40 repeated OIDC env/config mappings between
build-config.tsandapi-proxy-env-config.tsby introducing a sharedOIDC_AUTH_ENV_MAPPINGconstant.Changes
src/api-proxy-env-constants.ts: AddedOIDC_AUTH_ENV_MAPPING(config field ↔ env var pairs) andOIDC_AUTH_ENV_VARS(env var name array)src/commands/build-config.ts: Uses mapping to generate config from env/optionssrc/services/api-proxy-env-config.ts: UsesOIDC_AUTH_ENV_VARSforpickEnvVars()andOIDC_AUTH_ENV_MAPPINGfor config→env projectionBenefits
Testing
Closes #5621