Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@yorkjs/wechat
Advanced tools
整合微信常用的授权、支付、分享方法。
<script src="https://unpkg.com/@yorkjs/wechat"></script>
npm install @yorkjs/wechat
yarn add @yorkjs/wechat
参考微信授权文档:
import wechat from '@yorkjs/wechat'
// 初始化需要的对象
// storage 存储对象,包含 get/set/remove 方法
// getTimestamp 获取当前时间的方法(毫秒)
wechat.init({
storage: {
get(key) {
return localStorage.getItem(key)
},
set(key, value) {
localStorage.setItem(key, value)
},
remove(key) {
localStorage.removeItem(key)
}
},
getTimestamp() {
return Date.now()
},
})
// 发起微信授权 componentAppId 可选(第三方授权账号使用)
wechat.startAuth(state, url, appId, componentAppId)
// 解析授权返回的 state 和 code
// checkRule 校验规则,可选
// {
// expireSeconds: 10, // 过期秒数
// once: true, // 是否只读一次
// }
wechat.getAuthQuery(url, checkRule)
// 成功后,结束授权,清理内部相关信息
wechat.endAuth(state)
参考微信网页开发 JS-SDK 说明文档:
https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html
// wx: 微信网页内的 wx 对象
// signatrue: 签名
// jsApiList: js 接口列表
// shareInfo: 分享的内容
// debug: 是否开启调试
wechat
.share((wx, signature, jsApiList, shareInfo, debug)
.then(() => {})
.catch(() => {})
参考微信支付文档:
https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_7
// params 参数,参考微信支付文档的 getBrandWCPayRequest 参数定义
wechat.pay(params)
.then(() => {})
.catch(() => {})
FAQs
process wechat auth/pay/share tool
The npm package @yorkjs/wechat receives a total of 18 weekly downloads. As such, @yorkjs/wechat popularity was classified as not popular.
We found that @yorkjs/wechat demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.