You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The JSON body contains some fields such as MessageId, Message, and Type, but other fields are missing.
The PHP SNS SDK requires all of these fields [1] and throws an exception if any are missing:
Message
MessageId
Timestamp
TopicArn
Type
Signature
SigningCertURL or SigningCertUrl
SignatureVersion
In my implementation I'm already skipping signing for non-production (my other sns testing tools don't sign the requests) but the fields would still need to exist for the Message object to be constructed, such as via Message::fromRawPostData method.
In my "manually trigger sns handler" testing code code, I'm using the following field values:
Field
Value
MessageId
guid
Signature
EXAMPLE
SignatureVersion
1
SigningCertURL
http://example.com
Timestamp
current unix time, i.e. php gmdate('c')
TopicArn
arn:aws:sns:us-west-2:123456789012:MyTopic but the actual topic would be better
Type
Notification
I think I can see how to patch these other fields in, so I might have a go at it myself.
The JSON body contains some fields such as
MessageId
,Message
, andType
, but other fields are missing.The PHP SNS SDK requires all of these fields [1] and throws an exception if any are missing:
In my implementation I'm already skipping signing for non-production (my other sns testing tools don't sign the requests) but the fields would still need to exist for the
Message
object to be constructed, such as viaMessage::fromRawPostData
method.In my "manually trigger sns handler" testing code code, I'm using the following field values:
EXAMPLE
1
http://example.com
gmdate('c')
arn:aws:sns:us-west-2:123456789012:MyTopic
but the actual topic would be betterI think I can see how to patch these other fields in, so I might have a go at it myself.
[1] https://github.com/aws/aws-php-sns-message-validator/blob/master/src/Message.php#L11
The text was updated successfully, but these errors were encountered: