GRI-1873: enrolment over WebSocket (signage #12) #94
No reviewers
Labels
No labels
Area/Backend
Area/Database
Area/Docs
Area/Frontend
Area/Infra
Area/Security
Area/Tests
Area/Tooling
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Lang/Python
Lang/Rust
Lang/Shell
Lang/SQL
Lang/TypeScript
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Routing
Auto
Routing
Hold
Routing
Human
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grimoirix/grimoire-of-digital-signage!94
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/GRI-1873-enrolment-websocket"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
WebSocketroute (crates/server/src/ws.rs): the frozen handshake, the admission decision (blocklist / auto-approve / pending, perplan/server/enrolment.md), and the per-device token hand-off, perplan/shared/protocol.md.WebSocketupgrade is accepted, when it binds registered devices (the default): a blocked host gets a plain HTTP403, no frames are ever parsed. When the operator turns that setting off, the check runs afterClientHelloinstead, since a valid token could exempt the address.devices.rs(the device repository),tokens.rs(random token generation/hashing),signing.rs(a minimal ed25519 key load-or-generate for thesigning_public_keythe handshake hands a newly approved device — see ADR 0006; actual update signing/delivery stays "Later", perplan/shared/protocol.md).[enrolment]config section:trusted_proxies(addresses/CIDR ranges whoseX-Forwarded-Foris believed) andblocklist_applies_to_registered(on by default).Scope note
This is signage #12 only. Admin auth and the devices/IP-rules REST API (signage #13) are the next PR — there is no
POST /devices/{id}/approveroute yet.devices::approve_pendingis the function that route will call;ws_integration.rsexercises the approve → reconnect → token flow by calling it directly, the way a future REST handler will.Test plan
cargo test -p server— unit tests,db_integration,http_integration, and newws_integration(against a real Postgres viaSIGNAGE_TEST_DATABASE_URL): all green.ws_integration.rscovers: an unknown device becomes pending and itsRegistrationis recorded; approving a pending device then reconnecting with its temporary id issues a token; a blocklisted address is refused before the upgrade (plain HTTP 403); a device with a valid token is simply accepted.cargo clippy --workspace --all-targets -- -D warnings: clean.cargo fmt --check: clean../scripts/local-gates.sh --rust-only: every gate passed.cargo deny check: bans/licenses/sources ok; the pre-existingadvisoriesfailure (unmaintainedpaste/proc-macro-error, via the client's optionalgtk-rendererfeature) reproduces identically ondevand is unrelated to this change.