Parcourir la source

registry: remove unused authConfig from Session

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn il y a 3 ans
Parent
commit
541ed077a6
2 fichiers modifiés avec 4 ajouts et 7 suppressions
  1. 1 1
      registry/service.go
  2. 3 6
      registry/session.go

+ 1 - 1
registry/service.go

@@ -218,7 +218,7 @@ func (s *DefaultService) Search(ctx context.Context, term string, limit int, aut
 		}
 	}
 
-	r := newSession(client, authConfig, endpoint)
+	r := newSession(client, endpoint)
 
 	if index.Official {
 		// If pull "library/foo", it's stored locally under "foo"

+ 3 - 6
registry/session.go

@@ -25,9 +25,7 @@ import (
 type Session struct {
 	indexEndpoint *V1Endpoint
 	client        *http.Client
-	// TODO(tiborvass): remove authConfig
-	authConfig *types.AuthConfig
-	id         string
+	id            string
 }
 
 type authTransport struct {
@@ -178,9 +176,8 @@ func authorizeClient(client *http.Client, authConfig *types.AuthConfig, endpoint
 	return nil
 }
 
-func newSession(client *http.Client, authConfig *types.AuthConfig, endpoint *V1Endpoint) *Session {
+func newSession(client *http.Client, endpoint *V1Endpoint) *Session {
 	return &Session{
-		authConfig:    authConfig,
 		client:        client,
 		indexEndpoint: endpoint,
 		id:            stringid.GenerateRandomID(),
@@ -194,7 +191,7 @@ func NewSession(client *http.Client, authConfig *types.AuthConfig, endpoint *V1E
 		return nil, err
 	}
 
-	return newSession(client, authConfig, endpoint), nil
+	return newSession(client, endpoint), nil
 }
 
 // SearchRepositories performs a search against the remote repository