A proxy for Slack slash commands that does request validation and publishes the payload to Cloud Pub/Sub.
git clone https://github.com/admiralobvious/slack-command-proxy
cd slack-command-proxy
-
Modify
config.json
with your own settings. -
Create a Pub/Sub topic following this pattern:
gcloud pubsub topics create slack-command-proxy-myteam-mycommand
- Deploy Slack Command Proxy:
gcloud functions deploy SlackCommandProxy --runtime go113 --trigger-http --set-env-vars "GCP_PROJECT=your-project-id" --allow-unauthenticated
- You work in an environment with more than one slash command
- You're already hosting your slash commands on GCP
- Your slash commands are implemented in more than one programming language
- Your slash commands are usually simple enough that you don't want to bundle a full-fledged Slack API library in your code just to do request validation
- Some of your slash commands may be written by less experienced (or who aren't primarily) developers and you'd rather they don't have to deal with request validation
- You don't wanna have to add a new service, open incoming ports and so on every time you add a new slash command
- You want the incoming requests to have a persistence layer