Class: WebHook

Inherits:
ApplicationRecord show all
Includes:
Sortable
Defined in:
app/models/hooks/web_hook.rb

Direct Known Subclasses

ProjectHook, ServiceHook, SystemHook

Instance Method Summary collapse

Methods inherited from ApplicationRecord

at_most, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, underscore, without_order

Instance Method Details

#allow_local_requests?Boolean

Allow urls pointing localhost and the local network

Returns:

  • (Boolean)

37
38
39
# File 'app/models/hooks/web_hook.rb', line 37

def allow_local_requests?
  Gitlab::CurrentSettings.allow_local_requests_from_web_hooks_and_services?
end

#async_execute(data, hook_name) ⇒ Object

rubocop: disable CodeReuse/ServiceClass


31
32
33
# File 'app/models/hooks/web_hook.rb', line 31

def async_execute(data, hook_name)
  WebHookService.new(self, data, hook_name).async_execute
end

#execute(data, hook_name) ⇒ Object

rubocop: disable CodeReuse/ServiceClass


25
26
27
# File 'app/models/hooks/web_hook.rb', line 25

def execute(data, hook_name)
  WebHookService.new(self, data, hook_name).execute
end

#help_pathObject


41
42
43
# File 'app/models/hooks/web_hook.rb', line 41

def help_path
  'user/project/integrations/webhooks'
end