Martin Mineo
12/06/2024, 7:09 PMpact-broker publish 'pacts/Fulfilment_API-Orders_API.json' -b <http://localhost:9292> --consumer-app-version 1.0.0 -v -u packbroker -p packbroker
I’m getting the Unauthorized error
the whole error in the thread
...
...
<- "POST /contracts/publish HTTP/1.1\r\nAccept: application/hal+json\r\nUser-Agent: Ruby\r\nContent-Type: application/json\r\nAuthorization: [redacted]\r\n"
<- "{\"pacticipantName\":\"Fulfilment_API\",\"pacticipantVersionNumber\":\"1.0.0\",\"tags\":[],\"contracts\":[{\"consumerName\":\"Fulfilment_API\",\"providerName\":\"Orders_API\",\"specification\":\"pact\",\"contentType\":\"application/json\",\"content\":\"eyJjb25zdW1lciI6eyJuYW1lIjoiRnVsZmlsbWVudF9BUEkifSwiaW50ZXJhY3Rpb25zIjpbeyJjb250ZW50cyI6eyJjb250ZW50Ijp7ImlkIjoxfSwiY29udGVudFR5cGUiOiJhcHBsaWNhdGlvbi9qc29uIiwiZW5jb2RlZCI6ZmFsc2V9LCJkZXNjcmlwdGlvbiI6ImFuIGV2ZW50IGluZGljYXRpbmcgdGhhdCBhbiBvcmRlciBoYXMgYmVlbiBjcmVhdGVkIiwibWF0Y2hpbmdSdWxlcyI6eyJib2R5Ijp7IiQuaWQiOnsiY29tYmluZSI6IkFORCIsIm1hdGNoZXJzIjpbeyJtYXRjaCI6ImludGVnZXIifV19fX0sInBlbmRpbmciOmZhbHNlLCJ0eXBlIjoiQXN5bmNocm9ub3VzL01lc3NhZ2VzIn1dLCJtZXRhZGF0YSI6eyJwYWN0UnVzdCI6eyJmZmkiOiIwLjQuMjMiLCJtb2RlbHMiOiIxLjIuNSJ9LCJwYWN0U3BlY2lmaWNhdGlvbiI6eyJ2ZXJzaW9uIjoiNC4wIn19LCJwcm92aWRlciI6eyJuYW1lIjoiT3JkZXJzX0FQSSJ9fQ==\"}]}"
-> "HTTP/1.1 401 Unauthorized\r\n"
-> "Content-Type: text/plain\r\n"
-> "WWW-Authenticate: Basic realm=\"Restricted area\"\r\n"
-> "Content-Length: 0\r\n"
-> "\r\n"
reading 0 bytes...
-> ""
read 0 bytes
Conn keep-alive
Do you have any suggestions?Martin Mineo
12/06/2024, 7:10 PMopening connection to localhost:9292...
opened
<- "GET /? HTTP/1.1\r\nAccept: application/hal+json\r\nUser-Agent: Ruby\r\nAuthorization: [redacted]\r\n"
-> "HTTP/1.1 200 OK\r\n"
-> "Vary: Accept\r\n"
-> "Cache-Control: no-cache\r\n"
-> "Content-Type: application/hal+json;charset=utf-8\r\n"
-> "Date: Fri, 06 Dec 2024 19:06:42 GMT\r\n"
-> "Server: Webmachine-Ruby/2.0.0 Rack/1.3\r\n"
-> "X-Pact-Broker-Version: 2.109.1\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "Content-Length: 4464\r\n"
-> "\r\n"
reading 4464 bytes...
-> "{\"_links\":{\"self\":{\"href\":\"<http://localhost:9292>\",\"title\":\"Index\",\"templated\":false},\"pb:publish-pact\":{\"href\":\"<http://localhost:9292/pacts/provider/{provider}/consumer/{consumer}/version/{consumerApplicationVersion}>\",\"title\":\"Publish a pact\",\"templated\":true},\"pb:publish-contracts\":{\"href\":\"<http://localhost:9292/contracts/publish>\",\"title\":\"Publish contracts\",\"templated\":false},\"pb:latest-pact-versions\":{\"href\":\"<http://localhost:9292/pacts/latest>\",\"title\":\"Latest pact versions\",\"templated\":false},\"pb:tagged-pact-versions\":{\"href\":\"<http://localhost:9292/pacts/provider/{provider}/consumer/{consumer}/tag/{tag}>\",\"title\":\"All versions of a pact for a given consumer, provider and consumer version tag\",\"templated\":false},\"pb:pacticipants\":{\"href\":\"<http://localhost:9292/pacticipants>\",\"title\":\"Pacticipants\",\"templated\":false},\"pb:pacticipant\":{\"href\":\"<http://localhost:9292/pacticipants/{pacticipant}>\",\"title\":\"Fetch pacticipant by name\",\"templated\":true},\"pb:latest-provider-pacts\":{\"href\":\"<http://localhost:9292/pacts/provider/{provider}/latest>\",\"title\":\"Latest pacts by provider\",\"templated\":true},\"pb:latest-provider-pacts-with-tag\":{\"href\":\"<http://localhost:9292/pacts/provider/{provider}/latest/{tag}>\",\"title\":\"Latest pacts for provider with the specified tag\",\"templated\":true},\"pb:provider-pacts-with-tag\":{\"href\":\"<http://localhost:9292/pacts/provider/{provider}/tag/{tag}>\",\"title\":\"All pact versions for the provider with the specified consumer version tag\",\"templated\":true},\"pb:provider-pacts\":{\"href\":\"<http://localhost:9292/pacts/provider/{provider}>\",\"title\":\"All pact versions for the specified provider\",\"templated\":true},\"pb:latest-version\":{\"href\":\"<http://localhost:9292/pacticipants/{pacticipant}/latest-version>\",\"title\":\"Latest pacticipant version\",\"templated\":true},\"pb:latest-tagged-version\":{\"href\":\"<http://localhost:9292/pacticipants/{pacticipant}/latest-version/{tag}>\",\"title\":\"Latest pacticipant version with the specified tag\",\"templated\":true},\"pb:webhooks\":{\"href\":\"<http://localhost:9292/webhooks>\",\"title\":\"Webhooks\",\"templated\":false},\"pb:webhook\":{\"href\":\"<http://localhost:9292/webhooks/{uuid}>\",\"title\":\"Webhook\",\"templated\":true},\"pb:integrations\":{\"href\":\"<http://localhost:9292/integrations>\",\"title\":\"Integrations\",\"templated\":false},\"pb:pacticipant-version-tag\":{\"href\":\"<http://localhost:9292/pacticipants/{pacticipant}/versions/{version}/tags/{tag}>\",\"title\":\"Get, create or delete a tag for a pacticipant version\",\"templated\":true},\"pb:pacticipant-branch\":{\"href\":\"<http://localhost:9292/pacticipants/{pacticipant}/branches/{branch}>\",\"title\":\"Get or delete a pacticipant branch\",\"templated\":true},\"pb:pacticipant-branch-version\":{\"href\":\"<http://localhost:9292/pacticipants/{pacticipant}/branches/{branch}/versions/{version}>\",\"title\":\"Get or add/create a pacticipant version for a branch\",\"templated\":true},\"pb:pacticipant-version\":{\"href\":\"<http://localhost:9292/pacticipants/{pacticipant}/versions/{version}>\",\"title\":\"Get, create or delete a pacticipant version\",\"templated\":true},\"pb:metrics\":{\"href\":\"<http://localhost:9292/metrics>\",\"title\":\"Get Pact Broker metrics\"},\"pb:can-i-deploy-pacticipant-version-to-tag\":{\"href\":\"<http://localhost:9292/can-i-deploy?pacticipant={pacticipant}&version={version}&to={tag}>\",\"title\":\"Determine if an application version can be safely deployed to an environment identified by the given tag\",\"templated\":true},\"pb:can-i-deploy-pacticipant-version-to-environment\":{\"href\":\"<http://localhost:9292/can-i-deploy?pacticipant={pacticipant}&version={version}&environment={environment}>\",\"title\":\"Determine if an application version can be safely deployed to an environment\",\"templated\":true},\"pb:provider-pacts-for-verification\":{\"href\":\"<http://localhost:9292/pacts/provider/{provider}/for-verification>\",\"title\":\"Pact versions to be verified for the specified provider\",\"templated\":true},\"beta:provider-pacts-for-verification\":{\"name\":\"beta\",\"href\":\"<http://localhost:9292/pacts/provider/{provider}/for-verification>\",\"title\":\"DEPRECATED - please use pb:provider-pacts-for-verification\",\"templated\":true},\"curies\":[{\"name\":\"pb\",\"href\":\"<http://localhost:9292/doc/{rel}?context=index>\",\"templated\":true},{\"name\":\"beta\",\"href\":\"<http://localhost:9292/doc/{rel}?context=index>\",\"templated\":true}],\"pb:environments\":{\"title\":\"Environments\",\"href\":\"<http://localhost:9292/environments>\",\"templated\":false},\"pb:environment\":{\"title\":\"Environment\",\"href\":\"<http://localhost:9292/environments/{uuid}>\",\"templated\":true}}}"
read 4464 bytes
Conn keep-alive
opening connection to localhost:9292...
opened
<- "POST /contracts/publish HTTP/1.1\r\nAccept: application/hal+json\r\nUser-Agent: Ruby\r\nContent-Type: application/json\r\nAuthorization: [redacted]\r\n"
<- "{\"pacticipantName\":\"Fulfilment_API\",\"pacticipantVersionNumber\":\"1.0.0\",\"tags\":[],\"contracts\":[{\"consumerName\":\"Fulfilment_API\",\"providerName\":\"Orders_API\",\"specification\":\"pact\",\"contentType\":\"application/json\",\"content\":\"eyJjb25zdW1lciI6eyJuYW1lIjoiRnVsZmlsbWVudF9BUEkifSwiaW50ZXJhY3Rpb25zIjpbeyJjb250ZW50cyI6eyJjb250ZW50Ijp7ImlkIjoxfSwiY29udGVudFR5cGUiOiJhcHBsaWNhdGlvbi9qc29uIiwiZW5jb2RlZCI6ZmFsc2V9LCJkZXNjcmlwdGlvbiI6ImFuIGV2ZW50IGluZGljYXRpbmcgdGhhdCBhbiBvcmRlciBoYXMgYmVlbiBjcmVhdGVkIiwibWF0Y2hpbmdSdWxlcyI6eyJib2R5Ijp7IiQuaWQiOnsiY29tYmluZSI6IkFORCIsIm1hdGNoZXJzIjpbeyJtYXRjaCI6ImludGVnZXIifV19fX0sInBlbmRpbmciOmZhbHNlLCJ0eXBlIjoiQXN5bmNocm9ub3VzL01lc3NhZ2VzIn1dLCJtZXRhZGF0YSI6eyJwYWN0UnVzdCI6eyJmZmkiOiIwLjQuMjMiLCJtb2RlbHMiOiIxLjIuNSJ9LCJwYWN0U3BlY2lmaWNhdGlvbiI6eyJ2ZXJzaW9uIjoiNC4wIn19LCJwcm92aWRlciI6eyJuYW1lIjoiT3JkZXJzX0FQSSJ9fQ==\"}]}"
-> "HTTP/1.1 401 Unauthorized\r\n"
-> "Content-Type: text/plain\r\n"
-> "WWW-Authenticate: Basic realm=\"Restricted area\"\r\n"
-> "Content-Length: 0\r\n"
-> "\r\n"
reading 0 bytes...
-> ""
read 0 bytes
Conn keep-aliveMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
packbroker - should this be pactbroker?Martin Mineo
12/09/2024, 12:57 PMMatt (pactflow.io / pact-js / pact-go)