MCPcopy
hub / github.com/golang-jwt/jwt / ExtractToken

Method ExtractToken

request/extractor.go:57–67  ·  view source on GitHub ↗
(req *http.Request)

Source from the content-addressed store, hash-verified

55type MultiExtractor []Extractor
56
57func (e MultiExtractor) ExtractToken(req *http.Request) (string, error) {
58 // loop over header names and return the first one that contains data
59 for _, extractor := range e {
60 if tok, err := extractor.ExtractToken(req); tok != "" {
61 return tok, nil
62 } else if !errors.Is(err, ErrNoTokenInRequest) {
63 return "", err
64 }
65 }
66 return "", ErrNoTokenInRequest
67}
68
69// PostExtractionFilter wraps an Extractor in this to post-process the value before it's handed off.
70// See AuthorizationHeaderExtractor for an example

Callers

nothing calls this directly

Calls 1

ExtractTokenMethod · 0.65

Tested by

no test coverage detected