grafana/pkg/web
sh0rez 3d5d8c785b
pkg/web: restrict handler types (#48495)
Makes `pkg/web` only accept handles from the following set:

```go
	handlerStd       = func(http.ResponseWriter, *http.Request)
	handlerStdCtx    = func(http.ResponseWriter, *http.Request, *web.Context)
	handlerStdReqCtx = func(http.ResponseWriter, *http.Request, *models.ReqContext)
	handlerReqCtx    = func(*models.ReqContext)
	handlerReqCtxRes = func(*models.ReqContext) Response
	handlerCtx       = func(*web.Context)
```

This is a first step to reducing above set to only `http.Handler`.

---

Due to a cyclic import situation between `pkg/models` and `pkg/web`, parts of this PR were put into `pkg/api/response`, even though they definitely do not belong there. This however is _temporary_ until we untangle `models.ReqContext`.
2022-05-20 12:45:18 -04:00
..
webtest pkg/web: restrict handler types (#48495) 2022-05-20 12:45:18 -04:00
binding_test.go Add nil checks to HTTP request validation dispatch (#44371) 2022-01-24 16:43:44 +01:00
binding.go Security: Sync security changes on main (#45083) 2022-02-09 13:44:38 +01:00
context.go pkg/web: X-Forwarded-For multi-IP handling (#45098) 2022-02-08 14:37:19 -05:00
inject.go Chore: Move remaining web framework code to pkg/web, remove macaron binding module (#43018) 2021-12-13 15:56:14 +01:00
macaron.go pkg/web: restrict handler types (#48495) 2022-05-20 12:45:18 -04:00
macaron.s pkg/web: restrict handler types (#48495) 2022-05-20 12:45:18 -04:00
render.go Chore: Move remaining web framework code to pkg/web, remove macaron binding module (#43018) 2021-12-13 15:56:14 +01:00
response_writer_test.go Chore: Move remaining web framework code to pkg/web, remove macaron binding module (#43018) 2021-12-13 15:56:14 +01:00
response_writer.go Chore: Move remaining web framework code to pkg/web, remove macaron binding module (#43018) 2021-12-13 15:56:14 +01:00
router.go Chore: Move remaining web framework code to pkg/web, remove macaron binding module (#43018) 2021-12-13 15:56:14 +01:00
tree.go Chore: Move remaining web framework code to pkg/web, remove macaron binding module (#43018) 2021-12-13 15:56:14 +01:00
web.go Chore: Move remaining web framework code to pkg/web, remove macaron binding module (#43018) 2021-12-13 15:56:14 +01:00