fix: harden proxy config and CLI input validation#98
fix: harden proxy config and CLI input validation#98Alanperry1 wants to merge 3 commits intoopenai:mainfrom
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
|
recheck |
SummaryThis PR hardens It fixes a repeated-run issue where proxy config could accumulate duplicate managed entries, resolves an What Changed
WhyThese paths were a little too easy to break:
Testing
|
There was a problem hiding this comment.
Pull request overview
This PR hardens the CLI and proxy config management by introducing strict port validation, improving --extra-args JSON handling, and making write-proxy-config idempotently replace previously managed config blocks rather than duplicating entries.
Changes:
- Add a shared port validation module and apply it to CLI parsing and server-info parsing.
- Make
write-proxy-configreplace prior codex-action-managed proxy config on repeated runs. - Improve CLI validation/error reporting for malformed
--extra-argsJSON and add regression tests.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/writeProxyConfig.test.mjs | Adds a regression test ensuring repeated write-proxy-config runs don’t duplicate managed config. |
| test/cliValidation.test.mjs | Adds CLI validation tests for invalid ports and malformed/non-string --extra-args JSON. |
| src/writeProxyConfig.ts | Implements managed-block merge/strip logic for proxy config generation. |
| src/runCodexExec.ts | Fixes temp output-schema handling when running as an unprivileged user (sudo-aware create/write/cleanup). |
| src/readServerInfo.ts | Validates the server info port value using shared port validation. |
| src/ports.ts | Introduces reusable port parsing/validation helpers. |
| src/main.ts | Switches port parsing to the new validator and hardens --extra-args JSON parsing errors. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.