Kong Azure-Functions

A Kong plugin that enables an api endpoint to call Azure Functions.

Description

This plugin can make the client of Kong call the

Installation

Development

Navigate to kong/plugins folder and clone this repo

$ cd /path/to/kong/plugins
$ git clone https://github.com/nkfly/kong-azure-functions-plugin.git azure-functions
$ cd azure-functions
$ luarocks make *.rockspec

To make Kong aware that it has to look for the azure-functions plugin, you'll have to add it to the custom_plugins property in your configuration file.

custom_plugins:
    - azure-functions

Restart Kong and you're ready to go.

luarocks

$ luarocks install azure-functions

Configuration

You can add the plugin on top of an API by executing the following request on your Kong server:

$ curl -X POST http://kong:8001/apis/{api}/plugins \
    --data "name=middleman" \
    --data "config.url=http://myserver.io/validate"
form parameter default description
name The name of the plugin to use, in this case: middleman
config.url
required
The URL to which the plugin will make a JSON POST request before proxying the original request.

Middleman will execute a JSON POST request to the specified url with the following body:

Attribute Description
body_data The body of the original request
url_args The url arguments of the original request
headers The headers of the original request

In the scope of your own endpoint, you may validate any of these attributes and accept or reject the request according to your needs.

Author

Panagis Tselentis

License

The MIT License (MIT)
=====================

Copyright (c) 2015 Panagis Tselentis

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.