pub struct GitConfig { /* private fields */ }Expand description
Git configuration for Bashkit.
Controls git behavior including author identity and remote access.
§Example
use bashkit::GitConfig;
let config = GitConfig::new()
.author("Deploy Bot", "deploy@example.com");§Security
- Author identity is sandboxed (never reads from host)
- Remote URLs require explicit allowlist (Phase 2)
- All operations confined to virtual filesystem
Implementations§
Source§impl GitConfig
impl GitConfig
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new git configuration with default sandbox identity.
§Example
use bashkit::GitConfig;
let config = GitConfig::new();
// Uses default author: "sandbox <sandbox@bashkit.local>"Sourcepub fn allow_remote(self, pattern: impl Into<String>) -> Self
pub fn allow_remote(self, pattern: impl Into<String>) -> Self
Add a remote URL pattern to the allowlist (Phase 2).
Remote operations (clone, push, pull, fetch) require URLs to be in the allowlist. This method will be used in Phase 2.
§Example
use bashkit::GitConfig;
let config = GitConfig::new()
.allow_remote("https://github.com/myorg/");Sourcepub fn allow_remotes(
self,
patterns: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn allow_remotes( self, patterns: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Add multiple remote URL patterns to the allowlist (Phase 2).
Sourcepub fn allow_all_remotes(self) -> Self
pub fn allow_all_remotes(self) -> Self
Allow all remote URLs.
§Warning
This is dangerous and should only be used for testing or when the script is fully trusted.
Get the configured author name.
Get the configured author email.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GitConfig
impl RefUnwindSafe for GitConfig
impl Send for GitConfig
impl Sync for GitConfig
impl Unpin for GitConfig
impl UnwindSafe for GitConfig
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