Idea: Plugin as Slack Proxy

Hi,

I want users of my website to write me on slack by filling out a form. In my current setup, requests are simply made directly to slack. This is bad because the credentials are on the client side and if you extract them, you can post to any user or channel.

Here is what I would like to do:

browser → Caddy → Slack

Within Caddy, I would [optionally] like to do:

  • redirecti the request to Slack API | Slack
  • [filter JSON (eg. remove the channel, so the channel cannot be modified clientside)]
  • [append JSON]
  • [ratelimit]

I tried to redirect the request with

proxy / https://hooks.slack.com/services/

which did not work.

There is a plugin for ratelimiting, but I did not find any for modifying JSON.

Do you think I could reach my goal with existing plugins or do I need to write a new one?

To modify the JSON? You’ll probably have to write a plugin to do that.

If you want to actually do a redirect, you would need the redir directive.