Fixes #1605: make ErrorList introspectable by replacing ErrorList and
ErrorList#ToError with []error and util.SliceToError() respectively
This commit is contained in:
@@ -35,7 +35,7 @@ func New(authRequestHandlers ...authenticator.Request) authenticator.Request {
|
||||
// AuthenticateRequest authenticates the request using a chain of authenticator.Request objects. The first
|
||||
// success returns that identity. Errors are only returned if no matches are found.
|
||||
func (authHandler unionAuthRequestHandler) AuthenticateRequest(req *http.Request) (user.Info, bool, error) {
|
||||
var errors util.ErrorList
|
||||
var errors []error
|
||||
for _, currAuthRequestHandler := range authHandler {
|
||||
info, ok, err := currAuthRequestHandler.AuthenticateRequest(req)
|
||||
if err != nil {
|
||||
@@ -48,5 +48,5 @@ func (authHandler unionAuthRequestHandler) AuthenticateRequest(req *http.Request
|
||||
}
|
||||
}
|
||||
|
||||
return nil, false, errors.ToError()
|
||||
return nil, false, util.SliceToError(errors)
|
||||
}
|
||||
|
@@ -55,7 +55,7 @@ func (a *Authenticator) AuthenticateRequest(req *http.Request) (user.Info, bool,
|
||||
return nil, false, nil
|
||||
}
|
||||
|
||||
var errors util.ErrorList
|
||||
var errors []error
|
||||
for _, cert := range req.TLS.PeerCertificates {
|
||||
chains, err := cert.Verify(a.opts)
|
||||
if err != nil {
|
||||
@@ -75,7 +75,7 @@ func (a *Authenticator) AuthenticateRequest(req *http.Request) (user.Info, bool,
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil, false, errors.ToError()
|
||||
return nil, false, util.SliceToError(errors)
|
||||
}
|
||||
|
||||
// DefaultVerifyOptions returns VerifyOptions that use the system root certificates, current time,
|
||||
|
Reference in New Issue
Block a user