Skip to main content

EnvOnlyEnforcer

Struct EnvOnlyEnforcer 

Source
pub struct EnvOnlyEnforcer;
Expand description

Enforcer that only sets proxy env and runs the child (no runner, no isolation). Used when force_traffic_through_proxy is false, or when we’re already inside the runner (Docker/Firecracker).

Trait Implementations§

Source§

impl Enforce for EnvOnlyEnforcer

Source§

fn maybe_spawn_runner( &self, _cmd: &str, _secret_mappings: &[SecretMapping], _string_mappings: &[StringMapping], _allow_private_connect: bool, _upstream_ca: &Option<PathBuf>, _connection_policies: &[ConnectionPolicy], ) -> Result<Option<ExitStatus>, Box<dyn Error + Send + Sync>>

If this platform enforces by spawning a runner process (e.g. Linux network namespace), spawn it and return Ok(Some(status)). Otherwise return Ok(None) and the caller will run proxy+child in-process.
Source§

fn run_child( &self, cmd: &str, proxy_url: &str, env_vars_with_masked: &[(String, String)], ssl_cert_file: &Path, _force: bool, ) -> Result<ExitStatus, Box<dyn Error + Send + Sync>>

Run the child process with proxy env vars. When force is true, wrap with platform sandbox (e.g. sandbox-exec on macOS). Otherwise run normally (e.g. duct).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.