krakend / krakend-ce

KrakenD Community Edition: High-performance, stateless, declarative, API Gateway written in Go.
https://www.krakend.io
Apache License 2.0
1.86k stars 443 forks source link

Unable to Retrieve Path Variables in KrakenD Backend Plugin for Dynamic Endpoints #861

Open JavedMohammadTechie opened 4 months ago

JavedMohammadTechie commented 4 months ago

Hello KrakenD community,

I'm currently facing an issue with extracting path variables from dynamic endpoints in KrakenD when using a custom backend plugin. Specifically, I have an endpoint configured as follows:

image

I need to access these dynamic values (rollNo and section) within my backend plugin to perform certain operations based on the provided path variables. However, despite my attempts, I have been unable to retrieve these path variables in my backend plugin.

I've explored the available documentation and resources, but I couldn't find a clear solution for this scenario. Could someone please guide me on how to properly access the path variables from dynamic endpoints within a KrakenD backend plugin?

Any insights, code snippets, or pointers to relevant documentation would be greatly appreciated. Thank you in advance for your assistance!

nsitbon commented 3 months ago

Hi @JavedMohammadTechie as far as I know you don't have access to those variables inside server plugins... the only place where you have access to them is inside a request modifier https://github.com/luraproject/lura/blob/master/proxy/plugin.go#L201 Best regards