Skip to content

Commit

Permalink
fix: remote authorizers
Browse files Browse the repository at this point in the history
Fixes #1136
Supersedes #1138
  • Loading branch information
alnr committed Sep 11, 2024
1 parent ba39541 commit a33ebed
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pipeline/authz/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ func (a *AuthorizerRemote) GetID() string {
func (a *AuthorizerRemote) Authorize(r *http.Request, session *authn.AuthenticationSession, config json.RawMessage, rl pipeline.Rule) (err error) {
ctx, span := a.tracer.Start(r.Context(), "pipeline.authz.AuthorizerRemote.Authorize")
defer otelx.End(span, &err)
r = r.WithContext(ctx)

c, err := a.Config(config)
if err != nil {
Expand All @@ -80,7 +79,7 @@ func (a *AuthorizerRemote) Authorize(r *http.Request, session *authn.Authenticat
write.CloseWithError(errors.Wrapf(err, `could not pipe request body in rule "%s"`, rl.GetID()))
}()

req, err := http.NewRequest("POST", c.Remote, read)
req, err := http.NewRequestWithContext(ctx, "POST", c.Remote, read)
if err != nil {
return errors.WithStack(err)
}
Expand Down Expand Up @@ -116,7 +115,7 @@ func (a *AuthorizerRemote) Authorize(r *http.Request, session *authn.Authenticat
req.Header.Set(hdr, headerValue.String())
}

res, err := a.client.Do(req.WithContext(r.Context()))
res, err := a.client.Do(req)

if err != nil {
return errors.WithStack(err)
Expand Down

0 comments on commit a33ebed

Please sign in to comment.