1. Background

When configuring Directus to use DingTalk QR code login, I found that DingTalk’s password-free login (OAuth 2) is not consistent with the RFC specification. Protocol conversion is needed before it can communicate with Directus normally. This is a relatively niche requirement, and there was no existing software available, so I had to build it myself.

2. Main Functions

  1. Can act as a middleware for API communication, forwarding communication between clients and API servers, recording LOGs for convenient protocol analysis;
  2. As a middleware, it can modify request content and response content; it can do protocol adaptation and conversion.

APIPROXY is a RESTFUL API proxy, monitor and adaptor.

Forward RESTFUL API to another host. It’s man in the middle who can monitor and modify the header and body of the API Request & Response. Good for protocol study and adaptation.

Features

  • API proxy: forward any incoming API to remote sever and return the response back to client.
  • API monitor: you can get detailed log of the API req and res in the log file.
  • API adpator: modify the request and response on the fly while forwarding, including parameters, body, http headers etc.
  • API mock server: you can add your own API for testing purpose easily.

3. Current Status

Initially implemented RFC6749-compatible wrapper for DingTalk’s OAuth2 protocol. Currently, Directus can support DingTalk password-free login through its translation.

4. References