Class: Mihari::Emitters::Webhook
- Defined in:
- lib/mihari/emitters/webhook.rb
Constant Summary
Constants included from Mixins::Retriable
Instance Method Summary collapse
Methods inherited from Base
Methods included from Mixins::Retriable
Methods included from Mixins::Configurable
#configuration_values, #configured?
Constructor Details
This class inherits a constructor from Mihari::Emitters::Base
Instance Method Details
#emit(title:, description:, artifacts:, source:, tags:) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/mihari/emitters/webhook.rb', line 11 def emit(title:, description:, artifacts:, source:, tags:) return if artifacts.empty? headers = { "content-type": "application/x-www-form-urlencoded" } headers["content-type"] = "application/json" if use_json_body? emitter = Emitters::HTTP.new(uri: Mihari.config.webhook_url) emitter.emit(title: title, description: description, artifacts: artifacts, source: source, tags: ) end |
#valid? ⇒ Boolean
7 8 9 |
# File 'lib/mihari/emitters/webhook.rb', line 7 def valid? webhook_url? end |