Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions cli/trust/trust.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,12 @@ func GetNotaryRepository(in io.Reader, out io.Writer, userAgent string, repoInfo
Actions: actions,
}
creds := simpleCredentialStore{auth: *authConfig}
tokenHandlerOptions := auth.TokenHandlerOptions{
tokenHandler := auth.NewTokenHandlerWithOptions(auth.TokenHandlerOptions{
Transport: authTransport,
Credentials: creds,
Scopes: []auth.Scope{scope},
ClientID: registry.AuthClientID,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one made me wonder; I see we're constructing token handlers in different places; for this one, and some paths in docker/docker, we set the ClientID; https://github.com/moby/moby/blob/330857ad0ffbc8114556f7886997fc43d7be4aad/distribution/registry.go#L123

But in cli/registry/client we use auth.NewTokenHandler

creds := registry.NewStaticCredentialStore(&authConfig)
tokenHandler := auth.NewTokenHandler(authTransport, creds, repoName, actions...)

Which means we end up with github.com/docker/distribution picking a default;

clientID := th.clientID
if clientID == "" {
// Use default client, this is a required field
clientID = defaultClientID
}

Which would be registry-client

const defaultClientID = "registry-client"

}
tokenHandler := auth.NewTokenHandlerWithOptions(tokenHandlerOptions)
})
basicHandler := auth.NewBasicHandler(creds)
modifiers = append(modifiers, auth.NewAuthorizer(challengeManager, tokenHandler, basicHandler))
tr := transport.NewTransport(base, modifiers...)
Expand Down
Loading