Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Username env var is ignored by webhook commands #20

Closed
gruntster opened this issue Mar 10, 2021 · 1 comment
Closed

Username env var is ignored by webhook commands #20

gruntster opened this issue Mar 10, 2021 · 1 comment

Comments

@gruntster
Copy link

Webhook commands fail to successfully authenticate with the Pact Broker when passing credentials via environment variables.

e.g.

export PACT_BROKER_USERNAME=pbuser
export PACT_BROKER_PASSWORD=pbpassword

pact-broker create-or-update-webhook http://webhook -X POST -u whuser:whpassword -b https://pactbroker/ --uuid 00000000-0000-0000-0000-000000000000 --provider Provider --contract-content-changed

Error response:

PactBroker::Client::Hal::ErrorResponseReturned - Error retrieving https://pactbroker/ status=401

However passing the username as a long parameter works, e.g.

export PACT_BROKER_USERNAME=pbuser
export PACT_BROKER_PASSWORD=pbpassword

pact-broker create-or-update-webhook http://webhook -X POST -u whuser:whpassword -b https://pactbroker/ --uuid 00000000-0000-0000-0000-000000000000 --provider Provider --contract-content-changed --broker-username=${PACT_BROKER_USERNAME}

Is the -u parameter clashing?
https://github.com/pact-foundation/pact_broker-client/blob/master/lib/pact_broker/client/cli/custom_thor.rb#L26
https://github.com/pact-foundation/pact_broker-client/blob/master/lib/pact_broker/client/cli/custom_thor.rb#L101

@bethesque
Copy link
Member

Yes, the -u was clashing. I've released the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants