Skip to content

feat: Allow add custom provider headers#627

Merged
tienvx merged 2 commits intopact-foundation:masterfrom
tienvx:add-custom-provider-headers
Sep 4, 2024
Merged

feat: Allow add custom provider headers#627
tienvx merged 2 commits intopact-foundation:masterfrom
tienvx:add-custom-provider-headers

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 tienvx force-pushed the add-custom-provider-headers branch from cb4b5f5 to f35048f Compare September 2, 2024 16:17
@tienvx tienvx force-pushed the add-custom-provider-headers branch from f35048f to a378890 Compare September 2, 2024 16:27
@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
@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