pub fn validate_policy(policy: &PolicyConfig) -> Result<(), Vec<String>>Expand description
Validates a policy’s node graph structure, collecting all violations.
Enforced rules:
- no two nodes share an id;
- the policy has a
listenernode (entry) and aclientnode (exit); - every edge endpoint references an existing node;
- no orphan nodes (a node with neither incoming nor outgoing edges;
being named as the policy-level
error_handlercounts as connected); error_handler, if set, references an existing node that is not atype: supernodeinstance (expansion removes instance nodes, so a catch-all pointed at one would dangle at request time).
Returns Ok(()) when valid, otherwise Err with one message per
violation (validation does not stop at the first error).