Skip to main content

Module access

Module access 

Source
Expand description

Being let in.

With security switched on, a device asks for a token and a human approves it once:

  1. POST /signalk/v1/access/requests with a client id, a description and the permissions wanted. Answers 202 with a request id.
  2. GET /signalk/v1/requests/<id> – PENDING until somebody decides.
  3. The administrator approves it in the server’s own interface.
  4. The same GET then answers COMPLETED and carries the token.

The token goes in an Authorization: Bearer header afterwards and is good for as long as the administrator said. Storing it is the application’s business, not this crate’s.

§Whether a token is needed to read at all

With security on, the REST interface refuses an unauthenticated request with 401. The data stream is governed separately, by the server’s allowReadonly setting: it decides whether a device can draw a chart before anybody has approved it. Publishing routes always needs a token either way.

When allowReadonly is off, an unauthenticated client still connects and still receives the greeting, complete with the vessel’s identifier, then receives nothing further – indistinguishable on the wire from a boat whose instruments are switched off. A client with no token should report that itself rather than wait to be told, since it never will be.

Structs§

PendingRequest
A request that is now in front of whoever administers the server.

Enums§

Access
Where a request has got to.
Permissions
What the mariner is asking to be allowed to do.
Requested
What became of asking for access.

Functions§

check_access
Asks what became of a request.
request_access
Asks a server for a token.