pub struct AuthBuilder { /* private fields */ }Expand description
Builder for creating authentication strategies
Implementations§
Source§impl AuthBuilder
impl AuthBuilder
Sourcepub fn ssh_key<U, P>(
self,
username: U,
public_key: Option<PathBuf>,
private_key: P,
passphrase: Option<String>,
) -> Self
pub fn ssh_key<U, P>( self, username: U, public_key: Option<PathBuf>, private_key: P, passphrase: Option<String>, ) -> Self
Add SSH key file authentication
Sourcepub fn userpass<U, P>(self, username: U, password: P) -> Self
pub fn userpass<U, P>(self, username: U, password: P) -> Self
Add username/password authentication
Sourcepub fn token_unscoped<T>(self, token: T) -> Self
pub fn token_unscoped<T>(self, token: T) -> Self
Add token authentication without an authority binding.
Warning: an unscoped token is offered to ANY remote that challenges
for USER_PASS_PLAINTEXT. This is an explicit trusted-caller opt-in —
callers must understand the credential-exfiltration implications.
Prefer AuthBuilder::token_scoped which binds the token to an exact
origin authority.
Sourcepub fn token_scoped<T, H>(self, token: T, host: H) -> Self
pub fn token_scoped<T, H>(self, token: T, host: H) -> Self
Add token authentication bound to an exact origin host. The token is
only offered when the request URL’s host matches host.
Sourcepub fn default_fallback(self) -> Self
pub fn default_fallback(self) -> Self
Add default credentials (fallback). Maps to libgit2’s ambient credential
discovery (git credential helper, ~/.gitconfig, SSH agent fallback).
Only honored when the AuthManager is built with
AuthMode::AllowAmbient; under the default ExplicitOnly mode this
strategy is refused at resolution time.
Sourcepub fn build(self) -> AuthManager
pub fn build(self) -> AuthManager
Build the authentication manager (strict certs, ExplicitOnly auth).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AuthBuilder
impl RefUnwindSafe for AuthBuilder
impl Send for AuthBuilder
impl Sync for AuthBuilder
impl Unpin for AuthBuilder
impl UnsafeUnpin for AuthBuilder
impl UnwindSafe for AuthBuilder
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
§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