-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
SNS : fix Message Signature typo and add Lambda URL fixture #12181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…s and validate signature fix
LocalStack Community integration with Pro 2 files ± 0 2 suites ±0 1h 9m 59s ⏱️ - 40m 31s Results for commit 4ca3a5a. ± Comparison against base commit 1790318. This pull request removes 1446 and adds 47 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! well structured test, nice fixture and good to keep a more central hold on the constant strings 👍🏼
notification = "Notification" | ||
subscription_confirmation = "SubscriptionConfirmation" | ||
unsubscribe_confirmation = "UnsubscribeConfirmation" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think ASF would create such enums in the original CamelCase, but I don't think this matters a lot :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was exactly thinking about that. Will update and merge 👍 edit: even PascalCase it seems 😄
Motivation
As reported by #12179, we were not calculating the message signature correctly for
UnsubscribeConfirmation
message for HTTP/HTTPS subscriptions.I've created an
StrEnum
to avoid this kind of typo in the future.I had also been talking about creating a Lambda URL fixture to allow forwarding received message to an HTTP endpoint to an SQS queue, so this was a good occasion to do it.
This can be used as example for other services as well, the fixture could probably live in the global fixture file, once we see we can reuse it, as it can be dependent on what the HTTP endpoint needs to return.
But I'm thinking of making this fixture to do more SNS related things, like being able to return different status code to enable retries and such, or auto-approve the subscription, so we could probably duplicate it in a more general way.
Changes
StrEnum
to avoid future typosfixes #12179