Search code examples
pactpact-jvmpact-java

Validate Provider Build Verification for the Consumer Pacts with dynamic auth token


Can someone help me understand, how this scenario is handled?

Here are the steps what I am following

  1. Consumer pushed the Pacts to PACT Broker.
  2. Once a new version is published, I trigger the Provider verification Pipeline and verify the pacts against the actual running Application
  3. Pacts Verified and Publish the results to broker.

I am clear with this.

Now I have to verify these pacts when a Provider deploys a newer version.

As per my understanding, we should trigger "verify pacts" to check all the pacts for my provider application. But the problem here is that the Auth token in the Pacts file might have expired. How can I update the token again and verify this during provider build?


Solution

  • This guide sets out how you can handle these scenarios: https://docs.pact.io/provider/handling_auth.

    See also steps 8-10 in this workshop that demonstrate the recommended strategy.