
Security News
PEP 810 Proposes Explicit Lazy Imports for Python 3.15
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
egg-yufu-gameops
Advanced tools
egg-yufu-gameops plugin 工作台玉符插件
// config/plugin.js
exports.yufu = {
enable: true,
package: 'egg-yufu-gameops',
};
通过工作台网关,可以使用此插件,获取访问用户的信息
使用方式,安装后,启用插件,并参考下面的详细配置
请到 config/config.default.js 查看详细配置项说明。
// config/config.*.js
module.exports = {
yufu: {
header: {
userId: 'x-user-id', // 用户id的请求头字段
userName: 'x-user-name', // 用户名的请求头字段
},
verifyHeader: (headers) => { return true }, // 校验:校验请求头;
verifyUser: ({ userId, userName }) => { return true }, // 校验:校验解析出来的用户信息;
default_id: 1, // 无法解析时默认返回的 id
default_user: 'rtx-name', // 无法解析时默认返回的 user
exclude: path => !path, // 判断输入的路径是否为要排除的目录
handleError: ({ ctx, ret, msg }) => { ctx.body = { ret, msg }; }, // 如何处理错误
processHeader: (headers) => { return {}; }, // 自定义header处理,最终数据会加到返回的用户信息里
},
};
ctx.yufu; // { userId // 用户ID, userName // 用户名, headers // 请求头原始数据 }
FAQs
egg yufu gameops plugin
We found that egg-yufu-gameops 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
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.