You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.
right now the setAuth is not exported. It should be SetAuth. Otherwise, there's no way for a consumer to apply basic auth (e.g. ask for user/pass) when it's needed and instead they need to do it when the Auth is set on the Config which means you may ask for a user/pass before you know if an endpoint actually reuires auth.
Making the SetAuth exported is a quick fix so consumers can just implement the interface instead of using the built-in BasicAuth.
A better route would probably be to add a callback for grabbing the user/pass.
The text was updated successfully, but these errors were encountered:
@smola I believe that's what I essentially did in my PR.
I had to make it par of the basic auth since at the end of the day it has to set the creds on the http request. I'm open to suggestions on how to implement it better though. I really just need to get something working and would rather not fork this lib just for this
@jdoklovic I discussed this with the team and the preferred method for implementing this is retrying if authentication is required. Clone and other operations return transport.ErrAuthenticationRequired if authentication is required for the given repository. If such error is returned, you can set credentials with whatever logic you want and then retry.
right now the setAuth is not exported. It should be SetAuth. Otherwise, there's no way for a consumer to apply basic auth (e.g. ask for user/pass) when it's needed and instead they need to do it when the Auth is set on the Config which means you may ask for a user/pass before you know if an endpoint actually reuires auth.
Making the SetAuth exported is a quick fix so consumers can just implement the interface instead of using the built-in BasicAuth.
A better route would probably be to add a callback for grabbing the user/pass.
The text was updated successfully, but these errors were encountered: