Skip to main content

Crate tilo_secrets

Crate tilo_secrets 

Source
Expand description

App-scoped secret storage: one API on Linux, macOS, Windows and the web.

A SecretStore belongs to one app (SecretStore::for_app), and its keys name that app’s secrets and no other app’s. SecretStore::memory keeps them in the process, for tests.

TargetBackendProtection
Linuxthe freedesktop Secret Service over D-Bus (GNOME Keyring, KWallet)Protection::OsKeychain
Linux, in Tilo’s sandboxsealed files in the app’s directory, keyed by the Secret portalProtection::OsKeychain
macOSthe login Keychain’s generic passwordsProtection::OsKeychain
Windowsgeneric credentials in the user’s Credential Manager (DPAPI-encrypted, this machine only)Protection::OsKeychain
WebAES-GCM under a non-extractable CryptoKey; key and ciphertext in IndexedDBProtection::BrowserWrapped
Linux, macOS with TILO_SECRETS_DIRsealed owner-only files in that directoryProtection::LocalFile

SECRETS_DIR_ENV serves machines with no keychain to unlock: every process given it keeps its secrets in that directory instead of the system store. BrowserWrapped does not protect against script running in the page’s origin or an attacker holding the browser profile.

The API is async because the browser’s is, and its futures are Send on the desktop only: spawn them on tilo_rt::app(), which accepts both. Desktop code may use the *_blocking methods; the web answers them once the host has loaded the page’s secrets (web::mirror), and otherwise with Feature::Blocking unsupported.

Modules§

conformance
The contract every SecretStore keeps, as checks a backend’s tests (and a host’s own backend’s tests) run. They write, overwrite and delete one key, tilo-conformance, of the store they are given.

Structs§

ItemSecret
PutOptions
Secret
Secret bytes: wiped from memory on drop and never printed by Debug.
SecretStore
SecretsScope
Keeps a thread’s stores in one backend until it is dropped: see scope_thread.

Enums§

Availability
Feature
Protection
SecretError

Constants§

SECRETS_DIR_ENV

Traits§

SecretBackend

Functions§

arm_device_proof
Arm this process with the device secret it just read; only the key derived for proofs is kept.
availability
available
items_outlive_rebuilds
Whether what this build puts in the system store stays readable by later builds of the same program. On macOS only a Developer ID signature does; an ad-hoc or dev signature’s items are readable by that build alone.
keep_in_memory_for_process
From now on, every SecretStore::for_app in this process shares one in-memory store and never reaches the platform’s, which may prompt and holds the user’s real secrets.
memory_backend
scope_thread
From now until the guard drops, every SecretStore::for_app this thread creates keeps its secrets in backend, never the platform’s store.
unscoped

Type Aliases§

Unsupported