pact_broker-client 1.37.0 → 1.37.1
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 +7 -0
- data/lib/pact_broker/client/cli/broker.rb +6 -6
- data/lib/pact_broker/client/cli/create_or_update_webhook_long_desc.txt +3 -1
- data/lib/pact_broker/client/cli/create_webhook_long_desc.txt +2 -0
- data/lib/pact_broker/client/cli/custom_thor.rb +2 -5
- data/lib/pact_broker/client/version.rb +1 -1
- data/spec/lib/pact_broker/client/cli/broker_can_i_deploy_spec.rb +2 -0
- data/spec/lib/pact_broker/client/cli/broker_publish_spec.rb +1 -1
- data/spec/lib/pact_broker/client/cli/custom_thor_spec.rb +1 -7
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ee5df1eb310d1b9e093c4221ac3761f24cf7038dc923311cef87bc2d51fffcf
|
4
|
+
data.tar.gz: 0332f399dd793f3ab9a2e37446bee976770ba4e37ddbed83ebe2ef00074a20ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c3ba1e4b3303fe74c5227fdbd24c919cf6ce63bac1a85ec98e04b75618f6f75074b7cbba5933f5140ba80da903fc5c43b381c240639a0795d4cc4e835ec6244
|
7
|
+
data.tar.gz: 64104a222d139eb496ebe1c4a0850c755e96e1437ab337aafe480b549bea89da49684b67108b4314fbd0fa66bd03a6ef346f04848b0340f13a0bbe1b796f22cc
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
<a name="v1.37.1"></a>
|
2
|
+
### v1.37.1 (2021-03-11)
|
3
|
+
|
4
|
+
#### Bug Fixes
|
5
|
+
|
6
|
+
* set username from PACT_BROKER_USERNAME environment variable correctly when -u specified for create-or-update-webhook and create-webhook ([2411396](/../../commit/2411396))
|
7
|
+
|
1
8
|
<a name="v1.37.0"></a>
|
2
9
|
### v1.37.0 (2021-03-01)
|
3
10
|
|
@@ -287,15 +287,15 @@ module PactBroker
|
|
287
287
|
|
288
288
|
def pact_broker_client_options
|
289
289
|
client_options = { verbose: options.verbose }
|
290
|
-
client_options[:token] =
|
291
|
-
if options.broker_username
|
290
|
+
client_options[:token] = options.broker_token || ENV['PACT_BROKER_TOKEN']
|
291
|
+
if options.broker_username || ENV['PACT_BROKER_USERNAME']
|
292
292
|
client_options[:basic_auth] = {
|
293
|
-
username: options.broker_username,
|
294
|
-
password: options.broker_password
|
295
|
-
}
|
293
|
+
username: options.broker_username || ENV['PACT_BROKER_USERNAME'],
|
294
|
+
password: options.broker_password || ENV['PACT_BROKER_PASSWORD']
|
295
|
+
}.compact
|
296
296
|
end
|
297
297
|
|
298
|
-
client_options
|
298
|
+
client_options.compact
|
299
299
|
end
|
300
300
|
|
301
301
|
def parse_webhook_events
|
@@ -1 +1,3 @@
|
|
1
|
-
Create a curl command that executes the request that you want your webhook to execute, then replace "curl" with "pact-broker create-or-update-webhook" and add the consumer, provider, event types and broker details. Note that the URL must be the first parameter when executing create-or-update-webhook and a uuid must also be provided. You can generate a valid UUID by using the `generate-uuid` command.
|
1
|
+
Create a curl command that executes the request that you want your webhook to execute, then replace "curl" with "pact-broker create-or-update-webhook" and add the consumer, provider, event types and broker details. Note that the URL must be the first parameter when executing create-or-update-webhook and a uuid must also be provided. You can generate a valid UUID by using the `generate-uuid` command.
|
2
|
+
|
3
|
+
Note that the -u option from the curl command clashes with the -u option from the pact-broker CLI. When used in this command, the -u will be used as a curl option. Please use the --broker-username or environment variable for the Pact Broker username.
|
@@ -1 +1,3 @@
|
|
1
1
|
Create a curl command that executes the request that you want your webhook to execute, then replace "curl" with "pact-broker create-webhook" and add the consumer, provider, event types and broker details. Note that the URL must be the first parameter when executing create-webhook.
|
2
|
+
|
3
|
+
Note that the -u option from the curl command clashes with the -u option from the pact-broker CLI. When used in this command, the -u will be used as a curl option. Please use the --broker-username or environment variable for the Pact Broker username.
|
@@ -22,10 +22,7 @@ module PactBroker
|
|
22
22
|
def self.add_broker_config_from_environment_variables argv
|
23
23
|
return argv if argv[0] == 'help' || argv.empty?
|
24
24
|
|
25
|
-
|
26
|
-
new_argv = add_option_from_environment_variable(new_argv, 'broker-username', 'u', 'PACT_BROKER_USERNAME')
|
27
|
-
new_argv = add_option_from_environment_variable(new_argv, 'broker-token', 'k', 'PACT_BROKER_TOKEN')
|
28
|
-
add_option_from_environment_variable(new_argv, 'broker-password', 'p', 'PACT_BROKER_PASSWORD')
|
25
|
+
add_option_from_environment_variable(argv, 'broker-base-url', 'b', 'PACT_BROKER_BASE_URL')
|
29
26
|
end
|
30
27
|
|
31
28
|
def self.add_option_from_environment_variable argv, long_name, short_name, environment_variable_name
|
@@ -117,4 +114,4 @@ module PactBroker
|
|
117
114
|
end
|
118
115
|
end
|
119
116
|
end
|
120
|
-
end
|
117
|
+
end
|
@@ -52,12 +52,9 @@ module PactBroker::Client::CLI
|
|
52
52
|
ENV['PACT_BROKER_TOKEN'] = 'token'
|
53
53
|
end
|
54
54
|
|
55
|
-
it "populates the
|
55
|
+
it "populates the base URL from the environment variables" do
|
56
56
|
expect(Delegate).to receive(:call) do | options |
|
57
57
|
expect(options.broker_base_url).to eq 'http://foo'
|
58
|
-
expect(options.broker_username).to eq 'username'
|
59
|
-
expect(options.broker_password).to eq 'password'
|
60
|
-
expect(options.broker_token).to eq 'token'
|
61
58
|
end
|
62
59
|
TestThor.start(%w{test_using_env_vars})
|
63
60
|
end
|
@@ -65,9 +62,6 @@ module PactBroker::Client::CLI
|
|
65
62
|
it "does not override a value specifed on the command line" do
|
66
63
|
expect(Delegate).to receive(:call) do | options |
|
67
64
|
expect(options.broker_base_url).to eq 'http://bar'
|
68
|
-
expect(options.broker_username).to eq 'username'
|
69
|
-
expect(options.broker_password).to eq 'password'
|
70
|
-
expect(options.broker_token).to eq 'token'
|
71
65
|
end
|
72
66
|
TestThor.start(%w{test_using_env_vars --broker-base-url http://bar})
|
73
67
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pact_broker-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.37.
|
4
|
+
version: 1.37.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Beth Skurrie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -337,7 +337,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
337
337
|
- !ruby/object:Gem::Version
|
338
338
|
version: '0'
|
339
339
|
requirements: []
|
340
|
-
rubygems_version: 3.2.
|
340
|
+
rubygems_version: 3.2.14
|
341
341
|
signing_key:
|
342
342
|
specification_version: 4
|
343
343
|
summary: See description
|