From b41ac1ec711316dc86d21b67b37c5543ecdd6363 Mon Sep 17 00:00:00 2001 From: Havrileck Alexandre Date: Tue, 6 Jul 2021 19:47:23 +0200 Subject: [PATCH] feat(authorization): Forward tracing to OPA --- pkg/s3-proxy/authx/authorization/opa-server.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/s3-proxy/authx/authorization/opa-server.go b/pkg/s3-proxy/authx/authorization/opa-server.go index ea47d68a..028c9dca 100644 --- a/pkg/s3-proxy/authx/authorization/opa-server.go +++ b/pkg/s3-proxy/authx/authorization/opa-server.go @@ -90,6 +90,12 @@ func isOPAServerAuthorized(req *http.Request, oidcUser *models.OIDCUser, resourc } // Add content type request.Header.Add("Content-Type", "application/json") + // Forward trace on request + err = childTrace.InjectInHTTPHeader(req.Header) + // Check error + if err != nil { + return false, err + } // Making request to OPA server resp, err := http.DefaultClient.Do(request) if err != nil {