Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dingtalk_suite_callback

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dingtalk_suite_callback - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

5

index.js

@@ -22,4 +22,3 @@ var WXBizMsgCrypt = require('wechat-crypto');

var message = JSON.parse(result.message);
if (message.EventType === 'check_update_suite_url') { //创建套件第一步,验证有效性。
if (message.EventType === 'check_update_suite_url' || message.EventType === 'check_create_suite_url') { //创建套件第一步,验证有效性。
var Random = message.Random;

@@ -65,2 +64,2 @@ result = _jsonWrapper(timestamp, nonce, Random);

}
}

4

package.json
{
"name": "dingtalk_suite_callback",
"version": "0.0.2",
"version": "0.0.3",
"main": "index",

@@ -26,2 +26,2 @@ "keywords": [

}
}
}
# dingtalk suite callback
dingtalk express 中间件。自动验证回调URL有效性。
express中间件。自动验证回调URL有效性。
配合另一个项目:主动调用API [dingtalk_suite](https://github.com/hezedu/dingtalk_suite) 使用。
##安装

@@ -14,5 +16,8 @@ `npm install dingtalk_suite_callback`

suiteid: 'xxxxxxxxxxxx', //第一次验证没有不用填
saveTicket: function(data, callback){//可选,和dd_suite配合使用。
/*data:{value: ticket的字符串, expires:到期时间,钉钉回调时间戳 + 20分钟} */
saveTicket: function(data, callback){//可选,和主动调用API: dingtalk_suite 配合使用。
//data:{value: ticket字符串, expires:到期时间,钉钉回调时间戳 + 20分钟}
fs.writeFile(this.suiteid + 'ticket.txt',JSON.stringify(data), callback);
}
}

@@ -24,5 +29,4 @@

switch (message.EventType) {
case 'tmp_auth_code': //企业号临时授权码
/*{ AuthCode: '6b4294d637a0387eb36e6785451ff845',

@@ -32,3 +36,4 @@ EventType: 'tmp_auth_code',

TimeStamp: '1452665779818' }*/
//使用 dingtalk_suite 获取永久授权码
res.reply();

@@ -38,6 +43,6 @@ break;

case 'change_auth': //授权变更消息
res.reply();
break;
case 'suite_relieve': //解除授权消息
/*{ AuthCorpId: 'ding5bfeb97afcccb984',

@@ -50,11 +55,13 @@ EventType: 'suite_relieve',

break;
case 'suite_ticket': //ticket,间隔20分。如果有config.saveTicket 不会触发。
/*{
EventType: 'suite_ticket',
/*{ EventType: 'suite_ticket',
SuiteKey: 'suitexpiycccccccccchj',
SuiteTicket: 'wrEooJqhQlNcWU327mtr20yzWkPtea9LOm0P8w2M3MDjRPUYY5Tu9fspDhZ8HPXeP5yzKuorHIQ0P9GSU5evAc',
TimeStamp: '1452328049089'}保存到数据库*/
TimeStamp: '1452328049089'}*/
res.reply();
break;
default:

@@ -61,0 +68,0 @@ message.name = 'ddtalk unknow EventType';

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc