
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Model-based dynamic multi-level APIs for any provider, plus multiple consumption channels
Lightweight framework for building dynamic multi-level APIs for any provider (Express, socket.io, etc.), consumable via multiple channels (HTTP, socket.io, etc.)
API Core is in beta
and NOT ready for production use.
To install the latest version, use NPM:
$ npm install api-core
In API Core every API is built from edges. An edge defines operations and relations of a Data Model.
Every edge provides the following operations:
Every operation provides standard features like filtering, sorting, population and pagination.
Also every operation is available via all enabled channels.
So while you can list students via a HTTP request, you also can do the same via a socket.io message or any custom channel defined by you.
You can use API Providers to make your API consumable via different channels.
We have (or working on) providers for the following channels:
Also you can implement your own API provider.
Every API requires a set of data models. As with API Providers, you have a bunch of options when choosing your library for creating the models.
We have (or working on) data model libraries for the following frameworks:
Also you can implement your own API model library.
We have two working examples in the following repository, one with a local in-memory model (master branch) and one with a Mongoose model (mongodb branch).
Working Demo: api-demo
A complete API with 5 models and relations in 77 lines:
import {ApiEdgeError, OneToOneRelation, OneToManyRelation, ApiEdgeQueryResponse, Api} from "api-core";
import {MongooseModelFactory} from "api-model-mongoose";
import {EllipseApiRouter} from "api-provider-ellipse";
import * as mongoose from "mongoose";
const Ellipse = require('ellipse'),
app = new Ellipse;
mongoose.Promise = global.Promise;
mongoose.connect("mongodb://localhost/api-demo");
const studentEdge =
MongooseModelFactory.createModel("student", "students", {
id: String,
firstName: String,
lastName: String,
email: String,
phone: String,
schoolId: mongoose.Schema.Types.ObjectId,
classId: mongoose.Schema.Types.ObjectId
}),
classEdge =
MongooseModelFactory.createModel("class", "classes", {
id: String,
name: String,
semester: String,
room: String,
schoolId: mongoose.Schema.Types.ObjectId
}),
courseEdge =
MongooseModelFactory.createModel("course", "courses", {
id: String,
name: String,
classId: mongoose.Schema.Types.ObjectId,
courseTypeId: mongoose.Schema.Types.ObjectId
}),
courseTypeEdge =
MongooseModelFactory.createModel("courseType", "courseTypes", {
id: String,
name: String
}),
schoolEdge =
MongooseModelFactory.createModel("school", "schools", {
id: String,
name: String,
address: String,
phone: String
});
const api10
= new Api('1.0')
.edge(studentEdge);
const api11
= new Api('1.1')
.edge(studentEdge)
.edge(classEdge)
.edge(courseEdge)
.edge(courseTypeEdge)
.edge(schoolEdge)
.relation(new OneToOneRelation(courseEdge, courseTypeEdge))
.relation(new OneToManyRelation(courseTypeEdge, courseEdge))
.relation(new OneToManyRelation(studentEdge, courseEdge))
.relation(new OneToOneRelation(studentEdge, classEdge))
.relation(new OneToOneRelation(studentEdge, schoolEdge))
.relation(new OneToOneRelation(classEdge, schoolEdge))
.relation(new OneToOneRelation(courseEdge, classEdge))
.relation(new OneToManyRelation(classEdge, studentEdge))
.relation(new OneToManyRelation(classEdge, courseEdge))
.relation(new OneToManyRelation(schoolEdge, studentEdge))
.relation(new OneToManyRelation(schoolEdge, classEdge));
app.use(require('body-parser').json());
const router = new EllipseApiRouter(api11, api10);
router.apply(app);
app.listen(8080);
We maintain high test coverage to provide a reliable framework for your APIs.
To run tests, execute the following NPM commands:
$ npm install
$ npm test
The MIT License. Free forever. :)
FAQs
Model-based dynamic multi-level APIs for any provider, plus multiple consumption channels
The npm package api-core receives a total of 57 weekly downloads. As such, api-core popularity was classified as not popular.
We found that api-core 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.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.