Skip to main content

galata_vault/
lib.rs

1// The crate documentation is the README, so every example in it compiles as
2// a doctest and the two cannot drift. It carries the review-status
3// statement, `REVIEW_STATUS` below.
4// Non-test code never panics on its input: `unwrap`, `expect` and `panic!`
5// are denied outside `#[cfg(test)]`. Integration tests are separate crates,
6// and exempt.
7
8/// The review-status statement, word for word as the README, the Python
9/// package's description and the `gv --help` footer carry it. It is replaced by a link to the report only
10/// once an external review is published in the repository's `audit/`.
11pub const REVIEW_STATUS: &str = "galata-vault has not been independently audited. Its formats may change before 1.0. Use it at your own risk.";
12
13/// The private test-vector runner (feature `vectors`). Unsupported: it
14/// exists so the Python wheel runs the protocol vectors with this build's
15/// code (`docs/spec/README.md#5`).
16#[cfg(feature = "vectors")]
17#[doc(hidden)]
18#[path = "vectors.rs"]
19pub mod __vectors;
20// The SDK itself: the owner API, the token client, and the client-side
21// crypto they are built on. `sdk` is what pulls in `keys` and `seal`, so a
22// build without it links no value or name crypto at all -- which is what
23// makes the server build below provable rather than merely intended
24// (scripts/check-linkage.sh).
25#[cfg(feature = "sdk")]
26pub mod audit;
27#[cfg(feature = "sdk")]
28mod check;
29#[cfg(feature = "sdk")]
30pub mod client;
31#[cfg(feature = "sdk")]
32pub mod keys;
33#[cfg(feature = "sdk")]
34pub mod seal;
35
36/// The wire protocol: types, framing and the route table. Every build has it.
37pub mod proto;
38
39// The storage and serving side. None of it is compiled into an SDK-only
40// build, and none of it can reach `keys` or `seal`, which are not compiled
41// into a server-only build.
42#[cfg(feature = "storage")]
43pub mod backend;
44#[cfg(feature = "server")]
45pub mod server;
46#[cfg(feature = "server-core")]
47pub mod server_core;
48
49// The two binaries' libraries; crates/gv and crates/gv-mcp wrap them.
50#[cfg(feature = "cli")]
51pub mod cli;
52#[cfg(feature = "mcp")]
53pub mod mcp;
54
55#[cfg(feature = "embedded")]
56pub mod embedded;
57#[cfg(feature = "sdk")]
58mod error;
59#[cfg(feature = "sdk")]
60pub mod owner;
61#[cfg(feature = "sdk")]
62pub mod state;
63#[cfg(feature = "sdk")]
64pub mod store;
65#[cfg(feature = "test-util")]
66pub mod testing;
67#[cfg(feature = "sdk")]
68mod token;
69#[cfg(feature = "sdk")]
70mod value;
71#[cfg(feature = "sdk")]
72mod vault;
73
74#[cfg(feature = "sdk")]
75pub use crate::client::{
76    Api, Events, Method, NoEvents, Progress, Request, Response, Transport, TransportError, Warning,
77};
78#[cfg(feature = "http")]
79#[cfg(feature = "sdk")]
80pub use crate::client::{BuildError, ClientBuilder, HttpTransport};
81#[cfg(feature = "sdk")]
82pub use crate::proto::api::{Scope, VaultStatus, VersionMeta};
83#[cfg(feature = "sdk")]
84pub use crate::proto::audit::{Actor, ChainHead};
85#[cfg(feature = "sdk")]
86pub use crate::proto::path::EnvPath;
87#[cfg(feature = "sdk")]
88pub use crate::seal::ConfigFormat;
89#[cfg(feature = "sdk")]
90pub use audit::{AuditEntry, AuditReport, Unverifiable};
91#[cfg(feature = "sdk")]
92pub use check::{scan_literals, validate};
93#[cfg(feature = "sdk")]
94pub use error::{Error, ErrorKind, Expected, IntegrityFailure, code, kind_of, kind_of_status};
95#[cfg(feature = "sdk")]
96pub use state::{FileStateStore, LocalState, StateStore};
97#[cfg(feature = "sdk")]
98pub use store::{KeyName, KeyStore, StoreError};
99#[cfg(feature = "sdk")]
100pub use token::{LeakReport, TokenFileCheck, Vault, report_leaked_token};
101#[cfg(feature = "sdk")]
102pub use value::{ConfigDocument, Entry, Expect, Expiry, NewConfig, SecretSet, SecretValue};
103#[cfg(feature = "sdk")]
104pub use vault::{DescriptorPin, EXPIRY_WARNING_SECS, Pins};