pub trait CredentialProvider {
// Required method
fn fill(&mut self, request: GitCredential) -> Result<Option<GitCredential>>;
// Provided methods
fn approve(&mut self, _credential: &GitCredential) -> Result<()> { ... }
fn reject(&mut self, _credential: &GitCredential) -> Result<()> { ... }
}Expand description
Supplies credentials for an authenticated remote, mirroring git’s credential
protocol: fill is handed a partial
GitCredential describing the request (protocol/host/path) and returns a
completed credential, or None to proceed unauthenticated.
approve / reject
let a backing store remember or forget a credential after the request
succeeds or fails; the default no-ops suit providers without a store.
Required Methods§
Sourcefn fill(&mut self, request: GitCredential) -> Result<Option<GitCredential>>
fn fill(&mut self, request: GitCredential) -> Result<Option<GitCredential>>
Complete request into a usable credential, or return None to attempt
the request without authentication.
Provided Methods§
Sourcefn approve(&mut self, _credential: &GitCredential) -> Result<()>
fn approve(&mut self, _credential: &GitCredential) -> Result<()>
Record credential as having worked (e.g. store it). Default: no-op.
Sourcefn reject(&mut self, _credential: &GitCredential) -> Result<()>
fn reject(&mut self, _credential: &GitCredential) -> Result<()>
Record credential as having failed (e.g. erase it). Default: no-op.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".