code: func NewSession(client *http.Client, authConfig *types.AuthConfig, endpoint *V1Endpoint) (*Session, error) {
  	if err := authorizeClient(client, authConfig, endpoint); err != nil {
  		return nil, err
  	}
  
  	return newSession(client, authConfig, endpoint), nil
  }
docs: // NewSession creates a new session
  // TODO(tiborvass): remove authConfig param once registry client v2 is vendored