Skip to main content

Module console

Module console 

Source
Expand description

The console: a web page served on the TLS listener at /console/. It is a client of the HTTP API and nothing more. Its files are built into the binary and need no key: they are the same for every caller, hold no data and change nothing. Every request the page makes is an API request that carries the key the user signed in with.

Constants§

FILES
Every file the console is made of. The router serves exactly these, and a test holds this list, the console directory and the package’s include list to one another.
HEADERS
The headers on every console answer: no inline code, nothing from another origin, no framing, no sniffing, no referrer, no caching. The player’s page alone carries PLAYER_POLICY in place of the first.
PLAYER_PATH
The path of the player’s page, the one console answer with a policy of its own.
PLAYER_POLICY
The policy of the player’s page: the console’s, but a recording may play from a blob made in the page (media-src blob:) and the page may make no request at all (connect-src 'none'). The console hands the player the bytes; the player fetches nothing.
REPORT_PATH
The path the policies tell a browser to send its reports of a violation to.

Functions§

path_of
The path a console file is served at.
policy_for
The content-security policy of the answer at path: the player’s for the player’s page and the console’s for everything else.
router
The console’s routes, merged into the API’s router: its files, /console sent on to /console/, and 404 for any other path under it, each answer with the headers. A report sent to REPORT_PATH is answered 204 and dropped; the server’s own router counts each one (api::router).

Type Aliases§

File
One console file: its name under /console/ (empty for the page), its bytes as built into the binary, and its media type.