-
Notifications
You must be signed in to change notification settings - Fork 105
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
Shunrao slack webhooks example #98
base: master
Are you sure you want to change the base?
Conversation
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.
All in all it looks pretty good! Can you double check the nits / little points of clarity and consider incorporating them in?
Thanks!
create_parser.add_argument( | ||
"--target", | ||
type=str, | ||
help="The webhook URL to receive the HTTP POST", |
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.
Can we describe an example of this if they run as per the instructions, just to make it clear that they're specifying a callback address they're setting up with the server file? I believe that'd be something like http://[computer_address]:3000/receive_webhook
(if we change the route below...)
``` | ||
ASANA_ACCESS_TOKEN=<your Asana PAT> SLACK_TOKEN=<your Slack API token> ./server.py | ||
``` | ||
|
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.
It might be worth pointing out that the computer that this is running on needs to be DNS-addressable or have a public IP address that Asana can get to. This is often a point of confusion / friction for developers.
load_webhook_secret(), msg=req.data, digestmod=sha256 | ||
).hexdigest() | ||
|
||
return hmac.compare_digest(computed_signature, request_signature) |
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.
👏 since this is optional to get a webhook payload I applaud you including it (I have a feeling a lot of apps don't even check...)
|
||
|
||
@app.route("/slack_webhook", methods=["POST"]) | ||
def slack_webhook(): |
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.
Nit: I think it might be clearer to name this something a bit more clear that this is the callback url for Asana and not for, say, one from Slack. How do you feel about recieve_webhook
or receive_asana_webhook
?
I'm going to move your branch to a PR for easier reviewing...