Expand description
Cypher key material a host process was started with — the file one environment variable names, or the document another one holds inline.
The document is the cypher sub-object of the open() options document, parsed by
crate::options::parse_cypher and nothing else, so a key file reads exactly the same here,
in hayson-browser and in a open({ cypher }) call from JS.
Validation happens at load, not at the first sealed record: a key file that does not parse, or material that is not 32 bytes, is a startup failure with a message naming the variable it came from. The alternative — a process running with silently no keys — turns one bad path into a read that refuses hours later, somewhere else entirely.
Structs§
- Cypher
KeyVars - The pair of environment variables one host reads its keys from —
<FILE>naming a JSON file,<INLINE>holding the same document as text. By conventionHAYSON_<APP>_CYPHER_KEY_FILEandHAYSON_<APP>_CYPHER_KEYS. - Cypher
Keyring - Key material a process holds, and where it came from. The ids are readable back; the material
is not — a host printing what it loaded prints
CypherKeyring::key_idsand never more. - Keyring
Error
Functions§
- ambient
- The keys
varsnames, orNonewhen neither variable is set to anything. The file wins over the inline document, so a host can override a baked-in environment by pointing at a file. - from_
file - The keys the JSON file at
pathholds.named_byis the flag or variable that pointed here, so a refusal says how the process was asked for this file rather than only which file it was. - from_
json_ text - Reads a
cypherdocument out of JSON text, namingsourcein every refusal.