MCPcopy Create free account
hub / github.com/pace/bricks / Handler

Method Handler

http/oauth2/oauth2.go:33–41  ·  view source on GitHub ↗

Handler will parse the bearer token, introspect it, and put the token and other relevant information back in the context.

(next http.Handler)

Source from the content-addressed store, hash-verified

31// Handler will parse the bearer token, introspect it, and put the token and other
32// relevant information back in the context.
33func (m *Middleware) Handler(next http.Handler) http.Handler {
34 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
35 ctx, isOk := introspectRequest(r, w, m.Backend)
36 if !isOk {
37 return
38 }
39 next.ServeHTTP(w, r.WithContext(ctx))
40 })
41}
42
43type token struct {
44 value string

Callers 14

RouterFunction · 0.45
RouterWithFallbackFunction · 0.45
RouterFunction · 0.45
TestCustomRoutesFunction · 0.45
RouterFunction · 0.45
RouterWithFallbackFunction · 0.45
RouterFunction · 0.45
RouterWithFallbackFunction · 0.45
RouterFunction · 0.45
RouterWithFallbackFunction · 0.45
RouterFunction · 0.45
RouterWithFallbackFunction · 0.45

Calls 3

introspectRequestFunction · 0.85
WithContextMethod · 0.80
ServeHTTPMethod · 0.45

Tested by 11

TestCustomRoutesFunction · 0.36
RouterFunction · 0.36
RouterWithFallbackFunction · 0.36
RouterFunction · 0.36
RouterWithFallbackFunction · 0.36
RouterFunction · 0.36
RouterWithFallbackFunction · 0.36
RouterFunction · 0.36
RouterWithFallbackFunction · 0.36
RouterFunction · 0.36
RouterWithFallbackFunction · 0.36