From 144db5217a6467f9bcf735e4565eb903cae4f5d9 Mon Sep 17 00:00:00 2001 From: Jruif <597710271@qq.com> Date: Wed, 19 Feb 2020 18:50:02 +0800 Subject: [PATCH 01/10] Update README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit YApi 的客户列表添加 伴鱼 --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 389f02d9..b47ba434 100755 --- a/README.md +++ b/README.md @@ -106,6 +106,7 @@ YApi 是高效易用功能强大 * 新浪 * VIPKID * 马蜂窝 +* 伴鱼 ### Authors * [hellosean1025](https://github.com/hellosean1025) From 2c9eed93a7b48760d1e8134658cc1a6ef0681cc3 Mon Sep 17 00:00:00 2001 From: Bill Date: Tue, 28 Apr 2020 16:00:16 +0800 Subject: [PATCH 02/10] doc: Add Megvii.com to readme.md Add Megvii.com --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index fda4e2df..d58e41d7 100755 --- a/README.md +++ b/README.md @@ -104,6 +104,7 @@ YApi 是高效易用功能强大 * 新浪 * VIPKID * 马蜂窝 +* 旷视科技 ### Authors * [hellosean1025](https://github.com/hellosean1025) From c12d5de71f519d755625c4e47cfd17fe0ebce2b0 Mon Sep 17 00:00:00 2001 From: wang Date: Mon, 26 Oct 2020 15:13:46 +0800 Subject: [PATCH 03/10] update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7588e805..5ea80366 100755 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ YApi 是高效易用功能强大 * [使用 YApi 管理 API 文档,测试, mock](https://juejin.im/post/5acc879f6fb9a028c42e8822) * [自动更新 Swagger 接口数据到 YApi 平台](https://juejin.im/post/5af500e251882567096140dd) * [自动化测试](https://juejin.im/post/5a388892f265da430e4f4681) +* [GTest(基于YApi)接口研发效能提升10倍 实战](https://mp.weixin.qq.com/s/z66f7bRX8aAOppAtBIB7Uw) ### YApi 插件 * [yapi sso 登录插件](https://github.com/YMFE/yapi-plugin-qsso) From 54f80ac862d7e6e4bb3b2608c646249ea86669ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20Loba=C4=8Devski?= Date: Tue, 1 Dec 2020 11:01:23 +0200 Subject: [PATCH 04/10] Create SECURITY.md Please provide a security contact --- SECURITY.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..9327604f --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,5 @@ +# Security Policy + +## Reporting a Vulnerability + +Please report security issues at xxxxxxxxxxxx@yyyyyyyyyyy.com From 43794487aa596204484fbf7e6f9ced0ae0e0086a Mon Sep 17 00:00:00 2001 From: duicym <281116094@qq.com> Date: Thu, 10 Dec 2020 20:29:40 +0800 Subject: [PATCH 05/10] Update plugin-list.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 定时自动测试发送钉钉插件 --- docs/documents/plugin-list.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/documents/plugin-list.md b/docs/documents/plugin-list.md index 826c7d3d..b7f0da0f 100644 --- a/docs/documents/plugin-list.md +++ b/docs/documents/plugin-list.md @@ -7,4 +7,5 @@ Fork [yapi](https://github.com/YMFE/yapi), 然后修改 docs/documents/plugin-li * [qsso](https://github.com/ymfe/yapi-plugin-qsso) sso 第三方登录 * [import-rap](https://github.com/wxxcarl/yapi-plugin-import-rap) 从rap中导入项目 * [export-docx-data](https://github.com/inceptiongt/Yapi-plugin-export-docx-data) 数据导出docx文档 -* [import-swagger-customize](https://github.com/follow-my-heart/yapi-plugin-import-swagger-customize) 导入指定swagger接口 \ No newline at end of file +* [import-swagger-customize](https://github.com/follow-my-heart/yapi-plugin-import-swagger-customize) 导入指定swagger接口 +* [autotest](https://github.com/duicym/yapi-plugin-autotest) 定时自动测试发送钉钉插件 From df1fb4154cd6ced452f642265074e338b513714a Mon Sep 17 00:00:00 2001 From: PandaEye <2636015706@qq.com> Date: Wed, 28 Apr 2021 21:02:30 +0800 Subject: [PATCH 06/10] Update README.md add SwiftJSONModeler --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7588e805..221c55e8 100755 --- a/README.md +++ b/README.md @@ -75,6 +75,7 @@ YApi 是高效易用功能强大 ### 代码生成 * [yapi-to-typescript:根据 YApi 的接口定义生成 TypeScript 的请求函数](https://github.com/fjc0k/yapi-to-typescript) * [yapi-gen-js-code: 根据 YApi 的接口定义生成 javascript 的请求函数](https://github.com/hellosean1025/yapi-gen-js-code) +* [SwiftJSONModeler:根据 YApi 的接口生成 Swift 模型代码](https://github.com/CodeOcenS/SwiftJSONModeler) ### YApi docker部署(非官方) * [使用 alpine 版 docker 镜像快速部署 yapi](https://www.jianshu.com/p/a97d2efb23c5) From 37f7e55a07ca1c236cff6b0f0b00e6ec5063c58e Mon Sep 17 00:00:00 2001 From: ariesly Date: Fri, 25 Jun 2021 11:57:19 +0800 Subject: [PATCH 07/10] fix: fixed_sandbox_bug --- exts/yapi-plugin-advanced-mock/server.js | 2 +- package.json | 7 ++++--- server/utils/commons.js | 9 +++++---- server/utils/sandbox.js | 16 ++++++++++++++++ 4 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 server/utils/sandbox.js diff --git a/exts/yapi-plugin-advanced-mock/server.js b/exts/yapi-plugin-advanced-mock/server.js index ff4fa875..4b2500e4 100644 --- a/exts/yapi-plugin-advanced-mock/server.js +++ b/exts/yapi-plugin-advanced-mock/server.js @@ -207,6 +207,6 @@ module.exports = function() { // mock 脚本 let script = data.mock_script; - yapi.commons.handleMockScript(script, context); + await yapi.commons.handleMockScript(script, context); }); }; diff --git a/package.json b/package.json index 5513ae1a..d6102e3d 100644 --- a/package.json +++ b/package.json @@ -74,16 +74,17 @@ "node-schedule": "^1.3.2", "nodemailer": "4.0.1", "os": "0.1.1", + "qs": "^6.7.0", "request": "2.81.0", + "safeify": "^5.0.5", "sha.js": "2.4.9", "sha1": "1.1.1", "swagger-client": "^3.5.1", "tslib": "1.8.0", "underscore": "1.8.3", "url": "0.11.0", - "yapi-plugin-qsso": "^1.1.0", - "qs": "^6.7.0", - "vm2": "^3.8.4" + "vm2": "^3.8.4", + "yapi-plugin-qsso": "^1.1.0" }, "devDependencies": { "antd": "3.2.2", diff --git a/server/utils/commons.js b/server/utils/commons.js index b643acd3..03c76992 100755 --- a/server/utils/commons.js +++ b/server/utils/commons.js @@ -13,6 +13,7 @@ const json5 = require('json5'); const _ = require('underscore'); const Ajv = require('ajv'); const Mock = require('mockjs'); +const sandboxFn = require('./sandbox') @@ -576,7 +577,7 @@ ${JSON.stringify(schema, null, 2)}`) // script 是断言 if (globalScript) { logs.push('执行脚本:' + globalScript) - result = yapi.commons.sandbox(context, globalScript); + result = await sandboxFn(context, globalScript); } } @@ -585,7 +586,7 @@ ${JSON.stringify(schema, null, 2)}`) // script 是断言 if (script) { logs.push('执行脚本:' + script) - result = yapi.commons.sandbox(context, script); + result = await sandboxFn(context, script); } result.logs = logs; return yapi.commons.resReturn(result); @@ -613,7 +614,7 @@ exports.getUserdata = async function getUserdata(uid, role) { }; // 处理mockJs脚本 -exports.handleMockScript = function (script, context) { +exports.handleMockScript = async function (script, context) { let sandbox = { header: context.ctx.header, query: context.ctx.query, @@ -632,7 +633,7 @@ exports.handleMockScript = function (script, context) { var parts = Cookie.split('='); sandbox.cookie[parts[0].trim()] = (parts[1] || '').trim(); }); - sandbox = yapi.commons.sandbox(sandbox, script); + sandbox = await sandboxFn(sandbox, script); sandbox.delay = isNaN(sandbox.delay) ? 0 : +sandbox.delay; context.mockJson = sandbox.mockJson; diff --git a/server/utils/sandbox.js b/server/utils/sandbox.js new file mode 100644 index 00000000..db65c042 --- /dev/null +++ b/server/utils/sandbox.js @@ -0,0 +1,16 @@ +const Safeify = require('safeify').default; + +module.exports = async function sandboxFn(context, script) { + // 创建 safeify 实例 + const safeVm = new Safeify({ + timeout: 3000, + asyncTimeout: 60000 + }) + + // 执行动态代码 + const result = await safeVm.run(script, context) + + // 释放资源 + safeVm.destroy() + return result +} From d7e06446a61acb28fabe4bdc70b7099e133eec83 Mon Sep 17 00:00:00 2001 From: aweleey Date: Tue, 20 Jul 2021 13:46:22 +0800 Subject: [PATCH 08/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7588e805..ccbfe895 100755 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ 体验地址: -[https://yapi.baidu.com](https://yapi.baidu.com) +[http://yapi.smart-xwork.cn/](http://yapi.smart-xwork.cn/) 文档:

hellosean1025.github.io/yapi

From a53dafaa81be42b1ba0d41bec0712b5de25786a9 Mon Sep 17 00:00:00 2001 From: Mario Luo Date: Sat, 21 Aug 2021 16:34:46 +0800 Subject: [PATCH 09/10] =?UTF-8?q?doc:=20=E5=A2=9E=E5=8A=A0Yapi=20X?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E7=94=9F=E6=88=90=E6=8F=92=E4=BB=B6=E9=93=BE?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ccbfe895..ac14383d 100755 --- a/README.md +++ b/README.md @@ -89,6 +89,7 @@ YApi 是高效易用功能强大 * [idea 一键上传接口到yapi插件](https://github.com/diwand/YapiIdeaUploadPlugin) * [idea 接口上传调试插件 easy-yapi](https://easyyapi.com/) * [执行 postgres sql 的服务](https://github.com/shouldnotappearcalm/http-postgres-server) +* [Yapi X 一键生成接口文档, 上传到yapi, rap2, eolinker等(IDEA插件)](https://github.com/jetplugins/yapix) ### YApi 的一些客户 * 去哪儿 From c51a45a8f7d9b265779ff695aca0039e65f90bb9 Mon Sep 17 00:00:00 2001 From: aweleey Date: Mon, 23 Aug 2021 15:44:45 +0800 Subject: [PATCH 10/10] Update SECURITY.md --- SECURITY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SECURITY.md b/SECURITY.md index 9327604f..c11f46ee 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,4 +2,4 @@ ## Reporting a Vulnerability -Please report security issues at xxxxxxxxxxxx@yyyyyyyyyyy.com +Please report security issues at js@liyi.im