pact_broker 2.85.0 → 2.88.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/trigger_pact_docs_update.yml +22 -0
  3. data/CHANGELOG.md +67 -0
  4. data/DEVELOPER_DOCUMENTATION.md +0 -2
  5. data/db/migrations/20210914_add_labels_to_webhooks.rb +14 -0
  6. data/db/migrations/20210915_add_verified_by_to_verification.rb +6 -0
  7. data/db/migrations/20210929_increase_event_context_column_size.rb +14 -0
  8. data/docker-compose-ci-mysql.yml +1 -0
  9. data/docker-compose-test.yml +2 -0
  10. data/docs/CONFIGURATION.md +255 -66
  11. data/docs/api/WEBHOOKS.md +789 -0
  12. data/docs/configuration.yml +166 -101
  13. data/lib/db.rb +0 -1
  14. data/lib/pact/doc/interaction_view_model.rb +2 -2
  15. data/lib/pact/doc/markdown/consumer_contract_renderer.rb +1 -1
  16. data/lib/pact_broker/api/contracts/configuration.rb +33 -0
  17. data/lib/pact_broker/api/contracts/publish_contracts_schema.rb +35 -16
  18. data/lib/pact_broker/api/contracts/webhook_contract.rb +24 -2
  19. data/lib/pact_broker/api/decorators/matrix_decorator.rb +3 -1
  20. data/lib/pact_broker/api/decorators/pact_decorator.rb +12 -0
  21. data/lib/pact_broker/api/decorators/verification_decorator.rb +9 -3
  22. data/lib/pact_broker/api/decorators/webhook_decorator.rb +27 -4
  23. data/lib/pact_broker/api/pact_broker_urls.rb +30 -6
  24. data/lib/pact_broker/api/resources/all_webhooks.rb +2 -2
  25. data/lib/pact_broker/api/resources/default_base_resource.rb +5 -1
  26. data/lib/pact_broker/api/resources/environment.rb +4 -4
  27. data/lib/pact_broker/api/resources/environments.rb +1 -1
  28. data/lib/pact_broker/api/resources/index.rb +7 -1
  29. data/lib/pact_broker/api/resources/metadata_resource_methods.rb +33 -3
  30. data/lib/pact_broker/api/resources/pact_version.rb +4 -0
  31. data/lib/pact_broker/api/resources/previous_distinct_pact_version.rb +1 -1
  32. data/lib/pact_broker/api/resources/publish_contracts.rb +1 -1
  33. data/lib/pact_broker/api/resources/verification.rb +5 -2
  34. data/lib/pact_broker/api/resources/webhook_execution.rb +7 -3
  35. data/lib/pact_broker/api/resources/webhook_execution_methods.rb +23 -17
  36. data/lib/pact_broker/api.rb +6 -0
  37. data/lib/pact_broker/application_context.rb +5 -0
  38. data/lib/pact_broker/config/runtime_configuration.rb +4 -0
  39. data/lib/pact_broker/config/runtime_configuration_database_methods.rb +1 -1
  40. data/lib/pact_broker/db/clean.rb +1 -2
  41. data/lib/pact_broker/db/delete_overwritten_data.rb +41 -23
  42. data/lib/pact_broker/deployments/deployed_version.rb +1 -0
  43. data/lib/pact_broker/deployments/deployed_version_service.rb +1 -0
  44. data/lib/pact_broker/deployments/environment_service.rb +7 -2
  45. data/lib/pact_broker/deployments/released_version_service.rb +1 -0
  46. data/lib/pact_broker/doc/controllers/app.rb +1 -0
  47. data/lib/pact_broker/doc/views/can-i-deploy.markdown +2 -1
  48. data/lib/pact_broker/doc/views/index/publish-contracts.markdown +38 -9
  49. data/lib/pact_broker/doc/views/pacticipant/label.markdown +12 -0
  50. data/lib/pact_broker/doc/views/provider-pacts-for-verification.markdown +7 -7
  51. data/lib/pact_broker/doc/views/webhooks.markdown +17 -0
  52. data/lib/pact_broker/domain/index_item.rb +9 -0
  53. data/lib/pact_broker/domain/pacticipant.rb +4 -0
  54. data/lib/pact_broker/domain/verification.rb +19 -4
  55. data/lib/pact_broker/domain/webhook.rb +5 -5
  56. data/lib/pact_broker/domain/webhook_pacticipant.rb +6 -0
  57. data/lib/pact_broker/index/service.rb +4 -4
  58. data/lib/pact_broker/locale/en.yml +4 -1
  59. data/lib/pact_broker/matrix/head_row.rb +1 -1
  60. data/lib/pact_broker/matrix/parse_can_i_deploy_query.rb +5 -3
  61. data/lib/pact_broker/matrix/quick_row.rb +0 -1
  62. data/lib/pact_broker/matrix/repository.rb +0 -1
  63. data/lib/pact_broker/matrix/row.rb +2 -2
  64. data/lib/pact_broker/pacticipants/repository.rb +1 -1
  65. data/lib/pact_broker/pacts/latest_pact_publication_id_for_consumer_version.rb +0 -1
  66. data/lib/pact_broker/pacts/metadata.rb +7 -1
  67. data/lib/pact_broker/pacts/pact_publication.rb +7 -0
  68. data/lib/pact_broker/pacts/pact_publication_clean_selector_dataset_module.rb +19 -0
  69. data/lib/pact_broker/pacts/pact_publication_dataset_module.rb +30 -2
  70. data/lib/pact_broker/pacts/pact_version.rb +24 -1
  71. data/lib/pact_broker/pacts/pacts_for_verification_repository.rb +5 -4
  72. data/lib/pact_broker/pacts/repository.rb +50 -47
  73. data/lib/pact_broker/pacts/service.rb +5 -5
  74. data/lib/pact_broker/string_refinements.rb +1 -1
  75. data/lib/pact_broker/test/http_test_data_builder.rb +40 -10
  76. data/lib/pact_broker/test/test_data_builder.rb +28 -5
  77. data/lib/pact_broker/ui/helpers/url_helper.rb +12 -0
  78. data/lib/pact_broker/ui/view_models/index_item.rb +15 -1
  79. data/lib/pact_broker/ui/view_models/index_item_branch_head.rb +39 -0
  80. data/lib/pact_broker/ui/view_models/index_item_provider_branch_head.rb +39 -0
  81. data/lib/pact_broker/ui/views/dashboard/show.haml +14 -7
  82. data/lib/pact_broker/verifications/repository.rb +5 -2
  83. data/lib/pact_broker/verifications/service.rb +7 -4
  84. data/lib/pact_broker/version.rb +1 -1
  85. data/lib/pact_broker/versions/abbreviate_number.rb +8 -4
  86. data/lib/pact_broker/versions/branch_head.rb +0 -2
  87. data/lib/pact_broker/versions/branch_version.rb +1 -0
  88. data/lib/pact_broker/versions/repository.rb +0 -1
  89. data/lib/pact_broker/webhooks/event_listener.rb +4 -2
  90. data/lib/pact_broker/webhooks/pact_and_verification_parameters.rb +18 -3
  91. data/lib/pact_broker/webhooks/repository.rb +10 -4
  92. data/lib/pact_broker/webhooks/trigger_service.rb +1 -1
  93. data/lib/pact_broker/webhooks/webhook.rb +71 -8
  94. data/lib/webmachine/describe_routes.rb +62 -0
  95. data/public/stylesheets/index.css +5 -0
  96. data/script/data/auto-create-things-for-tags.rb +1 -0
  97. data/script/data/branches.rb +1 -1
  98. data/script/data/contract-published-requiring-verification.rb +0 -1
  99. data/script/data/verify-pact-for-multiple-selectors.rb +30 -0
  100. data/script/docs/generate-api-docs.rb +117 -0
  101. data/script/docs/generate-configuration-docs.rb +24 -3
  102. data/script/docs/regenerate-api-docs.sh +11 -0
  103. data/script/generate-erd +55 -0
  104. data/spec/features/create_webhook_spec.rb +55 -10
  105. data/spec/features/get_pact_spec.rb +2 -3
  106. data/spec/fixtures/approvals/docs_webhooks_executing_a_saved_webhook_options.approved.json +20 -0
  107. data/spec/fixtures/approvals/docs_webhooks_executing_a_saved_webhook_post.approved.json +43 -0
  108. data/spec/fixtures/approvals/docs_webhooks_executing_an_unsaved_webhook_options.approved.json +20 -0
  109. data/spec/fixtures/approvals/docs_webhooks_executing_an_unsaved_webhook_post.approved.json +63 -0
  110. data/spec/fixtures/approvals/docs_webhooks_logs_of_triggered_webhook_get.approved.json +20 -0
  111. data/spec/fixtures/approvals/docs_webhooks_logs_of_triggered_webhook_options.approved.json +20 -0
  112. data/spec/fixtures/approvals/docs_webhooks_pact_webhooks_get.approved.json +45 -0
  113. data/spec/fixtures/approvals/docs_webhooks_pact_webhooks_options.approved.json +20 -0
  114. data/spec/fixtures/approvals/docs_webhooks_triggered_webhooks_for_pact_publication_get.approved.json +52 -0
  115. data/spec/fixtures/approvals/docs_webhooks_triggered_webhooks_for_pact_publication_options.approved.json +20 -0
  116. data/spec/fixtures/approvals/docs_webhooks_triggered_webhooks_for_verification_publication_get.approved.json +32 -0
  117. data/spec/fixtures/approvals/docs_webhooks_triggered_webhooks_for_verification_publication_options.approved.json +20 -0
  118. data/spec/fixtures/approvals/docs_webhooks_webhook_get.approved.json +74 -0
  119. data/spec/fixtures/approvals/docs_webhooks_webhook_options.approved.json +20 -0
  120. data/spec/fixtures/approvals/docs_webhooks_webhook_put.approved.json +77 -0
  121. data/spec/fixtures/approvals/docs_webhooks_webhooks_for_a_provider_get.approved.json +41 -0
  122. data/spec/fixtures/approvals/docs_webhooks_webhooks_for_a_provider_options.approved.json +20 -0
  123. data/spec/fixtures/approvals/docs_webhooks_webhooks_for_consumer_and_provider_get.approved.json +45 -0
  124. data/spec/fixtures/approvals/docs_webhooks_webhooks_for_consumer_and_provider_options.approved.json +20 -0
  125. data/spec/fixtures/approvals/docs_webhooks_webhooks_for_consumer_get.approved.json +41 -0
  126. data/spec/fixtures/approvals/docs_webhooks_webhooks_for_consumer_options.approved.json +20 -0
  127. data/spec/fixtures/approvals/docs_webhooks_webhooks_get.approved.json +45 -0
  128. data/spec/fixtures/approvals/docs_webhooks_webhooks_options.approved.json +20 -0
  129. data/spec/fixtures/approvals/docs_webhooks_webhooks_post.approved.json +78 -0
  130. data/spec/fixtures/approvals/docs_webhooks_webhooks_status_get.approved.json +79 -0
  131. data/spec/fixtures/approvals/docs_webhooks_webhooks_status_options.approved.json +20 -0
  132. data/spec/fixtures/approvals/get_provider_pacts_for_verification.approved.json +1 -2
  133. data/spec/fixtures/approvals/publish_contract_no_branch.approved.json +1 -2
  134. data/spec/fixtures/approvals/publish_contract_nothing_exists.approved.json +1 -2
  135. data/spec/fixtures/approvals/publish_contract_nothing_exists_with_webhook.approved.json +1 -2
  136. data/spec/fixtures/approvals/publish_contract_verification_already_exists.approved.json +1 -2
  137. data/spec/fixtures/approvals/publish_contract_with_validation_error.approved.json +1 -2
  138. data/spec/fixtures/invalid-publish-contract-body.json +38 -0
  139. data/spec/fixtures/verification.json +4 -0
  140. data/spec/integration/pact_metdata_spec.rb +105 -0
  141. data/spec/integration/webhooks/contract_publication_spec.rb +68 -0
  142. data/spec/integration/webhooks/contract_requiring_verification_published_spec.rb +67 -0
  143. data/spec/integration/webhooks/pact_publication_spec.rb +51 -0
  144. data/spec/integration/webhooks_documentation_spec.rb +348 -0
  145. data/spec/lib/pact/doc/markdown/consumer_contract_renderer_spec.rb +2 -2
  146. data/spec/lib/pact_broker/api/contracts/publish_contracts_schema_spec.rb +13 -0
  147. data/spec/lib/pact_broker/api/contracts/webhook_contract_spec.rb +50 -0
  148. data/spec/lib/pact_broker/api/decorators/matrix_decorator_spec.rb +1 -1
  149. data/spec/lib/pact_broker/api/decorators/verification_decorator_spec.rb +15 -7
  150. data/spec/lib/pact_broker/api/decorators/verification_summary_decorator_spec.rb +4 -2
  151. data/spec/lib/pact_broker/api/decorators/webhook_decorator_spec.rb +4 -4
  152. data/spec/lib/pact_broker/api/pact_broker_urls_spec.rb +18 -0
  153. data/spec/lib/pact_broker/api/resources/triggered_webhook_logs_spec.rb +6 -5
  154. data/spec/lib/pact_broker/config/runtime_configuration_documentation_spec.rb +30 -0
  155. data/spec/lib/pact_broker/deployments/environment_service_spec.rb +22 -1
  156. data/spec/lib/pact_broker/domain/webhook_spec.rb +35 -0
  157. data/spec/lib/pact_broker/matrix/head_row_spec.rb +9 -5
  158. data/spec/lib/pact_broker/matrix/parse_can_i_deploy_query_spec.rb +13 -0
  159. data/spec/lib/pact_broker/pacts/{latest_tagged_pact_publications_spec.rb → pact_publication_clean_selector_dataset_module_spec.rb} +7 -9
  160. data/spec/lib/pact_broker/pacts/pact_version_spec.rb +32 -0
  161. data/spec/lib/pact_broker/pacts/repository_find_for_verification_spec.rb +4 -5
  162. data/spec/lib/pact_broker/pacts/repository_spec.rb +33 -0
  163. data/spec/lib/pact_broker/ui/view_models/index_item_spec.rb +1 -1
  164. data/spec/lib/pact_broker/verifications/service_spec.rb +22 -8
  165. data/spec/lib/pact_broker/versions/abbreviate_number_spec.rb +2 -1
  166. data/spec/lib/pact_broker/webhooks/render_spec.rb +3 -2
  167. data/spec/lib/pact_broker/webhooks/repository_spec.rb +158 -15
  168. data/spec/lib/pact_broker/webhooks/webhook_spec.rb +8 -5
  169. data/spec/support/documentation.rb +64 -0
  170. data/spec/support/rack_helpers.rb +1 -1
  171. data/tasks/db.rake +4 -1
  172. data/tasks/development.rake +14 -13
  173. metadata +89 -12
  174. data/lib/pact_broker/pacts/all_pact_publications.rb +0 -158
  175. data/lib/pact_broker/pacts/latest_pact_publications.rb +0 -48
  176. data/lib/pact_broker/pacts/latest_pact_publications_by_consumer_version.rb +0 -26
  177. data/lib/pact_broker/pacts/latest_tagged_pact_publications.rb +0 -45
  178. data/lib/pact_broker/verifications/latest_verification_for_pact_version.rb +0 -39
  179. data/spec/lib/pact_broker/verifications/latest_verification_for_pact_version_spec.rb +0 -18
@@ -0,0 +1,52 @@
1
+ {
2
+ "category": "Webhooks",
3
+ "name": "Triggered webhooks for pact publication",
4
+ "order": 41,
5
+ "request": {
6
+ "method": "GET",
7
+ "path_template": "/pacts/provider/:provider_name/consumer/:consumer_name/version/:consumer_version_number/triggered-webhooks",
8
+ "path": "/pacts/provider/Bar/consumer/Foo/version/2/triggered-webhooks",
9
+ "headers": {
10
+ "Accept": "application/hal+json"
11
+ }
12
+ },
13
+ "response": {
14
+ "status": 200,
15
+ "headers": {
16
+ "Content-Type": "application/hal+json;charset=utf-8"
17
+ },
18
+ "body": {
19
+ "_embedded": {
20
+ "triggeredWebhooks": [
21
+ {
22
+ "name": "POST example.org",
23
+ "status": "not_run",
24
+ "attemptsMade": 1,
25
+ "attemptsRemaining": 6,
26
+ "triggerType": "resource_creation",
27
+ "eventName": "contract_content_changed",
28
+ "triggeredAt": "2021-09-01T00:07:21+00:00",
29
+ "_links": {
30
+ "pb:logs": {
31
+ "href": "http://example.org/triggered-webhooks/6cd5cc48-db3c-4a4c-a36d-e9bedeb9d91e/logs",
32
+ "title": "Webhook execution logs",
33
+ "name": "POST example.org"
34
+ },
35
+ "pb:webhook": {
36
+ "href": "http://example.org/webhooks/d2181b32-8b03-4daf-8cc0-d9168b2f6fac",
37
+ "title": "Webhook",
38
+ "name": "POST example.org"
39
+ }
40
+ }
41
+ }
42
+ ]
43
+ },
44
+ "_links": {
45
+ "self": {
46
+ "title": "Webhooks triggered by the publication of the pact between Foo (2) and Bar",
47
+ "href": "http://example.org/pacts/provider/Bar/consumer/Foo/version/2/triggered-webhooks"
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "category": "Webhooks",
3
+ "name": "Triggered webhooks for pact publication",
4
+ "order": 43,
5
+ "request": {
6
+ "method": "OPTIONS",
7
+ "path_template": "/pacts/provider/:provider_name/consumer/:consumer_name/version/:consumer_version_number/triggered-webhooks",
8
+ "path": "/pacts/provider/Bar/consumer/Foo/version/2/triggered-webhooks",
9
+ "headers": {
10
+ "Accept": "application/hal+json"
11
+ }
12
+ },
13
+ "response": {
14
+ "status": 200,
15
+ "headers": {
16
+ "Access-Control-Allow-Methods": "GET, OPTIONS"
17
+ },
18
+ "body": ""
19
+ }
20
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "category": "Webhooks",
3
+ "name": "Triggered webhooks for verification publication",
4
+ "order": 45,
5
+ "request": {
6
+ "method": "GET",
7
+ "path_template": "/pacts/provider/:provider_name/consumer/:consumer_name/pact-version/:pact_version_sha/verification-results/:verification_number/triggered-webhooks",
8
+ "path": "/pacts/provider/Bar/consumer/Foo/pact-version/3e193ecb37ad04b43ce974a38352c704b2e0ed6b/verification-results/1/triggered-webhooks",
9
+ "headers": {
10
+ "Accept": "application/hal+json"
11
+ }
12
+ },
13
+ "response": {
14
+ "status": 200,
15
+ "headers": {
16
+ "Content-Type": "application/hal+json;charset=utf-8"
17
+ },
18
+ "body": {
19
+ "_embedded": {
20
+ "triggeredWebhooks": [
21
+
22
+ ]
23
+ },
24
+ "_links": {
25
+ "self": {
26
+ "title": "Webhooks triggered by the publication of verification result 1",
27
+ "href": "http://example.org/pacts/provider/Bar/consumer/Foo/pact-version/3e193ecb37ad04b43ce974a38352c704b2e0ed6b/verification-results/1/triggered-webhooks"
28
+ }
29
+ }
30
+ }
31
+ }
32
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "category": "Webhooks",
3
+ "name": "Triggered webhooks for verification publication",
4
+ "order": 47,
5
+ "request": {
6
+ "method": "OPTIONS",
7
+ "path_template": "/pacts/provider/:provider_name/consumer/:consumer_name/pact-version/:pact_version_sha/verification-results/:verification_number/triggered-webhooks",
8
+ "path": "/pacts/provider/Bar/consumer/Foo/pact-version/3e193ecb37ad04b43ce974a38352c704b2e0ed6b/verification-results/1/triggered-webhooks",
9
+ "headers": {
10
+ "Accept": "application/hal+json"
11
+ }
12
+ },
13
+ "response": {
14
+ "status": 200,
15
+ "headers": {
16
+ "Access-Control-Allow-Methods": "GET, OPTIONS"
17
+ },
18
+ "body": ""
19
+ }
20
+ }
@@ -0,0 +1,74 @@
1
+ {
2
+ "category": "Webhooks",
3
+ "name": "Webhook",
4
+ "order": 1,
5
+ "request": {
6
+ "method": "GET",
7
+ "path_template": "/webhooks/:uuid",
8
+ "path": "/webhooks/d2181b32-8b03-4daf-8cc0-d9168b2f6fac",
9
+ "headers": {
10
+ "Accept": "application/hal+json"
11
+ }
12
+ },
13
+ "response": {
14
+ "status": 200,
15
+ "headers": {
16
+ "Content-Type": "application/hal+json;charset=utf-8"
17
+ },
18
+ "body": {
19
+ "uuid": "d2181b32-8b03-4daf-8cc0-d9168b2f6fac",
20
+ "description": "an example webhook",
21
+ "consumer": {
22
+ "name": "Foo"
23
+ },
24
+ "provider": {
25
+ "name": "Bar"
26
+ },
27
+ "enabled": true,
28
+ "request": {
29
+ "method": "POST",
30
+ "url": "https://example.org/example",
31
+ "headers": {
32
+ "Content-Type": "application/json"
33
+ },
34
+ "body": {
35
+ "pactUrl": "${pactbroker.pactUrl}"
36
+ }
37
+ },
38
+ "events": [
39
+ {
40
+ "name": "contract_content_changed"
41
+ }
42
+ ],
43
+ "createdAt": "2021-09-01T00:07:21+00:00",
44
+ "_links": {
45
+ "self": {
46
+ "title": "an example webhook",
47
+ "href": "http://example.org/webhooks/d2181b32-8b03-4daf-8cc0-d9168b2f6fac"
48
+ },
49
+ "pb:execute": {
50
+ "title": "Test the execution of the webhook with the latest matching pact or verification by sending a POST request to this URL",
51
+ "href": "http://example.org/webhooks/d2181b32-8b03-4daf-8cc0-d9168b2f6fac/execute"
52
+ },
53
+ "pb:consumer": {
54
+ "title": "Consumer",
55
+ "name": "Foo",
56
+ "href": "http://example.org/pacticipants/Foo"
57
+ },
58
+ "pb:provider": {
59
+ "title": "Provider",
60
+ "name": "Bar",
61
+ "href": "http://example.org/pacticipants/Bar"
62
+ },
63
+ "pb:pact-webhooks": {
64
+ "title": "All webhooks for consumer Foo and provider Bar",
65
+ "href": "http://example.org/webhooks/provider/Bar/consumer/Foo"
66
+ },
67
+ "pb:webhooks": {
68
+ "title": "All webhooks",
69
+ "href": "http://example.org/webhooks"
70
+ }
71
+ }
72
+ }
73
+ }
74
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "category": "Webhooks",
3
+ "name": "Webhook",
4
+ "order": 5,
5
+ "request": {
6
+ "method": "OPTIONS",
7
+ "path_template": "/webhooks/:uuid",
8
+ "path": "/webhooks/d2181b32-8b03-4daf-8cc0-d9168b2f6fac",
9
+ "headers": {
10
+ "Accept": "application/hal+json"
11
+ }
12
+ },
13
+ "response": {
14
+ "status": 200,
15
+ "headers": {
16
+ "Access-Control-Allow-Methods": "GET, PUT, DELETE, OPTIONS"
17
+ },
18
+ "body": ""
19
+ }
20
+ }
@@ -0,0 +1,77 @@
1
+ {
2
+ "category": "Webhooks",
3
+ "name": "Webhook",
4
+ "order": 3,
5
+ "request": {
6
+ "method": "PUT",
7
+ "path_template": "/webhooks/:uuid",
8
+ "path": "/webhooks/d2181b32-8b03-4daf-8cc0-d9168b2f6fac",
9
+ "headers": {
10
+ "Content-Type": "application/json",
11
+ "Accept": "application/hal+json"
12
+ },
13
+ "body": {
14
+ "description": "an example webhook",
15
+ "events": [
16
+ {
17
+ "name": "contract_content_changed"
18
+ }
19
+ ],
20
+ "request": {
21
+ "method": "POST",
22
+ "url": "https://example.org/example",
23
+ "username": "username",
24
+ "password": "password",
25
+ "headers": {
26
+ "Accept": "application/json"
27
+ },
28
+ "body": {
29
+ "pactUrl": "${pactbroker.pactUrl}"
30
+ }
31
+ }
32
+ }
33
+ },
34
+ "response": {
35
+ "status": 200,
36
+ "headers": {
37
+ "Content-Type": "application/hal+json;charset=utf-8"
38
+ },
39
+ "body": {
40
+ "uuid": "d2181b32-8b03-4daf-8cc0-d9168b2f6fac",
41
+ "description": "an example webhook",
42
+ "enabled": true,
43
+ "request": {
44
+ "method": "POST",
45
+ "url": "https://example.org/example",
46
+ "headers": {
47
+ "Accept": "application/json"
48
+ },
49
+ "body": {
50
+ "pactUrl": "${pactbroker.pactUrl}"
51
+ },
52
+ "username": "username",
53
+ "password": "**********"
54
+ },
55
+ "events": [
56
+ {
57
+ "name": "contract_content_changed"
58
+ }
59
+ ],
60
+ "createdAt": "2021-09-01T00:07:21+00:00",
61
+ "_links": {
62
+ "self": {
63
+ "title": "an example webhook",
64
+ "href": "http://example.org/webhooks/d2181b32-8b03-4daf-8cc0-d9168b2f6fac"
65
+ },
66
+ "pb:execute": {
67
+ "title": "Test the execution of the webhook with the latest matching pact or verification by sending a POST request to this URL",
68
+ "href": "http://example.org/webhooks/d2181b32-8b03-4daf-8cc0-d9168b2f6fac/execute"
69
+ },
70
+ "pb:webhooks": {
71
+ "title": "All webhooks",
72
+ "href": "http://example.org/webhooks"
73
+ }
74
+ }
75
+ }
76
+ }
77
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "category": "Webhooks",
3
+ "name": "Webhooks for a provider",
4
+ "order": 17,
5
+ "request": {
6
+ "method": "GET",
7
+ "path_template": "/webhooks/provider/:provider_name",
8
+ "path": "/webhooks/provider/Bar",
9
+ "headers": {
10
+ "Accept": "application/hal+json"
11
+ }
12
+ },
13
+ "response": {
14
+ "status": 200,
15
+ "headers": {
16
+ "Content-Type": "application/hal+json;charset=utf-8"
17
+ },
18
+ "body": {
19
+ "_links": {
20
+ "self": {
21
+ "title": "Webhooks",
22
+ "href": "http://example.org/webhooks/provider/Bar"
23
+ },
24
+ "pb:create": {
25
+ "title": "POST to create a webhook",
26
+ "href": "http://example.org/webhooks/provider/Bar"
27
+ },
28
+ "pb:webhooks": [
29
+
30
+ ],
31
+ "curies": [
32
+ {
33
+ "name": "pb",
34
+ "href": "http://example.org/doc/webhooks-{rel}",
35
+ "templated": true
36
+ }
37
+ ]
38
+ }
39
+ }
40
+ }
41
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "category": "Webhooks",
3
+ "name": "Webhooks for a provider",
4
+ "order": 19,
5
+ "request": {
6
+ "method": "OPTIONS",
7
+ "path_template": "/webhooks/provider/:provider_name",
8
+ "path": "/webhooks/provider/Bar",
9
+ "headers": {
10
+ "Accept": "application/hal+json"
11
+ }
12
+ },
13
+ "response": {
14
+ "status": 200,
15
+ "headers": {
16
+ "Access-Control-Allow-Methods": "POST, GET, OPTIONS"
17
+ },
18
+ "body": ""
19
+ }
20
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "category": "Webhooks",
3
+ "name": "Webhooks for consumer and provider",
4
+ "order": 21,
5
+ "request": {
6
+ "method": "GET",
7
+ "path_template": "/webhooks/provider/:provider_name/consumer/:consumer_name",
8
+ "path": "/webhooks/provider/Bar/consumer/Foo",
9
+ "headers": {
10
+ "Accept": "application/hal+json"
11
+ }
12
+ },
13
+ "response": {
14
+ "status": 200,
15
+ "headers": {
16
+ "Content-Type": "application/hal+json;charset=utf-8"
17
+ },
18
+ "body": {
19
+ "_links": {
20
+ "self": {
21
+ "title": "Webhooks",
22
+ "href": "http://example.org/webhooks/provider/Bar/consumer/Foo"
23
+ },
24
+ "pb:create": {
25
+ "title": "POST to create a webhook",
26
+ "href": "http://example.org/webhooks/provider/Bar/consumer/Foo"
27
+ },
28
+ "pb:webhooks": [
29
+ {
30
+ "title": "A webhook for the pact between Foo and Bar",
31
+ "name": "an example webhook",
32
+ "href": "http://example.org/webhooks/d2181b32-8b03-4daf-8cc0-d9168b2f6fac"
33
+ }
34
+ ],
35
+ "curies": [
36
+ {
37
+ "name": "pb",
38
+ "href": "http://example.org/doc/webhooks-{rel}",
39
+ "templated": true
40
+ }
41
+ ]
42
+ }
43
+ }
44
+ }
45
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "category": "Webhooks",
3
+ "name": "Webhooks for consumer and provider",
4
+ "order": 23,
5
+ "request": {
6
+ "method": "OPTIONS",
7
+ "path_template": "/webhooks/provider/:provider_name/consumer/:consumer_name",
8
+ "path": "/webhooks/provider/Bar/consumer/Foo",
9
+ "headers": {
10
+ "Accept": "application/hal+json"
11
+ }
12
+ },
13
+ "response": {
14
+ "status": 200,
15
+ "headers": {
16
+ "Access-Control-Allow-Methods": "POST, GET, OPTIONS"
17
+ },
18
+ "body": ""
19
+ }
20
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "category": "Webhooks",
3
+ "name": "Webhooks for consumer",
4
+ "order": 13,
5
+ "request": {
6
+ "method": "GET",
7
+ "path_template": "/webhooks/consumer/:consumer_name",
8
+ "path": "/webhooks/consumer/Foo",
9
+ "headers": {
10
+ "Accept": "application/hal+json"
11
+ }
12
+ },
13
+ "response": {
14
+ "status": 200,
15
+ "headers": {
16
+ "Content-Type": "application/hal+json;charset=utf-8"
17
+ },
18
+ "body": {
19
+ "_links": {
20
+ "self": {
21
+ "title": "Webhooks",
22
+ "href": "http://example.org/webhooks/consumer/Foo"
23
+ },
24
+ "pb:create": {
25
+ "title": "POST to create a webhook",
26
+ "href": "http://example.org/webhooks/consumer/Foo"
27
+ },
28
+ "pb:webhooks": [
29
+
30
+ ],
31
+ "curies": [
32
+ {
33
+ "name": "pb",
34
+ "href": "http://example.org/doc/webhooks-{rel}",
35
+ "templated": true
36
+ }
37
+ ]
38
+ }
39
+ }
40
+ }
41
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "category": "Webhooks",
3
+ "name": "Webhooks for consumer",
4
+ "order": 15,
5
+ "request": {
6
+ "method": "OPTIONS",
7
+ "path_template": "/webhooks/consumer/:consumer_name",
8
+ "path": "/webhooks/consumer/Foo",
9
+ "headers": {
10
+ "Accept": "application/hal+json"
11
+ }
12
+ },
13
+ "response": {
14
+ "status": 200,
15
+ "headers": {
16
+ "Access-Control-Allow-Methods": "POST, GET, OPTIONS"
17
+ },
18
+ "body": ""
19
+ }
20
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "category": "Webhooks",
3
+ "name": "Webhooks",
4
+ "order": 7,
5
+ "request": {
6
+ "method": "GET",
7
+ "path_template": "/webhooks",
8
+ "path": "/webhooks",
9
+ "headers": {
10
+ "Accept": "application/hal+json"
11
+ }
12
+ },
13
+ "response": {
14
+ "status": 200,
15
+ "headers": {
16
+ "Content-Type": "application/hal+json;charset=utf-8"
17
+ },
18
+ "body": {
19
+ "_links": {
20
+ "self": {
21
+ "title": "Webhooks",
22
+ "href": "http://example.org/webhooks"
23
+ },
24
+ "pb:create": {
25
+ "title": "POST to create a webhook",
26
+ "href": "http://example.org/webhooks"
27
+ },
28
+ "pb:webhooks": [
29
+ {
30
+ "title": "A webhook for the pact between Foo and Bar",
31
+ "name": "an example webhook",
32
+ "href": "http://example.org/webhooks/d2181b32-8b03-4daf-8cc0-d9168b2f6fac"
33
+ }
34
+ ],
35
+ "curies": [
36
+ {
37
+ "name": "pb",
38
+ "href": "http://example.org/doc/webhooks-{rel}",
39
+ "templated": true
40
+ }
41
+ ]
42
+ }
43
+ }
44
+ }
45
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "category": "Webhooks",
3
+ "name": "Webhooks",
4
+ "order": 11,
5
+ "request": {
6
+ "method": "OPTIONS",
7
+ "path_template": "/webhooks",
8
+ "path": "/webhooks",
9
+ "headers": {
10
+ "Accept": "application/hal+json"
11
+ }
12
+ },
13
+ "response": {
14
+ "status": 200,
15
+ "headers": {
16
+ "Access-Control-Allow-Methods": "GET, POST, OPTIONS"
17
+ },
18
+ "body": ""
19
+ }
20
+ }
@@ -0,0 +1,78 @@
1
+ {
2
+ "category": "Webhooks",
3
+ "name": "Webhooks",
4
+ "order": 9,
5
+ "request": {
6
+ "method": "POST",
7
+ "path_template": "/webhooks",
8
+ "path": "/webhooks",
9
+ "headers": {
10
+ "Content-Type": "application/json",
11
+ "Accept": "application/hal+json"
12
+ },
13
+ "body": {
14
+ "description": "an example webhook",
15
+ "events": [
16
+ {
17
+ "name": "contract_content_changed"
18
+ }
19
+ ],
20
+ "request": {
21
+ "method": "POST",
22
+ "url": "https://example.org/example",
23
+ "username": "username",
24
+ "password": "password",
25
+ "headers": {
26
+ "Accept": "application/json"
27
+ },
28
+ "body": {
29
+ "pactUrl": "${pactbroker.pactUrl}"
30
+ }
31
+ }
32
+ }
33
+ },
34
+ "response": {
35
+ "status": 201,
36
+ "headers": {
37
+ "Content-Type": "application/hal+json;charset=utf-8",
38
+ "Location": "http://example.org/webhooks/dCGCl-Ba3PqEFJ_iE9mJkQ"
39
+ },
40
+ "body": {
41
+ "uuid": "dCGCl-Ba3PqEFJ_iE9mJkQ",
42
+ "description": "an example webhook",
43
+ "enabled": true,
44
+ "request": {
45
+ "method": "POST",
46
+ "url": "https://example.org/example",
47
+ "headers": {
48
+ "Accept": "application/json"
49
+ },
50
+ "body": {
51
+ "pactUrl": "${pactbroker.pactUrl}"
52
+ },
53
+ "username": "username",
54
+ "password": "**********"
55
+ },
56
+ "events": [
57
+ {
58
+ "name": "contract_content_changed"
59
+ }
60
+ ],
61
+ "createdAt": "2021-09-01T00:07:21+00:00",
62
+ "_links": {
63
+ "self": {
64
+ "title": "an example webhook",
65
+ "href": "http://example.org/webhooks/dCGCl-Ba3PqEFJ_iE9mJkQ"
66
+ },
67
+ "pb:execute": {
68
+ "title": "Test the execution of the webhook with the latest matching pact or verification by sending a POST request to this URL",
69
+ "href": "http://example.org/webhooks/dCGCl-Ba3PqEFJ_iE9mJkQ/execute"
70
+ },
71
+ "pb:webhooks": {
72
+ "title": "All webhooks",
73
+ "href": "http://example.org/webhooks"
74
+ }
75
+ }
76
+ }
77
+ }
78
+ }