Skip to content

Commit 4ede7d5

Browse files
authored
Merge pull request #117 from dlmiddlecote/feature/expose-more-options
Expose —broker-token option
2 parents 0cbb9d4 + 73ae8d2 commit 4ede7d5

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,11 @@ The username to use when contacting the Pact Broker.
308308
The password to use when contacting the Pact Broker. You can also specify this value
309309
as the environment variable `PACT_BROKER_PASSWORD`.
310310

311+
###### --pact-broker-token
312+
313+
The bearer token to use when contacting the Pact Broker. You can also specify this value
314+
as the environment variable `PACT_BROKER_TOKEN`.
315+
311316
### Provider States
312317
In many cases, your contracts will need very specific data to exist on the provider
313318
to pass successfully. If you are fetching a user profile, that user needs to exist,

pact/test/test_verify.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ def test_all_options(self):
118118
'--provider-states-setup-url=http://localhost/provider-states/set',
119119
'--pact-broker-username=user',
120120
'--pact-broker-password=pass',
121+
'--pact-broker-token=token',
121122
'--publish-verification-results',
122123
'--provider-app-version=1.2.3',
123124
'--timeout=60',
@@ -136,6 +137,7 @@ def test_all_options(self):
136137
'--provider-states-setup-url=http://localhost/provider-states/set',
137138
'--broker-username=user',
138139
'--broker-password=pass',
140+
'--broker-token=token',
139141
'--publish-verification-results',
140142
'--provider-app-version', '1.2.3',
141143
'--verbose')

pact/verify.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@
5151
envvar='PACT_BROKER_PASSWORD',
5252
help='Password for Pact Broker basic authentication. Can also be specified'
5353
' via the environment variable PACT_BROKER_PASSWORD')
54+
@click.option(
55+
'token', '--pact-broker-token',
56+
envvar='PACT_BROKER_TOKEN',
57+
help='Bearer token for Pact Broker authentication. Can also be specified'
58+
' via the environment variable PACT_BROKER_TOKEN')
5459
@click.option(
5560
'header', '--custom-provider-header',
5661
envvar='CUSTOM_PROVIDER_HEADER',
@@ -79,7 +84,7 @@
7984
default=False,
8085
help='Toggle verbose logging, defaults to False.')
8186
def main(pacts, base_url, pact_url, pact_urls, states_url,
82-
states_setup_url, username, password, header, timeout,
87+
states_setup_url, username, password, token, header, timeout,
8388
provider_app_version, publish_verification_results, verbose):
8489
"""
8590
Verify one or more contracts against a provider service.
@@ -121,6 +126,7 @@ def main(pacts, base_url, pact_url, pact_urls, states_url,
121126
'--provider-states-setup-url': states_setup_url,
122127
'--broker-username': username,
123128
'--broker-password': password,
129+
'--broker-token': token,
124130
'--custom-provider-header': header,
125131
}
126132
command = [VERIFIER_PATH]

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
IS_64 = sys.maxsize > 2 ** 32
16-
PACT_STANDALONE_VERSION = '1.54.4'
16+
PACT_STANDALONE_VERSION = '1.74.0'
1717

1818

1919
here = os.path.abspath(os.path.dirname(__file__))

0 commit comments

Comments
 (0)