pub struct Config {
pub settings: Settings,
pub commands: Commands,
pub wrappers: WrapperConfig,
pub git: GitConfig,
pub cargo: CargoConfig,
pub kubectl: KubectlConfig,
pub gh: GhConfig,
}Expand description
Top-level configuration, produced by merging embedded defaults with
an optional user overlay from ~/.config/cc-toolgate/config.toml.
Fields§
§settings: SettingsGlobal settings (e.g. escalate_deny).
commands: CommandsFlat command-to-decision mappings (allow, ask, deny lists).
wrappers: WrapperConfigWrapper commands that execute their arguments as subcommands.
git: GitConfigGit subcommand-aware evaluation rules.
cargo: CargoConfigCargo subcommand-aware evaluation rules.
kubectl: KubectlConfigkubectl subcommand-aware evaluation rules.
gh: GhConfigGitHub CLI (gh) subcommand-aware evaluation rules.
Implementations§
Source§impl Config
impl Config
Sourcepub fn default_config() -> Self
pub fn default_config() -> Self
Load the default embedded configuration.
Sourcepub fn load() -> Self
pub fn load() -> Self
Load configuration with resolution order:
- Start with embedded defaults
- Merge user overlay from ~/.config/cc-toolgate/config.toml (if exists)
User config merges with defaults: lists extend, scalars override.
Set replace = true in any section to replace its defaults entirely.
Use remove_<field> lists to subtract specific items from defaults.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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