This works using the UI and an advanced trigger via URL Rewrite. But in my Go plugin, I want to change the target_url so that I can do header validation and process the request to one of multiple upstreams depending on the header value.
Eg. header “UserID: 1” should send the upstream to Service A
header “UserID: 2” should send the upstream to Service B
I’m trying not to spam the forums, but I am having issue building the Go plugin in the Go custom plugin tutorial because we don’t have a license. I tried to use the docker image the tutorial uses directly, but there are incompatibilities in versions of the tutorial .go file
Makes perfect sense - you will need a license key to stand up the Gateway in the Custom-Go-Plugin repo. You can self serve a license key here and run that environment directly via the MakeFile.
Please note that this solution will override the StructuredTargetList at the API definition level, which can result in race conditions. For example, a ManyToMany relationship when we return a different upstream for identical requests (i.e., based on a key).