Repository navigation
refactor(configuration): drop the dead ipv4 pattern and pin the deploy-time gateway password check - #2425
Conversation
…y-time Gateway password check openAiBaseUrlRewritesIpv4 tested the parser's own hostname against a strict decimal pattern. The URL parser always serializes an IPv4 host as four decimal octets without leading zeros, so the pattern never failed where isIP(hostname) === 4; comparing the written host with the parsed one decides every case alone. Same refusals, same messages. The second refuseLiteralGatewayPassword call (in the Configuration Driver's credential rules) is not a duplicate: deployment validates the stored document through the Driver without running validateConfigurationSettings, so this call is what refuses a literal password an older release stored. Removing it turned that 400 into a 409 gateway.auth.mode conflict on Kubernetes Compute and a 503 elsewhere. Keep it, say so in the comments, and pin it with a test. byteSize keeps its KiB branch: ConfigurationSizeError is the documented way any Configuration Driver reports its own limit, so other limits can reach it.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR removes a redundant IPv4 pattern and tests the existing deployment refusal for stored literal Gateway passwords. Example: Configure a Codex endpoint as https://3221225985/v1.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open for maintainer triage: this focused refactor preserves existing behavior and adds useful deployment coverage; no introduced defect was found. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherEndpoint validation checks profile and Compute inputs before storing normalized URLs; Configuration Drivers validate stored documents before deployment admits an Agent revision. flowchart TD
A[Profile input] --> B[Endpoint validation]
B --> C[Compute admission]
D[Stored Configuration] --> E[Configuration Driver validation]
E --> C
C --> F[Agent revision]
Technical reviewBest possible solution: Retain the simpler IPv4 comparison and the deployment refusal coverage under the existing Configuration Driver. Do we have a high-confidence way to reproduce the issue? This PR addresses redundant code and missing coverage rather than a current product failure; source inspection supports its explanation, and this read-only review ran no tests. Is this the best way to solve the issue? The narrow simplification preserves the endpoint contract, and the added integration case exercises the real Driver check that existing save and Compute fixture tests do not protect. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d3ccc54781d0. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 14, 2026, 9:39 AM ET / 13:39 UTC (Revision 2). |
…ssword comments Name isIP's own canonical-form rule in the IPv4 comment, say that deployment (not Compute admission) refuses a stored document under these rules, scope the re-check claim to the bundled Configuration Drivers, and have the stored Gateway password test also pin the read values and the re-save refusal.
Problem
A mutation sweep (mutant-sweep-1014b) listed three spots that looked like code that never decides anything:
strictDecimalIpv4inopenAiBaseUrlRewritesIpv4(apps/controller/src/drivers/openai-endpoint.ts).refuseLiteralGatewayPasswordcall in the Configuration Driver's credential rules (validateModelCredentialReferences,apps/controller/src/drivers/configuration/model-auth.ts), which repeats the save rule invalidateConfigurationSettings.byteSize(packages/occ/src/errors.ts), whose only in-repo caller passes 1 MiB.Change
hostname, and only afterisIP(hostname) === 4. The URL parser serializes every IPv4 host as four decimal octets with no leading zeros, so the strict pattern can never fail there.written !== hostnamealone refuses every rewritten spelling. The refusals and messages are unchanged; the doc comment now says why the comparison is enough.configurationDriver.validate) without runningvalidateConfigurationSettings. This call is what refuses a literalgateway.auth.passwordthat an older release stored. When the call is removed, deploying such a document returns409 gateway.auth.mode must be trusted-proxyon Kubernetes Compute and503 DEPENDENCY_UNAVAILABLEon other Compute, instead of the save message. Comments in both files now say this. A new integration test pins the stored document: it reads back unchanged, and both a re-save and a deploy are refused (400, same message, no revision, no echo of the value), for both kinds of Compute.ConfigurationSizeError(limitBytes)is the documented way any Configuration Driver reports its own limit (docs/reference/drivers/configuration.md, thevalidateSizecontract), so other limits can reachbyteSize. It stays a tiny general helper.Verification
010.0.0.1,10.00.0.1), octal (0300.0250.0.1,017700000001), hex (0xC0.0xA8.0.1,0x7f000001,0x), short forms (192.168.1,192.11010305,3232235777,00), a trailing dot,%31escapes, a fullwidth digit and a backslash after the scheme. Each yields a canonical hostname that passes the pattern. The comparison with the written host refuses each one, and the old and new functions agree on every input. A fuzz run over 300k random digit, hex and dot hosts (26.5k parsed as IPv4) found no hostname that fails the pattern.tsc --buildis clean, and prettier and eslint pass on the touched files.Risks
Low. An opus review approved it with nits, all applied: comment wording, and the test also pins the read values and the re-save refusal. One condition is removed, and the probe and fuzz run show it cannot change a result. The rest is comments and one new test.