Add basic auth for Pact Broker

Issue #72 closed
David Dyke created an issue

Problem

At the moment I can add basic auth to the URL, but because links within the responses are followed, subsequent API calls do not have credentials added to the request and 401 responses come back.

Proposed solution

Allow for basic auth flags which are used in all Pact Broker API calls:

--username

--password

Or even better, pick up username and password from environment variables allowing CI runners to hide credentials easily:

$PACT_BROKER_USERNAME

$PACT_BROKER_PASSWORD

Or even better still, both

Official response

Comments (4)

  1. Mauri Edo Account Deactivated

    Available now in v.5.2.0, by passing basic auth credentials in a single -u flag, i.e. USERNAME:PASSWORD.

  2. Log in to comment