{"id":15808814,"url":"https://github.com/qu4tro/slack-events-api","last_synced_at":"2025-03-31T23:43:51.216Z","repository":{"id":72502311,"uuid":"208504194","full_name":"Qu4tro/slack-events-api","owner":"Qu4tro","description":"The middlewares you need to deal with Slack Events API","archived":false,"fork":false,"pushed_at":"2019-09-14T21:55:42.000Z","size":25,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-04T21:02:10.084Z","etag":null,"topics":["crystal","crystal-lang","crystal-language","crystal-shard","middleware","middlewares","slack-api","slack-events-api","slack-webhook"],"latest_commit_sha":null,"homepage":null,"language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Qu4tro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-14T21:09:28.000Z","updated_at":"2019-10-28T15:33:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"14e03ee8-da59-47b3-a912-d159352d4766","html_url":"https://github.com/Qu4tro/slack-events-api","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qu4tro%2Fslack-events-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qu4tro%2Fslack-events-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qu4tro%2Fslack-events-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qu4tro%2Fslack-events-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Qu4tro","download_url":"https://codeload.github.com/Qu4tro/slack-events-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246558112,"owners_count":20796696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["crystal","crystal-lang","crystal-language","crystal-shard","middleware","middlewares","slack-api","slack-events-api","slack-webhook"],"created_at":"2024-10-05T03:07:16.013Z","updated_at":"2025-03-31T23:43:51.186Z","avatar_url":"https://github.com/Qu4tro.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Slack Events API adapter for Crystal\n\n[![Build Status](https://travis-ci.com/Qu4tro/slack-events-api.svg?token=Mqsa3fKeSUryp43kNdBt\u0026branch=master)](https://travis-ci.com/Qu4tro/slack-events-api)\n\n[![Github release](https://img.shields.io/github/release/qu4tro/slack-events-api.svg)](https://github.com/qu4tro/slack-events-api/releases)\n\n### The middlewares you need to deal with Slack Events API\n\n## Overview\n\nslack-events-api is a [Crystal](https://crystal-lang.org/) package composed of two middlewares:\n\n`SlackEvents::VerificationHandler`\n  - Middleware that verifies that requests are correctly signed with `SLACK_SIGNING_SECRET` by Slack. All requests going through this middleware, will be checked. In the event of a request whose signature couldn't be verified, the middleware will early return with a `403 - Forbidden`.\n  - Receives `SLACK_SIGNING_SECRET` as its sole argument.\n\n\n`SlackEvents::ChallengeHandler`\n  - Middleware that does the initial challenge handshake between Slack and your API.\n  \nFurther documentation can be found in https://qu4tro.github.io/slack-events-api/\n\n## Installation\n\n1. Add this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n  slack-events-api:\n    github: qu4tro/slack-events-api\n```\n2. Run `shards install`\n\n\n## Usage\nThis example will suffice to perform the initial setup, but actual events will be 404'd, until you write your application-specific handler.\n\n```crystal\n#!/usr/bin/env crystal\n\nrequire \"http/server\"\nrequire \"http/server/handler\"\n\nrequire \"slack-events-api\"\n\nmiddlewares = [\n  HTTP::LogHandler.new.as(HTTP::Handler),\n  HTTP::ErrorHandler.new,\n  SlackEvents::VerificationHandler.new(ENV[\"SLACK_SIGNING_SECRET\"]),\n  SlackEvents::ChallengeHandler.new,\n] \n\nHTTP::Server.new(middlewares).tap do |server|\n  address = server.bind_tcp \"localhost\", ENV[\"PORT\"].to_i\n  puts \"Listening on http://#{address}\"\n  server.listen\nend\n```\n## Further work\n\n- Make JSON mappings for all event types supported by the Event API \n- If a reverse-proxy middleware comes up for Crystal, I think it's worth thinking about creating a docker image, to allow for the verification and challenge-setup to be automated for any ad-hoc server.\n\n\n## Development\n\nAny restriction to development should be tool-automated.\nSo, feel free to open PRs. If all the tests pass, it should be good to merge, if it fits the package domain - opening an issue is a good way to clarify. In fact, feel free to open issues for any type of clarification.\n\n\n## Contributing\n\n1. [Fork it](https://github.com/Qu4tro/slack-events-api/fork)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n\n## Authors\n\n* **Xavier Francisco** - *Initial work* - [Qu4tro](https://github.com/Qu4tro)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqu4tro%2Fslack-events-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqu4tro%2Fslack-events-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqu4tro%2Fslack-events-api/lists"}