Skip to main content

Module device_sign_in

Module device_sign_in 

Source
Expand description

Signing a device in by approving it on another: the code a TV shows, and the link its QR code carries.

The code is 8 letters from an alphabet without vowels (so it never spells a word), shown as two groups of four: BCDF-GHJK. 20^8 codes, a 5-minute life and rate-limited guessing put a guessed code out of reach. People type it with any case, dash or spacing; normalize takes all of them. The server makes codes; everyone reads them here.

Structs§

Link
A link a phone scanned or was opened with.

Constants§

ALPHABET
The letters a code is made of.
CODE_LEN
Letters in a code.

Functions§

display
code as shown: BCDF-GHJK.
link
What the device’s QR code carries: the server to approve on (its hex EndpointId, so a phone that has not seen it can connect and pin it) and the code.
normalize
input as a code (BCDFGHJK), whatever case, dashes or spaces it was typed with; None if it cannot be one.
parse_link
The server and code of a link; None if text is not one.
web_link
The page of the web UI at origin (https://media.example.org) that approves code: what the QR code carries for a phone with a browser and no Spoolframe app.