-
Notifications
You must be signed in to change notification settings - Fork 92
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
Refactor verifySignature for re-use #721
Conversation
Staging instance deployed by Travis CI! |
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.
Two nits.
(Sorry I forgot to send the draft last Friday...)
Staging instance deployed by Travis CI! |
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
"github.com/web-platform-tests/wpt.fyi/shared" | ||
) | ||
|
||
func verifyAndGetPayload(r *http.Request) ([]byte, error) { |
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.
Optional: this is fine for now, but I imagine you'd like to reuse this method in checks to verify the payload? (I saw your TODO in that PR.)
When that happens, we'd need to export (and perhaps move) this function, and add tokenName
as an argument.
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.
Will do :)
Description
Extract the "load secret + verify payload" behaviour into a reusable method, in prep for adding another GitHub webhook for custom checks.
Working towards #712