Execute Local Script

Hello,

I have install Tyk v2.7.1 community edition on Ubuntu 16. I have a very basic setup of an API working with authentication and version rewriting the uri and sending on the request to an internal service.

Is it possible for Tyk instead of forwarding on the request to an internal service to execute a local python script and feed the output of the script back ? If this is possible could you point me to the corresponding documentation ?

Apologies for what i feel is a nood question, I have only been using tyk for a day so far

thanks
alexis

Hi Alexis,

This is absolutely possible:

https://tyk.io/docs/customise-tyk/plugins/rich-plugins/python/custom-auth-python-tutorial/
https://tyk.io/docs/customise-tyk/plugins/rich-plugins/python/tyk-python-api-methods/
https://tyk.io/docs/customise-tyk/plugins/rich-plugins/python/tutorial-add-demo-plugin-api/

The above example is for custom authentication, however you could do your own thing - and rather than use the the Auth hook, you could use the Post hook of the middleware execution chain.

https://tyk.io/docs/concepts/middleware-execution-order/

And finally - here are some example plugins which you could take and play with in different languages: https://github.com/TykTechnologies/tyk-awesome-plugins

Good luck!

This is perfect ! thanks @AhmetSoormally

alexis