All Projects → vaibhav-sinha → kong-java-client

vaibhav-sinha / kong-java-client

Licence: Apache-2.0 license
Java Client for Kong API Gateway configuration

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to kong-java-client

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 (-13.04%)
Mutual labels:  api-gateway, kong
kong
Kong docker image that easily installs plugins from source code.
Stars: ✭ 20 (-71.01%)
Mutual labels:  api-gateway, kong
okta-api-center
Get up and running quickly with Okta's OAuth as a Service and your favorite API Gateway.
Stars: ✭ 58 (-15.94%)
Mutual labels:  api-gateway, kong
kong-ui
UI for KONG API Gateway
Stars: ✭ 20 (-71.01%)
Mutual labels:  api-gateway, kong
kong-plugin-url-rewrite
Kong API Gateway plugin for url-rewrite purposes
Stars: ✭ 43 (-37.68%)
Mutual labels:  api-gateway, kong
django-api-bouncer
Simple Django app to provide API Gateways for micro-services
Stars: ✭ 18 (-73.91%)
Mutual labels:  api-gateway, kong
kong-upstream-jwt
A plugin for Kong which adds a signed JWT to HTTP Headers to backend requests
Stars: ✭ 40 (-42.03%)
Mutual labels:  api-gateway, kong
kong-scalable-rate-limiter
Kong plugin for Rate Limiting at high throughputs.
Stars: ✭ 19 (-72.46%)
Mutual labels:  api-gateway, kong
Kong
🦍 The Cloud-Native API Gateway
Stars: ✭ 30,838 (+44592.75%)
Mutual labels:  api-gateway, kong
Kong Docs Cn
微服务 Api 网关 Kong 最新文档中文版
Stars: ✭ 371 (+437.68%)
Mutual labels:  api-gateway, kong
kong-oidc-auth
OpenID Connect authentication with Kong gateway
Stars: ✭ 41 (-40.58%)
Mutual labels:  api-gateway, kong
kong-plugin-api-response-merger
Kong API response merger plugin
Stars: ✭ 14 (-79.71%)
Mutual labels:  api-gateway, kong
gluu-gateway
Gluu API 🚀 and Web Gateway 🎯
Stars: ✭ 29 (-57.97%)
Mutual labels:  api-gateway, kong
c
Official C client library for Kubernetes
Stars: ✭ 83 (+20.29%)
Mutual labels:  client-library
lura
Ultra performant API Gateway with middlewares. A project hosted at The Linux Foundation
Stars: ✭ 5,159 (+7376.81%)
Mutual labels:  api-gateway
circles-core
Common methods to interact with the Circles ecosystem
Stars: ✭ 22 (-68.12%)
Mutual labels:  client-library
safe-client-gateway
Gateway service for Safe apps that serves transaction data conforming with the UI of our mobile apps
Stars: ✭ 33 (-52.17%)
Mutual labels:  api-gateway
terraform-aws-api-gateway
Terraform module to create Route53 resource on AWS for create api gateway with it's basic elements.
Stars: ✭ 43 (-37.68%)
Mutual labels:  api-gateway
ably-dotnet
.NET, Xamarin and Mono client library SDK for Ably realtime messaging service
Stars: ✭ 32 (-53.62%)
Mutual labels:  client-library
tencent-apigateway
Easily provision Tencent API Gateway using Serverless Components
Stars: ✭ 33 (-52.17%)
Mutual labels:  api-gateway

Kong Java Client

Kong is a popular Open Source API Gateway. Kong Java Client makes it easy to configure the API Gateway through your code.

Installation

The artifact is available on Maven Central Repository and be downloaded by adding the following dependency in pom.xml

<dependency>
    <groupId>com.github.vaibhav-sinha</groupId>
    <artifactId>kong-java-client</artifactId>
    <version>0.2.0</version>
</dependency>

Usage

KongClient kongClient = new KongClient("http://localhost:8001");
Consumer request = new Consumer();
request.setCustomId("1234-5678-9012");
Consumer response = kongClient.getConsumerService().createConsumer(request);

Look in the tests to find more examples.

Supported Plugins

Besides the Admin APIs, Plugin configuration is also supported.

Authentication Plugins

  • Basic Auth
  • Key Auth
  • HMAC Auth
  • JWT Auth
  • OAuth2
  • LDAP

Security Plugins

  • ACL
  • IP Restriction

Traffic Control Plugins

  • Rate Limiting
  • Request Size Limiting
  • Request Termination

Only those plugins are supported which might need configuration through code. For example, adding rate limit for a new consumer when there is a new signup. Plugins which require one time configuration are not supported.

Example Usage

To add credentials for a new Consumer for Basic Auth

kongClient.getBasicAuthService().addCredentials("con-su-mer-id", "username", "password");

To add OAuth2 Plugin for an API

//See: RetrofitApiPluginServiceTest.java
kongClient.getApiPluginService().addPluginForApi(API_NAME, oauth2Plugin);

To add an Application for a Consumer for OAuth2

//See: RetrofitOAuth2ManageServiceTest.java
kongClient.getOAuth2ManageService().createConsumerApplication(CONSUMER_ID, 
    new Application(appName, appRedirectUrl, appClientId, appClientSecret));

To do the OAuth2 Process (Authorization Code)

//See: RetrofitOAuth2ProcessServiceTest.java
kongClient.getOAuth2ProcessService().authorize(API_URI, authorizationRequest);
kongClient.getOAuth2ProcessService().grantToken(API_URI, grantTokenRequest)
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].