MCPcopy
hub / github.com/daptin/daptin / TokenExtractor

FuncType TokenExtractor

server/jwt/jwtmiddleware.go:46–46  ·  view source on GitHub ↗

TokenExtractor is a function that takes a request as input and returns either a token or an error. An error should only be returned if an attempt to specify a token was found, but the information was somehow incorrectly formed. In the case where a token is simply not present, this should not be tr

func(r *http.Request) (string, error)

Source from the content-addressed store, hash-verified

44// formed. In the case where a token is simply not present, this should not
45// be treated as an error. An empty string should be returned in that case.
46type TokenExtractor func(r *http.Request) (string, error)
47
48// Options is a struct for specifying configuration options for the middleware.
49type Options struct {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected