Skip to content

ooclab/ga

Repository files navigation

Guardian Angel

Guardian Angel is a lightweight middleware for service-oriented architecture.

What is the service-oriented here ?

  1. big services : export a http(s) api
  2. small services
    • microservices / nanoservices
    • serverless / FaaS

We don't want to argument the term, we just want to do right job. :-)

ga arch

Current Support:

Current Middlewares:

  • openai : as a gateway of openai, custom your key and limit the request count
  • hello : for example
  • jwt : decode JWT (from Authorization in HTTP Request Header), and set X-User-Id header by user id
  • addauth : manage access_token and refresh_token , add JWT with Authorization in HTTP Request Header auto
  • openapi : authorize permissions and validate request args with OpenAPI 2.0 Spec Document of the backend service
  • debug : print http request data when debug is enable
  • openapi-response : check the response for testing

目录

ga 架构示例:

进展

已完成

  • 支持启动任意数量的 forwarder ,每个 forwarder 可以自由搭配任意数量的 middlewares
  • 支持 golang plugin 方式写自定义的 middleware 。 可以查看示例: hello

TODO

  • 支持提供 TLS 服务:指定证书和私钥或使用 letsencrypt 申请并自动更新证书(参考 caddy 和 traefik )。避免使用文件系统存放证书,而是使用 etcd 存放证书(分布式)。
  • 使用 etcd 或类似服务作为统一分布式存储,主程序和 middleware 都可以使用 etcd 存储和读取数据及配置,提供统一内部 API 供主程序和 middleware 使用。
    • 存储可以考虑单机(kv)或分布式(etcd)2种方式,提供统一的 store 抽象。
    • main, middleware 的配置和数据(监控),以及 let's encrypt 的证书都需要存储。

Contact