pub struct GitCloner { /* private fields */ }Expand description
Git repository cloner with security measures
Implementations§
Source§impl GitCloner
impl GitCloner
Sourcepub fn with_auth_token(self, token: Option<String>) -> Self
pub fn with_auth_token(self, token: Option<String>) -> Self
Set authentication token for private repositories
Sourcepub fn with_timeout(self, secs: u64) -> Self
pub fn with_timeout(self, secs: u64) -> Self
Set clone timeout in seconds
Sourcepub fn with_max_size(self, mb: u64) -> Self
pub fn with_max_size(self, mb: u64) -> Self
Set maximum repository size in MB
Sourcepub fn clone(&self, url: &str, git_ref: &str) -> Result<ClonedRepo, RemoteError>
pub fn clone(&self, url: &str, git_ref: &str) -> Result<ClonedRepo, RemoteError>
Clone a repository with security measures
Security measures:
- Uses shallow clone (depth=1)
- Disables git hooks (template and local)
- Uses temporary directory that is automatically cleaned up
- Token is passed via GIT_ASKPASS (not embedded in URL)
- Clone has configurable timeout
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GitCloner
impl RefUnwindSafe for GitCloner
impl Send for GitCloner
impl Sync for GitCloner
impl Unpin for GitCloner
impl UnwindSafe for GitCloner
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