{"id":18008900,"url":"https://github.com/invrs/slack_verify","last_synced_at":"2026-04-25T08:35:10.662Z","repository":{"id":57549089,"uuid":"146357421","full_name":"invrs/slack_verify","owner":"invrs","description":"A plug to verify Slack requests","archived":false,"fork":false,"pushed_at":"2022-09-06T02:07:01.000Z","size":22,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-12-13T02:02:27.160Z","etag":null,"topics":["events","hmac","slack","verification"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/slack_verify","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/invrs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-27T21:40:18.000Z","updated_at":"2018-08-29T15:45:19.000Z","dependencies_parsed_at":"2022-08-27T01:40:31.300Z","dependency_job_id":null,"html_url":"https://github.com/invrs/slack_verify","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/invrs/slack_verify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invrs%2Fslack_verify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invrs%2Fslack_verify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invrs%2Fslack_verify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invrs%2Fslack_verify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/invrs","download_url":"https://codeload.github.com/invrs/slack_verify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invrs%2Fslack_verify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30370282,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"online","status_checked_at":"2026-03-11T02:00:07.027Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["events","hmac","slack","verification"],"created_at":"2024-10-30T02:07:49.715Z","updated_at":"2026-03-11T04:03:26.552Z","avatar_url":"https://github.com/invrs.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SlackVerify\n\nSlackVerify is a plug that enables [verifying Slack requests](https://api.slack.com/docs/verifying-requests-from-slack).\n\n## Installation\nInstallation is a five-step process.\n\n1) Add the dependency in your mix.deps:\n```elixir\ndef deps do\n  [\n    {:slack_verify, \"~\u003e 0.2.2\"}\n  ]\nend\n```\n\n2) Configure your application's Slack signing secret:\n```elixir\n# config.exs\nconfig :slack_verify, slack_signing_secret: System.get_env(\"MY_SLACK_SIGNING_SECRET\")\n```\n\n3) SlackVerify relies on the raw request body for signature verification. To achieve this,\nconfigure the `body_reader` option on `Plug.Parsers`:\n```elixir\nplug Plug.Parsers,\n  parsers: [:urlencoded, :multipart, :json],\n  pass: [\"*/*\"],\n  body_reader: {CacheBodyReader, :read_body, []}, # \u003c-- right here\n  json_decoder: Poison\n```\n\n4) Then, per [the Plug.Parsers documentation](https://hexdocs.pm/plug/Plug.Parsers.html#module-custom-body-reader) define the CacheBodyReader module like so:\n```elixir\ndefmodule CacheBodyReader do\n  def read_body(conn, opts) do\n    {:ok, body, conn} = Plug.Conn.read_body(conn, opts)\n    conn = update_in(conn.assigns[:raw_body], \u0026[body | (\u00261 || [])])\n    {:ok, body, conn}\n  end\nend\n```\n\n5) Plug it in!\n```elixir\nplug SlackVerify\n```\n\n## Common Patterns\n\nIt's advisable to configure a controller specifically to handle Slack requests. Then you can only\nplug SlackVerify in your Slack controller and leave other controller logic in your app untouched.\n\n```elixir\ndefmodule MyAppWeb.MySlackController do\n  use MyAppWeb, :controller\n\n  plug SlackVerify\n\n  def handle(conn, _params) do\n    text conn, \"Hello, Slack!\"\n  end\nend\n```\n\nDocumentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)\nand published on [HexDocs](https://hexdocs.pm). Once published, the docs can\nbe found at [https://hexdocs.pm/slack_verify](https://hexdocs.pm/slack_verify).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finvrs%2Fslack_verify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finvrs%2Fslack_verify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finvrs%2Fslack_verify/lists"}