Expand description
Peer-class matching engine.
This layer takes the PeerClass rules parsed from the
governance XML and classifies a remote peer (represented
by its PeerCapabilities) into the matching class. The
GovernancePolicyEngine consults
the result and emits the corresponding protection level.
§Matching rule
- Iteration over
domain_rule.peer_classesin XML order — first match wins. - A peer class matches if all set
match_criteriafields are satisfied (AND combination):auth_plugin_class— exact string comparison.""matchesNonein the peer (legacy peer without a plugin).cert_cn_pattern— wildcard comparison viacn_pattern_match. A peer without a cert CN does not match.suite— the peer must list the suite in itssupported_suites(CSV string comparison).require_ocsp—PeerCapabilities::has_valid_certmust betrue.
- Empty
match_criteria(all fieldsNone/false) matches every peer — this is the default/fallback class, which typically is the last entry in the XML.
§Spec reference
docs/architecture/08_heterogeneous_security.md§5.- Plan DoD §stage 8: “governance example with 4 peer classes
(legacy/fast/secure/HA) is parsed correctly” —
resolve_peer_classis the runtime verification of exactly this example.
Functions§
- interface_
accepts_ class - Allow-list check: may a peer of a given class communicate on the given interface?
- peer_
matches_ class - Checks whether a
PeerClassmatches the peer capabilities. - peer_
matches_ class_ with_ delegation - Extended variant of
peer_matches_classthat additionally resolvesdelegation_profilereferences. - resolve_
peer_ class - Finds the first matching peer class for a peer. Returns
Noneif no class matches — the caller then falls back to the domain default protection. - resolve_
protection - Extracts the protection level of a matching peer class.
Noneif no class matched.