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.
Archen is a simple, flexible and fast GraphQL library written in Typescript.
$ npm install archen
Archen is ridiculously easy to use. In the simplest form, it requires nothing more than the details to connect to an existing database. Below is an example to add GraphQL API to a MySQL database:
const { Archen } = require('archen');
const archen = new Archen({
database: {
connection: {
dialect: 'postgres',
connection: {
user: 'root',
password: 'secret',
database: 'example'
}
}
}
});
await archen.bootstrap();
const source = `
query {
users {
id
email
}
}
`;
const result = await archen.query({ source });
// console.log(result.users);
Archen provides a command line tool that lets you add GraphQL API to your existing databases without writing any code:
$ npm install express express-graphql mysql archen
$ node_modules/archen/bin/archen.js --user root --password secret --database example --listen 3000
Now you can open a browser and go to http://localhost:3000/graphql to interact with an automatically generated GraphQL server by Archen.
Archen can be configured using an ArchenConfig
object.
By default, archen exports all models and fields to the GraphQL API. To stop a model from being exported, add an entry in graphql.models
field and set it to false. The following config shows how to export all models except for User
:
{
graphql: {
models: {
User: false
}
}
}
Setting graphql.allowAll
to false
stops all models being exported to the API by default. The following config exports only Product
and Category
to the API:
{
graphql: {
allowAll: false,
models: {
Product: true,
Category: true
}
}
}
The following config forbids creating User
objects via the generated API:
{
graphql: {
models: {
User: {
create: false,
},
}
}
}
# Test for SQLite
$ DB_TYPE=sqlite3 npm run test
# Test for Postgres
$ DB_TYPE=postgres DB_USER=postgres npm run test
# Test for MySQL
$ DB_TYPE=mysql DB_USER=root DB_PASS=secret npm run test
FAQs
Archen - Add GraphQL API to your existing applications
The npm package archen receives a total of 24 weekly downloads. As such, archen popularity was classified as not popular.
We found that archen 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.