Github offers a way to let a URL know when a project has been updated using webhooks.
How do I verify that a post sent to my server's post-receive hook actually came from github?
Should I check the IP address of the sender or can I send an auth check somewhere? I want to make sure someone doesn't try to spoof a request pretending to be from github.
One option is to setup the hook through PubSubHubbub and use the hub.secret
option to create a SHA1 HMAC signature of the post body. However, that would require my server setting up the request rather than waiting for users to setup the post-receive callback to my site when they want to. I would rather just ask users to paste the URL I give them into the post url.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…