Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexferl/slack-command-proxy
A Cloud Functions proxy for Slack slash commands that does request validation and publishes the payload to Cloud Pub/Sub.
https://github.com/alexferl/slack-command-proxy
gcp-cloud-functions gcp-pubsub slack slack-slash-command slack-slash-commands
Last synced: 8 days ago
JSON representation
A Cloud Functions proxy for Slack slash commands that does request validation and publishes the payload to Cloud Pub/Sub.
- Host: GitHub
- URL: https://github.com/alexferl/slack-command-proxy
- Owner: alexferl
- License: mit
- Created: 2020-05-05T01:49:07.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-06-04T20:01:17.000Z (over 4 years ago)
- Last Synced: 2024-11-22T02:35:05.474Z (2 months ago)
- Topics: gcp-cloud-functions, gcp-pubsub, slack, slack-slash-command, slack-slash-commands
- Language: Go
- Homepage:
- Size: 18.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Slack Command Proxy
A proxy for Slack [slash commands](https://api.slack.com/interactivity/slash-commands) that does
[request validation](https://api.slack.com/authentication/verifying-requests-from-slack) and publishes the payload to
[Cloud Pub/Sub](https://cloud.google.com/pubsub).## Using
```shell script
git clone https://github.com/admiralobvious/slack-command-proxy
cd slack-command-proxy
```1. Modify `config.json` with your own settings.
2. Create a Pub/Sub topic following this pattern:
```shell script
gcloud pubsub topics create slack-command-proxy-myteam-mycommand
```3. Deploy Slack Command Proxy:
```shell script
gcloud functions deploy SlackCommandProxy --runtime go113 --trigger-http --set-env-vars "GCP_PROJECT=your-project-id" --allow-unauthenticated
```## Why
- 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## Credits
[GCP Go Samples - functions](https://github.com/GoogleCloudPlatform/golang-samples/tree/9ca9b3f27ce69c46685ea66c70acc8a44815c56a/functions/slack)[GCP Go Samples - pubsub](https://github.com/GoogleCloudPlatform/golang-samples/tree/9ca9b3f27ce69c46685ea66c70acc8a44815c56a/pubsub)