Repository navigation
Limit project link device ACLs to the device's own instance - #9083
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## project-link-app-aware #9083 +/- ##
=======================================================
Coverage 79.88% 79.88%
=======================================================
Files 476 476
Lines 26164 26164
Branches 6972 6972
=======================================================
Hits 20902 20902
Misses 5262 5262
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
38ad95b to
56548dd
Compare
andypalmi
left a comment
There was a problem hiding this comment.
Ran the same 56 ACL cases against /api/comms/v2/acls on this branch: all 56 pass, including the 6 team channel cases that fail on #9079 alone. Runtime traffic between hosted instances, application owned, instance owned and device group devices is unchanged. Approving.
|
This has been rechecked by myself and @andypalmi but I am holding off merge until tomorrow morning when i around in case of issue. |
|
final testing on pre-staging with real devices and existing 0.7.9 version link nodes: Setup
Flows usedother-app-instance.json |
- Device subscriptions to p/<instance>/in and p/<instance>/res, and device publishes to p/<instance>/out, now use checkDeviceAssignedToProject so a device only uses its own instance's topics - Return only id and name from GET /teams/:teamId/projects for device tokens, as already done for project tokens - Add ACL tests for wildcard, cross-team and dev: response/broadcast topics
56548dd to
967ae9e
Compare
This setup was recreated on our staging env in team "Plant Enterprise"
|




Description
Follow-up to #9079, stacked on its branch. It will retarget to
mainonce #9079 merges.Three device rules for project link checked only that the instance in the topic was in the device's team, not that it was the device's own instance. The devices are now limited to their own instance's topics:
p/<instance>/in(direct messages)p/<instance>/res(link call responses)p/<instance>/out(team broadcasts)All three now use
checkDeviceAssignedToProject. ThedeviceOwnerType: 'instance'setting is gone from these rules.checkDeviceCanAccessProjectnever read it, so it had no effect, and application owned devices matched these rules as well.GET /api/v1/teams/:teamId/projectsnow returns onlyidandnamefor device tokens, as it already does for project tokens. The only caller with a device token is nr-project-nodes, which only reads those two fields.Sending stays open to the whole team. Any member can send a direct message to any instance or application owned device in the team, and reply to any link call, as before.
What each version of the nodes does
Topics drop the
ff/v1/<team>/prefix and the user's sub-topic.ownis the client's id in topics: the instance id for a hosted instance, its instance's id for an instance owned device,dev:<deviceId>for an application owned device.0.7.9, and 0.8.0 on a platform without
/project-link/targets:p/+/outp/<S>/outp/<own>/inp/<own>/outp/<T>/inp/<T>/in, subp/<own>/res(res-<random>on HA)p/<caller>/resorres-<random>Added in 0.8.0, on a platform with
/project-link/targets:p/dev:<own>/inp/dev:<T>/inp/dev:<caller>/resp/<instance>/res-<random>p/dev:<S>/outa/<app>/p/<own>/outa/<app>/p/+/outora/<app>/p/<S>/outCompatibility
p/<instance>/in,/resor/outwith an instance id on an application owned device. v0.1.0 to v0.5.0 don't start without an instance, and v0.6.0 onwards usedev:<deviceId>.Testing
authRoutes_spec.js, and 1 changed. The application owned device can no longer subscribe to an instance inbox, so "can subscribe to project inbox" became "cannot subscribe to project inbox".dev:callers, and broadcasts fromdev:sourcesp/+/inandp/+/resteam_spec.jschecks device tokens get onlyidandname.Related Issue(s)
Closes FlowFuse/engineering#592
Part of FlowFuse/nr-project-nodes#30
Checklist
flowforge.yml?FlowFuse/helmto update ConfigMap TemplateFlowFuse/CloudProjectto update values for Staging/ProductionLabels
area:migrationlabel