Merge pull request #5961 from thaJeztah/trust_remove_intermediate_var

cli/trust: GetNotaryRepository: remove intermediate var
This commit is contained in:
Paweł Gronowski 2025-03-31 11:40:13 +00:00 committed by GitHub
commit 8e6de54d18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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,
}
tokenHandler := auth.NewTokenHandlerWithOptions(tokenHandlerOptions)
})
basicHandler := auth.NewBasicHandler(creds)
modifiers = append(modifiers, auth.NewAuthorizer(challengeManager, tokenHandler, basicHandler))
tr := transport.NewTransport(base, modifiers...)