class Bundler::Fetcher

def retry_with_auth

the caller should use this to re-attempt the failing request with the altered `@remote_uri`.
Attempt to retry with HTTP authentication, if it's appropriate to do so. Yields to a block;
def retry_with_auth
  # Authentication has already been attempted and failed.
  raise BadAuthenticationError.new(uri) if @remote_uri.user
  auth = Bundler.settings[@remote_uri.to_s]
  # Authentication isn't provided at all, by "bundle config" or in the URI.
  raise AuthenticationRequiredError.new(uri) if auth.nil?
  @remote_uri.user, @remote_uri.password = *auth.split(":", 2)
  yield
end