Class: OmniEvent::Notifier

Inherits:
ApplicationRecord show all
Defined in:
app/models/omni_event/notifier.rb

Instance Method Summary collapse

Instance Method Details

#allows_ip?(ip) ⇒ Boolean

Returns true if the given IP is allowed to send requests. Skipped when check_ip is false.

Returns:

  • (Boolean)


17
18
19
20
21
# File 'app/models/omni_event/notifier.rb', line 17

def allows_ip?(ip)
  return true unless check_ip?

  Array(allowed_ips).include?(ip.to_s)
end

#signature_verification?Boolean

Returns true if HMAC signature verification is active for this notifier.

Returns:

  • (Boolean)


24
25
26
# File 'app/models/omni_event/notifier.rb', line 24

def signature_verification?
  secret_key.present?
end