Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/monarchapis/gateway-openresty
OpenResty-based API Gateway for Monarch
https://github.com/monarchapis/gateway-openresty
Last synced: 2 months ago
JSON representation
OpenResty-based API Gateway for Monarch
- Host: GitHub
- URL: https://github.com/monarchapis/gateway-openresty
- Owner: monarchapis
- Created: 2015-01-30T21:29:33.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-02-11T16:15:35.000Z (almost 9 years ago)
- Last Synced: 2024-03-17T20:56:27.460Z (11 months ago)
- Language: Lua
- Size: 14.6 KB
- Stars: 8
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-resty - Monarch API Gateway - based API Gateway (Libraries)
README
Monarch OpenResty-based API Gateway
===================================Works in tandem with the API Manager to authenticate and authorize requests before proxying them to the appropriate backend service.
Simply overlay the following files into your [OpenResty](http://openresty.org "OpenResty home page") installation directory (e.g. /usr/local/openresty).
- **lualib/monarch.lua** - The main gateway script that handles calling the Monarch API Manager to verify the incoming request.
- **lualib/resty/hmac.lua** - A contributed script that adds HMAC support.
- **lualib/net/url.lua** - A contributed script that parses URLs.
- **nginx/conf/nginx.conf** - The API gateway Nginx configuration.Next, you will need to edit nginx.conf to configure the following values:
- **Host** and **Environment ID** - Under `location = /monarch_auth` and `location = /monarch_traffic` you will need to update the `Host` and `X-Environment-Id` headers. The Monarch environment ID can be accessed in the admin console by clicking the gear icon next to your user name in the upper right-hand corner. Likewise, the `upstream monarch_backend` needs to have the correct host and port.
- **Provider Key** and **Shared Secret** - You will need to create a new Provider in the admin console (e.g. name = gateway, permissions = Authenticate API requests) and change the `set $provider_key "XXXX";` in nginx.conf to have the correct provider API key and shared secret you created for this provider.Refer to the `location /` for how to enable the communication with Monarch. You can find documentation on configuring Nginx [on their wiki](http://wiki.nginx.org/Configuration "Nginx configuration").