Closed jnatten closed 5 years ago
This could be implemented by adding the authorization header when creating the SimpleRequest
(By parsing the url with a simple regex).
Another option could be to parse the url in the implementations of IScalaPactHttpClient
.
What do you think @davesmith00000 ?
I've tried to set it up in my pact.sbt like this:
pactBrokerAddress := "http://username:password@pact-broker.local"
and whenever i run
sbt pactPublish
everything seems to go okay until the last second (when the actual publishing happens):If i replace the header here: https://github.com/ITV/scala-pact/blob/602aeb08d76468503d109ab9ad56d636c2d8105d/sbt-scalapact-shared/src/main/scala/com/itv/scalapact/plugin/shared/Publisher.scala#L39
With this (
dXNlcm5hbWU6cGFzc3dvcmQ=
is "username:password" base64 encoded):The publish works and everything is fine.
Would you like me to create a pull-request adding basic auth header to requests to a broker?