mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
chore: make authz recorder opt in (#20310)
The authz recorder is causing a lot of memory to be allocated, and is a memory leak for websocket connections. This change makes it opt-in on a per request basis (ontop of `isDev`). To get the authz headers, use `Copy as cURL` on chrome and append the header `x-authz-checks=true`.
This commit is contained in:
+1
-1
@@ -493,7 +493,7 @@ func New(options *Options) *API {
|
||||
// We add this middleware early, to make sure that authorization checks made
|
||||
// by other middleware get recorded.
|
||||
if buildinfo.IsDev() {
|
||||
r.Use(httpmw.RecordAuthzChecks)
|
||||
r.Use(httpmw.RecordAuthzChecks(options.DeploymentValues.EnableAuthzRecording.Value()))
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
|
||||
Reference in New Issue
Block a user