1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! `ledvar-core` — the reference implementation of the **Ledvar protocol** core:
//! the data model, the canonical content-addressed hashing, and well-formedness.
//!
//! The crate is deliberately **domain-blind** (it knows nothing about security,
//! cloud, or any domain) and **dependency-light** (`serde` for the wire model,
//! `sha2` for hashing — nothing else). Hashing streams the canonical bytes
//! straight into SHA-256 with no intermediate allocation; see the design note in
//! `docs/canonical-hashing.md`.
//!
//! ```
//! use ledvar_core::Node;
//! use std::collections::{BTreeMap, BTreeSet};
//!
//! let mut content = BTreeMap::new();
//! content.insert("grants".to_string(), BTreeSet::from(["SELECT".into(), "INSERT".into()]));
//! content.insert("risk".to_string(), BTreeSet::from(["Medium".into()]));
//! let node = Node {
//! path: vec!["mydb".into(), "user:app".into()],
//! content,
//! labels: BTreeMap::new(),
//! refs: Vec::new(),
//! };
//! assert_eq!(node.identity_key().unwrap(), "8e303e0e8139ff7d377e0eaf9097e2790071f9914bc7cf8b28020bb98a3cca95");
//! assert_eq!(node.content_hash().unwrap(), "296190489d577d410f0f7fa09dfa24660722227fe405daaf621f4e2666bf370f");
//! ```
pub use canonical_json_string;
pub use Error;
pub use ;
pub use ;
pub use ;