Skip to content

Commit

Permalink
lxd: Set OpenFGA cache in request context for all requests
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Mougard <[email protected]>
  • Loading branch information
gabrielmougard committed Dec 4, 2024
1 parent fc733ed commit 2f78972
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lxd/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,9 @@ func (d *Daemon) createCmd(restAPI *mux.Router, version string, c APIEndpoint) {
return
}

// Set OpenFGA cache in request context.
request.SetCtxValue(r, request.CtxOpenFGARequestCache, &openfga.RequestCache{})

// Dump full request JSON when in debug mode
if daemon.Debug && r.Method != "GET" && util.IsJSONRequest(r) {
newBody := &bytes.Buffer{}
Expand Down

0 comments on commit 2f78972

Please sign in to comment.