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: Support retrieving OAS provider contracts from PactFlow #45

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

YOU54F
Copy link
Member

@YOU54F YOU54F commented Aug 22, 2023

Feature: Support retrieving OAS provider contracts from PactFlow

Allowing users to retrieve both Pact's (#44) and Provider contracts from PactFlow, we would provide a much quicker route to users self-diagnosing and replaying of the verification results locally

Assuming the user has the following env vars set

  • PACT_BROKER_TOKEN

and have access to the consumer and provider contract url's that they wish to verify

Provider

Consumer

/bin/swagger-mock-validator.mjs https://testdemo.pactflow.io/internal/contracts/bi-directional/provider/pact-provider-poc/version/64898db/consumer/pact-consumer-poc/version/9191e17/provider-contract https://testdemo.pactflow.io/pacts/provider/pact-provider-poc/consumer/pact-consumer-poc/version/9191e17

Notes

Leverages PactFlow internal url for BDCT

internal/contracts/bi-directional

Sample curl request

curl -H "Authorization: Bearer $PACT_BROKER_TOKEN" https://testdemo.pactflow.io/internal/contracts/bi-directional/provider/pact-provider-poc/version/64898db/consumer/pact-consumer-poc/version/9191e17/provider-contract | jq .

relies on the following resource

_embedded["providerContract"]["content"]

If the pact broker has auth enabled, set the necessary env vars to access the pact broker resources.

PACT_BROKER_USERNAME
PACT_BROKER_PASSWORD
PACT_BROKER_TOKEN
replace with PACT_BROKER_USERNAME/PACT_BROKER_PASSWORD env vars
if using OS Pact Broker.

Use PACT_BROKER_TOKEN if using Pact Broker with Bearer auth
(such as PactFlow)
notes:- leverages PactFlow internal url for BDCT

internal/contracts/bi-directional

curl -H "Authorization: Bearer $PACT_BROKER_TOKEN" https://testdemo.pactflow.io/internal/contracts/bi-directional/provider/pact-provider-poc/version/64898db/consumer/pact-consumer-poc/version/9191e17/provider-contract | jq .

relies on the following resource

_embedded[providerContract][content]
@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