Add metadata injection support to Pact JS Verifier
Armen Chuljyan
Metadata injection support is currently available in Java, for example 'https://github.com/pact-foundation/pact-plugins/blob/main/examples/gRPC/metadata/provider-jvm/server/src/test/java/io/pact/example/grpc/provider/PactVerificationTest.java#L60' . This function is needed in cases such as providing an authentication token to be able to verify the contract file using "verifyProvider" if the producer service is performing token authorization.
Armen Chuljyan
Matt, will this feature be implemented in the near future? Since this is not a new feature, it is already in the Java plugin and may be in others as well. Also, it is a standard in REST. I would say this is a critical feature. For us personally, this is a blocker.
Matt Fellows
Armen Chuljyan: well you've just asked for it and we need to think about how to build it and the so it. So unlikely.
It needs to be added to our core FFI engine (https://github.com/pact-foundation/pact-reference) and then we need to think about how clients like Pact JS can use it.
See also https://pact-foundation.slack.com/archives/C02BXLDJ7JR/p1716200056061779 if you'd like to help
Matt Fellows
Ok thanks. Pact JS already has that capability for HTTP requests, just not for plugin based ones.
Matt Fellows
Specifically, you're asking about that support for plugin interactions?
Armen Chuljyan
Since this is related to grpc/protobuf metadata support, I'm assuming this should be implemented in plugins, but not sure may be this this should be done in Pact js? In general, my request is to simply be able to inject metadata (as is done in the Java example at the link given in the description) to solve the authentication problem in my specific case. But I'm sure there could certainly be other use cases involving metadata injection.
also see the related slack chat: https://pact-foundation.slack.com/archives/CEQBDD5U4/p1715944597764949