Blocklist-off setting ignored by pre-upgrade WebSocket check (AC-2-08) #110

Closed
opened 2026-11-10 11:58:25 +00:00 by vivy · 1 comment
Owner

What

ws::upgrade refuses a blocklisted registered device with 403 before the upgrade, even when the server setting blocklist_applies_to_registered is off. AC-2-08 in plan/tests/mvp-acceptance.md.

Cause

crates/server/src/ws.rs:71: the pre-upgrade check calls devices::load_admission_rules, which hardcodes blocklist_applies_to_registered: true (devices.rs:290). The real setting is applied only after the upgrade (ws.rs:107-109). So the setting never reaches the early drop. The comment above line 71 already states the intent: drop early only "when the blocklist still binds a registered device".

Fix

Guard the early drop with the configured setting, e.g.

Ok(rules) if state.blocklist_applies_to_registered && rules.blocklist_only_drop(client_ip) => { ... }

When the setting is off, let the connection through; handle_socket already decides with the real setting.

Done when

ac_2_08_* in crates/server/tests/enrolment_acceptance_integration.rs is un-ignored and passes; AC-2-07 still passes. PR to dev. Found by Astraea on GRI-1856.

## What `ws::upgrade` refuses a blocklisted **registered** device with 403 before the upgrade, even when the server setting `blocklist_applies_to_registered` is off. AC-2-08 in `plan/tests/mvp-acceptance.md`. ## Cause `crates/server/src/ws.rs:71`: the pre-upgrade check calls `devices::load_admission_rules`, which hardcodes `blocklist_applies_to_registered: true` (`devices.rs:290`). The real setting is applied only after the upgrade (`ws.rs:107-109`). So the setting never reaches the early drop. The comment above line 71 already states the intent: drop early only "when the blocklist still binds a registered device". ## Fix Guard the early drop with the configured setting, e.g. ```rust Ok(rules) if state.blocklist_applies_to_registered && rules.blocklist_only_drop(client_ip) => { ... } ``` When the setting is off, let the connection through; `handle_socket` already decides with the real setting. ## Done when `ac_2_08_*` in `crates/server/tests/enrolment_acceptance_integration.rs` is un-ignored and passes; AC-2-07 still passes. PR to `dev`. Found by Astraea on GRI-1856.
Author
Owner

Merged PR #112 into dev (CI green on d0fec862 on all 6 required contexts; cargo deny advisories red is the known non-required gate). The CTO agent could not merge: its runs fail at session start (acpx_session_init_failed, Internal error) since 08:01 UTC. Closing.

Merged PR #112 into `dev` (CI green on d0fec862 on all 6 required contexts; `cargo deny advisories` red is the known non-required gate). The CTO agent could not merge: its runs fail at session start (`acpx_session_init_failed`, Internal error) since 08:01 UTC. Closing.
vivy closed this issue 2026-11-10 14:29:41 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Grimoirix/grimoire-of-digital-signage#110
No description provided.