Struct EgressPolicy
pub struct EgressPolicy { /* private fields */ }Expand description
One materialized view of canonical operator egress policy.
Construct this inside an EgressPolicyResolver call. Long-lived stores
retain the resolver, not this view, so an operator’s edit applies to the
next dial rather than to the next restart.
The two host lists are exactly the operator’s
plugins.entries[].egress_hosts and egress_allow_private. There is no
second config surface: a destination is reachable because the operator
granted it, and no manifest, permission, or default adds to that.
Implementations§
Source§impl EgressPolicy
impl EgressPolicy
Sourcepub fn new(
hosts: &[String],
allow_private: &[String],
nat64_prefixes: &[String],
max_connections_per_instance: usize,
) -> Result<Self, EgressError>
pub fn new( hosts: &[String], allow_private: &[String], nat64_prefixes: &[String], max_connections_per_instance: usize, ) -> Result<Self, EgressError>
Build and validate one resolved policy view.
hosts and allow_private use the strict egress grammar
(zeroclaw_infra::net_guard::normalize_egress_pattern): exact hosts or
*.suffix patterns, with no allow-all form. An empty hosts list is
the default and means no reach at all.
nat64_prefixes is the deployment’s security.nat64_prefixes, parsed
here so a malformed list fails the policy closed rather than silently
disabling network-specific classification. This mirrors how the built-in
tools parse the same list at construction.
§Errors
Returns EgressError for an invalid host pattern, a private carveout
that is broader than every host grant, an invalid NAT64 prefix, or a
zero connection ceiling.
Sourcepub fn deny_all(
max_connections_per_instance: usize,
) -> Result<Self, EgressError>
pub fn deny_all( max_connections_per_instance: usize, ) -> Result<Self, EgressError>
A policy that grants nothing. The state an unconfigured instance is in.
§Errors
Returns EgressError::InvalidConnectionLimit for a zero ceiling.
Trait Implementations§
Source§impl Clone for EgressPolicy
impl Clone for EgressPolicy
Source§fn clone(&self) -> EgressPolicy
fn clone(&self) -> EgressPolicy
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more