beam/sea/session/mod.rs
1//! Session storage backends for SEA `recall()`.
2//!
3//! Session storage allows user keypairs to be persisted across restarts
4//! without requiring the user to re-enter their password. The `SessionStorage`
5//! trait defines the interface; two backends are provided:
6//!
7//! - `InMemorySessionStorage` — ephemeral, for testing and short-lived processes
8//! - `EncryptedFileSessionStorage` — production-grade, AES-256-GCM encrypted files (native only)
9//!
10//! # Security
11//!
12//! Session files contain encrypted private keys. The master key is resolved
13//! from (1) `BEAM_SEA_SESSION_KEY` env var, (2) `~/.config/beam/.session_key`
14//! file, or (3) auto-generated with an `ERROR`-level log. Files are stored
15//! with `0700` permissions on Unix.
16
17#[cfg(not(target_arch = "wasm32"))]
18pub mod file;
19pub mod memory;
20
21#[cfg(not(target_arch = "wasm32"))]
22pub use file::EncryptedFileSessionStorage;
23pub use memory::InMemorySessionStorage;