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

Improvements to pact verification #1

Merged
merged 4 commits into from
Jun 11, 2024
Merged

Improvements to pact verification #1

merged 4 commits into from
Jun 11, 2024

Commits on May 27, 2024

  1. Change path in escript

    Previously the path to ebin did not work properly when a different
    folder structure was used. This makes sure that it targets the correct
    folder.
    
    (In future commits, this could even be a parameter, for better configurability)
    Siim Mardus committed May 27, 2024
    Configuration menu
    Copy the full SHA
    cf115fe View commit details
    Browse the repository at this point in the history

Commits on May 28, 2024

  1. Log out the output from pact verifying

    OutputLog contains useful information about what happens with Pact
    verification.
    Siim Mardus committed May 28, 2024
    Configuration menu
    Copy the full SHA
    ae0b4f0 View commit details
    Browse the repository at this point in the history

Commits on May 29, 2024

  1. Allow adding custom auth token for pact verification

    This is useful if the provider wants to use real authentication
    flow for the contract tests.
    
    Disclaimer:
    `pactffi_verifier_add_custom_header` function unfortunately is not
    able to override an existing header, so using this requires the pact
    to not include the authorization header in the first place. This can
    either be done by simply not using it on the consumer-side test or
    removing it somehow before publishing the pact.
    
    Although I worked through the following issues:
    - pact-foundation/pact-net#460
    - pact-foundation/pact-reference#275
    from which the latter is actually marked as closed, and the fix is
    allegedly included in the pact-ffi version that we use, it still did
    not override an existing header. I tried bumping to a higher version
    as well but without any luck. I will create an issue to pact-foundation
    to try to get clarity on this.
    Siim Mardus committed May 29, 2024
    Configuration menu
    Copy the full SHA
    d75d6ba View commit details
    Browse the repository at this point in the history

Commits on Jun 5, 2024

  1. Revert "Allow adding custom auth token for pact verification"

    This reverts commit d75d6ba.
    
    Reason:
    
    I actually found anther way of replacing the authorization header:
    - Use `fromProviderState` Matcher function on consumer side for auth
    header. Match `Bearer ${authToken}`, use JWT regex
    - On provider side, in state change URL endpoint, generate the token
    and return it in the callback under `authToken`
    - The provider-generated auth token will be used in the request.
    
    I am leaving this as commit + revert for future reference purposes.
    Siim Mardus committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    df5df77 View commit details
    Browse the repository at this point in the history