From ccf24372810eee13a6bb4998772ec49b875deb71 Mon Sep 17 00:00:00 2001 From: nyagamunene Date: Tue, 17 Dec 2024 13:26:09 +0300 Subject: [PATCH] remove pat check in keys api Signed-off-by: nyagamunene --- auth/api/http/keys/transport.go | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/auth/api/http/keys/transport.go b/auth/api/http/keys/transport.go index 9e1124704eb..057ed53b43f 100644 --- a/auth/api/http/keys/transport.go +++ b/auth/api/http/keys/transport.go @@ -58,12 +58,7 @@ func decodeIssue(_ context.Context, r *http.Request) (interface{}, error) { return nil, apiutil.ErrUnsupportedContentType } - token := apiutil.ExtractBearerToken(r) - if strings.HasPrefix(token, patPrefix) { - return nil, apiutil.ErrUnsupportedTokenType - } - - req := issueKeyReq{token: token} + req := issueKeyReq{token: apiutil.ExtractBearerToken(r)} if err := json.NewDecoder(r.Body).Decode(&req); err != nil { return nil, errors.Wrap(errors.ErrMalformedEntity, err) } @@ -72,13 +67,8 @@ func decodeIssue(_ context.Context, r *http.Request) (interface{}, error) { } func decodeKeyReq(_ context.Context, r *http.Request) (interface{}, error) { - token := apiutil.ExtractBearerToken(r) - if strings.HasPrefix(token, patPrefix) { - return nil, apiutil.ErrUnsupportedTokenType - } - req := keyReq{ - token: token, + token: apiutil.ExtractBearerToken(r), id: chi.URLParam(r, "id"), } return req, nil