MCPcopy Create free account
hub / github.com/GoogleChrome/webstatus.dev / mockAuthMiddleware

Function mockAuthMiddleware

backend/pkg/httpserver/middlewares_test.go:151–160  ·  view source on GitHub ↗
(u *auth.User)

Source from the content-addressed store, hash-verified

149}
150
151func mockAuthMiddleware(u *auth.User) func(http.Handler) http.Handler {
152 return func(next http.Handler) http.Handler {
153 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
154 if u != nil {
155 r = r.WithContext(httpmiddlewares.AuthenticatedUserToContext(r.Context(), u))
156 }
157 next.ServeHTTP(w, r)
158 })
159 }
160}

Calls

no outgoing calls

Tested by

no test coverage detected