Commit Graph

14 Commits

Author SHA1 Message Date
Preben Ingvaldsen
36489ab70a lfsapi: Add DoWithAuthNoRetry()
Add a new auth function, `DoWithAuthNoRetry()`, which sends an
HTTP request with authorization but won't retry if authorization
failed.

This commit also removes the `allowRetry` parameter from
`DoWithAuth()` as a result, and that function will now
retry requests where authorization failed as before.
2018-10-02 16:47:10 -07:00
Preben Ingvaldsen
95fa7fb5da lfsapi: add allowRetry param
Add an allowRetry parameter to DoWithAuth(). This parameter is a
boolean, and allows any requests without an authentication header
to be retried if an authorization error was returned.

This change is required to get things working with the basic
upload adapter. Since it passes along a file reader in the
request body, and since that reader is read by the HTTP Client
in a copy operation to construct a new request, an upload request
body can't be re-used in a new request.
2018-09-28 14:16:55 -07:00
Preben Ingvaldsen
880bbf81af lfsapi: add Access param to DoWithAuth()
Add a new Access parameter to DoWithAuth() to allow callers to
specify the URL Access Mode. This removes the assumption that
DoWithAuth() will always be used for an LFS API request. This
commit also adds DoAPIRequestWithAuth(), which provides the
functionality of DoWithAuth() while explicitly using the LFS API
endpoint for the access mode, allowing parity with the previous
DoWithAuth() functionality.
2018-09-28 14:16:55 -07:00
brian m. carlson
c752dcdf51
Move credential handling to its own package
In a future commit, we're going to be accessing credential handling from
multiple packages.  To avoid an import loop, move credential handling
into its own package.  Update all the callers of the credential handling
code to use a qualified name.

Where there is a local variable called "creds", which would conflict
with our package name, rename it "cred" instead.
2018-09-24 15:09:22 +00:00
Preben Ingvaldsen
d101bdb605 lfsapi: extract new lfshttp package
Extract more basic http-related functionality out of lfsapi and
into a new package, lfshttp. Everything is currently functional
aside from authorization.
2018-09-11 14:51:29 -07:00
Fabrizio Steiner
2a166fd94e Use SSPI ntlm authentication on windows:
This brings support for SingleSignOn on windows using the default credentials of the currently logged in user if
an empty username and empty password is provided from gitcredentials. This plays well with the Git for windows
implementation which stores an empty username and password if it should use the default credentials.
2018-02-27 17:02:57 +01:00
Fabrizio Steiner
1b4cb3ebf6 Split ntlm implementation into a generic ntlm handling and a ntlm authentication process 2018-02-16 12:35:42 +01:00
rick olson
b1a4307254 lfsapi: only send 'path' to cred helpers if credential.useHttpPath is on 2017-10-26 16:29:43 -06:00
rick olson
ff2aa7c2c9 lfsapi: add *git.Configuration to Client 2017-10-25 15:38:13 -06:00
rick olson
ec092d0f4f lfsapi: introduce interface for initializing a Client 2017-10-25 15:33:20 -06:00
Taylor Blau
552b955b3f all: expand config.Environment interface to support multiple values per key 2017-04-12 17:29:11 -04:00
risk danger olson
0af31c4c6a lfsapi: clean up cloneRequest() from httputil ntlm support 2017-01-06 14:06:25 -07:00
risk danger olson
4f745fcdf7 lfsapi: Upstream changes 2017-01-06 13:37:31 -07:00
risk danger olson
b73674e5f8 lfsapi: port ntlm support from httputil 2017-01-06 11:50:24 -07:00