1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//! SSH-based endpoint resolution hook.
//!
//! When the LFS endpoint is reached via SSH (e.g. `lfs.url =
//! ssh://...`, or a `git@host:repo` remote without a separate
//! `lfs.url`), upstream Git LFS shells out to `git-lfs-authenticate` to
//! obtain a replacement HTTPS URL plus auth headers. This crate is
//! transport-agnostic, so it expresses the hook as a [`SshResolver`]
//! trait — the actual `ssh` invocation lives in `git-lfs-creds`.
//!
//! The [`Client`](crate::Client) consults the resolver once per
//! request: a non-empty [`SshAuth::href`] overrides the endpoint URL
//! prefix for that call, and [`SshAuth::headers`] are merged into the
//! outgoing request. Caching is the resolver's responsibility — see
//! `git_lfs_creds::SshAuthClient` for the production implementation.
use HashMap;
use Arc;
use crateApiError;
/// `git-lfs-authenticate <path> <op>` operation argument. Wire form is
/// lowercase `upload` or `download`.
/// Resolved auth from a `git-lfs-authenticate` call.
/// Hook called once per LFS API request to resolve SSH-mediated auth.
///
/// Implementations are typically backed by a `git-lfs-authenticate`
/// invocation with a small in-memory cache keyed on `(host, path,
/// operation)` so the SSH command runs at most once per cache TTL.
/// Type alias for the boxed-resolver field on [`Client`](crate::Client).
pub type SharedSshResolver = ;