(opts *TokenDecoderOptions)
| 118 | } |
| 119 | |
| 120 | func NewTokenDecoder(opts *TokenDecoderOptions) (*TokenDecoder, error) { |
| 121 | publicKey, err := generatePublicKey(opts.PublicKeyPath, opts.PublicKey) |
| 122 | if err != nil { |
| 123 | return nil, err |
| 124 | } |
| 125 | |
| 126 | tokenDecoder := TokenDecoder{ |
| 127 | PublicKey: publicKey, |
| 128 | } |
| 129 | return &tokenDecoder, nil |
| 130 | } |
| 131 | |
| 132 | func (tokenDecoder *TokenDecoder) DecodeToken(signedString string) (*jwt.Token, error) { |
| 133 | return jwt.Parse(signedString, func(token *jwt.Token) (interface{}, error) { |
searching dependent graphs…