Add exact Number, exact String.Array and attribute key matching to SNS subscription filter policy and validate filter policy

This commit is contained in:
gruebel 2019-08-25 16:48:14 +02:00
commit d8a922811c
5 changed files with 564 additions and 8 deletions

View file

@ -57,7 +57,16 @@ class SNSResponse(BaseResponse):
transform_value = None
if 'StringValue' in value:
transform_value = value['StringValue']
if data_type == 'Number':
try:
transform_value = float(value['StringValue'])
except ValueError:
raise InvalidParameterValue(
"An error occurred (ParameterValueInvalid) "
"when calling the Publish operation: "
"Could not cast message attribute '{0}' value to number.".format(name))
else:
transform_value = value['StringValue']
elif 'BinaryValue' in value:
transform_value = value['BinaryValue']
if not transform_value: