Expand description
Credential layer — Git-compatible credential filling/approval/rejection for library embedders.
This is the reusable core lifted from the CLI’s grit credential command
(grit/src/commands/credential.rs). It exposes:
Credential— a structured credential with the standard Git fields (protocol,host,path,username,password,url) plus parsing/serialization in Git’skey=value\n…\n\ncredential wire format (Credential::parse/Credential::serialize).CredentialProvider— the pluggable seam an embedder implements (or wraps) to supply credentials.HelperCredentialProvider— the Git-compatible default that runs the configuredcredential.helper/credential.<url>.helperprograms (shell!cmd, the built-instore/cachehelpers, and externalgit-credential-*binaries).
§Non-interactive by design
Unlike the CLI, HelperCredentialProvider never prompts on a TTY or
via askpass. When the configured helpers cannot supply a usable
username/password, fill returns a typed
Error::Message (see NON_INTERACTIVE_MESSAGE) rather than blocking on
/dev/tty. Interactive prompting is an explicitly opt-in concern an
embedder can layer on top.
Structs§
- Credential
- A structured Git credential.
- Helper
Credential Provider - Git-compatible
CredentialProviderthat runs the configuredcredential.helperprograms.
Constants§
- NON_
INTERACTIVE_ MESSAGE - Message returned (as
Error::Message) when credentials are required but no configured helper could supply a complete username/password and interactive prompting is disallowed.
Traits§
- Credential
Provider - The pluggable credential seam an embedder implements (or wraps).
Functions§
- use_
http_ path - Whether
credential.useHttpPath(optionally URL-scoped) is enabled.