Skip to content

Commit

Permalink
Cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
kristinapathak committed Sep 17, 2019
1 parent 7c4b0a6 commit 6984bc0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
2 changes: 1 addition & 1 deletion basculehttp/tokenFactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (btf BearerTokenFactory) ParseAndValidate(ctx context.Context, _ *http.Requ

principal, ok := payload[jwtPrincipalKey].(string)
if !ok {
return nil, emperror.WrapWith(ErrorUnexpectedPrincipal, "failed to get and convert principal", "principal", payload[jwtPrincipalKey], "claims map", claimsMap, "payload", payload)
return nil, emperror.WrapWith(ErrorUnexpectedPrincipal, "failed to get and convert principal", "principal", payload[jwtPrincipalKey], "payload", payload)
}

return bascule.NewToken("jwt", principal, payload), nil
Expand Down
11 changes: 0 additions & 11 deletions jws.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,5 @@ func (c *ClaimsWithLeeway) UnmarshalJSON(data []byte) error {

// GetMap returns a map of string to interfaces of the values in the ClaimsWithLeeway
func (c *ClaimsWithLeeway) GetMap() (map[string]interface{}, error) {
// for StandardClaims, which don't work with the []string aud values that we use
// var finalMap map[string]interface{}
// inrec, err := json.Marshal(c)
// if err != nil {
// return nil, err
// }
// err = json.Unmarshal(inrec, &finalMap)
// if err != nil {
// return nil, err
// }
// return finalMap, nil
return c.MapClaims, nil
}

0 comments on commit 6984bc0

Please sign in to comment.