All Projects → navinkumarr → kong-api-gateway-plugin-and-microservices-demo

navinkumarr / kong-api-gateway-plugin-and-microservices-demo

Licence: other
Creating plugin for Kong API Gateway and Simple micro services example

Programming Languages

swift
15916 projects
kotlin
9241 projects
lua
6591 projects
Dockerfile
14818 projects
javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to kong-api-gateway-plugin-and-microservices-demo

kong-map
Kongmap is a free visualization tool which allows you to view and edit configurations of your Kong API Gateway Clusters, including Routes, Services, and Plugins/Policies. The tool is being offered for installation via Docker and Kubernetes at this time.
Stars: ✭ 60 (+200%)
Mutual labels:  kong, kong-plugin, kong-gateway
kong-plugin-acme
Let's Encrypt and ACMEv2 integration with Kong - this plugin has been moved into https://github.com/Kong/kong, please open issues and PRs in that repo
Stars: ✭ 36 (+80%)
Mutual labels:  kong, kong-plugin
kong-plugin-api-response-merger
Kong API response merger plugin
Stars: ✭ 14 (-30%)
Mutual labels:  kong, kong-plugin
django-api-bouncer
Simple Django app to provide API Gateways for micro-services
Stars: ✭ 18 (-10%)
Mutual labels:  kong, kong-gateway
kong-plugin-zipkin
A Kong plugin for propogating zipkin spans and reporting spans to a zipkin server - this plugin has been moved into https://github.com/Kong/kong, please open issues and PRs in that repo
Stars: ✭ 60 (+200%)
Mutual labels:  kong, kong-plugin
kong-plugin-grpc-gateway
Kong Plugin to transcode REST request to gRPC - this plugin has been moved into https://github.com/Kong/kong, please open issues and PRs in that repo
Stars: ✭ 15 (-25%)
Mutual labels:  kong, kong-plugin
gluu-gateway
Gluu API 🚀 and Web Gateway 🎯
Stars: ✭ 29 (+45%)
Mutual labels:  kong, kong-plugin
kubernetes-sidecar-injector
Easy Service Mesh with Kong and Kubernetes
Stars: ✭ 20 (+0%)
Mutual labels:  kong, kong-plugin
Kong Dashboard
Dashboard for managing Kong gateway
Stars: ✭ 2,142 (+10610%)
Mutual labels:  kong, kong-gateway
kong-scalable-rate-limiter
Kong plugin for Rate Limiting at high throughputs.
Stars: ✭ 19 (-5%)
Mutual labels:  kong, kong-plugin
kong-circuit-breaker
Kong plugin for wrapping all proxy calls with a circuit-breaker
Stars: ✭ 27 (+35%)
Mutual labels:  kong, kong-plugin
kongsul
Kong Api Gateway with Consul Service Discovery (MicroService)
Stars: ✭ 35 (+75%)
Mutual labels:  kong, kong-gateway
kong-plugin-http-anti-replay-attack
http-anti-replay-attack [防重放攻击]
Stars: ✭ 20 (+0%)
Mutual labels:  kong, kong-plugin
kong-plugin-url-rewrite
Kong API Gateway plugin for url-rewrite purposes
Stars: ✭ 43 (+115%)
Mutual labels:  kong, kong-plugin
kongverge
A desired state configuration tool for Kong
Stars: ✭ 23 (+15%)
Mutual labels:  kong, kong-gateway
docker-kong-oidc
Kong + OIDC plugins
Stars: ✭ 83 (+315%)
Mutual labels:  kong
kong-js-pdk
Kong PDK for Javascript and plugin server
Stars: ✭ 28 (+40%)
Mutual labels:  kong
kuma-gui
🐻 A GUI built on Vue.js for use with Kuma.
Stars: ✭ 34 (+70%)
Mutual labels:  kong
lua-resty-timer
Extended timers for OpenResty
Stars: ✭ 20 (+0%)
Mutual labels:  kong
lua-circuit-breaker
Circuit breaker pattern in Lua
Stars: ✭ 28 (+40%)
Mutual labels:  kong

Requirements

Mandatory tools

Optional tools

Application Architecture

  • API Gateway (Lua)

    Used to add authentication with custom authentication plugin and only exposing search service to the world.

  • Search Service (Kotlin)

    Used to fetch profile based on search criteria, in our case using only profileids. Internally uses profile services to fetch profile data and cache service for caching profile data.

  • Profile Service (NodeJS)

    Used to fetch profiles from datasource

  • Cache Service (Swift)

    Used to cache profiles

Project structure

    ├── api-gateway (API Gateway Application)
    ├── api.md
    ├── assets
    ├── cache-service (Cache Service Application)
    ├── docker-compose.yml
    ├── docker.md (Contains helpful docker commands)
    ├── profile-service (Profile Service Application)
    ├── README.md
    └── search-service (Search Service Application)
  • API Gateway

      api-gateway
      ├── docker-entrypoint.sh
      ├── Dockerfile
      └── kong
          └── plugins
              └── demoauth
                  ├── constants.lua
                  ├── handler.lua (access method of the handler is the entrypoint of the plugin)
                  ├── schema.lua (schema defines the configuration needed by this plugin)
                  └── utils.lua
    
  • Cache Service

      cache-service
      ├── cloud.yml
      ├── CONTRIBUTING.md
      ├── Dockerfile
      ├── Package.resolved
      ├── Package.swift
      ├── Public
      ├── README.md
      ├── Sources
      │   ├── App
      │   │   ├── app.swift
      │   │   ├── boot.swift
      │   │   ├── configure.swift
      │   │   ├── Controllers
      │   │   │   └── CacheController.swift (Controller contains logic to store cache)
      │   │   ├── Models
      │   │   │   └── Cache.swift (Cache model)
      │   │   └── routes.swift (Contains routes of the API)
      │   └── Run
      │       └── main.swift ()
      └── Tests
          ├── AppTests
          │   └── AppTests.swift
          └── LinuxMain.swift
    
  • Profile Service

      profile-service
      ├── Dockerfile
      ├── index.js (Contains profile server)
      ├── node_modules
      ├── package.json
      ├── package-lock.json
      └── profiles.json (Json file acting as database)
    
  • Search Service

      search-service
      ├── build
      ├── build.gradle
      ├── Dockerfile
      ├── gradle
      ├── gradlew
      ├── gradlew.bat
      ├── HELP.md
      ├── settings.gradle
      └── src
          ├── main
          │   ├── kotlin
          │   │   └── com
          │   │       └── shaadi
          │   │           └── search
          │   │               ├── SearchApplication.kt (Main application)
          │   │               └── SearchController.kt (Contains routing and business logic)
          │   └── resources
          │       ├── application.properties (application config)
          │       ├── static
          │       └── templates
          └── test
              └── kotlin
                  └── com
                      └── shaadi
                          └── search
    

Running the application

sudo docker-compose up

Setting Up API Gateway

  • Create Service

jo url="http://search-service:8081/" name="search-service" | http POST :8001/services

  • Create Route on Service

jo -d. name="search-service-route" service.id="856704f8-aced-4d2e-8207-c75b22d1def7" paths[]="/v1/search" methods[]="GET" | http POST :8001/routes

  • Activate auth plugin on Search Service

jo name=demoauth | http POST :8001/services/search-service/plugin

Accessing API without activating auth plugin

http :8081/search?profileids=a1q1q1

Accessing API With authkey header after activating auth plugin

http :8000/v1/search?profileids=a1q1q1 authkey:"hackfest|demo|"

External Links

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].