Kong is an API gateway.
Text
Monolithic Architecture → Microservice Architecture
Pros of Monolith Architecture -
Cons of Monolith Architecture -
Pros of Microservice Architecture -
Cons of Microservice Architecture -
Kong is suite of software that utilizes OpenResty to dynamically configure NGINX and process HTTP requests.
Text
Service entities are abstractions of each of your own upstream APIs and microservices.
Route entities define rules to match client requests. Every request matching a given Route will be proxied to its associated Service.
Each Route is associated with a Service, and a single Service can have many Routes.
Plugins allow you to easily add new features to your API or make your API easier to manage.
Consumers are associated to individuals or applications using your API. They can be used for tracking, access management, and more.
Key-Auth. 服务端之间的相互调用。
ACL. 不同的用户组配置不同的访问权限。
JWT. 客户端及第三方调用。
Kong上面针对服务或路由启用JWT插件。
JWT插件上配置consumer和credential。
客户端调用登录接口,服务端验证用户身份后从Kong上面获取JWT的秘钥,然后生成JWT的令牌,返回给用户。
客户端将令牌保存到本地,用于后续接口的调用。