pub trait SinkCallback {
// Required method
fn is_sink(&self, node: i64, entity: &GraphEntity) -> bool;
}Expand description
Callback trait for detecting security-sensitive sinks.
Implement this trait to define custom sink detection logic. The callback receives a node ID and its entity data, returning true if the node is a security-sensitive sink.
§Example
ⓘ
use sqlitegraph::algo::{SinkCallback, TaintResult};
use sqlitegraph::graph::types::GraphEntity;
struct SqlQueryDetector;
impl SinkCallback for SqlQueryDetector {
fn is_sink(&self, node: i64, entity: &GraphEntity) -> bool {
// Detect SQL query execution nodes
entity.kind == "sql_execute" ||
entity.data["operation"].as_str() == Some("query")
}
}