APIcast (https://github.com/3scale/apicast) is an Open Source API Gateway whose main focus areas are high performance and extensibility. It is part of the Redhat 3scale API Management solution, and is used by hundreds of companies around the world to expose their APIs in a secure and controlled way.
Install and enable SSO before using this module. SSO is used to issue the JWT tokens during the OpenID Connect (http://openid.net/connect/) over OAuth 2.0 standard code flow to enable the secure connection to the gateway.
$ git clone https://github.com/redhat-helloworld-msa/api-management $ cd api-management/ $ oc new-build --binary --name api-management -e BACKEND_URL=http://127.0.0.1:8081
$ oc start-build api-management --from-dir=. --follow $ oc new-app api-management $ oc expose svc/api-management --name api-bonjour $ oc expose svc/api-management --name api-hola $ oc expose svc/api-management --name api-ola $ oc expose svc/api-management --name api-aloha
After enabling the API Management use case, you will see a new Tab (or two if you haven’t previously enabled SSO) containing the new scenario.
-
Click in the API Management tab and you will see a new panel with the information of your deployed services.
-
Click the Refresh results link, if you are not logged in, you will see the services failing with an "Unauthorized" error.
-
Log in using the link in the top right corner using the user/user credentials.
-
After the page refresh click again in the API Management tab.
-
Click the Refresh Results link to call the managed API endpoints. You will see the same results as calling them from the browser tab.
-
Click the link again 6 more times in less than a minute.
Did you notice that now the bonjour
service failed with a HTTP 429 Too Many Requests error? The 3scale APIcast allows you to gate (secure or protect) your endopoint without the need to change or add new endpoint in your code. You can proxy your service and add policies, like enabling CORS, doing URL Rewrite or edge rate limiting with a simple configuration.