diff --git a/logical/sanitize.go b/logical/sanitize.go index 3ea28aa61..0b6c702c4 100644 --- a/logical/sanitize.go +++ b/logical/sanitize.go @@ -35,6 +35,7 @@ func SanitizeResponse(input *Response) *HTTPResponse { } type HTTPResponse struct { + RequestID string `json:"request_id"` LeaseID string `json:"lease_id"` Renewable bool `json:"renewable"` LeaseDuration int `json:"lease_duration"` diff --git a/vault/request_handling.go b/vault/request_handling.go index c3e7e2cd5..92004802c 100644 --- a/vault/request_handling.go +++ b/vault/request_handling.go @@ -424,7 +424,15 @@ func (c *Core) wrapInCubbyhole(req *logical.Request, resp *logical.Response) (*l return nil, ErrInternalError } + var requestid string + requestid, err = uuid.generateUUID() + if err != nil { + c.logger.Printf("[ERR] core: failed to generate unique identifier: %v", err) + return nil, ErrInternalError + } + cubbyReq := &logical.Request{ + ID: requestid, Operation: logical.CreateOperation, Path: "cubbyhole/response", ClientToken: te.ID,