-
Notifications
You must be signed in to change notification settings - Fork 739
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
I want to know how to verify Java for Validating payloads from webhooks #1376
Comments
If you are developing a GitHub bot, I would suggest you have a look to my Quarkus GitHub App project, which handles all the boilerplate for you: https://github.com/quarkiverse/quarkus-github-app . If you prefer doing things all by yourself, just have a look at the payload checker there: https://github.com/quarkiverse/quarkus-github-app/blob/main/runtime/src/main/java/io/quarkiverse/githubapp/runtime/signing/PayloadSignatureChecker.java . It's Apache licensed so feel free to borrow it. If your question was about parsing the |
Thinks |
I can match it with your demo data I can't match the correct signature with,GitHub sent sender. eg: this txt is :payload-signature-checker.json ,GitHub sent it to me push event json my webhooks-secret: webhooksSecret GitHub sent it to me : 99c04af1c3897c1d0bb9870cb4b8237701e1aacb8c0bc6f15fdbf00a36772276, I use demo : b00dc3bc916f8e95a7542c88656dde45fc24d7c3d3727c464338509aba17ba2d why |
I can't really say. I know it works for me with Quarkus GitHub App. One important point though: you need to provide the JSON exactly as is. If you are using something like smee.io to redirect the payload to your computer, smee.io actually changes the payload before sending it to you. It's a well known bug of smee.io (see probot/smee.io#78 for instance but there are a few others related). I have no idea if you're doing that though. In the case of Quarkus GitHub App, I disable the signature checking in development mode when using smee.io and only enable it in production. |
package github.test.play; import org.apache.commons.codec.DecoderException; import javax.crypto.Mac; public class SecretKeyTest {
} |
|
Is there any Java API?
how to decrypt payload
}
The text was updated successfully, but these errors were encountered: