-
Notifications
You must be signed in to change notification settings - Fork 16
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
Feature Request: Add Ability to Pass Custom Header for Verification #95
Comments
@kelliepersson, have a go at this by setting the branch as your source for .package(
url: "https://github.com/surpher/PactSwift.git",
branch: "feature/provider_verification_headers_option"
) If it works as expected I'll merge the PR (#96) and create a new release. |
@surpher Thanks so much for jumping on this so quickly!!! I am testing now. Will let you know asap. |
@surpher I am not able to get the branch to resolve the dependency,
Xcode [ |
@surpher it's definitely an error on my end 😅 . I will spend more time today trying to resolve it. The problem is my Xcode will not remove the package 😩. Searched around and this seems to be a problem others have had as well. Hoping to resolve this by eod. Thanks again for all your help. Will let you know. |
@surpher Package resolution is still failing for me. Seems |
What sort of a project are you working on? Does it by any chance have Package.swift files but Xcode is trying to set a new separate one and there is a conflict? |
I can merge it into |
Thank you @surpher. I was originally trying to test this against a work project. We have Package.swift files. So instead, I just created a simple project and pointed to your branch. I was able to pass in the new customHeaders dictionary. Finally able to get my test to run 😄, but ended up failing w/
|
Dug deeper into this and it looks like the interface Update: |
@surpher this is awesome! I am glad that this surfaced this issue. I appreciate your work on this and am looking forward to the changes. For someone working in their spare time, you are on it & responsive!!! Thank you so much! |
@surpher wanted to check back in. Has there been any progress from pactffi maintainers, |
There's some progress refactoring You should be able to set up provider verification by chaining the commands found on func testPactVerification() {
let verifierHandle = ProviderVerifier(name: "provider", version: "1.0.0")!
let verificationResult = verifierHandle
.setCustomHeaders(["Authorization": "Bearer somethingSomething"])
.setVerificationOptions(disableSSL: true, timeout: 2)
.setProviderInfo(name: "provider", url: URL(string: "http://localhost:8080")!)
.verifyPactsAt(source: .file("/tmp/pacts/consumerName-providerName.json"))
.verify()
XCTAssertEqual(verificationResult, .success(true))
} I'm working with the maintainers of the core Pact FFI and we've identified a few things that will need to be resolved as well, particularly when setting provider state |
@kelliepersson pact_ffi and |
🗣 Context
Would like to
ProviderVerifier.Options
to support--header <custom-header>
option💬 Narrative
When I run my
PactVerifiable
conforming testsI want to be able to pass in a
header
optionSo that I can inject the header with an authorization token
📝 Notes
According to the
pact_verifier_cli
documentation , passing a custom header is one of the available options.🏗 Design
✅ Acceptance Criteria
GIVEN
header = ["Authorization" : "sometokenhere"
WHEN
ProviderVerifier.Options
is initialized with custom header valueTHEN
Provider Verification is successful and custom header to
pact_verifier_cli
is passed in the option list.🚫 Out of Scope
The text was updated successfully, but these errors were encountered: