Class: PactBroker::Api::Resources::WebhookExecution
Instance Method Summary
collapse
#finish_request, #handle_webhook_events, #schedule_triggered_webhooks
#webhook_validation_errors?
Instance Method Details
#action ⇒ Object
55
56
57
|
# File 'lib/pact_broker/api/resources/webhook_execution.rb', line 55
def action
:execute
end
|
#allowed_methods ⇒ Object
24
25
26
|
# File 'lib/pact_broker/api/resources/webhook_execution.rb', line 24
def allowed_methods
["POST", "OPTIONS"]
end
|
#content_types_accepted ⇒ Object
16
17
18
|
# File 'lib/pact_broker/api/resources/webhook_execution.rb', line 16
def content_types_accepted
[["application/json"]]
end
|
#content_types_provided ⇒ Object
20
21
22
|
# File 'lib/pact_broker/api/resources/webhook_execution.rb', line 20
def content_types_provided
[["application/hal+json"]]
end
|
39
40
41
42
43
44
45
46
47
48
49
|
# File 'lib/pact_broker/api/resources/webhook_execution.rb', line 39
def malformed_request?
if request.post?
if uuid
false
else
webhook_validation_errors?(webhook)
end
else
super
end
end
|
#policy_name ⇒ Object
51
52
53
|
# File 'lib/pact_broker/api/resources/webhook_execution.rb', line 51
def policy_name
:'webhooks::webhook'
end
|
#policy_record ⇒ Object
59
60
61
|
# File 'lib/pact_broker/api/resources/webhook_execution.rb', line 59
def policy_record
webhook
end
|
#process_post ⇒ Object
28
29
30
31
32
33
|
# File 'lib/pact_broker/api/resources/webhook_execution.rb', line 28
def process_post
webhook_execution_result = webhook_trigger_service.test_execution(webhook, webhook_execution_configuration.webhook_context, webhook_execution_configuration)
response.["Content-Type"] = "application/hal+json;charset=utf-8"
response.body = post_response_body(webhook_execution_result)
true
end
|
#resource_exists? ⇒ Boolean
35
36
37
|
# File 'lib/pact_broker/api/resources/webhook_execution.rb', line 35
def resource_exists?
!!webhook
end
|