forked from slack-ruby/slack-ruby-bot-server-events
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathendpoints.rb
More file actions
27 lines (24 loc) · 855 Bytes
/
Copy pathendpoints.rb
File metadata and controls
27 lines (24 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# frozen_string_literal: true
module SlackRubyBotServer
module Api
module Endpoints
class RootEndpoint
namespace :slack do
format :json
before do
::Slack::Events::Request.new(
request,
signing_secret: SlackRubyBotServer::Events.config.signing_secret,
signature_expires_in: SlackRubyBotServer::Events.config.signature_expires_in
).verify!
rescue ::Slack::Events::Request::TimestampExpired
error!('Invalid Signature', 403)
end
mount SlackRubyBotServer::Events::Api::Endpoints::Slack::CommandsEndpoint
mount SlackRubyBotServer::Events::Api::Endpoints::Slack::ActionsEndpoint
mount SlackRubyBotServer::Events::Api::Endpoints::Slack::EventsEndpoint
end
end
end
end
end