Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for per-url credential helpers #2686

Closed
technoweenie opened this issue Oct 24, 2017 · 0 comments
Closed

Add support for per-url credential helpers #2686

technoweenie opened this issue Oct 24, 2017 · 0 comments
Milestone

Comments

@technoweenie
Copy link
Contributor

LFS doesn't detect credential helpers set on a url:

[credential "https://my-git-server.com/"]
        helper = /path/to/helper

The problem is that LFS loads the cred helpers when an *lfsapi.Client is initialized:

git-lfs/lfsapi/lfsapi.go

Lines 69 to 72 in 3480fa4

creds, err := getCredentialHelper(osEnv, gitEnv)
if err != nil {
return nil, errors.Wrap(err, "cannot find credential helper(s)")
}

Instead, it needs to happen at request time here, using *config.URLConfig:

git-lfs/lfsapi/auth.go

Lines 23 to 27 in 3480fa4

func (c *Client) DoWithAuth(remote string, req *http.Request) (*http.Response, error) {
credHelper := c.Credentials
if credHelper == nil {
credHelper = defaultCredentialHelper
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant