Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
一个随便封装的多进程 koa 框架
.
├── config
│ ├── default.js
│ ├── pron.js
│ └── dev.js
├── middleware
│ └── ttt.js
├── tools
│ └── redis.js
├── controller
│ └── testController.js
├── service
│ └── test.js
├── app.js
└── package.json
一下目录均不支持嵌套级别
config 配置目录「必需」,会自动读取改目录下的所有文件,配置文件以环境名命名例如:pron,dev,test, default 为默认配置,会与其他配置合并
middleware「非必需」 中间件目录,目前暂时不支持中间件顺序设定,中间件暴露为标准的 koa 中间件 async (ctx, next) => Promise 模式
tools「非必需」 工具目录,以 (app) => void 方式暴露挂载函数,函数内自己手动往某个地方挂载工具,有 app.tools 对象通常可以挂载到这上面
controller 控制器目录「必需」,舍弃了 router 配置,每个控制器代码会传入 app, router, tools 对象 例:
module.exports = (app, router, tools) => {
router.get('/test', async (ctx) => {
try {
ctx.success({ id: app.tools.generateId() })
} catch (err) {
console.error(err)
ctx.error(err)
}
})
}
例:
module.exports = class TestService {
constructor(app) {
this.app = app
this.tools = app.tools
}
}
type app: Koa && {
config: object,
tools: {
generateId: () => bigint
},
logger: {debug, info, error}// winston
service: object,
}
FAQs
一个随便封装的多进程 koa 框架
The npm package koaaaa receives a total of 1 weekly downloads. As such, koaaaa popularity was classified as not popular.
We found that koaaaa 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.