pub struct GitCredentialHelper { /* private fields */ }Expand description
Shells out to the git binary’s credential subsystem.
git_program defaults to "git". Override for tests via
Self::with_program — point at a fake git that records its input
or scripts a response.
protect_protocol mirrors credential.protectProtocol (default
true). When set, every value written to git credential stdin is
rejected if it contains a carriage return — preventing newline-based
protocol smuggling. Newlines and null bytes are rejected
unconditionally regardless of this flag.
Implementations§
Source§impl GitCredentialHelper
impl GitCredentialHelper
Sourcepub fn with_program(git_program: impl Into<String>) -> Self
pub fn with_program(git_program: impl Into<String>) -> Self
Build the helper around a custom git-compatible binary.
Used by the integration tests, which point at a shell script that fakes the protocol.
Sourcepub fn with_protect_protocol(self, protect: bool) -> Self
pub fn with_protect_protocol(self, protect: bool) -> Self
Toggle credential.protectProtocol for this helper.
Default is true. Pass false only when the user has
explicitly opted out; carriage returns in URLs are otherwise
a known smuggling vector.
Trait Implementations§
Source§impl Clone for GitCredentialHelper
impl Clone for GitCredentialHelper
Source§fn clone(&self) -> GitCredentialHelper
fn clone(&self) -> GitCredentialHelper
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GitCredentialHelper
impl Debug for GitCredentialHelper
Source§impl Default for GitCredentialHelper
impl Default for GitCredentialHelper
Source§impl Helper for GitCredentialHelper
impl Helper for GitCredentialHelper
Source§fn fill(&self, query: &Query) -> Result<Option<Credentials>, HelperError>
fn fill(&self, query: &Query) -> Result<Option<Credentials>, HelperError>
query. Read more