Class: PactBroker::Api::Resources::WebhookExecution
Instance Method Summary
collapse
#webhook_execution_configuration
#webhook_validation_errors?
Instance Method Details
#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
|
43
44
45
46
47
48
49
|
# File 'lib/pact_broker/api/resources/webhook_execution.rb', line 43
def malformed_request?
if uuid
false
else
webhook_validation_errors?(webhook)
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
|
#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_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?
!!resource_object
end
|
#resource_object ⇒ Object
39
40
41
|
# File 'lib/pact_broker/api/resources/webhook_execution.rb', line 39
def resource_object
webhook
end
|