func LogicalResponseToHTTPResponse(input *Response) *HTTPResponse {
	httpResp := &HTTPResponse{
		Data:     input.Data,
		Warnings: input.Warnings,
	}
	if input.Secret != nil {
		httpResp.LeaseID = input.Secret.LeaseID
		httpResp.Renewable = input.Secret.Renewable
		httpResp.LeaseDuration = int(input.Secret.TTL.Seconds())
	}
	if input.Auth != nil {
		httpResp.Auth = &HTTPAuth{
			ClientToken:   input.Auth.ClientToken,
			Accessor:      input.Auth.Accessor,
			Policies:      input.Auth.Policies,
			Metadata:      input.Auth.Metadata,
			LeaseDuration: int(input.Auth.TTL.Seconds()),
			Renewable:     input.Auth.Renewable,
			EntityID:      input.Auth.EntityID,
		}
	}
	return httpResp
}
This logic was pulled from the http package so that it can be used for
encoding wrapped responses as well. It simply translates the logical
response to an http response, with the values we want and omitting the
values we don't.
package logical
import (
	"bytes"
	"encoding/json"
	"fmt"
	"time"
)