You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The return type of func (w wrapper) Resolve(r Resource) is (Authenticator, error) but in practice it will never return a non-nil error.
Even when the call to w.h.Get(r.RegistryStr()) returns an error, Resolve return an anonymous authenticator with a nil error.
This is a problem as it does not give a way for the caller to differentiate between the case where it is supposed to use an anonymous authentication and the case where an error happened when reaching out to the registry.
If this kind of behavior cannot be avoided (typically, for some registries one cannot distinguish between the need to use anonymous authentication and an error happening when reaching out to the registry), then it should at least be clearly documented in the type Keychain interface that the Resolve function can return Anonymous, nil when there was an error resolving.
This way, callers who know they are not supposed to use anonymous credentials can check for Anonymous, nil and not just err != nil.
The text was updated successfully, but these errors were encountered:
The return type of
func (w wrapper) Resolve(r Resource)
is(Authenticator, error)
but in practice it will never return a non-nil error.Even when the call to
w.h.Get(r.RegistryStr())
returns an error,Resolve
return an anonymous authenticator with anil
error.This is a problem as it does not give a way for the caller to differentiate between the case where it is supposed to use an anonymous authentication and the case where an error happened when reaching out to the registry.
If this kind of behavior cannot be avoided (typically, for some registries one cannot distinguish between the need to use anonymous authentication and an error happening when reaching out to the registry), then it should at least be clearly documented in the
type Keychain interface
that theResolve
function can returnAnonymous, nil
when there was an error resolving.This way, callers who know they are not supposed to use anonymous credentials can check for
Anonymous, nil
and not justerr != nil
.The text was updated successfully, but these errors were encountered: