Skip to main content

Module server

Module server 

Source
Expand description

The console’s HTTP API (RFC-108 D5 and D9) and the rules for where it may listen.

Structs§

ServeConfig
Where and how tuff console serve listens.
ServerOptions
How the running server decides who may publish, and what the UI and GET /api/v1/settings tell viewers about it.

Functions§

check_bind
The bind rules of D5. A loopback address needs nothing. Any other address needs --public-read, because viewing is not authenticated, and at least one publish credential (a key or a trust), because publishing is authenticated. A demo needs no credential: its data is generated and in memory, and with none configured every publish is refused, so it is read only.
router
The API routes. Publishing needs a live key or a verified OIDC token in Authorization: Bearer when require_key is set, when a trust is configured, and whenever at least one key exists, on any address. With none of those, anyone who can connect may publish.
run
Open the store, apply the bind rules, and serve until interrupted. on_ready receives the bound address once the server accepts connections.
serve
Serve router(store, options) on listener until shutdown completes.