gossan_graph/lib.rs
1#![forbid(unsafe_code)]
2// pedantic moved to workspace [lints.clippy] in root Cargo.toml
3#![cfg_attr(
4 not(test),
5 deny(
6 clippy::unwrap_used,
7 clippy::expect_used,
8 clippy::todo,
9 clippy::unimplemented,
10 clippy::panic
11 )
12)]
13#![allow(
14 clippy::module_name_repetitions,
15 clippy::must_use_candidate,
16 clippy::missing_errors_doc,
17)]
18
19//! Attack-surface graph — typed schema, multiple backends, and query layer.
20//!
21//! # Backends
22//! - [`store::sqlite::SqliteBackend`] — persistent SQLite with temporal diffing.
23//! - [`store::json::JsonBackend`] — JSON/JSONL export, auto-streams past 10K nodes.
24//! - [`store::graphml::GraphMlBackend`] — GraphML for network-analysis tools.
25//!
26//! # Query layer
27//! - [`query::find_all`] — nodes by type.
28//! - [`query::neighbors`] — outgoing edges from a node.
29//! - [`query::path`] — BFS shortest path between two nodes.
30
31pub mod edge;
32pub mod node;
33pub mod query;
34pub mod schema;
35pub mod store;
36
37pub use edge::Edge;
38pub use node::Node;
39
40// Re-export schema types
41pub use schema::{EdgeType, GraphSchema, NodeType, SchemaError, SCHEMA_VERSION};
42
43// Re-export store backends and traits
44pub use store::graphml::GraphMlBackend;
45pub use store::json::JsonBackend;
46pub use store::sqlite::{ScanDiff, SqliteBackend};
47pub use store::GraphBackend;
48
49// Re-export query helpers
50pub use query::{find_all, neighbors, path};
51
52// Re-export legacy compatibility items from the sqlite backend.
53pub use store::sqlite::target_id_from_finding;
54// Public deterministic ID for a `Target` — see `store::sqlite::target_id`
55// for shape (`domain:<host>` / `host:<ip>` / etc.). Re-exported at
56// crate root so callers can call it without spelling the backend
57// path; legendary unit test depends on this for ID-format pinning.
58pub use store::sqlite::target_id;