Skip to content
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

fix(3225): handling when the webhook is incorrect [4] #37

Merged
merged 4 commits into from
Oct 21, 2024

Conversation

y-oksaku
Copy link
Contributor

@y-oksaku y-oksaku commented Oct 21, 2024

Context

The parseHook method returns null when all scm instances do not accept the webhook.
So we cannnot know whether the webhook has correct signature at here because null is returned too when the webhook type is not supported.

Objective

Throw error when all scm instances do not accept the webhook.
It will be able to see correctly that each scm accept the webhook or not by the following PRs.

Webhook response example

example

  • Invalid signature webhook
  • Not support hook event

References

Issue

License

I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@y-oksaku y-oksaku changed the title [4] fix(3225): handling when the webhook is incorrect fix(3225): handling when the webhook is incorrect [4] Oct 21, 2024
index.js Outdated

err.statusCode = 400;

throw err;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to add a test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. I add a test for this.

@tkyi tkyi merged commit 20b4afe into screwdriver-cd:master Oct 21, 2024
2 checks passed
@sd-buildbot
Copy link

🎉 This PR is included in version 8.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@y-oksaku y-oksaku deleted the fix-parse-hook branch October 22, 2024 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants