Skip to content

Feature Request: Add Ability to Pass Custom Header for Verification #95

Description

@kelliepersson

🗣 Context

Would like to ProviderVerifier.Options to support --header <custom-header> option

💬 Narrative

When I run my PactVerifiable conforming tests
I want to be able to pass in a header option
So 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.

--header <custom-header>...
            Add a custom header to be included in the calls to the provider. Values must be in the
            form KEY=VALUE, where KEY and VALUE contain ASCII characters (32-127) only. Can be
            repeated.

🏗 Design

✅ Acceptance Criteria

GIVEN header = ["Authorization" : "sometokenhere"

WHEN
ProviderVerifier.Options is initialized with custom header value

options = ProviderVerifier.Options(
            provider: provider,
            pactsSource: .broker(pactBroker),
            customHeader: header,
            logLevel: .error
        )

THEN
Provider Verification is successful and custom header to pact_verifier_cli is passed in the option list.

🚫 Out of Scope

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions