Repository navigation
fix(id): validate [interfaces.web] route/socket before axum registration panics (#4779) - #4781
Conversation
…ion panics (#4779) web_interface_from_app_toml now rejects route/socket values missing a leading slash, both sides naming the same path, and either side colliding with a host-registered route, with named WebInterfaceError variants instead of a router-construction panic. Adds regression tests for the five verified panic cases plus the valid control.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 48 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. CodeRabbit Verify
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Fixes #4779. Does not touch #4060 scope (parse_app_manifest/discover_apps).
Problem
web_interface_from_app_toml(pkgs/id/src/web/app_interface.rs) validated only the[interfaces.web]mode, so route/socket strings flowed unchecked intocreate_router_for_app, where axum panics on a path without a leading slash or on a path colliding with an already-registered host route. Verified pre-fix: route='arena', route='/', route='/files', socket='ws/arena', socket='/ws/tags' each parsed Ok and panicked (routes.rs:322, routes.rs:382, world_ws.rs:60); web files unchanged since the probe base (cb190a3..a41cba3 empty diff).Fix
Parse-time validation with named
WebInterfaceErrorvariants:RouteMustStartWithSlash/SocketMustStartWithSlash— value must start with '/'RouteSocketOverlap— both sides naming the same pathRouteReserved/SocketReserved— collision with a host-registered route (HOST_RESERVED_ROUTES, mirrored withcreate_router_inner+world_http_routes, plus the/api/world/*prefix)Applies to all modes uniformly; the world app binding (/world + /ws/world) and tic-tac-toe (/tic-tac-toe) still parse.
Tests
cargo test --lib --features web -- app_interface public_entry_point: 13/13 pass — 7 new regression tests (five panic cases + overlap + world-binding control) and the existingpublic_entry_point_honours_a_configured_bindingrouter test stays green.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.