#[non_exhaustive]pub enum TransportAuth {
Default,
UsernamePassword {
username: String,
password: SecretString,
},
Token {
username: Option<String>,
token: SecretString,
},
SshKey {
username: String,
public_key: Option<PathBuf>,
private_key: PathBuf,
passphrase: Option<SecretString>,
},
SshAgent {
username: String,
},
}Expand description
Supported repository transport authentication strategies.
Credential-bearing fields are wrapped in SecretString so tokens and
passwords never leak through Debug, Display, or serialization; access the
plaintext intentionally with SecretString::expose only at the point it is
handed to git2.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Default
Use default environment-driven authentication.
UsernamePassword
Use a username/password combination.
Token
Use an HTTP token.
Fields
§
username: Option<String>Optional username override; defaults to DEFAULT_TOKEN_USERNAME when None.
§
token: SecretStringToken or password value.
SshKey
Use explicit SSH key material.
Fields
§
passphrase: Option<SecretString>Optional passphrase.
SshAgent
Use the local SSH agent.
Trait Implementations§
Source§impl Clone for TransportAuth
impl Clone for TransportAuth
Source§fn clone(&self) -> TransportAuth
fn clone(&self) -> TransportAuth
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TransportAuth
impl Debug for TransportAuth
Source§impl Default for TransportAuth
impl Default for TransportAuth
Source§fn default() -> TransportAuth
fn default() -> TransportAuth
Returns the “default value” for a type. Read more
impl Eq for TransportAuth
Source§impl PartialEq for TransportAuth
impl PartialEq for TransportAuth
impl StructuralPartialEq for TransportAuth
Auto Trait Implementations§
impl Freeze for TransportAuth
impl RefUnwindSafe for TransportAuth
impl Send for TransportAuth
impl Sync for TransportAuth
impl Unpin for TransportAuth
impl UnsafeUnpin for TransportAuth
impl UnwindSafe for TransportAuth
Blanket Implementations§
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
Mutably borrows from an owned value. Read more