I have a use case where a JSVM pre middleware contacts an external host to fetch that actual upstream hostname and use it in the URL Rewriter so that the upstream URL is composed with the hostname fetched from the external host (as the response of pre middleware)
I tried the following scenarios and their results, following by a couple of questions:
A. JSVM Pre Middleware + URL Rewriter >> only the pre middleware executes
B. JSVM Post Auth Middleware + URL Rewriter >> only the Rewriter executes
C. URL Rewriter + JSVM Post Middleware >> Both executes… Rewriter first and then the Middleware (as expected). However, this is not applicable/usable for my use case.
- Why does the URL Rewrite not get executed in Scenario A?
- What is the provision through which the URL Rewriter can absorb data from the JSVM pre middleware? Is this possible at all? I understand from this post (Hostname Rewrite from Middlewares) that it is possible with a GRPC plugin to set session metadata, but am not sure if JSVM can enable transporting data from the middleware response to the Rewriter.
Are rich plugins the only way to make use of URL Rewriters for the use case?
I do not get any clue from the following issues and their fixes:
I want to be able to use the response of my Pre Middleware in URL Rewriter.