Port access-control probes to Rust integration tests; document HTTPS hardening
#12 in tonybierman/arium — merged 2026-05-25
Summary
Outputs of reviewing the past-24h security-hardening merges (#1–#11):
- Replace the shell access-control probes with Rust integration tests. The two
examples/*/access-control-probe.shscripts (and their bespoke CI jobs that built the example server-only,nohup'd it on a port, waited for readiness, andcurl'd it) are replaced by deterministic in-process integration tests in the adapter crates, run by the normalcargo test --workspacegate. - Document the opt-in HTTPS production hardening in
SECURITY.md— thecookie_secure/hsts/content_security_policybuilder knobs added in PR #7 were in rustdoc but no consumer-facing doc.
Access-control tests (full 3-phase parity, both adapters)
crates/arium-{dioxus,leptos}/tests/access_control.rs:
- Phase 1 — anonymous caller denied on every protected/admin endpoint.
- Phase 2 — logged-in non-admin refused on admin endpoints (vertical privilege escalation).
- Phase 3 — user B cannot revoke user A's API token (IDOR), verified directly via A's token list + a control revoke.
Harness extracted into a per-adapter tests/common/mod.rs (shared with the existing server_fn_roundtrip.rs, which now consumes it instead of inlining its own copy — the "no duplication" requirement). spawn_app disables rate limiting so a fast multi-endpoint sweep can't be masked by a 429.
Unlike the shell probe's loose assert_denied (which treated a 404 as a pass), the Rust port distinguishes a 404 from a real denial — and immediately caught a stale inventory entry: GET /api/user/permissions was never a route (permissions ride on /api/user/profile).
Engine-level tests (crates/arium/tests/{rbac,api_tokens}.rs) already cover the permission model + SQL scoping; these add the missing mounted-route enforcement coverage, so deleting the scripts loses nothing.
Removals
examples/*/access-control-probe.sh- the
access-controlandaccess-control-leptosjobs in.github/workflows/ci.yml(no replacement job needed — thetestjob runs the new tests) - fixed the now-stale
.gitignorecomment
Verification
cargo test --workspace --exclude dioxus-fullstack-example— green; both adapters'access_control(3 phases each) + refactoredserver_fn_roundtrippass.ci.ymlparses; no lingeringaccess-control-probereferences except the provenance comments in the new test files.- wasm unaffected: all four test files carry
#.
🤖 Generated with Claude Code
Last updated 2026-05-26
Links to this note
Merged pull requests, newest first.