Cache git-lfs-authenticate repsonse#2045
Conversation
e7c509c to
7a31a3b
Compare
Changes summary: * lfsapi.NewRequest now returns RequestFactory instead of (*http.Request, err); * RequestFactory interface have two methods: * NewRequest() (*http.Request, error) - generate request; * InvalidateAuthorization() bool - invalidate cached authentication data. * For simple HTTP requests RequestFactory simply wraps http.Request. * For SSH based HTTP requests RequestFactory generate http.Request based on last git-lfs-authenticate response.
7a31a3b to
14ffccb
Compare
|
Interesting approach, but I think a better approach would be wrapping the credential and ssh code with a write-through caching layer. For example, there's already a Also, the SSH auth cache doesn't take |
It not a problem: |
I wanted to use CredentialHelper, but |
LFS exhibits this behavior in other places where it will retry requests that have actions that are already expired instead of receiving a 401 and retrying the request later down the pipeline. If the client and server have drastically different times, the request retry budget will be exceeded and the request will fail. I think it would be worthwhile to keep that behavior consistent here and respect the
I think it would be fine to also return credentials from this function, but I would love to hear @technoweenie's thoughts on this. |
|
I think the ssh auth can have its own custom interface that returns a (cached) |
|
Closing since we merged #2080. |
Changes summary:
last
git-lfs-authenticateresponse.This change for fix issue #2018