Tatiana
05/17/2023, 1:14 PMMatt (pactflow.io / pact-js / pact-go)
Tatiana
05/18/2023, 12:58 AMTatiana
05/18/2023, 12:58 AMBoris
05/18/2023, 4:46 AMTatiana
05/18/2023, 11:08 AMYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
pacticipants
curl -H "Authorization: Bearer $PACT_BROKER_TOKEN" "<https://test.pactflow.io/pacticipants>" | jq .
but you could also avoid also that jazz, by just using the verifier cli
https://docs.pact.io/implementation_guides/cli#provider-verifierYousaf Nabi (pactflow.io)
Konstantin Manna
05/19/2023, 7:14 AMKonstantin Manna
05/19/2023, 7:19 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
pact-provider-verifier
CLI with the --verbose
flag, you could follow the API calls there and use that to download the contracts you neededKonstantin Manna
05/23/2023, 3:02 PMimport json
import os
from pathlib import Path
import httpx
Path("provider_pacts").mkdir(parents=True, exist_ok=True)
headers = {"Authorization": f'Bearer {os.getenv("PACTFLOW_API_TOKEN")}'}
with httpx.Client(headers=headers) as client:
for pact in client.get(
"<https://codility.pactflow.io/pacts/provider/task-service/latest>",
).json()["_links"]["pb:pacts"]:
Path(f"provider_pacts/{pact['name']}_contract.json").write_text(
json.dumps(client.get(pact["href"]).json(), indent=4),
)