adding ids

This commit is contained in:
Laura Bennett 2016-07-25 16:54:43 -04:00
parent 8d52a96df5
commit ae8a90be30
2 changed files with 9 additions and 0 deletions

View file

@ -35,6 +35,7 @@ func SanitizeResponse(input *Response) *HTTPResponse {
} }
type HTTPResponse struct { type HTTPResponse struct {
RequestID string `json:"request_id"`
LeaseID string `json:"lease_id"` LeaseID string `json:"lease_id"`
Renewable bool `json:"renewable"` Renewable bool `json:"renewable"`
LeaseDuration int `json:"lease_duration"` LeaseDuration int `json:"lease_duration"`

View file

@ -424,7 +424,15 @@ func (c *Core) wrapInCubbyhole(req *logical.Request, resp *logical.Response) (*l
return nil, ErrInternalError 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{ cubbyReq := &logical.Request{
ID: requestid,
Operation: logical.CreateOperation, Operation: logical.CreateOperation,
Path: "cubbyhole/response", Path: "cubbyhole/response",
ClientToken: te.ID, ClientToken: te.ID,