Fix REST API calls for encrypt/decrypt (#767)

The merge of two recent changes seems to have led to these calls invoking the API incorrectly.
This commit is contained in:
Luke Hoban 2017-12-26 09:42:42 -08:00 committed by GitHub
parent a7fbdff7ea
commit 56fd8bc257
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -154,7 +154,7 @@ func (c *cloudCrypter) EncryptValue(plaintext string) (string, error) {
var resp apitype.EncryptValueResponse
req := apitype.EncryptValueRequest{Plaintext: []byte(plaintext)}
if err := pulumiRESTCall(c.backend.cloudURL, "POST", path, &req, &resp, nil); err != nil {
if err := pulumiRESTCall(c.backend.cloudURL, "POST", path, nil, &req, &resp); err != nil {
return "", err
}
return base64.StdEncoding.EncodeToString(resp.Ciphertext), nil
@ -176,7 +176,7 @@ func (c *cloudCrypter) DecryptValue(cipherstring string) (string, error) {
var resp apitype.DecryptValueResponse
req := apitype.DecryptValueRequest{Ciphertext: ciphertext}
if err := pulumiRESTCall(c.backend.cloudURL, "POST", path, &req, &resp, nil); err != nil {
if err := pulumiRESTCall(c.backend.cloudURL, "POST", path, nil, &req, &resp); err != nil {
return "", err
}
return string(resp.Plaintext), nil