Skip to main content

sentinelpass_protocol/
lib.rs

1//! SentinelPass IPC protocol contract.
2//!
3//! This crate is the narrow, stable surface that daemon clients embed:
4//! message types, the authentication envelope, wire framing (length-prefixed
5//! frames, 64 KiB cap), platform transports (client side), token file
6//! management, and [`IpcClient`].
7//!
8//! Stability rules:
9//! - Every wire type must deserialize old payloads (serde defaults for new
10//!   fields; unknown fields are ignored by serde).
11//! - Framing and Windows AES-256-GCM frame format never change byte layout.
12//!
13//! Server-side types (listeners, the request dispatcher) intentionally live
14//! in `sentinelpass-core`, not here.
15
16pub mod client;
17pub mod connection;
18pub mod envelope;
19pub mod error;
20pub mod message;
21pub mod paths;
22pub mod service;
23pub mod session;
24pub mod token;
25pub mod transport;
26#[cfg(windows)]
27pub mod windows_frame;
28
29pub use client::IpcClient;
30pub use envelope::{IpcEnvelope, Origin};
31pub use error::ProtocolError;
32pub use message::{CredentialSummary, ExternalSecretField, IpcMessage, SitePermissionSummary};
33pub use paths::{default_ipc_socket_path, default_ipc_token_path, get_config_dir};
34pub use service::{
35    ServiceBiometricStatus, ServiceEntity, ServiceEntry, ServiceEntrySummary, ServiceError,
36    ServiceOutcome, ServiceSyncDeviceInfo, ServiceSyncStatus, ServiceTotpMetadata,
37    ServiceVaultStatus, VaultOp, VaultOpResult,
38};
39pub use token::{load_ipc_token, load_or_create_ipc_token};
40#[cfg(unix)]
41pub use transport::unix::UnixSocketConnection;
42#[cfg(windows)]
43pub use transport::windows::WindowsNamedPipeConnection;
44pub use transport::{TransportConfig, TransportError, TransportResult, MAX_MESSAGE_SIZE};
45#[cfg(windows)]
46pub use windows_frame::{
47    decrypt_windows_ipc_frame, encrypt_windows_ipc_frame, windows_named_pipe_path,
48};
49
50pub type Result<T> = std::result::Result<T, ProtocolError>;