git-lfs/lfsapi/lfsapi.go
brian m. carlson dcfd29419e
Remove NTLM support
Our NTLM support has been known to be broken in various situations for a
while, specifically on Windows.  The core team is unable to troubleshoot
these problems, and nobody has stepped up to maintain the NTLM support.
In addition, NTLM uses cryptography and security techniques that are
known to be insecure, such as the algorithms DES, MD4, and MD5, as well
as simple, unsalted hashes of passwords.

Since we now support Kerberos, most users should be able to replace
their use of NTLM with Kerberos instead.  Users have reported this
working on Windows and it is known to work well on at least Debian as
well.  Drop support for NTLM and remove it from the codebase.
2021-02-02 16:41:41 +00:00

41 lines
774 B
Go

package lfsapi
import (
"fmt"
"github.com/git-lfs/git-lfs/creds"
"github.com/git-lfs/git-lfs/errors"
"github.com/git-lfs/git-lfs/lfshttp"
)
type Client struct {
Endpoints EndpointFinder
Credentials creds.CredentialHelper
credContext *creds.CredentialHelperContext
client *lfshttp.Client
}
func NewClient(ctx lfshttp.Context) (*Client, error) {
if ctx == nil {
ctx = lfshttp.NewContext(nil, nil, nil)
}
gitEnv := ctx.GitEnv()
osEnv := ctx.OSEnv()
httpClient, err := lfshttp.NewClient(ctx)
if err != nil {
return nil, errors.Wrap(err, fmt.Sprintf("error creating http client"))
}
c := &Client{
Endpoints: NewEndpointFinder(ctx),
client: httpClient,
credContext: creds.NewCredentialHelperContext(gitEnv, osEnv),
}
return c, nil
}