cli/trust: GetNotaryRepository: remove intermediate var

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2025-03-25 11:48:26 +01:00
parent 2b0631f45e
commit 60645d29f4
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C

View File

@ -160,13 +160,12 @@ func GetNotaryRepository(in io.Reader, out io.Writer, userAgent string, repoInfo
Actions: actions, Actions: actions,
} }
creds := simpleCredentialStore{auth: *authConfig} creds := simpleCredentialStore{auth: *authConfig}
tokenHandlerOptions := auth.TokenHandlerOptions{ tokenHandler := auth.NewTokenHandlerWithOptions(auth.TokenHandlerOptions{
Transport: authTransport, Transport: authTransport,
Credentials: creds, Credentials: creds,
Scopes: []auth.Scope{scope}, Scopes: []auth.Scope{scope},
ClientID: registry.AuthClientID, ClientID: registry.AuthClientID,
} })
tokenHandler := auth.NewTokenHandlerWithOptions(tokenHandlerOptions)
basicHandler := auth.NewBasicHandler(creds) basicHandler := auth.NewBasicHandler(creds)
modifiers = append(modifiers, auth.NewAuthorizer(challengeManager, tokenHandler, basicHandler)) modifiers = append(modifiers, auth.NewAuthorizer(challengeManager, tokenHandler, basicHandler))
tr := transport.NewTransport(base, modifiers...) tr := transport.NewTransport(base, modifiers...)