
Security News
OpenGrep Restores Fingerprinting in JSON and SARIF Outputs
OpenGrep has restored fingerprint and metavariable support in JSON and SARIF outputs, making static analysis more effective for CI/CD security automation.
Wechat Official Account API (微信公众平台API) middleware for koajs
var app = require('koa')()
var wechat = require('koa-wechat')
app.use(wechat({ token: 'wechat_token' }))
To use this with weixin-robot
:
// Get the robot
app.use(function *(next) {
var media_id = this.path.split('/')[1]
if (!media_id) {
this.throw(404)
}
var webot = yield Webot.get(media_id)
if (!webot) {
this.throw(404)
}
this.webot = webot
this.wx_token = webot.wx_token
yield next
})
app.use(wechat())
app.use(session({ store: redisc('webot:session:') }))
// do the reply
app.use(function *(next) {
var info = this.req.body
info.session = this.session
this.body = yield this.webot.reply(info)
yield next
})
// an empty handler to prevent any following middlewares
app.use(wechat.close())
Token assigned to wechat API.
Find the token from a ctx
property, i.e., this[tokenProp]
Whether we need to check signature or not, default to true
.
By default, koa-wechat will set a this.sessionId
to identify (a offical account + a subscriber)
as an unique session. Then you can safely use koa-session
middleware to save an subscriber's session.
You can set options.session
to false
to disable this behavior.
FAQs
wechat offical account API middleware for koajs
The npm package koa-wechat receives a total of 10 weekly downloads. As such, koa-wechat popularity was classified as not popular.
We found that koa-wechat 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
OpenGrep has restored fingerprint and metavariable support in JSON and SARIF outputs, making static analysis more effective for CI/CD security automation.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.