MCPcopy Index your code
hub / github.com/gavv/httpexpect / validateToken

Function validateToken

_examples/oauth2.go:61–71  ·  view source on GitHub ↗
(f http.HandlerFunc, srv *server.Server)

Source from the content-addressed store, hash-verified

59}
60
61func validateToken(f http.HandlerFunc, srv *server.Server) http.HandlerFunc {
62 return func(w http.ResponseWriter, r *http.Request) {
63 _, err := srv.ValidationBearerToken(r)
64 if err != nil {
65 http.Error(w, err.Error(), http.StatusBadRequest)
66 return
67 }
68
69 f.ServeHTTP(w, r)
70 }
71}

Callers 1

OAuth2HandlerFunction · 0.85

Calls 2

ErrorMethod · 0.45
ServeHTTPMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…