Expand description
Credential helper bridge for Git LFS (git credential fill/approve/reject).
LFS endpoints are usually HTTPS, and HTTPS auth needs a username
and password. Rather than maintaining a separate credential store,
this crate defers to git’s existing one: whatever the user has
already configured for their git remote (osxkeychain, libsecret,
manager, store, plain cache, …) is what LFS uses too.
The Helper trait represents one credential source. A
HelperChain tries multiple sources in order, broadcasting
Helper::approve / Helper::reject to every helper so caches
stay in sync. The bundled implementations are:
CachingHelper: in-process cache keyed on theQuerytuple (protocol, host, path).GitCredentialHelper: shells out togit credential fill/approve/reject, picking up whatever helper the user has configured.AskpassHelper: spawns theGIT_ASKPASS/core.askpass/SSH_ASKPASSprogram for interactive prompts.NetrcCredentialHelper: parses~/.netrc(or_netrcon Windows) for host-keyed login/password pairs.
SSH remotes follow a different flow. SshAuthClient runs
git-lfs-authenticate <path> <operation> over SSH and parses an
SshAuth response containing a replacement HTTPS endpoint plus
short-lived authorization headers; no username/password is asked
of the user. Results are cached per request key with the
server-supplied expiry honored.
Structs§
- Askpass
Helper - Spawns
programper call with a single prompt argument and reads the username or password from stdout. - Caching
Helper - Process-local credential cache, keyed on the full
Querytuple. - Credentials
- A username/password pair returned by a credential helper.
- GitCredential
Helper - Shells out to the
gitbinary’s credential subsystem. - Helper
Chain - Try each helper in order on
fill, broadcastapprove/reject. - Netrc
Credential Helper - Netrc-backed credential helper.
- Query
- The fields
git credentialexpects on stdin, and thatHelperimplementations key on. - SshAuth
- Parsed
git-lfs-authenticateresponse with absolute expiry resolved. - SshAuth
Client - Spawns
ssh user@host git-lfs-authenticate <path> <operation>and caches the result. Cloneable (cache isArc-backed viaMutex).
Enums§
- Helper
Error - Things that can go wrong while invoking a credential helper.
- SshAuth
Error - Things that can go wrong while resolving SSH-based credentials.
- SshOperation
git-lfs-authenticate <path> <operation>operation argument.
Traits§
- Helper
- Resolve credentials for a given query, and report success/failure back so the helper can persist or invalidate its state.