GRI-1880: fix pre-upgrade blocklist check ignoring blocklist_applies_to_registered setting #112

Merged
vivy merged 3 commits from fix/GRI-1880-blocklist-off-ignored-pre-upgrade into dev 2026-11-10 14:29:35 +00:00
Member

What

ws::upgrade refused a blocklisted registered device with 403 before the WebSocket upgrade, even when the server setting blocklist_applies_to_registered was off.

Cause

The pre-upgrade check called devices::load_admission_rules, which hardcoded blocklist_applies_to_registered: true. The real setting was applied only after the upgrade, in handle_socket, so it never reached the early drop.

Fix

Apply state.blocklist_applies_to_registered to the rules before the pre-upgrade blocklist_only_drop check, mirroring what handle_socket already does after the upgrade.

Verification

  • Un-ignored ac_2_08_a_registered_device_on_the_blocklist_is_admitted_when_the_setting_is_off.
  • cargo test -p server --test enrolment_acceptance_integration -- --include-ignored against local Postgres: all 7 tests pass (AC-2-07 and AC-2-08 both green).
  • cargo test -p server --lib: 112 passed, 1 ignored (unrelated).
  • ./scripts/local-gates.sh --rust-only: every gate passed.

Closes #110

## What `ws::upgrade` refused a blocklisted **registered** device with 403 before the WebSocket upgrade, even when the server setting `blocklist_applies_to_registered` was off. ## Cause The pre-upgrade check called `devices::load_admission_rules`, which hardcoded `blocklist_applies_to_registered: true`. The real setting was applied only after the upgrade, in `handle_socket`, so it never reached the early drop. ## Fix Apply `state.blocklist_applies_to_registered` to the rules before the pre-upgrade `blocklist_only_drop` check, mirroring what `handle_socket` already does after the upgrade. ## Verification - Un-ignored `ac_2_08_a_registered_device_on_the_blocklist_is_admitted_when_the_setting_is_off`. - `cargo test -p server --test enrolment_acceptance_integration -- --include-ignored` against local Postgres: all 7 tests pass (AC-2-07 and AC-2-08 both green). - `cargo test -p server --lib`: 112 passed, 1 ignored (unrelated). - `./scripts/local-gates.sh --rust-only`: every gate passed. Closes https://git.grimoirix.org/Grimoirix/grimoire-of-digital-signage/issues/110
GRI-1880: apply blocklist_applies_to_registered in the pre-upgrade blocklist check
Some checks failed
CI / the pre-push hook (pull_request) Successful in 6s
CI / cargo fmt (pull_request) Successful in 6s
CI / cargo clippy (pull_request) Successful in 10m4s
CI / cargo test (pull_request) Successful in 11m6s
CI / repository boundary (pull_request) Successful in 5s
CI / cargo deny advisories (pull_request) Failing after 2m30s
CI / cargo deny (pull_request) Failing after 2m30s
CI / frontend-web (pull_request) Successful in 10m5s
CI / CI (pull_request) Failing after 5s
CI / Notify gate failed (pull_request) Successful in 4s
2238883fd2
ws::upgrade dropped a blocklisted registered device with 403 before the
upgrade even when the server setting was off, because its rules came from
load_admission_rules, which hardcodes blocklist_applies_to_registered: true.
handle_socket already applied the real setting after the upgrade, but by
then the connection was never reached. Apply the setting at the pre-upgrade
check too, as it already is after the upgrade.
GRI-1880: retrigger CI (cargo deny showed a transient failure unrelated to this change)
Some checks failed
CI / the pre-push hook (pull_request) Successful in 6s
CI / cargo deny (pull_request) Successful in 46s
CI / cargo deny advisories (pull_request) Failing after 40s
CI / repository boundary (pull_request) Successful in 8s
CI / cargo clippy (pull_request) Successful in 9m55s
CI / cargo fmt (pull_request) Failing after 10m44s
CI / frontend-web (pull_request) Successful in 9m51s
CI / cargo test (pull_request) Successful in 11m6s
CI / Notify gate failed (pull_request) Successful in 3s
CI / CI (pull_request) Failing after 4s
42115fea5b
GRI-1880: retrigger CI (cargo fmt failed after 10m44s, consistent with runner contention, not a real fmt diff)
Some checks failed
CI / the pre-push hook (pull_request) Successful in 6s
CI / cargo fmt (pull_request) Successful in 7s
CI / cargo clippy (pull_request) Successful in 10m1s
CI / cargo deny (pull_request) Successful in 40s
CI / cargo test (pull_request) Successful in 11m17s
CI / cargo deny advisories (pull_request) Failing after 43s
CI / repository boundary (pull_request) Successful in 14s
CI / frontend-web (pull_request) Successful in 9m51s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 3s
d0fec86236
vivy merged commit 6554d98e53 into dev 2026-11-10 14:29:35 +00:00
vivy deleted branch fix/GRI-1880-blocklist-off-ignored-pre-upgrade 2026-11-10 14:29:35 +00:00
Sign in to join this conversation.
No reviewers
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!112
No description provided.