@@ -156,26 +156,23 @@ func GetNotaryRepository(in io.Reader, out io.Writer, userAgent string, repoInfo
156156 }
157157 }
158158
159- scope := auth.RepositoryScope {
160- Repository : repoInfo .Name .Name (),
161- Actions : actions ,
162- }
163- creds := simpleCredentialStore {auth : * authConfig }
164159 tokenHandler := auth .NewTokenHandlerWithOptions (auth.TokenHandlerOptions {
165160 Transport : authTransport ,
166- Credentials : creds ,
167- Scopes : []auth.Scope {scope },
168- ClientID : registry .AuthClientID ,
161+ Credentials : simpleCredentialStore {auth : * authConfig },
162+ Scopes : []auth.Scope {auth.RepositoryScope {
163+ Repository : repoInfo .Name .Name (),
164+ Actions : actions ,
165+ }},
166+ ClientID : registry .AuthClientID ,
169167 })
170- basicHandler := auth .NewBasicHandler (creds )
168+ basicHandler := auth .NewBasicHandler (simpleCredentialStore { auth : * authConfig } )
171169 modifiers = append (modifiers , auth .NewAuthorizer (challengeManager , tokenHandler , basicHandler ))
172- tr := transport .NewTransport (base , modifiers ... )
173170
174171 return client .NewFileCachedRepository (
175172 GetTrustDirectory (),
176173 data .GUN (repoInfo .Name .Name ()),
177174 server ,
178- tr ,
175+ transport . NewTransport ( base , modifiers ... ) ,
179176 GetPassphraseRetriever (in , out ),
180177 trustpinning.TrustPinConfig {})
181178}
@@ -234,9 +231,9 @@ func NotaryError(repoName string, err error) error {
234231 return fmt .Errorf ("error: remote trust data does not exist for %s: %v" , repoName , err )
235232 case signed.ErrInsufficientSignatures :
236233 return fmt .Errorf ("error: could not produce valid signature for %s. If Yubikey was used, was touch input provided?: %v" , repoName , err )
234+ default :
235+ return err
237236 }
238-
239- return err
240237}
241238
242239// AddToAllSignableRoles attempts to add the image target to all the top level
0 commit comments