Struct EgressHostService
pub struct EgressHostService { /* private fields */ }Expand description
Shared service injected into plugin stores and cloned across transports.
Policy is per service, because a service is built around one resolver. Connection accounting is not: it comes from the process-wide connection registry, so two services built independently for the same canonical instance spend one budget rather than one each.
Implementations§
Source§impl EgressHostService
impl EgressHostService
Sourcepub fn new(resolver: EgressPolicyResolver) -> Self
pub fn new(resolver: EgressPolicyResolver) -> Self
Construct one service around a live canonical policy resolver.
The connection budget it enforces is the process-wide one for each instance it sees, so an operator’s ceiling holds no matter how many tool registries end up representing the same instance.
Resolve DNS, apply current policy, pin the checked addresses, and reserve one shared connection slot for the request’s logical instance.
This is the single resolution: the addresses in the returned
AuthorizedEgress are the only ones that may be dialed.
§Errors
Returns EgressError when the grant check, DNS, address validation,
or connection-budget acquisition fails.
Apply current policy to an address set supplied by a resolver.
This is the adapter seam for custom resolvers and deterministic tests.
The returned ResolvedDestination is the only address set that may be
dialed; resolving the hostname again defeats the security contract.
§Errors
Returns EgressError for any denied or malformed request.
Trait Implementations§
Source§impl Clone for EgressHostService
impl Clone for EgressHostService
Source§fn clone(&self) -> EgressHostService
fn clone(&self) -> EgressHostService
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more