pub struct SshAuthClient { /* private fields */ }Expand description
Spawns ssh user@host git-lfs-authenticate <path> <operation> and
caches the result. Cloneable (cache is Arc-backed via Mutex).
Cache key is (user_and_host, port, path, operation). Entries with
less than 5s remaining are considered expired — same buffer upstream
uses to absorb network delay between cache check and HTTP send.
Implementations§
Source§impl SshAuthClient
impl SshAuthClient
Sourcepub fn new(program: impl Into<String>) -> Self
pub fn new(program: impl Into<String>) -> Self
Build with a resolved SSH program string. Whitespace-separated —
the first token is the executable, subsequent tokens are extra
args prepended before the per-call [-p PORT] user@host git-lfs-authenticate ... arguments. Same shape as upstream’s
subprocess.ExecCommand.
Sourcepub fn resolve(
&self,
user_and_host: &str,
port: Option<&str>,
path: &str,
operation: SshOperation,
) -> Result<SshAuth, SshAuthError>
pub fn resolve( &self, user_and_host: &str, port: Option<&str>, path: &str, operation: SshOperation, ) -> Result<SshAuth, SshAuthError>
Resolve auth for (user_and_host, port, path, operation). Hits
the cache first; on miss or expired entry, spawns ssh and stores
the new response.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SshAuthClient
impl RefUnwindSafe for SshAuthClient
impl Send for SshAuthClient
impl Sync for SshAuthClient
impl Unpin for SshAuthClient
impl UnsafeUnpin for SshAuthClient
impl UnwindSafe for SshAuthClient
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