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
AdrianP
AdrianP3w ago
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/logbook
Lille Ø
Lille ØOP3w ago
I don't think plugins can do that? The plugin.registerWithRouter interface is scoped to that path
AdrianP
AdrianP3w ago
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
Lille Ø
Lille ØOP3w ago
Ah, I see, you inject the routes directly into the SK server instance instead of using the plugin route registration mechanism
Want results from more Discord servers?
Add your server