mxc-sdk 1.2.0

Importable library for starting MXC sandboxes in-process, with streaming stdio.
Documentation
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

//! Seatbelt-specific configuration types.

/// macOS Seatbelt settings.
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub struct SeatbeltConfig {
    /// Replace the generated sandbox profile entirely.
    pub profile_override: Option<String>,
    /// Allow all Mach lookups and registrations, IOKit user clients, and POSIX
    /// shared memory, plus writes to the system temp folders. This includes
    /// system services that can make network requests for the sandbox.
    pub gui_access: bool,
    /// Allow the contained process to allocate nested pseudo-terminals.
    pub nested_pty: bool,
    /// Allow access to the macOS Keychain.
    pub keychain_access: bool,
    /// Additional Mach service global names the process may resolve.
    pub extra_mach_lookups: Vec<String>,
}

impl Default for SeatbeltConfig {
    fn default() -> Self {
        Self {
            profile_override: None,
            gui_access: false,
            nested_pty: true,
            keychain_access: false,
            extra_mach_lookups: Vec::new(),
        }
    }
}