All Projects → hidu → api-front

hidu / api-front

Licence: MIT License
api统一前端、转发代理、协议分析、流量复制

Programming Languages

go
31211 projects - #10 most used programming language
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to api-front

bff
A proxy to help your team adopt the Backend for Frontend (BFF) cloud pattern
Stars: ✭ 17 (-82.47%)
Mutual labels:  api-gateway
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 (-38.14%)
Mutual labels:  api-gateway
lambda-redirector
Redirect an entire website using AWS Lambda
Stars: ✭ 21 (-78.35%)
Mutual labels:  api-gateway
kong-ui
UI for KONG API Gateway
Stars: ✭ 20 (-79.38%)
Mutual labels:  api-gateway
serverless-event-gateway-plugin
Event Gateway plugin for Serverless Framework
Stars: ✭ 29 (-70.1%)
Mutual labels:  api-gateway
aws-swaggerui
Serverless Swagger UI for API Gateway
Stars: ✭ 26 (-73.2%)
Mutual labels:  api-gateway
api-lambda-save-dynamodb
Deploy instantly on Serverless Application Repository
Stars: ✭ 55 (-43.3%)
Mutual labels:  api-gateway
mangum-cli
CLI tools for use with Mangum
Stars: ✭ 14 (-85.57%)
Mutual labels:  api-gateway
phi
an api-gateway based on openresty
Stars: ✭ 23 (-76.29%)
Mutual labels:  api-gateway
hango-gateway
Hango API Gateway, build on Envoy & Istio.
Stars: ✭ 306 (+215.46%)
Mutual labels:  api-gateway
fastify-gateway
A Node.js API gateway that just works!
Stars: ✭ 88 (-9.28%)
Mutual labels:  api-gateway
tyk-operator
Tyk Operator for Kubernetes
Stars: ✭ 88 (-9.28%)
Mutual labels:  api-gateway
crank4go
API Gateway implemented in Golang
Stars: ✭ 124 (+27.84%)
Mutual labels:  api-gateway
snaily-cadv4
💻 An open source Computer Aided Dispatch (CAD) for FiveM, this is a web based integration for communities who love police roleplaying and dispatching. Discord: https://discord.gg/eGnrPqEH7U
Stars: ✭ 36 (-62.89%)
Mutual labels:  dispatch
nestjs-graphql-serverless
Boilerplate for using NestJS with GraphQL (Code-First) on serverless environment (AWS Lambda)
Stars: ✭ 64 (-34.02%)
Mutual labels:  api-gateway
particule
Fine-grained atomic React state management library
Stars: ✭ 31 (-68.04%)
Mutual labels:  dispatch
shim
HTTP Handler shim for Go projects running on AWS Lambda
Stars: ✭ 64 (-34.02%)
Mutual labels:  api-gateway
cfn-api-gateway-custom-domain
API Gateway custom domains as CloudFormation resources, backed by Let's Encrypt
Stars: ✭ 17 (-82.47%)
Mutual labels:  api-gateway
okta-api-center
Get up and running quickly with Okta's OAuth as a Service and your favorite API Gateway.
Stars: ✭ 58 (-40.21%)
Mutual labels:  api-gateway
super-serverless-sample
Backend serverless que simula o sistema de votação do BBB
Stars: ✭ 30 (-69.07%)
Mutual labels:  api-gateway

api-front

version :0.8.1

概述

api front是HTTP API统一前端,用于测试环境api统一管理,主要功能是请求代理转发协议抓包分析流量复制

用于解决如下问题:

  1. HTTP API大行其道,开发调试(特别是联调)花费的时间、人力成本很高。
  2. 后端的API调用是一个黑盒,特别是有问题的时候,基本是抓瞎(目前一般是把请求信息记录到日志中去)。
  3. 线下联调测试环境复杂多变,配置文件经常变动,经常其中一个环境好了另外一个又坏了。
  4. 可将接口的请求历史记录全部记录方便排查问题。
  5. 对返回的结果进行修改,返回再返回给客户端。

两种典型应用场景:

api输出

对外接口统一使用api-front管理,第三方通过api-front调用接口。有问题可随时抓包查看。

api接入

接入外部依赖的api接口统一使用api-front管理,第三方环境变动可轻松切换,有问题也可随时抓包查看。

部署示例

dispatch
api-front作为对外统一api入口。
如上图,可打开页面 http:10.10.2.10/_/ 进行接口管理。(系统自己的接口,页面都是以_开头的)

下载安装

使用go get命令安装:

go get -u github.com/hidu/api-front

运行

api-front -conf ./conf/server.json

配置

主配置文件

conf/server.json

``` { "users":["admin"], "store_api_url":"http://127.0.0.1/test/store.php", "store_view_url":"http://127.0.0.1/test/view.php?host_id={host_id}&api_name={api_name}" } ``` 注:admin用户有所有权限。 store_api_url: 远程保存请求详情的地址,发送post请求(同时需要下列子服务配置中的store=true才会生效) store_view_url: 查看接口历史数据的页面地址

子服务配置

conf/vhost/8080.json

``` { "port": 8080, "group": "order", "name": "order api", "enable": true, "hidden_cookie": true, "note": "订单相关接口", "users": [ "test" ] "store":true } ``` 访问 http://127.0.0.1:8080/ 即可进入管理页面。 注:test用户有当前子服务的所有权限。

用户配置

文件名:conf/users ,普通文本文件:

id:admin psw_md5:7bb483729b5a8e26f73e1831cde5b842 psw:psw
id:test psw_md5:7bb483729b5a8e26f73e1831cde5b842 psw:psw

修改服务配置需要登陆。

登陆控制

默认是采用普通的用户名/密码的认证方式(使用conf/users用户表)。
目前已经支持oauth2来登陆认证,若配置oauth2信息并且enable=true则使用oauth2登陆以进行权限控制。
conf/server.json 配置如下:

{
"users":["xxxx"],
"oauth2":{
  "type":"google",
   "enable":true,
  "client_id":"your client id",
  "client_sk":"your client secret key",
  "scopes":["openid", "email"],
  "auth_url":"https://accounts.google.com/o/oauth2/v2/auth",
  "token_url":"https://accounts.google.com/o/oauth2/token",
   "broken_auth_header":false,
  "apis":{
      "user_info":{
        "url":"https://www.googleapis.com/oauth2/v3/userinfo",
        "field_map":{
            "id":"email"
        }
      }
  }
}
}

broken_auth_header:获取token时是否不支持header模式

apis/user_info/field_map属性是用来进行属性映射的,以解决不同系统返回用户信息不一致的问题,默认值如下:

    //标准名字,当前名字
    "id":        "id",
    "nick_name": "name",
    "email":     "email",
    "picture":   "picture",

###说明 hidden_cookie:在使用协议抓包分析(analysis)是输出到前端的cookie值是否隐藏起来。

界面截图

dispatch

服务列表: dispatch

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].