NewParser creates a new Parser with the specified options
(options ...ParserOption)
| 29 | |
| 30 | // NewParser creates a new Parser with the specified options |
| 31 | func NewParser(options ...ParserOption) *Parser { |
| 32 | p := &Parser{ |
| 33 | validator: &Validator{}, |
| 34 | } |
| 35 | |
| 36 | // Loop through our parsing options and apply them |
| 37 | for _, option := range options { |
| 38 | option(p) |
| 39 | } |
| 40 | |
| 41 | return p |
| 42 | } |
| 43 | |
| 44 | // Parse parses, validates, verifies the signature and returns the parsed token. |
| 45 | // keyFunc will receive the parsed token and should return the key for validating. |
no outgoing calls
no test coverage detected