You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pattern: Provider environment variable constants are manually maintained in both the TypeScript host code and the CommonJS api-proxy container code. The files even document that they must be kept in sync.
Locations: src/api-proxy-env-constants.ts lines 8-39 and containers/api-proxy/provider-env-constants.js lines 10-41.
Impact: About 30 duplicated constant lines remain in a security-critical credential routing path. Drift can cause the host wrapper to forward one env var while the sidecar reads another, breaking credential isolation. This appears to reproduce the class tracked in completed issue [Duplicate Code] API proxy provider env-var constants are maintained in parallel JS and TypeScript files #5827, so filing a fresh issue because the duplication is still present.
Both files explicitly acknowledge the duplication:
// src/api-proxy-env-constants.ts:4-5// The CommonJS equivalent lives in containers/api-proxy/provider-env-constants.js.// Keep both files in sync; src/api-proxy-env-constants-sync.test.ts enforces parity.
// containers/api-proxy/provider-env-constants.js:6-7// The TypeScript equivalent lives in src/api-proxy-env-constants.ts.// Keep both files in sync; src/api-proxy-env-constants-sync.test.ts enforces parity.
Suggested Refactoring
Make one source authoritative. Options:
Store the constants in a small JSON file and generate both src/api-proxy-env-constants.ts and containers/api-proxy/provider-env-constants.js during build/test.
Or move the constants to a CommonJS-compatible JS module with JSDoc types and import it from TypeScript with generated .d.ts typings.
Either approach removes manual sync and lets the existing parity test become a generated-file freshness check.
Duplicate Code Opportunity
Summary
src/api-proxy-env-constants.tslines 8-39 andcontainers/api-proxy/provider-env-constants.jslines 10-41.Evidence
TypeScript host-side constants:
CommonJS sidecar constants duplicate the same values:
Both files explicitly acknowledge the duplication:
Suggested Refactoring
Make one source authoritative. Options:
src/api-proxy-env-constants.tsandcontainers/api-proxy/provider-env-constants.jsduring build/test..d.tstypings.Either approach removes manual sync and lets the existing parity test become a generated-file freshness check.
Affected Files
src/api-proxy-env-constants.ts— lines 8-39containers/api-proxy/provider-env-constants.js— lines 10-41Effort Estimate
Low
Detected by Duplicate Code Detector workflow. Run date: 2026-07-03
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
awmgmcpgSee Network Configuration for more information.