Skip to main content

Module vault

Module vault 

Source
Expand description

The process-wide vault session and its audit.

One VaultSession per forge process, built from [vault] at boot and swapped on a reload that changes the section. It owns the tokens and the derived keys; the connector holds neither. A call the server rejects with 401 tries the refresh token, and only a failed refresh locks the session and makes the next held call ask for the master password. [vault] idle_minutes, when set, locks an unused session on its first read after the bound.

The master password never enters this struct. It arrives with one answer, is used to derive the master key, and is zeroized before the answer is dropped.

Re-exportsΒ§

use std::path::Path; πŸ”’
use std::path::PathBuf; πŸ”’
use forge_connectors::vault::crypto; πŸ”’
use forge_connectors::vault::crypto::Unlocked; πŸ”’
use forge_connectors::vault::models::Prelogin; πŸ”’
use forge_connectors::vault::models::SyncData; πŸ”’
use forge_connectors::vault::models::TokenResponse; πŸ”’
use forge_connectors::vault::models::TwoFactorCode; πŸ”’
use forge_connectors::vault::VaultClient; πŸ”’
use forge_connectors::vault::VaultError; πŸ”’
use forge_primitives::vault::VaultReleased; πŸ”’
use forge_primitives::vault::VaultTool; πŸ”’
use serde_json::Value; πŸ”’
use zeroize::Zeroize; πŸ”’
use zeroize::Zeroize; πŸ”’
use zeroize::Zeroizing; πŸ”’
use crate::SessionSlot; πŸ”’
use crate::config::VaultConfig; πŸ”’
use crate::protocol::SessionUpdate; πŸ”’
use crate::update_fanout::UpdateFanout; πŸ”’

StructsΒ§

AuditFile πŸ”’
SessionState πŸ”’
The session’s live half: the tokens and the derived keys, or neither.
Tokens πŸ”’
The access and refresh tokens one unlock produced.
VaultAudit πŸ”’
The append-only audit file, rotated 10 MB x 6.
VaultSession πŸ”’
One process-wide Vaultwarden session.
VaultState
The shared vault session as a view draws it: whether it is locked and the idle bound the config set.

ConstantsΒ§

AUDIT_MAX_BYTES πŸ”’
AUDIT_MAX_FILES πŸ”’

FunctionsΒ§

production_client πŸ”’
The production vault clients: the machine’s extra TLS roots, https_only, the account’s own user agent, and the vault family’s bounds. The download client takes a longer read and total bound because an attachment is opaque ciphertext up to the server’s cap.
rotate πŸ”’
rotated_path πŸ”’