Repository navigation
fix(cli): reject blank APNs environment before node lookup - #144687
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Thanks @Alix-007 for the fix. Proof: The real compiled CLI on pinned main accepted an empty environment in both output modes and reached node lookup and the simulated push boundary. The repaired CLI rejects it locally with zero connections. Independent acceptance passed 31 public cases, including equals-form empty input, normalized and omitted values, varied node resolution, title/body defaults, and complete failed-push output.
All 28 focused tests passed, including the consolidated full-registration suite and unchanged push-owner controls. Independent source review and the exact-head ClawSweeper review found no actionable issues. Required CI passed. Merged as 9698406. The public proof used a synthetic loopback peer; it does not claim real Apple notification delivery or live server authorization enforcement. |
…144687) Reject an explicitly supplied blank push environment before node lookup while preserving omitted and normalized valid environments, request shaping, and complete failed-push output. Related: openclaw#130352 Co-authored-by: Ayaan Zaidi <[email protected]>
Related: #130352 (the earlier validation-order repair).
What Problem This Solves
An operator can explicitly pass an empty
--environmentvalue toopenclaw nodes push --node <id>. The command currently treats it as omission, reaches node lookup, and can use the node's default Apple push environment.Why This Change Was Made
The existing validator now checks whether the option was supplied. Empty, whitespace-only, and invalid values fail before lookup with the existing diagnostic. Regression coverage uses the existing full command-registration suite and replaces its contradictory empty-success expectation.
User Impact
Explicitly blank input fails locally. Omit the flag to retain the existing default selection. Valid normalized values, node resolution, title/body defaults, and complete failed-push output keep their behavior.
Evidence
openclaw.mjson pinned main: empty input in human and JSON modes reachednode.listand the controlledpush.testboundary, then exited successfully.--environment=spellings, varied node resolution, omitted environment forwarding, and complete failed-push output. Blank input created no connection.The public proof uses synthetic Linux state and a loopback Gateway peer. It verifies compiled CLI validation, forwarding and output. It does not send a real Apple notification or claim live server authorization or device delivery. Unchanged downstream payload, priority, expiration, registration and authorization contracts are covered by source review and focused owner tests.
AI-assisted implementation and validation.