pub enum AuthMode {
ExplicitOnly,
AllowAmbient,
}Expand description
Authentication provenance mode — whether ambient credential sources may be consulted.
ExplicitOnly (the default) refuses ambient strategies —
AuthStrategy::Default (git credential helper, ~/.gitconfig) and
AuthStrategy::SshAgent (the running SSH agent’s loaded keys). This
prevents an untrusted fetch from silently picking up the operator’s personal
credentials via Cred::ssh_key_from_agent or Cred::default. Explicit
strategies (SshKey file, UserPass, Token) are always honored. Callers
that intentionally want ambient discovery (e.g. a trusted first-party mirror
clone driven by the operator’s own identity) must explicitly opt in via
AuthMode::AllowAmbient.
Variants§
ExplicitOnly
Only explicit authentication strategies are honored.
Ambient strategies (AuthStrategy::Default, AuthStrategy::SshAgent)
are rejected, so the credential helper, ~/.gitconfig, and the SSH
agent are never consulted. Secure default for untrusted/forge-facing
fetches.
AllowAmbient
Permit ambient credential discovery via AuthStrategy::Default and
AuthStrategy::SshAgent. Opt-in for trusted first-party mirrors
where operator identity is expected.
Trait Implementations§
impl Copy for AuthMode
impl Eq for AuthMode
impl StructuralPartialEq for AuthMode
Auto Trait Implementations§
impl Freeze for AuthMode
impl RefUnwindSafe for AuthMode
impl Send for AuthMode
impl Sync for AuthMode
impl Unpin for AuthMode
impl UnsafeUnpin for AuthMode
impl UnwindSafe for AuthMode
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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