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

Create slack_hmac_check.ws #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RickCogley
Copy link

In a Slack app, you can specify a slash command and set a webhook such as one from webhook.site. Slack expects an HMAC check, and in the app you can find a shared secret to use for the webhook.site-side re-calculation. It works as needed using the new hmac() function, and the script will exit if the received signature and locally re-calculated signature don't match. The rest of the script assembles an array using the request.form params that come from Slack, converts it to json, and uploads it to a web service for reference. In our case, we have a Slack command "/iam" which lets us enter something like /iam @acme working on the server to indicate our status to peers and for linking to Time and Expense entries in our database.

In a Slack app, you can specify a slash command and set a webhook such as one from webhook.site. Slack expects an HMAC check, and in the app you can find a shared secret to use for the webhook.site-side re-calculation. It works as needed using the new hmac() function, and the script will exit if the received signature and locally re-calculated signature don't match. The rest of the script assembles an array using the request.form params that come from Slack, converts it to json, and uploads it to a web service for reference. In our case, we have a Slack command "/iam" which lets us enter something like `/iam @acme working on the server` to indicate our status to peers and for linking to Time and Expense entries in our database.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant