Commit 179ebca
authored
Remove default subscriptions setup when a device connects (#2296)
All devices, when connecting to a topic ("device", "console",
"extensions"), are lumped into a PubSub topic using the channel name
(the name used in join/3).
Since these names are generic, what ends up happening is that every
device is subscribed to a shared topic name that has fastlaning enabled,
meaning messages can be sent directly to devices.
I believe this could be a slight security issue, as pubsub messages can
be sent to all connected devices with just a simple:
```elixir
Phoenix.Channel.Server.broadcast(NervesHub.PubSub, "device", "any_event_name", %{just: "a payload"})
```
Additionally, this topic isn't needed or used, so we can unsubscribe
from it.1 parent 02971dd commit 179ebca
File tree
3 files changed
+16
-1
lines changed- lib/nerves_hub_web/channels
3 files changed
+16
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
65 | 70 | | |
66 | 71 | | |
67 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
57 | 62 | | |
58 | 63 | | |
59 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
28 | 33 | | |
29 | | - | |
| 34 | + | |
30 | 35 | | |
31 | 36 | | |
32 | 37 | | |
| |||
0 commit comments