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: Allow add custom provider headers #627

Merged
merged 2 commits into from
Sep 4, 2024

Conversation

tienvx
Copy link
Contributor

@tienvx tienvx commented Aug 30, 2024

Add ability to add custom provider headers to v10. Somehow I didn't notice this feature is available in v9 and FFI at the same time.

@tienvx tienvx force-pushed the add-custom-provider-headers branch 3 times, most recently from 4d1d82f to cb4b5f5 Compare August 31, 2024 15:48
@coveralls
Copy link

coveralls commented Aug 31, 2024

Pull Request Test Coverage Report for Build 10694982756

Details

  • 25 of 25 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 97.342%

Totals Coverage Status
Change from base Build 10632532438: 0.03%
Covered Lines: 2307
Relevant Lines: 2370

💛 - Coveralls

@tienvx tienvx requested a review from YOU54F August 31, 2024 15:55
@tienvx tienvx marked this pull request as ready for review August 31, 2024 15:55
Copy link
Member

@YOU54F YOU54F left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good,

I would have probably used a different example, rather than introducing a new one with some matcher todos. (Adding the form encoded example, may be better in a sep PR)

Update on docs would be nice - https://github.com/pact-foundation/pact-php/blob/master/docs/provider.md maybe pointing to this

https://docs.pact.io/provider/handling_auth#4-modify-the-request-to-use-real-credentials

Modify Requests Prior to Verification

and borrow some text from pact-js as to the rationale

https://github.com/pact-foundation/pact-js/blob/master/docs/provider.md#modify-requests-prior-to-verification-request-filters

I don't believe we have request filters as a concept in pact-php for modification of payloads prior to being sent to the provider. I believe JVM and JS do this by starting up a proxy.

@tienvx
Copy link
Contributor Author

tienvx commented Sep 2, 2024

I added the doc and removed the form-urlencoded example. But I am not confident adding to any existing example

@tienvx tienvx merged commit ded5c6f into pact-foundation:master Sep 4, 2024
28 of 29 checks passed
@tienvx tienvx deleted the add-custom-provider-headers branch September 4, 2024 04:21
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.

3 participants