TykTechnologies / tyk-demo

Tyk Docker Demo with full Pro Tyk Installation and more!
51 stars 12 forks source link

MDCB deployment visibility #227

Closed davegarvey closed 7 months ago

davegarvey commented 7 months ago

Purpose of this PR is to made the MDCB port available to localhost, to enable externally run gateways to be able to connect into the Tyk Demo deployment as worker gateways. The purpose of this is to enable local worker gateways to be run and debugged against the Tyk Demo environment. In addition, there are also numerous updates to the data files based on updates schemas.

MDCB update

This adds an API called External HTTPbin that uses the internet-hosted http://httpbin.org as the target, rather than the one found within the docker network http://httpbin. This provides gateways running outside of the docker network with an API that they are able to proxy to , as the majority of other APIs will are targeting hostnames which only resolve within the docker network.

There is also a custom key called external_httpbin_key that provides access to this API. It can be used as follows (assuming local gateway is running on port 9999):

curl localhost:9999/external-httpbin/get -H 'Authorization: external_httpbin_key'
{
  "args": {},
  "headers": {
    "Accept": "*/*",
    "Accept-Encoding": "gzip",
    "Authorization": "auth_key_copy",
    "Host": "httpbin.org",
    "User-Agent": "curl/8.1.2",
    "X-Amzn-Trace-Id": "Root=1-6568959e-1374c3702b9a979575323404"
  },
  "origin": "127.0.0.1, 213.55.240.159",
  "url": "http://httpbin.org/get"
}