Skip to main content
← rust.krizaka.comkrizaka.com

Module secrets

Module secrets 

Source
Expand description

Small secrets of a Mac app (the session token first of all: the bearer the product’s API gave at sign in, the same kind the mobile apps hold), in the macOS Keychain — never a file, never the page’s storage. The page sees it as the KeyValueStorage port of @krizaka/app-client, so the Mac apps use the same session store and API client as the mobile ones. This module holds the rules every store follows, and an in-memory store for tests.

Structs§

Checked
The checked way to every store: what reaches the Keychain has passed check_key and check_value.
MemorySecrets
A store in memory, for tests and previews.

Enums§

SecretError
Why a secret could not be read, written or removed. A refused key or value is never repeated: the page may have put a secret in the wrong argument.

Constants§

MAX_KEY
The longest key.
MAX_VALUE
The largest value stored; a bearer or a piece of the discovery manifest is far shorter.

Traits§

SecretStore
Where the secrets are kept. One Keychain service per app (its bundle id), one account per key.

Functions§

check_key
A key is lowercase letters, digits, ., -, _, at most MAX_KEY characters (verikora.session). A refused key is not repeated in the error: the page may have put a secret in the wrong argument.
check_value
A value is text of at most MAX_VALUE bytes, without a NUL.