Skip to content

Commit

Permalink
remove pat check in keys api
Browse files Browse the repository at this point in the history
Signed-off-by: nyagamunene <[email protected]>
  • Loading branch information
nyagamunene committed Dec 17, 2024
1 parent e1eb192 commit ccf2437
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions auth/api/http/keys/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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
Expand Down

0 comments on commit ccf2437

Please sign in to comment.