mirror of
https://github.com/smallstep/certificates.git
synced 2024-10-31 03:20:16 +00:00
Propagate (original) request ID to webhook requests
Technically the webhook request is a new request, so maybe the `X-Request-ID` should not be set to the value of the original request? But then the original request ID should be propageted in the webhook request body, or using a different header. The way the request ID is used in this functionality is actually more like a tracing ID, so that may be an option too.
This commit is contained in:
parent
70533f55a4
commit
f3229d3e3c
@ -15,6 +15,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/smallstep/certificates/logging"
|
||||
"github.com/smallstep/certificates/templates"
|
||||
"github.com/smallstep/certificates/webhook"
|
||||
"go.step.sm/linkedca"
|
||||
@ -169,6 +170,11 @@ retry:
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID, ok := logging.GetRequestID(ctx)
|
||||
if ok {
|
||||
req.Header.Set("X-Request-ID", requestID)
|
||||
}
|
||||
|
||||
secret, err := base64.StdEncoding.DecodeString(w.Secret)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Loading…
Reference in New Issue
Block a user