Class: IncidentManagement::PagerDuty::ProcessWebhookService

Inherits:
BaseService
  • Object
show all
Includes:
Gitlab::Utils::StrongMemoize, Settings
Defined in:
app/services/incident_management/pager_duty/process_webhook_service.rb

Constant Summary collapse

PAGER_DUTY_PAYLOAD_SIZE_LIMIT =
55.kilobytes
PAGER_DUTY_PROCESSABLE_EVENT_TYPES =
%w(incident.trigger).freeze

Instance Attribute Summary

Attributes inherited from BaseService

#current_user, #params, #project

Instance Method Summary collapse

Methods included from Settings

#auto_close_incident?, #incident_management_setting, #process_issues?

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Methods inherited from BaseService

#initialize

Methods included from BaseServiceUtility

#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level

Methods included from Gitlab::Allowable

#can?

Constructor Details

This class inherits a constructor from BaseService

Instance Method Details

#execute(token) ⇒ Object


15
16
17
18
19
20
21
22
23
# File 'app/services/incident_management/pager_duty/process_webhook_service.rb', line 15

def execute(token)
  return forbidden unless webhook_setting_active?
  return unauthorized unless valid_token?(token)
  return bad_request unless valid_payload_size?

  process_incidents

  accepted
end