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

Allow devices to expose the host, port and secure info for each forwarder session #68

Open
davidebriani opened this issue Mar 5, 2024 · 1 comment

Comments

@davidebriani
Copy link
Contributor

The io.edgehog.devicemanager.ForwarderSessionsState Astarte interface advertises the state of each session, exposing the status on the property /%{session_token}/status.

However there is no info about the host and port of the Forwarder used by that session.

It would be useful to find a way to expose those information in a reliable manner.
Also, if in the future multiple instances of the cloud Forwarder exist, it would become hard to know which one is used by a specific session token.

@davidebriani
Copy link
Contributor Author

  1. One option could be to query the Astarte interface io.edgehog.devicemanager.ForwarderSessionRequest and filter for the session token, in order to retrieve the initial request along with the other info. However with this approach it is not clear how many datastream events should be fetched in order to find the matching one.
  2. Another option could be to update the interface and add /%{session_token}/host, /%{session_token}/port and /%{session_token}/secure endpoints. However these endpoints are updated one at a time by the device, so it might happen that some properties are missing when Edgehog queries the interface.
  3. Another option could be to update the interface so that the device publishes object properties instead of individual properties. However, at the time of writing, this approach is not feasible since the functionality is not implemented in Astarte, see issue: Support for interfaces with aggregation=object of type=properties astarte-platform/astarte#503.
  4. Another option could be to update the interface so that an endpoint like /%{session_token}/%{host}/%{port}/%{secure}/status can be published. However this approach should be validated and it would lead to an odd property structure.
  5. Another option could be to update the interface so that an endpoint like /%{session_token}/state contains a JSON with all the necessary info. However this approach does not support type definitions and validation.

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

No branches or pull requests

1 participant