Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/integrations/slack/events/url_verification.rb')
-rw-r--r--lib/api/integrations/slack/events/url_verification.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/api/integrations/slack/events/url_verification.rb b/lib/api/integrations/slack/events/url_verification.rb
new file mode 100644
index 00000000000..4628b93665d
--- /dev/null
+++ b/lib/api/integrations/slack/events/url_verification.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+module API
+ class Integrations
+ module Slack
+ class Events
+ class UrlVerification
+ # When the GitLab Slack app is first configured to receive Slack events,
+ # Slack will issue a special request to the endpoint and expect it to respond
+ # with the `challenge` param.
+ #
+ # This must be done in-request, rather than on a queue.
+ #
+ # See https://api.slack.com/apis/connections/events-api.
+ def self.call(params)
+ { challenge: params[:challenge] }
+ end
+ end
+ end
+ end
+ end
+end