Implement backend security hardening in packages/opencode/src/config/config.ts:
- In well-known auth remote config substitution flow, keep env/template substitution behavior.
- Parse and normalize remote URL robustly.
- Enforce
remote_config.url origin matches the well-known base origin from auth key URL (normalized, no trailing slash).
- Reject URLs containing username/password credentials.
- Throw explicit error on violation.
Tests in packages/opencode/test/config/config.test.ts:
- Keep templated header substitution test passing with same-origin URL.
- Add test that cross-origin remote_config is rejected with error.
Validation:
cd packages/opencode && bun test test/config/config.test.ts
cd packages/opencode && bun typecheck
Implement backend security hardening in
packages/opencode/src/config/config.ts:remote_config.urlorigin matches the well-known base origin from auth key URL (normalized, no trailing slash).Tests in
packages/opencode/test/config/config.test.ts:Validation:
cd packages/opencode && bun test test/config/config.test.tscd packages/opencode && bun typecheck