pact_broker 2.113.1 → 2.114.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/db/migrations/20240112_add_client_language_verified_by_to_verification.rb +7 -0
- data/lib/pact_broker/api/decorators/verification_decorator.rb +3 -0
- data/lib/pact_broker/api/resources/badge.rb +2 -2
- data/lib/pact_broker/api/resources/badge_methods.rb +1 -1
- data/lib/pact_broker/api/resources/error_handling_methods.rb +2 -2
- data/lib/pact_broker/api/resources/error_response_generator.rb +2 -2
- data/lib/pact_broker/api/resources/pact_resource_methods.rb +1 -1
- data/lib/pact_broker/api/resources/pacticipant_resource_methods.rb +1 -1
- data/lib/pact_broker/api/resources/publish_contracts.rb +1 -1
- data/lib/pact_broker/api/resources/webhook_execution.rb +1 -1
- data/lib/pact_broker/app.rb +1 -1
- data/lib/pact_broker/doc/views/pact/publish-verification-results.markdown +18 -0
- data/lib/pact_broker/domain/verification.rb +3 -0
- data/lib/pact_broker/test/test_data_builder.rb +1 -1
- data/lib/pact_broker/ui/controllers/dashboard.rb +1 -1
- data/lib/pact_broker/ui/controllers/index.rb +1 -1
- data/lib/pact_broker/verifications/service.rb +3 -0
- data/lib/pact_broker/version.rb +1 -1
- data/lib/rack/pact_broker/add_cache_header.rb +1 -1
- data/lib/rack/pact_broker/add_pact_broker_version_header.rb +1 -1
- data/lib/rack/pact_broker/add_vary_header.rb +1 -1
- data/lib/rack/pact_broker/cascade.rb +2 -2
- data/lib/rack/pact_broker/invalid_uri_protection.rb +1 -1
- data/lib/rack/pact_broker/request_target.rb +2 -2
- data/lib/webmachine/adapters.rb +9 -0
- data/lib/webmachine/render_error_monkey_patch.rb +1 -1
- data/pact_broker.gemspec +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 159a993d4863a7a528c058763f2c5a5b6a3104710757d51110fc3d08b9f6c38b
|
4
|
+
data.tar.gz: 1832a40fbf58b8d54e375d460d50b5db331167d09dc695252cbf91e57878c8e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55a9a315ba42be7d8533af1e3fb895e5fcc6f24e49a199ae1f42150e6119b7c2cc80aec2e9b7ac4e56d2fc291ab665e44948f191912c9fe355aca74fc4abf1f9
|
7
|
+
data.tar.gz: fe719a11a09ca94776bebe02e51d66da51809080b7c009dfbd8a2ec208802e66863713e3ee698145accb800fed5d7dde8d0d184aa331917f840017b3dafee88d
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
<a name="v2.114.0"></a>
|
2
|
+
### v2.114.0 (2025-03-06)
|
3
|
+
|
4
|
+
#### Features
|
5
|
+
|
6
|
+
* support extended verification results (#778) ([18f571c8](/../../commit/18f571c8))
|
7
|
+
|
8
|
+
<a name="v2.113.2"></a>
|
9
|
+
### v2.113.2 (2025-03-05)
|
10
|
+
|
11
|
+
#### Bug Fixes
|
12
|
+
|
13
|
+
* downcase Content-Type header ([6eebfbdf](/../../commit/6eebfbdf))
|
14
|
+
* downcase X-Pact-Broker-Version header ([8dfb3ac2](/../../commit/8dfb3ac2))
|
15
|
+
* downcase Cache-Control header ([6ceae489](/../../commit/6ceae489))
|
16
|
+
* downcase Vary header ([a43416a3](/../../commit/a43416a3))
|
17
|
+
* add webmachine monkey patch to exclude webrick default load ([ef674d37](/../../commit/ef674d37))
|
18
|
+
|
1
19
|
<a name="v2.113.1"></a>
|
2
20
|
### v2.113.1 (2025-02-20)
|
3
21
|
|
@@ -18,6 +18,9 @@ module PactBroker
|
|
18
18
|
nested :verifiedBy do
|
19
19
|
property :verified_by_implementation, as: :implementation
|
20
20
|
property :verified_by_version, as: :version
|
21
|
+
property :verified_by_client_implementation, as: :client_implementation
|
22
|
+
property :verified_by_client_test_framework, as: :client_test_framework
|
23
|
+
property :verified_by_client_version, as: :client_version
|
21
24
|
end
|
22
25
|
|
23
26
|
link :self do | options |
|
@@ -18,12 +18,12 @@ module PactBroker
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def to_svg
|
21
|
-
response.headers["
|
21
|
+
response.headers["cache-control"] = "no-cache"
|
22
22
|
comment + badge_service.pact_verification_badge(pact, label, initials, pseudo_branch_verification_status, tags)
|
23
23
|
end
|
24
24
|
|
25
25
|
def moved_temporarily?
|
26
|
-
response.headers["
|
26
|
+
response.headers["cache-control"] = "no-cache"
|
27
27
|
badge_service.pact_verification_badge_url(pact, label, initials, pseudo_branch_verification_status, tags)
|
28
28
|
end
|
29
29
|
|
@@ -32,13 +32,13 @@ module PactBroker
|
|
32
32
|
# @param [String] type
|
33
33
|
# @param [Integer] status
|
34
34
|
def set_json_error_message(detail, title: "Server error", type: "server-error", status: 500)
|
35
|
-
response.headers["
|
35
|
+
response.headers["content-type"] = error_response_content_type
|
36
36
|
response.body = error_response_body(detail, title, type, status)
|
37
37
|
end
|
38
38
|
|
39
39
|
# @param [Hash,Dry::Validation::MessageSet] errors
|
40
40
|
def set_json_validation_error_messages(errors)
|
41
|
-
response.headers["
|
41
|
+
response.headers["content-type"] = error_response_content_type
|
42
42
|
response.body = validation_errors_response_body(errors)
|
43
43
|
end
|
44
44
|
|
@@ -68,9 +68,9 @@ module PactBroker
|
|
68
68
|
|
69
69
|
private_class_method def self.headers(env)
|
70
70
|
if problem_json?(env)
|
71
|
-
{ "
|
71
|
+
{ "content-type" => "application/problem+json;charset=utf-8" }
|
72
72
|
else
|
73
|
-
{ "
|
73
|
+
{ "content-type" => "application/hal+json;charset=utf-8" }
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
@@ -8,7 +8,7 @@ module PactBroker
|
|
8
8
|
messages = pacticipant_service.messages_for_potential_duplicate_pacticipants pacticipant_names, base_url
|
9
9
|
if messages.any?
|
10
10
|
response.body = messages.join("\n")
|
11
|
-
response.headers["
|
11
|
+
response.headers["content-type"] = "text/plain"
|
12
12
|
end
|
13
13
|
messages.any?
|
14
14
|
else
|
@@ -97,7 +97,7 @@ module PactBroker
|
|
97
97
|
contracts: conflict_notices.select(&:error?).collect(&:text)
|
98
98
|
}
|
99
99
|
}.to_json
|
100
|
-
response.headers["
|
100
|
+
response.headers["content-type"] = "application/json;charset=utf-8"
|
101
101
|
end
|
102
102
|
|
103
103
|
def conflict_notices
|
@@ -21,7 +21,7 @@ module PactBroker
|
|
21
21
|
|
22
22
|
def process_post
|
23
23
|
webhook_execution_result = webhook_trigger_service.test_execution(webhook, webhook_execution_configuration.webhook_context, webhook_execution_configuration)
|
24
|
-
response.headers["
|
24
|
+
response.headers["content-type"] = "application/hal+json;charset=utf-8"
|
25
25
|
response.body = post_response_body(webhook_execution_result)
|
26
26
|
true
|
27
27
|
end
|
data/lib/pact_broker/app.rb
CHANGED
@@ -197,7 +197,7 @@ module PactBroker
|
|
197
197
|
@app_builder.use Rack::PactBroker::AddPactBrokerVersionHeader
|
198
198
|
@app_builder.use Rack::PactBroker::AddVaryHeader
|
199
199
|
@app_builder.use Rack::Static, :urls => ["/stylesheets", "/css", "/fonts", "/js", "/javascripts", "/images"], :root => PactBroker.project_root.join("public")
|
200
|
-
@app_builder.use Rack::Static, :urls => ["/favicon.ico"], :root => PactBroker.project_root.join("public/images"), header_rules: [[:all, {"
|
200
|
+
@app_builder.use Rack::Static, :urls => ["/favicon.ico"], :root => PactBroker.project_root.join("public/images"), header_rules: [[:all, {"content-type" => "image/x-icon"}]]
|
201
201
|
@app_builder.use Rack::PactBroker::AddCacheHeader
|
202
202
|
@app_builder.use Rack::PactBroker::ConvertFileExtensionToAcceptHeader
|
203
203
|
# Rack::PactBroker::SetBaseUrl needs to be before the Rack::PactBroker::HalBrowserRedirect
|
@@ -11,3 +11,21 @@ Use a `POST` request to the `pb:publish-verification-results` link (`$['_links']
|
|
11
11
|
}
|
12
12
|
|
13
13
|
Multiple verification results may be published for the same pact resource. The most recently published one will be considered to reflect the current status of verification.
|
14
|
+
|
15
|
+
Optionally the body can contain details about the Pact implementation which performed the verification, and test results, which support arbitrary json
|
16
|
+
|
17
|
+
{
|
18
|
+
"providerApplicationVersion": "1",
|
19
|
+
"success": true,
|
20
|
+
"buildUrl": "http://build-url",
|
21
|
+
"testResults": [],
|
22
|
+
"verifiedBy": {
|
23
|
+
"implementation": "Pact-Rust",
|
24
|
+
"version": "1.0.0",
|
25
|
+
"clientLanguage": {
|
26
|
+
"testFramework": "TEST",
|
27
|
+
"name": "TESTER",
|
28
|
+
"version": "1.2.3"
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
@@ -259,6 +259,9 @@ end
|
|
259
259
|
# pact_pending | boolean |
|
260
260
|
# verified_by_implementation | text |
|
261
261
|
# verified_by_version | text |
|
262
|
+
# verified_by_client_implementation| text |
|
263
|
+
# verified_by_client_version | text |
|
264
|
+
# verified_by_client_test_framework| text |
|
262
265
|
# Indexes:
|
263
266
|
# verifications_pkey | PRIMARY KEY btree (id)
|
264
267
|
# verifications_pact_version_id_number_index | UNIQUE btree (pact_version_id, number)
|
@@ -362,7 +362,7 @@ module PactBroker
|
|
362
362
|
params[:events] || [{ name: PactBroker::Webhooks::WebhookEvent::DEFAULT_EVENT_NAME }]
|
363
363
|
end
|
364
364
|
events = event_params.collect{ |e| PactBroker::Webhooks::WebhookEvent.new(e) }
|
365
|
-
template_params = { method: "POST", url: "http://example.org", headers: {"
|
365
|
+
template_params = { method: "POST", url: "http://example.org", headers: {"content-type" => "application/json"}, username: params[:username], password: params[:password] }
|
366
366
|
request = PactBroker::Webhooks::WebhookRequestTemplate.new(template_params.merge(params))
|
367
367
|
new_webhook = PactBroker::Domain::Webhook.new(
|
368
368
|
request: request,
|
@@ -70,7 +70,7 @@ module PactBroker
|
|
70
70
|
private
|
71
71
|
|
72
72
|
def set_headers
|
73
|
-
response.headers["
|
73
|
+
response.headers["cache-control"] = "no-cache, no-store, must-revalidate"
|
74
74
|
response.headers["Pragma"] = "no-cache"
|
75
75
|
response.headers["Expires"] = "0"
|
76
76
|
end
|
@@ -55,7 +55,7 @@ module PactBroker
|
|
55
55
|
private
|
56
56
|
|
57
57
|
def set_headers
|
58
|
-
response.headers["
|
58
|
+
response.headers["cache-control"] = "no-cache, no-store, must-revalidate"
|
59
59
|
response.headers["Pragma"] = "no-cache"
|
60
60
|
response.headers["Expires"] = "0"
|
61
61
|
end
|
@@ -46,6 +46,9 @@ module PactBroker
|
|
46
46
|
verification.number = next_verification_number
|
47
47
|
verification.verified_by_implementation = params.dig("verifiedBy", "implementation")
|
48
48
|
verification.verified_by_version = params.dig("verifiedBy", "version")
|
49
|
+
verification.verified_by_client_implementation = params.dig("verifiedBy", "clientLanguage", "name")
|
50
|
+
verification.verified_by_client_version = params.dig("verifiedBy", "clientLanguage", "version")
|
51
|
+
verification.verified_by_client_test_framework = params.dig("verifiedBy", "clientLanguage", "testFramework")
|
49
52
|
verification.consumer_version_selector_hashes = event_context[:consumer_version_selectors]
|
50
53
|
pact_version = pact_repository.find_pact_version(first_verified_pact.consumer, first_verified_pact.provider, first_verified_pact.pact_version_sha)
|
51
54
|
verification = verification_repository.create(verification, provider_version_number, pact_version)
|
data/lib/pact_broker/version.rb
CHANGED
@@ -18,7 +18,7 @@ module Rack
|
|
18
18
|
module PactBroker
|
19
19
|
class Cascade
|
20
20
|
# deprecated, no longer used
|
21
|
-
NotFound = [404, {
|
21
|
+
NotFound = [404, { "content-type" => "text/plain" }, []]
|
22
22
|
|
23
23
|
# An array of applications to try in order.
|
24
24
|
attr_reader :apps
|
@@ -41,7 +41,7 @@ module Rack
|
|
41
41
|
# cascading, try the next app. If all responses require cascading,
|
42
42
|
# return the response from the last app.
|
43
43
|
def call(env)
|
44
|
-
return [404, {
|
44
|
+
return [404, { "content-type" => "text/plain" }, []] if @apps.empty?
|
45
45
|
result = nil
|
46
46
|
last_body = nil
|
47
47
|
|
@@ -20,7 +20,7 @@ module Rack
|
|
20
20
|
private
|
21
21
|
|
22
22
|
def body_is_json(env)
|
23
|
-
env["
|
23
|
+
env["content-type"]&.include?("json")
|
24
24
|
end
|
25
25
|
|
26
26
|
def explicit_request_for_api(env)
|
@@ -32,7 +32,7 @@ module Rack
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def body_is_api_content_type(env)
|
35
|
-
is_api_content_type((env["
|
35
|
+
is_api_content_type((env["content-type"]&.downcase) || "")
|
36
36
|
end
|
37
37
|
|
38
38
|
def is_api_content_type(header)
|
@@ -0,0 +1,9 @@
|
|
1
|
+
require "webmachine/adapters/lazy_request_body"
|
2
|
+
# require "webmachine/adapters/webrick" # Commenting out this line as our monkey patch
|
3
|
+
|
4
|
+
module Webmachine
|
5
|
+
# Contains classes and modules that connect Webmachine to Ruby
|
6
|
+
# application servers.
|
7
|
+
module Adapters
|
8
|
+
end
|
9
|
+
end
|
@@ -36,7 +36,7 @@ module Webmachine
|
|
36
36
|
message = options[:message] if options[:message]
|
37
37
|
|
38
38
|
res.body = error_response_body(req, message, title, title.dasherize.gsub(/^\d+\-/, ""), code, req)
|
39
|
-
res.headers[
|
39
|
+
res.headers["content-type"] = error_response_content_type(req)
|
40
40
|
end
|
41
41
|
ensure_content_length(res)
|
42
42
|
ensure_date_header(res)
|
data/pact_broker.gemspec
CHANGED
@@ -57,7 +57,7 @@ Gem::Specification.new do |gem|
|
|
57
57
|
gem.add_runtime_dependency "sequel", "~> 5.28"
|
58
58
|
gem.add_runtime_dependency "webmachine", ">= 2.0.0.beta", "< 3.0"
|
59
59
|
gem.add_runtime_dependency "semver2", "~> 3.4.2"
|
60
|
-
gem.add_runtime_dependency "rack", "~> 3.1", ">= 3.1.
|
60
|
+
gem.add_runtime_dependency "rack", "~> 3.1", ">= 3.1.11"
|
61
61
|
gem.add_runtime_dependency "redcarpet", ">= 3.5.1", "~>3.5"
|
62
62
|
gem.add_runtime_dependency "pact-support" , ">= 1.21.2", "~> 1.21"
|
63
63
|
gem.add_runtime_dependency "haml", "~>5.0"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pact_broker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.114.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bethany Skurrie
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
- Warner Godfrey
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2025-03-
|
12
|
+
date: 2025-03-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
@@ -138,7 +138,7 @@ dependencies:
|
|
138
138
|
version: '3.1'
|
139
139
|
- - ">="
|
140
140
|
- !ruby/object:Gem::Version
|
141
|
-
version: 3.1.
|
141
|
+
version: 3.1.11
|
142
142
|
type: :runtime
|
143
143
|
prerelease: false
|
144
144
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -148,7 +148,7 @@ dependencies:
|
|
148
148
|
version: '3.1'
|
149
149
|
- - ">="
|
150
150
|
- !ruby/object:Gem::Version
|
151
|
-
version: 3.1.
|
151
|
+
version: 3.1.11
|
152
152
|
- !ruby/object:Gem::Dependency
|
153
153
|
name: redcarpet
|
154
154
|
requirement: !ruby/object:Gem::Requirement
|
@@ -528,6 +528,7 @@ files:
|
|
528
528
|
- db/migrations/20230616_set_integrations_contract_data_updated_at.rb
|
529
529
|
- db/migrations/20231002_add_version_id_index_to_released_version.rb
|
530
530
|
- db/migrations/20231003_add_version_id_index_to_deployed_version.rb
|
531
|
+
- db/migrations/20240112_add_client_language_verified_by_to_verification.rb
|
531
532
|
- db/migrations/migration_helper.rb
|
532
533
|
- docs/CONFIGURATION.md
|
533
534
|
- docs/api/PACTICIPANTS.md
|
@@ -1093,6 +1094,7 @@ files:
|
|
1093
1094
|
- lib/sequel/plugins/age.rb
|
1094
1095
|
- lib/sequel/plugins/insert_ignore.rb
|
1095
1096
|
- lib/sequel/plugins/upsert.rb
|
1097
|
+
- lib/webmachine/adapters.rb
|
1096
1098
|
- lib/webmachine/adapters/rack3_adapter.rb
|
1097
1099
|
- lib/webmachine/application_monkey_patch.rb
|
1098
1100
|
- lib/webmachine/describe_routes.rb
|