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

Shunrao slack webhooks example #98

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

praecipula
Copy link
Contributor

I'm going to move your branch to a PR for easier reviewing...

@praecipula praecipula self-assigned this Nov 7, 2019
Copy link
Contributor Author

@praecipula praecipula left a 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",
Copy link
Contributor Author

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
```

Copy link
Contributor Author

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)
Copy link
Contributor Author

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():
Copy link
Contributor Author

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?

@praecipula praecipula assigned shunr and unassigned praecipula Nov 7, 2019
@shunr shunr assigned rossgrambo-zz and unassigned shunr Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants