I’m working on a custom auth Python middleware.
I want get the url of the request in the script. Is it included in the request object, and how to get it ?
I also want to get the source IP. I added the following global header in my API definition :
Hi, you can use request.object.request_uri to get the URL.
Accesing the values in global_headers isn’t currently possible when using a custom authentication middleware, the reason is that the middleware which injects global_headers runs after the authentication hook. However you should be able to access these values using a POST hook.
Currently it’s not possible to access the remote address using plugins but I will create a ticket with that feature suggestion.