Convert from single upstream to multi upstream
The original implementation created a 1 upstream / 1 deployment coupling. This would be a horizontally scalable solution except for the implementation detail that configuration of the deployment used a fixed set of envvars. To enable multiple proxies in a single tool account something needed to change. I decided that making the service capable of handling multiple upstreams in parallel would be a reasonable choice.
The main user facing change for the new implementation is that
configuration is now provided as a YAML document stored in the
RPROXY_CONFIG envvar. The configuration should look something like:
---
routes:
- path: /example(/|$)(.*)
upstream: https://example.com
template: /$2
- path: /org(/|$)(.*)
upstream: https://example.org
template: /$2
This config would cause the service to expect inbound requests staring
with either /example or /org which would be reverse proxied to the
associated upstream server. Requests starting with any other top level
path will receive a 404 response.
Bug: T414836