notesy::secrets

Keys, tokens and passwords, kept in the system keychain (the macOS Keychain, the Windows Credential Manager, the Secret Service on Linux), never in the plugin's store or anywhere else on disk. Needs nothing.

rustuse notesy::secrets;

pub fn ready() {
    if secrets::get("webhook")?.is_none() {
        secrets::set("webhook", "wh_example");
    }
}
Function What it does
secrets::get(name) The secret it kept as name, Some(text), or None.
secrets::set(name, secret) Keeps secret (up to 16 KB) as name.
secrets::remove(name) Deletes it.

Names are letters, digits, _, - and .. Names starting setting. and account. are notesy's: the values of secret settings (read those with settings::get) and the tokens of its accounts (which a script never sees; see notesy::accounts).

Each plugin reaches only its own secrets: notesy files every name under the plugin's id. Their names (never their values) are listed in its store, so they're all deleted with it when the user removes the plugin and its data.

When the system has no keychain notesy can reach, secrets are kept in memory until notesy quits, and notesy says so.

Every page