Security News
UK Officials Consider Banning Ransomware Payments from Public Entities
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
dingtalk_suite
Advanced tools
钉钉套件主动调用API, 自带cache。
回调server API见:dingtalk_suite_callback
配和企业号 API:dingtalk_enterprise可实现ISV套件控制企业号。
##安装
npm install dingtalk_suite
##示例
构造函数:
var dd_talk = require('dingtalk_suite');
var conf = {
suiteid: 'suitexpiygdnxxxxx',
secret: 'C1oXyeJUgH_QXEHYJS4-Um-zxfxxxxxxxxxxxxxxxxxx-6np3fXskv5dGs',
getTicket: function(callback){
//从数据库中取出Tikcet,返回的data样式为:{value: 'xxxxxxx', expires:1452735301543}
//ticket从 dingtalk_suite_callback 处获得
fs.readFile(this.suiteid + 'ticket.txt',function(err, data){
if(err){
return callback(err);
}
data = JSON.parse(data.toString());
callback(null, data);
});
},
getToken: function(callback){
//从数据库中取出Token,返回的data样式为:{value: 'xxxxxxx', expires:1452735301543}
fs.readFile(this.suiteid + 'token.txt',function(err, data){
if(err){
return callback(err);
}
data = JSON.parse(data.toString());
callback(null, data);
});
},
saveToken: function(data, callback){
//存储Token到数据库中,data样式为:{value: 'xxxxxxx', expires:1452735301543//过期时间}
fs.writeFile(this.suiteid + 'token.txt',JSON.stringify(data), callback);
}
}
var api = new dd_talk(conf);
注:本项目自带cache, token的过期时间默认为1小时59分50秒(防止网络延迟,故比规定2小时少了10秒)。
可以在conf.token_expires_in
更改(不可大于2小时)。
##方法
api.getPermanentCode(tmp_auth_code, callback)
tmp_auth_code字符串,由dingtalk_suite_callback处获得。
//auth_corpid和permanent_code由上面接口获得。
api.getCorpToken(auth_corpid, permanent_code, callback)
api.getAuthInfo(auth_corpid, permanent_code, callback)
api.getAgent(agentid, auth_corpid, permanent_code, callback)
api.activateSuite(auth_corpid, permanent_code, callback)
//ip_whitelist为数组格式:["1.2.3.4","5.6.*.*"]
api.setCorpIpwhitelist(auth_corpid, ip_whitelist, callback)
##更多钉钉相关
ISV套件回调server: dingtalk_suite_callback
企业号API: dingtalk_enterprise
ISV和企业号免登API: dingtalk_sso
FAQs
钉钉套件主动调用api
We found that dingtalk_suite 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
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.