From c6b60765443cf0016e67dde7522f533a949a0058 Mon Sep 17 00:00:00 2001 From: Pavel Korotkov Date: Tue, 21 Jul 2020 13:07:09 +0300 Subject: [PATCH] Get back checking severe auth errors --- auth/center.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/auth/center.go b/auth/center.go index df7f2fb0..83bfc6f4 100644 --- a/auth/center.go +++ b/auth/center.go @@ -153,9 +153,7 @@ func (center *Center) AuthenticationPassed(request *http.Request) (*service.Bear accessKeyID := sms1["access_key_id"] bearerToken, secretAccessKey, err := center.unpackBearerToken(accessKeyID) if err != nil { - // FIXME: Should be `return nil, errors.Wrap(err, "failed to unpack bearer token")` - center.log.Warn("Failed to unpack bearer token", zap.Error(err)) - return nil, nil + return nil, errors.Wrap(err, "failed to unpack bearer token") } otherRequest := request.Clone(context.TODO()) otherRequest.Header = map[string][]string{} @@ -178,9 +176,7 @@ func (center *Center) AuthenticationPassed(request *http.Request) (*service.Bear } sms2 := center.submatcher.getSubmatches(otherRequest.Header.Get("Authorization")) if sms1["v4_signature"] != sms2["v4_signature"] { - // FIXME: Should be `return nil, errors.Wrap(err, "failed to pass authentication procedure")` - center.log.Warn("Failed to pass authentication procedure") - return nil, nil + return nil, errors.Wrap(err, "failed to pass authentication procedure") } return bearerToken, nil }