@libfintech/api-gateway-plugin 0.1.18 → 0.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/authe/index.js +7 -0
  2. package/package.json +1 -1
package/authe/index.js CHANGED
@@ -237,7 +237,14 @@ async function main(pipeline, configs) {
237
237
  if (!req.headers)
238
238
  req.headers = {};
239
239
 
240
+ // 防止人为注入
241
+ delete req.headers["X-Session"];
242
+ delete req.headers["X-Account-Id"];
243
+ delete req.headers["X-Wechat-Open-Id"];
244
+
240
245
  if (session) {
246
+ //注入X-Session
247
+ req.headers["X-Session"] = Buffer.from(JSON.stringify(session)).toString('base64');
241
248
  //注入X-Account-Id
242
249
  req.headers["X-Account-Id"] = session["accountId"];
243
250
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libfintech/api-gateway-plugin",
3
- "version": "0.1.18",
3
+ "version": "0.1.20",
4
4
  "description": "api gateway plugin",
5
5
  "repository": {
6
6
  "type": "git",