Lille Ø - I'm writing a client that needs to ta...
I'm writing a client that needs to talk to the REST API of the Logbook plugin. Turns out this only works for admin-level users. That's somewhat dangerous
4 Replies
The API endpoints are under
/plugins
which requires admin privileges.
You will need to move them out from under there.
E.g. /signalk/v2/api/logbookI don't think plugins can do that? The plugin.registerWithRouter interface is scoped to that path
Have a look at the Freeboard-SK source. https://github.com/SignalK/freeboard-sk/blob/master/helper%2Fweather%2Fweather-service.ts
Line 186 for an example.
Here is the swagger definition of those end points https://demo.signalk.org/doc/openapi/?urls.primaryName=plugins%2Ffreeboard-sk
Ah, I see, you inject the routes directly into the SK server instance instead of using the plugin route registration mechanism