feat(smarthome): TP2 — owner mapping + portal widget - #208
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Smart Home TP2 — Owner-Zuordnung + Portal-Widget
Setzt TP2 der Smart-Home-Initiative (Phoscon/deCONZ) um: Admin weist Geräte (Licht/Steckdose/Gruppe) einzelnen Nutzern zu; eingeloggte Portal-Nutzer sehen und steuern nur ihre eigenen Geräte. Szenen erben die Zuweisung ihrer Gruppe (§16). Alles hinter dem Pro-Key
smarthome. Keine neue Migration (Tabellesmarthome_resource_ownersexistiert aus TP1 V64).Tasks (subagent-driven, je zweistufiges Review)
smarthomeOwners-Service — n:m + Szenen-Vererbung (resourcesOwnedBy/canAccess/inheritedOwnersOf), validate-before-write + atomarer Replaceusers.remove-Transaktion (neben Midea-Hook)PUT /resources/:id/owners+ownersinGET /resources(Szenen = geerbte Owner)widgets.smarthome(Default an)GET /smarthome(owner-scoped, redigiert) +POST /smarthome/:id/state(login→canAccess)c-smarthome(Switch/Slider/Szene-Aktivieren)Sicherheit
req.portalOwnerId/req.session.userId) — kein IDORid,kind,name,capabilities,state;state→{on,bri,reachable}) — keine Gateway-/deCONZ-/Route-InternasSpec-Konformität (§7/§8/§16/§17)
§17 ist maßgeblich: login_required =
200 + reason(nicht 401), Control viacanAccess(Szenen-Vererbung), Sensoren/Schalter nicht im Portal.Tests
6 neue Test-Dateien (Owner-Service, Cleanup, Admin-API, Portal-API, Widget-Flag). Laufen über GitHub Actions.
Review
Finales Whole-Branch-Review (opus): Ready to merge — eine Important-Findung (bare-async
throw eim Owners-PUT könnte Request hängen lassen) gefixt durchwrap()(32ea8a0).🤖 Generated with Claude Code