kong

How to implement external auth in KONG?

微笑、不失礼 提交于 2021-02-10 14:14:46
问题 I'm using KONG API Gateway, and I want to implement JWT authentication as separate microservice (not using KONG plugin), now I can easily register this service with KONG, and so users can register and login. Assume an authenticated user had sent a request with a token attached in the header, how to make KONG forwards the request to the authentication service first, then if it is valid the request is forwarded to the requested service? 回答1: Yes you can (But I have not used them) there is as

Kong: docker-compose [PostgreSQL error] failed to retrieve PostgreSQL server_version_num: host or service not provided, or not known

假装没事ソ 提交于 2021-01-28 07:13:57
问题 I'm trying to learn how to use Kong for my API server, but met the error: kong_1 | nginx: [error] init_by_lua error: /usr/local/share/lua/5.1/kong/init.lua:388: [PostgreSQL error] failed to retrieve PostgreSQL server_version_num: host or service not provided, or not known My docker-compose.yaml as below: version: "3" networks: kong-net: driver: bridge services: # Create a service named db. kong-postgres: # Use the Docker Image postgres. This will pull the newest release. image: "postgres" #

kong request transformer invoke multiple microservice APIs

时间秒杀一切 提交于 2020-07-16 07:57:08
问题 I am exploring Kong. I am wondering if I can achieve the following scenario using request transformer plugin. A request is reached at the request transformer plugin. Split the request into three microservice API requests. Call the three APIs sequentially. Merge the response of all three APIs. Send the response back. 回答1: I think that is not possible as Kong is not an orchestration/business process/ESB tool. I see two solutions for this use case: Deploy a BPM engine like Camunda, which takes

In kong api gateway, how to make custom url?

一世执手 提交于 2020-05-17 07:12:08
问题 So I am creating application using microservice architecture. I have few microservices and I want to configure all in kong with custom routes/url. For example: I have user service and location service and I want those routes in kong looks like this: GET http://localhost:8001/service/user/list --> http://user-service-url.com/user_list GET http://localhost:8001/service/location/122332--> http://location-service-url.com/get/122332 I have searched all over the internet and couldn't find anything.

API gateway 之 kong0.12.3 安装

谁都会走 提交于 2020-03-23 01:06:15
kong安装: https://getkong.org/install/centos/ 下载指定版本rpm: wget https://bintray.com/kong/kong-community-edition-rpm/download_file?file_path=centos/7/kong-community-edition-0.12.3.el7.noarch.rpm yum install epel-release yum install xxx.rpm kong数据库安装: kong支持2种数据库存储(postgreSQL 和 Cassandra ) postgreSQL官网: https://www.postgresql.org/download/ Cassandra官网: http://cassandra.apache.org/download/ 安装postgreSQL: yum install https://download.postgresql.org/pub/repos/yum/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-3.noarch.rpm yum install postgresql94 yum install postgresql94-server /usr/pgsql-9.4/bin

Kong入门及docker安装

我怕爱的太早我们不能终老 提交于 2020-03-23 01:05:50
一.Kong介绍 Kong( https://github.com/Kong/kong ) 是一个云原生,高效,可扩展的分布式 API 网关。 自 2015 年在 github 开源后,广泛受到关注,目前已收获 1.9w+ 的 star,其核心价值在于高性能和可扩展性。 二.安装前准备 安装好docker稳定版本 会docker 的基本使用 了解kong概念和使用(文档地址: https://getkong.org/docs/ ) 概念术语 upstream: 是对上游服务器的抽象; target: 代表了一个物理服务,是 ip + port 的抽象; service: 是抽象层面的服务,他可以直接映射到一个物理服务(host 指向 ip + port),也可以指向一个 upstream 来做到负载均衡; route: 是路由的抽象,他负责将实际的 request 映射到 service。 默认情况下,KONG监听的端口为 : 8000: 此端口是KONG用来监听来自客户端传入的HTTP请求,并将此请求转发到上有服务器; 8443: 此端口是KONG用来监听来自客户端传入的HTTP请求的。它跟8000端口的功能类似,但是它只是用来监听HTTP请求的,没有转发功能。可以通过修改配置文件来禁止它; 8001: Admin API,通过此端口,管理者可以对KONG的监听服务进行配置;

docker安装kong

喜欢而已 提交于 2020-03-23 01:03:06
Create a Docker network You will need to create a custom network to allow the containers todiscover and communicate with each other. In this examplekong-netis thenetwork name, you can use any name. $ docker network create kong-net Start your database If you wish to use a Cassandra container: $ docker run -d --name kong-database \ --network=kong-net \ -p 9042:9042 \ cassandra:3 If you wish to use a PostgreSQL container: $ docker run -d --name kong-database \ --network=kong-net \ -p 5432:5432 \ -e "POSTGRES_USER=kong" \ -e "POSTGRES_DB=kong" \ postgres:9.6 Prepare your database Run the

Kong api 网关 安装简单应用

流过昼夜 提交于 2020-03-23 01:02:51
Kong是一个可伸缩的开源API层(也称为API网关或API中间件)。Kong最初是由Kong Inc.(前身为Mashape)建造的,用于为其API市场提供超过15000个微服务,每月产生数十亿个请求。 在经过实战检验的NGINX的支持下,该公司专注于高性能,在2015年成为开源平台。在积极的发展下,Kong现在已被用于从创业公司到大型企业和政府部门的数百个组织的生产,包括:《纽约时报》 支持 权限控制,安全,负载均衡,请求分发,监控,限流 等等。 github : docker安装 :https://github.com/Kong/docker-kong Kong 源码:https://github.com/Kong/kong 官网地址:https://getkong.org/ 官网文档:https://getkong.org/docs/0.12.x/proxy/ 安装: cd /data/ git clone https://github.com/Kong/docker-kong.git cd docker-kong/compose docker-compose up -d Kong 项目会监控两个端口,一个是 8000,一个是 8001。 8000端口是可以给用户访问,就是说用户发送请求先到 Kong 项目的 8000 端口,然后Kong 项目帮你转到你的后端应用api。

KONG 可视化管理及接口访问

懵懂的女人 提交于 2020-03-19 15:06:51
1 Konga UI基本使用 一般访问地址: http://192.168.1.70:8080 1.1 Step1:创建upstream 1.1.1 【样例】 Name=>VCSAPI_SERVER Slot=>1000 1.2 Step2:配置upstream target 1.2.1 【样例】 多个节点,配置多个target即可。 Target=>192.168.10.30:8080 Weight=>100 1.3 Step3:添加API Service 1.3.1 【样例】 Name=>VCSAPI-SERVICE HOST=>VCSAPI_SERVER(注:对应upstream name) port=>80 path=>/vcs(注:对应目标转发路径,根据实际部署context调整) 1.4 Step4:配置API路由 1.4.1 【样例】 Service=>VCSAPI-SERVICE paths=>/vcs(注:客户端请求路径,根据实际部署调整) Preserve Host:true 客户端请求的HOST通过kong透传到上游服务。 Strip path:true,是否删除匹配的url前缀字符。 1.5 Step5:配置consumer 1.5.1 【样例】 username=>icfw 1.6 Step6:配置用户JWT认证 1.6.1 【样例】 End-Point

todo---git 生成密钥 原理分析

|▌冷眼眸甩不掉的悲伤 提交于 2020-03-08 11:57:15
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDRJkDZ2z7syFC2QDCaORKF41ecwbL/kyFwkycOVE3MavTRBliAhoAhOaZQTr4jxckbzQBufdRcBxqqghyJ15aztJOfm1IANUiFQq+yAu9n/tGeweUXF9n2HxY5hMCbunClSaB8AU7HP16N3iKz2KAyUn7bjET0ynREYIhpkj0RSnUUczR2Y55IaZzuf1BXAbBHI2I31Nu2hLYnl7W/M/UUdL9BAQg0qGMNg+apKyaUKQVlVd/nQk7hN3Ylw9u9TKqv6kBgRQATutxRIQALkLjI6/44pl1CpWcNQLRNZBdqXfdo6gpBlPtt/wpNRAOF3g7wsbXijmrWT5s0ejHhCVuj shoshana_kong@126.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDRJkDZ2z7syFC2QDCaORKF41ecwbL/kyFwkycOVE3MavTRBliAhoAhOaZQTr4jxckbzQBufdRcBxqqghyJ15aztJOfm1IANUiFQq+yAu9n