Struct git_credentials::helper::Cascade
source · Expand description
A list of helper programs to run in order to obtain credentials.
Fields
programs: Vec<Program>
The programs to run in order to obtain credentials
stderr: bool
If true, stderr is enabled when programs
are run, which is the default.
use_http_path: bool
If true, http(s) urls will take their path portion into account when obtaining credentials. Default is false.
Implementations
sourceimpl Cascade
impl Cascade
Initialization
sourcepub fn platform_builtin() -> Vec<Program>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
pub fn platform_builtin() -> Vec<Program>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Return the programs to run for the current platform.
These are typically used as basis for all credential cascade invocations, with configured programs following afterwards.
Note
These defaults emulate what typical git installations may use these days, as in fact it’s a configurable which comes from installation-specific configuration files which we cannot know (or guess at best). This seems like an acceptable trade-off as helpers are ignored if they fail or are not existing.
sourceimpl Cascade
impl Cascade
Builder
sourcepub fn extend(self, programs: impl IntoIterator<Item = Program>) -> Self
pub fn extend(self, programs: impl IntoIterator<Item = Program>) -> Self
Extend the list of programs to run programs
.
sourcepub fn use_http_path(self, toggle: bool) -> Self
pub fn use_http_path(self, toggle: bool) -> Self
If toggle
is true, http(s) urls will use the path portions of the url to obtain a credential for.
Otherwise, they will only take the user name into account.
sourceimpl Cascade
impl Cascade
Finalize
sourcepub fn invoke(&mut self, action: Action, prompt: Options<'_>) -> Result
pub fn invoke(&mut self, action: Action, prompt: Options<'_>) -> Result
Invoke the cascade by invoking
each program with action
, and configuring potential prompts with prompt
options.
The latter can also be used to disable the prompt entirely when setting the mode
to Disable
;=.
When getting credentials, all programs are asked until the credentials are complete, stopping the cascade. When storing or erasing all programs are instructed in order.