pub struct HelperChain { /* private fields */ }Expand description
Try each helper in order on fill, broadcast approve / reject.
Typical wiring puts a CachingHelper before a
GitCredentialHelper: the cache short-circuits the slow
shell-out path once a working pair has resolved, and approvals
propagate so subsequent calls hit the cache.
Implementations§
Trait Implementations§
Source§impl Helper for HelperChain
impl Helper for HelperChain
Source§fn fill(&self, query: &Query) -> Result<Option<Credentials>, HelperError>
fn fill(&self, query: &Query) -> Result<Option<Credentials>, HelperError>
Walk helpers in order. The first to return creds wins; helpers
that error out are logged and skipped so a busted askpass program
can’t lock the user out of git credential further down the
chain. Mirrors upstream’s CredentialHelpers.Fill at
creds/creds.go:502. If nothing returned creds and at least one
helper errored, surface the last error so callers see why
nothing worked rather than a bare “credentials not found”.
Source§fn approve(&self, query: &Query, creds: &Credentials) -> Result<(), HelperError>
fn approve(&self, query: &Query, creds: &Credentials) -> Result<(), HelperError>
Broadcast to every helper. Errors from individual helpers are surfaced (first wins) — a failed approve generally means we couldn’t write to the keystore, which is worth knowing about.