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.
@janiscommerce/api-get
Advanced tools
A package to handle JANIS Get APIs
npm install @janiscommerce/api-get
'use strict';
const { ApiGet } = require('@janiscommerce/api-get');
class MyApiGet extends ApiGet {
get fieldsToSelect() {
return [
'id',
'name',
'status'
];
}
async format(record) {
return {
...record,
oneMoreField: true
};
}
_parseFilters({ id, ...otherFilters }) {
return {
...otherFilters,
id: Number(id)
};
}
/**
* Validates the record getted from DB before format.
* @param {Object} The record in DB
**/
async postGetValidate({ name }) {
if(name === FORBIDDEN_NAME) {
this.setCode(403);
throw new Error('Forbidden name');
}
}
}
module.exports = MyApiGet;
All methods are optional
If you have for example, a get API for a sub-entity of one specific record, the parent will be automatically be added as a filter.
For example, the following endpoint: /api/parent-entity/1/sub-entity/2
, will be a get of the sub-entity, and parentEntity: '1'
will be set as a filter.
[4.0.0] - 2020-08-27
@janiscommerce/api
to 6.x.x
FAQs
A package to handle Janis Get APIs
The npm package @janiscommerce/api-get receives a total of 305 weekly downloads. As such, @janiscommerce/api-get popularity was classified as not popular.
We found that @janiscommerce/api-get 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.