Skip to main content

CredentialProvider

Trait CredentialProvider 

Source
pub trait CredentialProvider {
    // Required methods
    fn fill(&self, input: &Credential) -> Result<Credential>;
    fn approve(&self, cred: &Credential) -> Result<()>;
    fn reject(&self, cred: &Credential) -> Result<()>;
}
Expand description

The pluggable credential seam an embedder implements (or wraps).

All three methods take a (partial) Credential describing the target and return a result; transports call fill before a request and approve / reject after, mirroring Git’s credential_fill / credential_approve / credential_reject.

Required Methods§

Source

fn fill(&self, input: &Credential) -> Result<Credential>

Fill in missing fields (typically username/password) for input, returning a more-complete Credential. Implementations that cannot supply a usable credential should return a typed Error rather than block on interactive input.

Source

fn approve(&self, cred: &Credential) -> Result<()>

Mark cred as known-good (helpers store it).

Source

fn reject(&self, cred: &Credential) -> Result<()>

Mark cred as known-bad (helpers erase it).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§