Implement endpoint to perform request to services running in builds
As a part of https://gitlab.com/gitlab-org/gitlab-ee/issues/5276 we need a new endpoint (possibly in the EE::JobsController
) that will generate the proper metadata that would allow performing requests to services running in the build in a specific port.
In order to make this work we would need also gitlab-runner#3948 (closed) and gitlab-workhorse#205 (closed). Once the Web IDE performs a request to a specific endpoint in Workhorse, it will receive a request that will be modified with the proper metadata to pass the Workhorse validations and finally make the request get to the runner.
This metadata will be:
- the
url
that we want to send to the runner. It will have the format/session/uuid/proxy/<build|or|service-name>/<port>/<requested-uri>
. Whereport
is the port where the build service is running andrequested-uri
is the url that we want to request. The method used will be the same one of the current request. -
header
with theAuthorization
headers -
CAPem
which will hold the runner certificate. -
Subprotocols
in order to be able to use websockets
Follow-up issue https://gitlab.com/gitlab-org/gitlab-ee/issues/11078