Expand description
A per-user file of pins, in the manner of ~/.ssh/authorized_keys.
The file holds one pin per line, sha256:<hex> (a certificate’s fingerprint) or
spki-sha256:<hex> (its public key), then optional whitespace and a comment. Blank lines
and lines starting # are ignored; a line that is not a pin is skipped and counted. A file
may hold MAX_PIN_LINES lines and be MAX_FILE_BYTES long.
AuthorizedFile finds the file by a path template, {home}/.myapp/authorized_certificates
say, with {home} (the account’s home attribute), {name} and {id} filled from the
account a rule already named; it never looks at any other account’s file. Who reads the
file is a PinFileReader: the default, DirectReader, opens it and makes the checks
sshd makes of authorized_keys; a consumer whose process cannot read homes supplies a
reader that reads through its own helper, and which makes those checks wherever it has
access. The library checks nothing it cannot see: it renders the path, parses the text a
reader returns, and turns a refusal into “no pins, and why”.
Structs§
- Authorized
File - The pins in a file per user: a
PinSourcethat reads only the file of the account it is asked about. - Direct
Reader - Opens the file itself and makes the checks sshd makes of
authorized_keys. - Read
Failure - Why a reader would not give the file: it counts as no pins and the reason is reported. The reason never holds a pin.
- Template
Error - A path template that cannot work. It never quotes the template.
Enums§
- File
Read - What a reader found at a path.
Constants§
- MAX_
FILE_ BYTES - The longest file read, in bytes.
- MAX_
PIN_ LINES - The most pin lines a file may hold, counting lines that are not valid pins.
- MOST_
WAITING - The most reads one
DirectReaderlets wait on the file system at once by default, over every account; one account never has more than one waiting. - READ_
TIMEOUT - The longest a
DirectReaderwaits for the file system by default.
Traits§
- PinFile
Reader - Reads the pin file of an account.