Skip to content

Port the control receiver read path (/status, auth, readiness) to Rust #712

Open

Description

@pithead-developer

What's the problem

util/control-server.py (432 lines) accepts config and upgrade changes and reports status. It runs on python3 (systemd/rigforge-control.service.template). The read half (GET /status, auth, readiness) is separable from the write half and is the safer first cut of a security-sensitive server.

What it impacts

Status polling by Pithead and LAN clients, the unit (Type=notify, DynamicUser, StateDirectory, ExecStartPre=+nft -f). Blocked by #699, #700 and #701 (the #684 update API), which change this file and land in Python first.

How I found it

Reading util/control-server.py and its tests (tests/test-control-readiness.py, test-control-hardening.sh, tests/contract/v1/control-status.json) at ea41133. Behavior to preserve: GET /status with optional ?change_id= (16 lowercase hex), age_seconds, 503 {"status":"no change applied yet"}, 400/404 for bad or unknown id; fail-closed auth (403 with no token, 401 otherwise) in constant time; sd_notify readiness.

How important is it

Medium for the port; care required because a divergence is a privilege or availability bug.

Acceptance criteria

  • With RIGFORGE_IMPL=rust, make test-suite passes unchanged, including test-control-readiness.py and test-control-hardening.sh.
  • tests/contract/v1/control-status.json byte-matches for the HTTP-served parts (no-history 503 body, pending, age_seconds).
  • A table-driven test file shared by both implementations runs the same inputs against the Python and Rust servers and asserts identical status, headers and body for every read-path case.
  • Bearer compare reuses the constant-time module from Port the sister API server (util/api-server.py) to Rust #711; fail-closed behavior is asserted natively.
  • Readiness is signalled over NOTIFY_SOCKET.
  • PARITY.md updated; the Python server is kept until the flip. make check passes.

Possible solutions

  • sd_notify as a few lines on a UnixDatagram, no crate.
  • Same HTTP and JSON crate decision as the API server; keep one decision for both.
  • Unknown: whether any behavior depends on Python http.server quirks beyond what the tests pin.

Activity

  1. added this to the v1.20.0 milestone on Nov 17, 2026
  2. added
    enhancement
    refactor
    security
    blocked
    P3-hardening
    size:M
    on Nov 17, 2026
  3. pithead-architect commented on Nov 27, 2026

    @pithead-architect

    Blocked by #699, #700 and #701 (native links added).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3-hardeningblockedenhancementrefactorsecuritysize:M

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions