linux-automation / lxa-iobus

Linux Automation IOBus server
https://lxa-iobus.readthedocs.io/en/latest/
Apache License 2.0
3 stars 4 forks source link

Expose individual node info via REST and allow CORS requests #33

Closed hnez closed 2 years ago

hnez commented 2 years ago

In order to use the IOBus server REST API from within a website hosted under another hostname or on another port on the same host we need to set the appropriate CORS headers. What appropriate CORS headers are can be a tough question to answer, as it depends on which data is considered private and should not be available to anyone hosting a website on the internet who is able to guess domain names/IPs in our local network.

This commit makes the list of nodes and the node info publicly accessible but not the pin stati or any pin controls.

Signed-off-by: Leonard Göhrs l.goehrs@pengutronix.de

SmithChart commented 2 years ago

The iobus-server does not care about authentication whatsoever. If anyone want's to restrict access external measures are needed anyway.

So I don't mind setting that CORS header. Also: I would not mind to expose the state of pins (read or write) via the REST API as long as the state is consistent between API, nodes and web-interface.

SmithChart commented 2 years ago

Tested and works as expected.