Automating the creation of APIs in Kong

  • Validation of Open API and Swagger definitions
  • Importing APIs into Kong using good practices
  • Support for json and yaml formats
  • Provisioning Kong plugins (enable API Security, monitoring, etc.)
  • Supports variable interpolation to contemplate url from different environments, for example: dev, hom, prd, etc.

Using the Tool

  1. Docker installed
  2. Kong API Gateway in operation
  3. Konga up and running, to easily check the imported API

Validating the Open API / Swagger

  1. Obtain an Open API, for example, petstore-v3.0.yaml
  2. Remove the openapi (first) element for test purpose
  3. Run Open API validation:

Importing Open API / Swagger into Kong

  1. Importing petstore-v3.0.yaml
Services definitions
Routes definitions

Importing Open API / Swagger into Kong with Plugins

  1. Define prometheus plugin for all the petstore routes (.*)
Route definition with plugin

Results

  • Pipeline Integration: With steps contract validation and automatic import into API Gateway in environments, on every git commit
  • API Security: Authorization and authentication with OAuth2 and Keycloak through plugins, ensuring the security of the APIs in the delivery pipeline
  • Improved API governance with OPA (Open Policy Agent) and Spectral, enforcing Open API Specification with custom validations

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
3Bit Technologies

3Bit Technologies

Cloud Specialists providing professional services with DevOps, BigData, Cloud Native Applications and Security. https://www.3bit.com.br/3bit