pact_broker 2.12.0 → 2.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +42 -5
- data/README.md +13 -8
- data/bethtest.rb +21 -94
- data/db/migrations/20171112_add_test_results.rb +7 -0
- data/db/migrations/20171117_create_webhook_events.rb +14 -0
- data/db/migrations/20171118_create_webhook_events.rb +18 -0
- data/db/migrations/20180108_create_certificates_table.rb +14 -0
- data/db/migrations/20180109_migrate_trigger_type.rb +9 -0
- data/db/pact_broker_database.sqlite3 +0 -0
- data/db/test/backwards_compatibility/gemfiles/1.18.0.gemfile.lock +5 -5
- data/db/test/backwards_compatibility/gemfiles/2.0.0.gemfile.lock +5 -5
- data/db/test/backwards_compatibility/gemfiles/2.1.0.gemfile.lock +5 -5
- data/db/test/backwards_compatibility/gemfiles/2.2.0.gemfile.lock +12 -14
- data/db/test/backwards_compatibility/gemfiles/2.3.0.gemfile.lock +12 -14
- data/db/test/backwards_compatibility/gemfiles/2.4.2.gemfile.lock +12 -14
- data/db/test/backwards_compatibility/gemfiles/2.5.1.gemfile.lock +12 -14
- data/db/test/backwards_compatibility/gemfiles/2.6.0.gemfile.lock +12 -14
- data/db/test/backwards_compatibility/gemfiles/head.gemfile.lock +16 -15
- data/db/test/change_migration_strategy/before/Gemfile +1 -0
- data/example/README.md +65 -0
- data/example/config.ru +1 -0
- data/example/example_data.sql +17 -0
- data/lib/pact_broker/api.rb +1 -1
- data/lib/pact_broker/api/contracts/webhook_contract.rb +9 -1
- data/lib/pact_broker/api/decorators/verification_decorator.rb +1 -0
- data/lib/pact_broker/api/decorators/webhook_decorator.rb +35 -5
- data/lib/pact_broker/api/resources/matrix_badge.rb +21 -0
- data/lib/pact_broker/certificates/certificate.rb +8 -0
- data/lib/pact_broker/certificates/service.rb +41 -0
- data/lib/pact_broker/doc/controllers/app.rb +12 -2
- data/lib/pact_broker/doc/views/webhooks.markdown +37 -2
- data/lib/pact_broker/domain/verification.rb +2 -0
- data/lib/pact_broker/domain/webhook.rb +2 -1
- data/lib/pact_broker/domain/webhook_request.rb +22 -4
- data/lib/pact_broker/error.rb +5 -0
- data/lib/pact_broker/matrix/parse_query.rb +7 -10
- data/lib/pact_broker/matrix/repository.rb +5 -32
- data/lib/pact_broker/matrix/service.rb +21 -3
- data/lib/pact_broker/pacts/repository.rb +9 -2
- data/lib/pact_broker/pacts/service.rb +2 -2
- data/lib/pact_broker/services.rb +5 -0
- data/lib/pact_broker/ui/app.rb +15 -0
- data/lib/pact_broker/ui/controllers/matrix.rb +58 -3
- data/lib/pact_broker/ui/views/matrix/show.haml +65 -10
- data/lib/pact_broker/verifications/service.rb +6 -1
- data/lib/pact_broker/version.rb +1 -1
- data/lib/pact_broker/webhooks/job.rb +1 -1
- data/lib/pact_broker/webhooks/repository.rb +17 -0
- data/lib/pact_broker/webhooks/service.rb +8 -7
- data/lib/pact_broker/webhooks/triggered_webhook.rb +1 -1
- data/lib/pact_broker/webhooks/webhook.rb +3 -0
- data/lib/pact_broker/webhooks/webhook_event.rb +24 -0
- data/pact_broker.gemspec +2 -1
- data/public/javascripts/matrix.js +60 -0
- data/public/stylesheets/matrix.css +12 -0
- data/script/db-spec.sh +1 -0
- data/script/foo-bar-verification.json +57 -0
- data/script/insert-self-signed-certificate-from-url.rb +32 -0
- data/script/publish-verification.sh +5 -0
- data/script/seed-matrix.rb +6 -5
- data/script/seed.rb +67 -59
- data/spec/features/create_webhook_spec.rb +4 -1
- data/spec/features/get_matrix_badge_spec.rb +40 -0
- data/spec/features/publish_verification_spec.rb +28 -4
- data/spec/fixtures/certificate-invalid.pem +29 -0
- data/spec/fixtures/certificate.pem +53 -0
- data/spec/fixtures/certificates/cacert.pem +21 -0
- data/spec/fixtures/certificates/cert.pem +20 -0
- data/spec/fixtures/certificates/key.pem +27 -0
- data/spec/fixtures/certificates/self-signed.badssl.com.pem +21 -0
- data/spec/fixtures/verification.json +4 -1
- data/spec/fixtures/webhook_valid.json +3 -0
- data/spec/integration/webhooks/certificate_spec.rb +80 -0
- data/spec/lib/pact_broker/api/contracts/webhook_contract_spec.rb +20 -0
- data/spec/lib/pact_broker/api/decorators/pact_webhooks_status_decorator_spec.rb +2 -2
- data/spec/lib/pact_broker/api/decorators/verification_decorator_spec.rb +5 -0
- data/spec/lib/pact_broker/api/decorators/verification_summary_decorator_spec.rb +1 -0
- data/spec/lib/pact_broker/api/decorators/webhook_decorator_spec.rb +29 -19
- data/spec/lib/pact_broker/api/resources/badge_spec.rb +61 -0
- data/spec/lib/pact_broker/api/resources/matrix_badge_spec.rb +11 -0
- data/spec/lib/pact_broker/api/resources/pact_webhooks_spec.rb +8 -9
- data/spec/lib/pact_broker/certificates/service_spec.rb +60 -0
- data/spec/lib/pact_broker/domain/verification_spec.rb +13 -0
- data/spec/lib/pact_broker/domain/webhook_request_spec.rb +0 -4
- data/spec/lib/pact_broker/matrix/service_spec.rb +40 -8
- data/spec/lib/pact_broker/pacts/repository_spec.rb +18 -1
- data/spec/lib/pact_broker/webhooks/job_spec.rb +1 -1
- data/spec/lib/pact_broker/webhooks/repository_spec.rb +53 -13
- data/spec/lib/pact_broker/webhooks/service_spec.rb +9 -6
- data/spec/migrations/change_migration_strategy_spec.rb +13 -14
- data/spec/spec_helper.rb +4 -0
- data/spec/support/ssl_webhook_server.rb +37 -0
- data/spec/support/test_data_builder.rb +12 -4
- data/tasks/database.rb +9 -7
- data/tasks/database/table_dependency_calculator.rb +44 -0
- metadata +57 -6
- data/lib/pact_broker/doc/views/pact-webhooks.markdown +0 -50
- data/lib/pact_broker/doc/views/webhooks-create.markdown +0 -38
- data/lib/pact_broker/doc/views/webhooks-webhooks.markdown +0 -15
@@ -1,50 +0,0 @@
|
|
1
|
-
# Webhooks
|
2
|
-
|
3
|
-
Allowed methods: GET, POST, DELETE
|
4
|
-
|
5
|
-
### Creating
|
6
|
-
|
7
|
-
1. To create a webhook, in the HAL Browser, navigate to the pact you want to create the webhook for
|
8
|
-
(Click "Go to Entry Point", then select "latest-pacts", then select the pact you want to create the webhook for.)
|
9
|
-
2. Click the "NON-GET" button for the "pact-webhooks" relation.
|
10
|
-
3. Paste in the webhook JSON (example shown below) in the body section and click "Make Request".
|
11
|
-
|
12
|
-
An example webhook to trigger a Bamboo job.
|
13
|
-
|
14
|
-
{
|
15
|
-
"request": {
|
16
|
-
"method": "POST",
|
17
|
-
"url": "http://master.ci.my.domain:8085/rest/api/latest/queue/SOME-PROJECT?os_authType=basic",
|
18
|
-
"username": "username",
|
19
|
-
"password": "password",
|
20
|
-
"headers": {
|
21
|
-
"Accept": "application/json"
|
22
|
-
}
|
23
|
-
}
|
24
|
-
}
|
25
|
-
|
26
|
-
A request body can be specified as well.
|
27
|
-
|
28
|
-
{
|
29
|
-
"request": {
|
30
|
-
"method": "POST",
|
31
|
-
"url": "http://example.org/something",
|
32
|
-
"body": {
|
33
|
-
"some" : "json"
|
34
|
-
}
|
35
|
-
}
|
36
|
-
}
|
37
|
-
|
38
|
-
**BEWARE** The password can be reverse engineered from the database, so make a separate account for the Pact Broker to use, don't use your personal account!
|
39
|
-
|
40
|
-
### Testing
|
41
|
-
|
42
|
-
To test a webhook, navigate to the webhook in the HAL browser, then make a POST request to the "execute" relation. The response or error will be shown in the window.
|
43
|
-
|
44
|
-
### Deleting
|
45
|
-
|
46
|
-
Send a DELETE request to the webhook URL.
|
47
|
-
|
48
|
-
### Updating
|
49
|
-
|
50
|
-
Send a PUT request to the webhook URL with all fields required for the new webhook.
|
@@ -1,38 +0,0 @@
|
|
1
|
-
# Create a webhook
|
2
|
-
|
3
|
-
Allowed methods: POST
|
4
|
-
|
5
|
-
1. Click the "NON-GET" button for the "pb:create" relation.
|
6
|
-
3. Paste in the webhook JSON (example shown below) in the body section and click "Make Request".
|
7
|
-
|
8
|
-
An example webhook to trigger a Bamboo job.
|
9
|
-
|
10
|
-
{
|
11
|
-
"request": {
|
12
|
-
"method": "POST",
|
13
|
-
"url": "http://master.ci.my.domain:8085/rest/api/latest/queue/SOME-PROJECT?os_authType=basic",
|
14
|
-
"username": "username",
|
15
|
-
"password": "password",
|
16
|
-
"headers": {
|
17
|
-
"Accept": "application/json"
|
18
|
-
}
|
19
|
-
}
|
20
|
-
}
|
21
|
-
|
22
|
-
A request body can be specified as well.
|
23
|
-
|
24
|
-
{
|
25
|
-
"request": {
|
26
|
-
"method": "POST",
|
27
|
-
"url": "http://example.org/something",
|
28
|
-
"body": {
|
29
|
-
"some" : "json"
|
30
|
-
}
|
31
|
-
}
|
32
|
-
}
|
33
|
-
|
34
|
-
**BEWARE** The password can be reverse engineered from the database, so make a separate account for the Pact Broker to use, don't use your personal account!
|
35
|
-
|
36
|
-
### Testing
|
37
|
-
|
38
|
-
To test a webhook, navigate to the webhook in the HAL browser, then make a POST request to the "execute" relation. The response or error will be shown in the window.
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# Webhooks
|
2
|
-
|
3
|
-
Allowed methods: GET, DELETE
|
4
|
-
|
5
|
-
### Testing
|
6
|
-
|
7
|
-
To test a webhook, navigate to the webhook in the HAL browser, then make a POST request to the "execute" relation. The response or error will be shown in the window.
|
8
|
-
|
9
|
-
### Deleting
|
10
|
-
|
11
|
-
Send a DELETE request to the webhook URL.
|
12
|
-
|
13
|
-
### Updating
|
14
|
-
|
15
|
-
Send a PUT request to the webhook URL with all fields required for the new webhook.
|