You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe what are you trying to do:
I'm trying to implement the following behind the /seq endpoint
Call /info if X-Auth exists, fetch customerId and insert into /cart/{resp0_customerId}.json
Happy path: If an X-Auth header is present, call the /info backend, extract the customerId and insert it into the /cart/{resp0_customerId}.json backend using the sequential proxy. This part works
Invalid header: In case the /info backend returns a 401 because the X-Auth header is invalid, I pass-through the status code and interrupt the sequence. This part also works
In case the X-Auth header is not set at all, I want to skip both the /info and the /cart/{resp0_customerId}.json backend and forward the request to /cart instead. I'm simulating the /cart backend without the parameter with a benchmark which also returns json. This is the part where I need help. I tried to use CEL to suppress the execution of the /info backend, I tried Lua to redirect, but I can't figure out how to make it work.
Is this mix of conditions and sequence possible in KrakenD?
Environment info:
I'm running krakend in docker-compose based on the community playground:
Describe what are you trying to do:
I'm trying to implement the following behind the
/seq
endpointCall /info if X-Auth exists, fetch customerId and insert into /cart/{resp0_customerId}.json
/info
backend, extract the customerId and insert it into the/cart/{resp0_customerId}.json
backend using the sequential proxy. This part works/info
backend returns a 401 because the X-Auth header is invalid, I pass-through the status code and interrupt the sequence. This part also works/info
and the/cart/{resp0_customerId}.json
backend and forward the request to/cart
instead. I'm simulating the/cart
backend without the parameter with a benchmark which also returns json. This is the part where I need help. I tried to use CEL to suppress the execution of the/info
backend, I tried Lua to redirect, but I can't figure out how to make it work.Is this mix of conditions and sequence possible in KrakenD?
Your configuration file:
Configuration check output:
Result of
krakend check -dtc krakend.json --lint
commandCommands used:
How did you start the software?
Logs:
That's the logs for the happy path under 1.
That's the logs for 2. with the invalid header:
That's the logs for 3. when the X-Auth header is missing:
Additional comments:
Even when I set the encoding of the 1st backend to no-op, I don't get any response, only an empty object:
The text was updated successfully, but these errors were encountered: