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

Feat: Bearer token based auth for Pact Brokers #44

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

YOU54F
Copy link
Member

@YOU54F YOU54F commented Aug 22, 2023

It would be nice to also be able to support Bearer based tokens, for Bearer protected Brokers.

The Open source Pact Broker does not provide this out of the box, however PactFlow does, and users of the open source broker, may roll their own auth mechanisms to support a bearer token.

The following curl request will retrieve a pact from a bearer protected Broker (example PactFlow)

curl -H "Authorization: Bearer $PACT_BROKER_TOKEN" https://testdemo.pactflow.io/pacts/provider/pact-provider-poc/consumer/pact-consumer-poc/version/9191e17 | jq .

Most users will have the following combos of env vars, depending on their setup

PACT_BROKER_BASE_URL

Basic Auth

PACT_BROKER_USERNAME
PACT_BROKER_PASSWORD

Bearer Auth

PACT_BROKER_TOKEN

There it would be reasonable to assume, that these are set or are easily set in a users local, or ci environment.

Only read-only tokens are required, as no write actions are performed on a broker

@YOU54F YOU54F changed the title Feat/token auth Feat: Bearer token based auth for Pact Brokers Aug 22, 2023
@YOU54F YOU54F closed this Feb 9, 2024
@YOU54F YOU54F reopened this Sep 24, 2024
@YOU54F YOU54F marked this pull request as draft September 24, 2024 13:52
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

Successfully merging this pull request may close these issues.

1 participant