Added HTTPAuthDecorator
Use basic auth for private registries when over HTTPS.
RequestFactory is no longer a singleton (can be different for different instances of Registry)
Registry now has an indexEndpoint member
Registry methods that needed the indexEndpoint parameter no longer do so
Registry methods will only use token auth where applicable if basic auth is not enabled.
gofmt
Factorized auth token setting
missed one call to setTokenAuth
Don't return req as result of setTokenAuth
Handle 401 response in auth.Login() for authed private registries
Merge pull request #2339 from shin-/private_reg_auth

Private registry auth