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.
@devil7softwares/eslint-plugin-axios-swagger
Advanced tools
ESLint plugin to lint routes used in the app with axios using swagger spec.
ESLint plugin to lint routes used in the app with axios using swagger spec.
This plugin takes your swagger spec json files and checks whether the method and routes you use with axios exists.
Install the package
npm install --save-dev @devil7softwares/eslint-plugin-axios-swagger
(or)
yarn add --dev @devil7softwares/eslint-plugin-axios-swagger
Add the plugin to the eslint configuration
{
"plugins": ["@devil7softwares/axios-swagger"]
}
Add rules to the eslint configuratin
{
"rules": {
"@devil7softwares/axios-swagger/no-unknown-route": "error",
"@devil7softwares/axios-swagger/no-unsupported-method": "error"
}
}
Add paths to swagger spec to settings in the eslint configuration
{
"settings": {
"axios-swagger": {
"specs": ["./spec/swagger.json"]
}
}
}
Key | Type | Required | Description |
---|---|---|---|
specs | Array<string> | ✔ | Paths of swagger specification files. Paths should be relative to the package root where the plugin is installed. |
basePath | string | Base path for URL. |
Rule | Description |
---|---|
@devil7softwares/axios-swagger/no-unknown-route | Enforces that no routes that are not specified in the swagger spec can be used |
@devil7softwares/axios-swagger/no-unsupported-method | Enforces that the matched routes are used only with methods specified in the swagger spec |
NOTE: I wrote this plugin for using in my own projects. So, I handled all the scenarios I encountered. I have listed some of the scenarios where this plugin might not work. Feel free to make a pull request to fit your needs or let me know, maybe I'll look into it when I have the time.
get
, post
, put
, delete
methods. e.g. axios.get('/users')
or axios.post('/users', data)
FAQs
ESLint plugin to lint routes used in the app with axios using swagger spec.
We found that @devil7softwares/eslint-plugin-axios-swagger 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.