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 2, 2024
1 parent 5463278 commit 9c61530
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
}

// Generate an OpenFGA request ID
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 9c61530

Please sign in to comment.