pact_broker 2.58.3 → 2.59.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/.github/workflows/release_gem.yml +7 -0
- data/CHANGELOG.md +7 -0
- data/lib/pact_broker/api/decorators/version_decorator.rb +2 -0
- data/lib/pact_broker/api/resources/all_webhooks.rb +9 -0
- data/lib/pact_broker/api/resources/badge.rb +4 -0
- data/lib/pact_broker/api/resources/can_i_deploy.rb +8 -0
- data/lib/pact_broker/api/resources/dashboard.rb +4 -0
- data/lib/pact_broker/api/resources/group.rb +8 -0
- data/lib/pact_broker/api/resources/index.rb +4 -0
- data/lib/pact_broker/api/resources/integration.rb +12 -0
- data/lib/pact_broker/api/resources/integrations.rb +9 -1
- data/lib/pact_broker/api/resources/label.rb +12 -5
- data/lib/pact_broker/api/resources/latest_pact.rb +6 -2
- data/lib/pact_broker/api/resources/latest_pacts.rb +9 -1
- data/lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb +8 -0
- data/lib/pact_broker/api/resources/pact.rb +5 -1
- data/lib/pact_broker/api/resources/pacticipant.rb +4 -0
- data/lib/pact_broker/api/resources/pacticipants.rb +14 -0
- data/lib/pact_broker/api/resources/previous_distinct_pact_version.rb +4 -1
- data/lib/pact_broker/api/resources/provider_pacts.rb +5 -1
- data/lib/pact_broker/configuration.rb +6 -3
- data/lib/pact_broker/policies.rb +2 -2
- data/lib/pact_broker/version.rb +1 -1
- data/spec/lib/pact_broker/api/decorators/version_decorator_spec.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9b0e297ccfb28aff9a5671f6db509740d72b305ea876c90dd9f43801a29d678
|
4
|
+
data.tar.gz: 2671cd878bcdfa50e841b8f69f40188053f7c65646100b94ea2d700add445132
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a1e25b8199ca7a2ed5940d32f749273d1e9be09bb376440902fd3b72bcfaaa26820b98c177cf22922d1ea325afd821b12b8136e3e0728febbed261ecbe92a12
|
7
|
+
data.tar.gz: 64735e63241058558c290c24e46ff929bb89d7515d7d97413d9e18491b543128a610fc568b711efb9e2fba6bb099d99ed4600aee842c9119e47961a5b99d7a46
|
@@ -12,6 +12,13 @@ jobs:
|
|
12
12
|
- uses: actions/checkout@v2
|
13
13
|
with:
|
14
14
|
fetch-depth: 0
|
15
|
+
# - name: 'Wait for status checks'
|
16
|
+
# id: wait-for-status-checks
|
17
|
+
# uses: "WyriHaximus/github-action-wait-for-status@v2"
|
18
|
+
# with:
|
19
|
+
# checkInterval: 15
|
20
|
+
# env:
|
21
|
+
# GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
15
22
|
- uses: pact-foundation/release-gem@v0.0.11
|
16
23
|
env:
|
17
24
|
GEM_HOST_API_KEY: '${{ secrets.RUBYGEMS_API_KEY }}'
|
data/CHANGELOG.md
CHANGED
@@ -45,6 +45,15 @@ module PactBroker
|
|
45
45
|
response.body = Decorators::WebhookDecorator.new(saved_webhook).to_json(decorator_options)
|
46
46
|
end
|
47
47
|
|
48
|
+
def policy_name
|
49
|
+
:'webhooks::webooks'
|
50
|
+
end
|
51
|
+
|
52
|
+
def policy_record
|
53
|
+
# Note: consumer and provider not yet set on new webhook
|
54
|
+
request.post? ? webhook : webhooks
|
55
|
+
end
|
56
|
+
|
48
57
|
private
|
49
58
|
|
50
59
|
def validation_errors? webhook
|
@@ -16,6 +16,18 @@ module PactBroker
|
|
16
16
|
integration_service.delete(consumer_name, provider_name)
|
17
17
|
true
|
18
18
|
end
|
19
|
+
|
20
|
+
def policy_name
|
21
|
+
:'integrations::integration'
|
22
|
+
end
|
23
|
+
|
24
|
+
def policy_resource
|
25
|
+
integration
|
26
|
+
end
|
27
|
+
|
28
|
+
def integration
|
29
|
+
@integration ||= OpenStruct.new(consumer: consumer, provider: provider)
|
30
|
+
end
|
19
31
|
end
|
20
32
|
end
|
21
33
|
end
|
@@ -26,13 +26,21 @@ module PactBroker
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def integrations
|
29
|
-
integration_service.find_all
|
29
|
+
@integrations ||= integration_service.find_all
|
30
30
|
end
|
31
31
|
|
32
32
|
def delete_resource
|
33
33
|
integration_service.delete_all
|
34
34
|
true
|
35
35
|
end
|
36
|
+
|
37
|
+
def policy_name
|
38
|
+
:'integrations::integrations'
|
39
|
+
end
|
40
|
+
|
41
|
+
def policy_resource
|
42
|
+
integrations
|
43
|
+
end
|
36
44
|
end
|
37
45
|
end
|
38
46
|
end
|
@@ -19,7 +19,7 @@ module PactBroker
|
|
19
19
|
|
20
20
|
def from_json
|
21
21
|
unless label
|
22
|
-
@label = label_service.create
|
22
|
+
@label = label_service.create(identifier_from_path)
|
23
23
|
# Make it return a 201 by setting the Location header
|
24
24
|
response.headers["Location"] = label_url(label, base_url)
|
25
25
|
end
|
@@ -27,26 +27,33 @@ module PactBroker
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def resource_exists?
|
30
|
-
!!
|
30
|
+
!!label
|
31
31
|
end
|
32
32
|
|
33
33
|
def resource_object
|
34
34
|
label
|
35
35
|
end
|
36
36
|
|
37
|
+
def policy_name
|
38
|
+
:'labels::label'
|
39
|
+
end
|
40
|
+
|
41
|
+
def policy_record
|
42
|
+
label
|
43
|
+
end
|
44
|
+
|
37
45
|
def to_json
|
38
46
|
PactBroker::Api::Decorators::LabelDecorator.new(label).to_json(decorator_options)
|
39
47
|
end
|
40
48
|
|
41
49
|
def label
|
42
|
-
@label ||= label_service.find
|
50
|
+
@label ||= label_service.find(identifier_from_path)
|
43
51
|
end
|
44
52
|
|
45
53
|
def delete_resource
|
46
|
-
label_service.delete
|
54
|
+
label_service.delete(identifier_from_path)
|
47
55
|
true
|
48
56
|
end
|
49
|
-
|
50
57
|
end
|
51
58
|
end
|
52
59
|
|
@@ -26,6 +26,14 @@ module PactBroker
|
|
26
26
|
decorator_for(summary).to_json(user_options: decorator_context(identifier_from_path))
|
27
27
|
end
|
28
28
|
|
29
|
+
def policy_name
|
30
|
+
:'verifications::verifications'
|
31
|
+
end
|
32
|
+
|
33
|
+
def policy_record
|
34
|
+
version
|
35
|
+
end
|
36
|
+
|
29
37
|
private
|
30
38
|
|
31
39
|
def version
|
@@ -56,6 +56,20 @@ module PactBroker
|
|
56
56
|
def new_model
|
57
57
|
@new_model ||= decorator_for(PactBroker::Domain::Pacticipant.new).from_json(request.body.to_s)
|
58
58
|
end
|
59
|
+
|
60
|
+
def policy_name
|
61
|
+
:'pacticipants::pacticipants'
|
62
|
+
end
|
63
|
+
|
64
|
+
def policy_record
|
65
|
+
request.post? ? nil : pacticipants
|
66
|
+
end
|
67
|
+
|
68
|
+
private
|
69
|
+
|
70
|
+
def pacticipants
|
71
|
+
@pacticipants ||= pacticipant_service.find_all_pacticipants
|
72
|
+
end
|
59
73
|
end
|
60
74
|
end
|
61
75
|
end
|
@@ -6,7 +6,6 @@ require 'pact_broker/api/decorators/pact_decorator'
|
|
6
6
|
module PactBroker
|
7
7
|
module Api
|
8
8
|
module Resources
|
9
|
-
|
10
9
|
class PreviousDistinctPactVersion < BaseResource
|
11
10
|
|
12
11
|
def content_types_provided
|
@@ -25,6 +24,10 @@ module PactBroker
|
|
25
24
|
pact
|
26
25
|
end
|
27
26
|
|
27
|
+
def policy_resource
|
28
|
+
pact
|
29
|
+
end
|
30
|
+
|
28
31
|
def to_json
|
29
32
|
PactBroker::Api::Decorators::PactDecorator.new(pact).to_json(user_options: {base_url: base_url})
|
30
33
|
end
|
@@ -47,7 +47,10 @@ module PactBroker
|
|
47
47
|
attr_accessor :base_equality_only_on_content_that_affects_verification_results
|
48
48
|
attr_reader :api_error_reporters
|
49
49
|
attr_reader :custom_logger
|
50
|
-
attr_accessor :
|
50
|
+
attr_accessor :policy_builder, :policy_scope_builder, :base_resource_class_factory
|
51
|
+
|
52
|
+
alias_method :policy_finder=, :policy_builder=
|
53
|
+
alias_method :policy_scope_finder=, :policy_scope_builder=
|
51
54
|
|
52
55
|
def initialize
|
53
56
|
@before_resource_hook = ->(resource){}
|
@@ -106,8 +109,8 @@ module PactBroker
|
|
106
109
|
script_src: "'self' 'unsafe-inline' 'unsafe-eval'",
|
107
110
|
frame_ancestors: "'self'"
|
108
111
|
}
|
109
|
-
config.
|
110
|
-
config.
|
112
|
+
config.policy_builder = -> (object) { DefaultPolicy.new(nil, object) }
|
113
|
+
config.policy_scope_builder = -> (scope) { scope }
|
111
114
|
config.base_resource_class_factory = -> () {
|
112
115
|
require 'pact_broker/api/resources/default_base_resource'
|
113
116
|
PactBroker::Api::Resources::DefaultBaseResource
|
data/lib/pact_broker/policies.rb
CHANGED
@@ -44,10 +44,10 @@ module PactBroker
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def self.policy!(*args)
|
47
|
-
PactBroker.configuration.
|
47
|
+
PactBroker.configuration.policy_builder.call(*args)
|
48
48
|
end
|
49
49
|
|
50
50
|
def self.policy_scope!(*args)
|
51
|
-
PactBroker.configuration.
|
51
|
+
PactBroker.configuration.policy_scope_builder.call(*args)
|
52
52
|
end
|
53
53
|
end
|
data/lib/pact_broker/version.rb
CHANGED
@@ -51,6 +51,10 @@ module PactBroker
|
|
51
51
|
expect(subject[:_embedded][:tags].first[:name]).to eq "prod"
|
52
52
|
end
|
53
53
|
|
54
|
+
it "includes the timestamps" do
|
55
|
+
expect(subject[:createdAt]).to_not be nil
|
56
|
+
end
|
57
|
+
|
54
58
|
it "includes a list of sorted pacts" do
|
55
59
|
expect(subject[:_links][:'pb:pact-versions']).to be_instance_of(Array)
|
56
60
|
expect(subject[:_links][:'pb:pact-versions'].first[:href]).to include ("1.2.3")
|
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.59.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bethany Skurrie
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-07-
|
13
|
+
date: 2020-07-31 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: httparty
|