| |||
Confidentiality Notice: This email, including any attachments, may contain confidential and privileged information for the sole use of the intended recipient(s). Any unauthorized review, use, disclosure, or distribution is prohibited. If you are not the intended recipient, please contact the sender immediately and destroy all copies of this email. Thank you. This email has been sent in accordance with the European Union General Data Protection Regulation (EU GDPR).
--
You received this message because you are subscribed to the Google Groups "KrakenD Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to community+...@krakend.io.
To view this discussion on the web visit https://groups.google.com/a/krakend.io/d/msgid/community/13c295c0-f2cc-42d6-af09-a98c7c7c01can%40krakend.io.
Hey Fuat,
Thanks for reaching out! I see you're aiming to pull the userId from your userService and then slot it into the backend request header. While it might seem straightforward, there are some important considerations.
Performance Impact: Your method involves a sequential proxy, which can be a real drag on performance (multiple calls for EACH request). For more insights on why this isn't the best route, check out our sequential proxy documentation: https://www.krakend.io/docs/endpoints/sequential-proxy/. A more efficient alternative would be to use an Identity Provider like Keycloak, which offers built-in support for user federation.
Martian Limitations: You hit the nail on the head; Martian is more about static header manipulation and won't suit your dynamic needs.
Lua Scripts in Community Edition: If you're using the KrakenD Community Edition, Lua scripts can help you out with dynamic header manipulation and making those extra calls. However, keep in mind that this will still have the performance impact mentioned in point 1. More on Lua scripts: https://www.krakend.io/docs/endpoints/lua/#making-additional-requests-http_response
Dynamic Routing in Enterprise Edition: If you're on KrakenD Enterprise, you've got the option for dynamic routing. This feature allows you to add info from any part of the request when building the backend request. Learn more at: https://www.krakend.io/docs/enterprise/endpoints/dynamic-routing/
Feel free to write back if you have more questions or need further clarification.
Best,
Confidentiality Notice: This email, including any attachments, may contain confidential and privileged information for the sole use of the intended recipient(s). Any unauthorized review, use, disclosure, or distribution is prohibited. If you are not the intended recipient, please contact the sender immediately and destroy all copies of this email. Thank you. This email has been sent in accordance with the European Union General Data Protection Regulation (EU GDPR).