fix(daemon): enforce control tier for WebSocket zone layout preview mutations#85
fix(daemon): enforce control tier for WebSocket zone layout preview mutations#85hyperb1iss wants to merge 1 commit into
Conversation
|
Warning Review limit reached
More reviews will be available in 58 minutes and 24 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Motivation
zone_layout_previews(bypassing the HTTP router) which could be used to change live LED output or trigger large canvas allocations and OOMs.Description
RequestAuthContext::can_perform_write()to centralize the security check for write/control permission. (crates/hypercolor-daemon/src/api/security.rs).ClientMessage::ZoneLayoutPreviewandClientMessage::ZoneLayoutPreviewClearbranches withensure_control_tier(...)so they require control-tier permission before applying previews. (crates/hypercolor-daemon/src/api/ws/session.rs).ensure_control_tierhelper and focused unit tests (security_tests) asserting read-only contexts are rejected and unsecured/local contexts are allowed. (crates/hypercolor-daemon/src/api/ws/session.rs).cargo fmtto keep code style consistent.Testing
cargo fmt -- crates/hypercolor-daemon/src/api/security.rs crates/hypercolor-daemon/src/api/ws/session.rswhich completed successfully.ws/session.rs(security_tests) that verify the newensure_control_tierbehavior; a targetedcargo test -p hypercolor-daemon security_tests::run was started but the full dependency compile did not complete in this session due to environment/time constraints, so test execution should be validated by CI (expected to pass).cargo testfor thehypercolor-daemoncrate to validate the new tests and ensure no regressions.Codex Task