restore KeyId to kms decrypt response

regression introduced in #2071 "KMS generate_data_key"
This commit is contained in:
Earl Robinson 2019-08-14 08:19:32 -04:00
parent 9a3a99243f
commit 5347a577da

View File

@ -238,7 +238,7 @@ class KmsResponse(BaseResponse):
value = self.parameters.get("CiphertextBlob")
try:
return json.dumps({"Plaintext": base64.b64decode(value).decode("utf-8")})
return json.dumps({"Plaintext": base64.b64decode(value).decode("utf-8"), 'KeyId': 'key_id'})
except UnicodeDecodeError:
# Generate data key will produce random bytes which when decrypted is still returned as base64
return json.dumps({"Plaintext": value})