Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support restricting device connections to the web endpoint #1881

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joshk
Copy link
Collaborator

@joshk joshk commented Feb 5, 2025

This allows installations to disable shared secret device connections to web endpoints.

This is ideal for cases where you are running a devices endpoint and want to make sure all connections go there.

@joshk joshk requested review from lawik, nshoes and jjcarstens February 5, 2025 06:58
@joshk joshk force-pushed the device-web-endpoint-restrictions branch 2 times, most recently from 527cc55 to 274bad9 Compare February 5, 2025 08:19
@joshk joshk force-pushed the device-web-endpoint-restrictions branch from 274bad9 to b3c1205 Compare February 5, 2025 08:22
@@ -1,12 +1,19 @@
defmodule NervesHub.Helpers.WebsocketConnectionError do
import Plug.Conn

@message "no certificate pair or shared secrets connection settings were provided"
@no_auth_message "no certificate pair or shared secrets connection settings were provided"
@check_uri_message "incorrect uri used, please contact support"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we get some configured URL info into this message so we can actually tell them the fix?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Although, just so you know, slipstream doesn't show this message by default, which is a pity

@@ -188,6 +198,14 @@ defmodule NervesHubWeb.DeviceSocket do
end
end

defp check_source_enabled(source) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should have an in-between mode for the transition that just throws a "wrong-endpoint" key in the device connection metadata or similar. And then we could show it to people.

Though we have few enough people that will be hit by it that we can essentially tell them and give them a deadline?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I wouldn't want to add too much extra complexity to this. Instead we can just send out a warning to current users, check our logs to make sure people are off, and then turn it off. I have no intention to turn this off yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants