Add wrap support to API/CLI

This commit is contained in:
Jeff Mitchell
2016-05-02 01:58:58 -04:00
parent 21c0e4ee42
commit ff4dc0b853
6 changed files with 63 additions and 12 deletions

View File

@@ -15,6 +15,7 @@ type Request struct {
URL *url.URL
Params url.Values
ClientToken string
WrapTTL string
Obj interface{}
Body io.Reader
BodySize int64
@@ -62,5 +63,9 @@ func (r *Request) ToHTTP() (*http.Request, error) {
req.Header.Set("X-Vault-Token", r.ClientToken)
}
if len(r.WrapTTL) != 0 {
req.Header.Set("X-Vault-Wrap-TTL", r.WrapTTL)
}
return req, nil
}