
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
node-api-connector
Advanced tools
安装
npm install node-api-connector
添加到 express
var g = new guard({
PACKAGE_HOME: __dirname + '/package',
/* api 配置 */
api: {
use: function(appid, callback) {
callback(null, {
'store': true,
'wx_conf': true,
'wx_oauth': true,
'wx_pay': true
});
},
conf: {
get: function(appid, config, callback) {
for(var key in config){
if(key == 'appid'){
config['appid'] = 'wx50d746e9d0f0af1d';//'wx22fb445469f289a2';
}
}
callback(null, config);
}
},
data: {
save: function(appid, apiname, data,callback){
console.log('==== data ====');
console.log(appid + ':' + apiname);
console.log(data);
callback(null,null);
}
},
called: function(appid,apiname,ip,refer){
//TODO
}
},
/* 保存API返回数据*/
data: function(appid,apiname,data,callback){
callback(null);
}
});
app.use(g.proxy);
opt 说明:
endpoint: /mkit.js
method: GET
验证: none
参数:
none
说明:
前端 js 类库
测试:
http://localhost:8000/mkit.js
endpoint: /{appid}/fn.js
method: GET
验证: none
参数:
appid: appid, 必填
说明:
前端 api.js 加载完成之后会加载此文件, 在添 mkit 中添加指定app的前端接口
测试:
http://localhost:8000/foo/fn.js
endpoint: /{appid}/endpoint/{wx_conf}
method: GET
验证: none
参数:
appid: appid, 必填
说明:
不同 API 接口被前端调用的中间地址, 服务器根据此地址转发到真正的
地址 (manifest.json 文件中)上
测试:
http://localhost:8000/foo/endpoint/wx_conf
endpoint: /api/list
验证: none
参数:
none
说明:
获取所有已公开的API列表
测试:
http://localhost:8000/api/list
endpoint: /api/{apiname}
验证:
none
参数:
apiname: api name, 必填
说明:
获取某个API详情, 包括标题, 描述, 及配置信息等, 但不包含 doc
测试:
http://localhost:8000/api/wechat_conf
endpoint: /api/{apiname}/doc
验证: none
参数:
apiname: api name, 必填
说明:
获取某个 API markdown content
测试:
http://localhost:8000/api/wechat_conf/doc
endpoint: /{uid}/{appid}/{apiname}/conf
方法: GET
验证: none
参数:
uid: 必填
appid: 必填
apiname: 必填
说明:
获取某个 API 配置
测试:
http://localhost:8000/uid/appid/store/conf
endpoint: /{uid}/{appid}/{apiname}/conf
方法: POST
验证: none
参数:
uid: 必填
appid: 必填
apiname: 必填
说明:
更新配置到 API, 通过form key value提交, key 的约定形式见文档;
FAQs
node-api-connector
We found that node-api-connector demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.