Skip to content

feat(httpd): wire --allow-net cap check (ILO-381)#639

Merged
danieljohnmorris merged 1 commit into
feature/httpd-lazy-bodyfrom
feature/httpd-cap-check
May 22, 2026
Merged

feat(httpd): wire --allow-net cap check (ILO-381)#639
danieljohnmorris merged 1 commit into
feature/httpd-lazy-bodyfrom
feature/httpd-cap-check

Conversation

@danieljohnmorris
Copy link
Copy Markdown
Collaborator

Summary

  • Adds --allow-net flag to HttpdArgs (mirrors the RunArgs pattern from ILO-59)
  • httpd_cmd now calls caps.check_net("0.0.0.0") before binding the TCP socket; exits 1 with "ilo httpd needs --allow-net to listen on a port" if the check fails
  • New build_httpd_caps() helper: no --allow-net flag → Caps::Restricted { net: Policy::List([]) } (deny all); --allow-net=*Policy::All; specific hosts are passed through Caps::parse_allow
  • Resolves the TODO(ILO-59) comment left in the httpd block comment

Builds on:

Test plan

  • httpd_refuses_to_start_without_allow_net — verifies exit non-zero + error message when --allow-net is omitted
  • httpd_passes_cap_check_with_allow_net_star — verifies cap error absent when --allow-net * is supplied
  • All existing httpd unit tests still pass

🤖 Generated with Claude Code

`ilo httpd` now requires `--allow-net` to be supplied; without it the
process exits 1 with "ilo httpd needs --allow-net to listen on a port"
before touching the network.  Adds `--allow-net` flag to `HttpdArgs`,
`build_httpd_caps()` helper, and two integration tests in
`capability_flags.rs` covering the refuse-without-flag and
pass-with-star cases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@danieljohnmorris danieljohnmorris merged commit 4376272 into feature/httpd-lazy-body May 22, 2026
@danieljohnmorris danieljohnmorris deleted the feature/httpd-cap-check branch May 22, 2026 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant