bookclerk_workerd::egress
Host egress policy for workerd guests (wraps shared EgressPolicy).
pub struct EgressProxy {
/* private fields */
}
Initial-host allowlist with redirect-follow semantics.
Thin wrapper kept for call sites; core matching lives in
bookclerk_plugin_manifest::EgressPolicy.
pub fn from_manifest(manifest: &PluginManifest) -> Self
Builds egress constraints from a plugin manifest network section.
manifest- Parsed plugin manifest.
Updated Self for chaining.
pub fn from_policy(inner: EgressPolicy) -> Self
Builds egress constraints from an already-approved host policy.
inner-innerinput for this call.
Updated Self for chaining.
pub fn with_relay(self, addr: impl Into<String>) -> Self
Routes the isolate's egress through the launcher's relay.
addr- Workerdexternaladdress the relay listens on.
Updated Self for chaining.
pub fn relay(&self) -> Option<&str>
Workerd external address of the egress relay, when one is set.
pub fn policy(&self) -> &EgressPolicy
Returns the underlying egress policy for inspection / logging.
pub fn mode(&self) -> NetworkMode
Network mode from the plugin manifest.
pub fn max_redirects(&self) -> u32
Maximum redirect hops after an allowed initial request.
pub fn allowed_initial_hosts(&self) -> &[String]
domains entries the guest may fetch before redirects: a host
pattern with an optional :port (no port grants 80 and 443).
pub fn allows_initial_host(&self, host: &str) -> bool
Whether a direct (non-redirect) request host is permitted.
host- Hostname being checked for egress.
true when the predicate holds.
pub fn allows_redirect_hop(&self, host: &str, hop_index: u32) -> bool
Redirect hops must stay in the fetch allowlist unless
allowUndeclaredPublicRedirects is set. Address-space policy still
applies (loopback / RFC1918 / link-local / metadata stay denied).
host- Redirect target hostname.hop_index- Numeric hop index after the initial request.
true when the predicate holds.
Implements: Clone, Debug
Generated from crates/bookclerk-workerd at main · View as Markdown