Skip to content

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