sefy-core 0.20.0

Core library for sefy: an inconspicuous encrypted secret store in a single file
Documentation
//! Core library behind [sefy](https://github.com/lacodda/sefy): a personal
//! secret store that lives in one unremarkable file.
//!
//! A vault is a SQLite database sealed whole with XChaCha20-Poly1305 under a
//! key derived from a master password with Argon2id. The file on disk is
//! `salt ‖ nonce ‖ ciphertext` — no magic bytes, no header, no extension
//! convention, nothing to mark it as a secret store.
//!
//! # Threat model
//!
//! sefy is **inconspicuous, not deniable**. It hides secrets from a passing
//! glance, a curious file listing and a cloud-side scanner looking for known
//! formats. It does not claim to withstand forensic analysis — a
//! high-entropy headerless file is recognizable as *some* container to an
//! examiner — nor to protect anyone compelled to give up a password.
//!
//! # Example
//!
//! ```
//! use sefy_core::{ItemKind, NewItem, Payload, Query, Vault};
//! # let directory = tempfile::tempdir().unwrap();
//! # let path = directory.path().join("notes.bak");
//!
//! let mut vault = Vault::create(&path, b"master password")?;
//! let id = vault.add(
//!     NewItem::new("bank", Payload::Note { text: "vault code 1234".into() })
//!         .with_tags(["money"]),
//! )?;
//! vault.save()?;
//!
//! let reopened = Vault::open(&path, b"master password")?;
//! let found = reopened.search(&Query::all().text("bank").kind(ItemKind::Note))?;
//! assert_eq!(found[0].id, id);
//! # Ok::<(), sefy_core::Error>(())
//! ```

#![forbid(unsafe_code)]
#![warn(missing_docs)]

#[cfg(feature = "agent")]
pub mod agent;
pub mod audit;
pub mod clipboard;
pub mod copies;
pub mod crypto;
pub mod db;
pub mod device;
pub mod error;
pub mod exchange;
pub mod expiry;
pub mod format;
pub mod generate;
pub mod history;
pub mod keys;
pub mod merge;
pub mod model;
pub mod otp;
pub mod plugin;
pub mod policy;
pub mod strength;
pub mod sync;
pub mod time;
pub mod vault;
pub mod wipe;

pub use audit::{Due, Old, Place, Report, Unreadable, Weak, audit};
pub use error::{Error, Result};
pub use exchange::{
    EXPORT_VERSION, Export, ExportField, ExportItem, ExportReport, ExportStamp, ExportVersion,
    Exported, Format, ImportReport, Notice, Outcome, Target,
};
pub use expiry::Expiry;
pub use format::{FORMAT_VERSION, SEALING, Sealing};
pub use generate::{Classes, Generated, Language, Recipe, generate};
pub use history::{Change, ChangeKind, Line, Version};
pub use keys::{FreshKey, KeySource, Opener};
pub use merge::{Conflict, MergeReport, MergedItem, Side, merge};
pub use model::{
    AuditAs, Field, FieldSpec, Item, ItemKind, ItemSummary, LEGACY_LOGIN_NAME, NewItem, Payload,
    Query, Template,
};
pub use otp::Totp;
pub use plugin::{PROTOCOL_VERSION, Plugin};
pub use policy::Policy;
pub use strength::{Strength, estimate, estimate_generated};
pub use sync::{Fetched, PullReport, SyncPreview, SyncReport, fetch, pull, push, sync};
pub use vault::{PasswordChange, Stats, Status, SyncStamp, Vault};
pub use wipe::Wiped;