pub struct Sandbox { /* private fields */ }Expand description
Sandbox for running a subprocess with masked secrets and an HTTP proxy that rewrites tokens.
HTTP requests are forwarded with token replacement. HTTPS (CONNECT) is always handled by MITM:
the proxy decrypts, rewrites tokens, and re-encrypts to upstream. The subprocess must trust our CA
(we set SSL_CERT_FILE). For self-signed or custom upstream servers, set upstream_ca on SandboxConfig.
Implementations§
Source§impl Sandbox
impl Sandbox
Sourcepub fn new(config: SandboxConfig) -> Self
pub fn new(config: SandboxConfig) -> Self
Create a sandbox from the given config.
Sourcepub async fn run(
&self,
program: &str,
args: &[String],
) -> Result<ExitStatus, Box<dyn Error + Send + Sync>>
pub async fn run( &self, program: &str, args: &[String], ) -> Result<ExitStatus, Box<dyn Error + Send + Sync>>
Run a command in the sandbox: start an HTTP proxy that rewrites masked tokens and string tokens to real values, set subprocess env with masked tokens (if any) and HTTP_PROXY/HTTPS_PROXY, then wait for the process to exit.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Sandbox
impl RefUnwindSafe for Sandbox
impl Send for Sandbox
impl Sync for Sandbox
impl Unpin for Sandbox
impl UnsafeUnpin for Sandbox
impl UnwindSafe for Sandbox
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more