pub enum AuthStrategy {
SshAgent {
username: Option<String>,
},
SshKey {
username: String,
public_key: Option<PathBuf>,
private_key: PathBuf,
passphrase: Option<String>,
},
UserPass {
username: String,
password: String,
},
Token {
token: String,
host: Option<String>,
},
Default,
}Expand description
Authentication strategy for git operations
Variants§
SshAgent
Use SSH key from agent
SshKey
Use specific SSH key file
UserPass
Use username/password
Token
Use a personal access token.
host optionally binds the token to an exact origin host (e.g.
"github.com"). When set, the credential callback only offers the
token when the request URL’s host matches — a token configured for
host A is never sent to host B. None means unscoped; unscoped tokens
must not be attached to default/untrusted clone paths (see
crate::manager::GitManager::default_clone_options).
Default
Use default credentials (for public repos)
Implementations§
Source§impl AuthStrategy
impl AuthStrategy
Sourcepub fn is_ambient(&self) -> bool
pub fn is_ambient(&self) -> bool
Whether this strategy consults ambient credential sources — the
running SSH agent (ssh_key_from_agent), the git credential helper,
or ~/.gitconfig — rather than explicit material the caller provided.
Default and SshAgent are ambient. SshKey (explicit file path),
UserPass, and Token are explicit and always honored, including
under crate::callback_config::AuthMode::ExplicitOnly.
Trait Implementations§
Source§impl Clone for AuthStrategy
impl Clone for AuthStrategy
Source§fn clone(&self) -> AuthStrategy
fn clone(&self) -> AuthStrategy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for AuthStrategy
impl RefUnwindSafe for AuthStrategy
impl Send for AuthStrategy
impl Sync for AuthStrategy
impl Unpin for AuthStrategy
impl UnsafeUnpin for AuthStrategy
impl UnwindSafe for AuthStrategy
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more