-
Notifications
You must be signed in to change notification settings - Fork 619
Feature/sns validator #27
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
Upon further testing, I found that messages without a subject will have no |
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.
Transcribed over-the-shoulder review by @stealthycoin and @AllanFly120
}); | ||
|
||
|
||
it('should produce a canonical string from subscription confirmations', () => { |
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.
s/subscription confirmations/unsubscription confirmations/
{ | ||
"name": "@aws/sns-message-validator", | ||
"private": true, | ||
"version": "0.0.1", |
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.
This should match what's in the existing library and be version 0.4.0
( | ||
toSign: string, | ||
key: keyof T | ||
): string => `${toSign}${key}\n${message[key]}\n`, |
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.
This formatting is terrible.
@stealthycoin says #shipit |
* WIP commit * Add tests for getCertificate * Wire up certificate fetching and signature verification and round out the test suite * Remove `null` Subject fields in the convertLambdaNotification function * Improve formatting and fix typos
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
This PR adds a TS port of https://github.com/aws/aws-js-sns-message-validator The test fixtures include the same message captured on an HTTP endpoint and in a lambda function, and a functional test ensuring those known-valid signatures are correctly validated is included.
Once this gets reviewed, I would like to release it as version 0.4.0 of the
sns-validator
package, whose readme should be updated to say "This package has been merged into the official AWS SDK for JavaScript" or the like once v3 is in developer preview.