
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
apollo-server-cache-redis
Advanced tools
[](https://badge.fury.io/js/apollo-server-cache-redis) [](https://circleci.com/gh/apollograph
This package exports an implementation of KeyValueCache
that allows using Redis as a backing store for resource caching in Data Sources.
It currently supports a single instance of Redis, Cluster and Sentinel.
This package is built to be compatible with the ioredis Redis client. The recommended usage is to use the BaseRedisCache
class which takes either a client
option (a client that talks to a single server) or a noMgetClient
option (a client that talks to Redis Cluster). (The difference is that ioredis only supports the mget
multi-get command in non-cluster mode, so using noMgetClient
tells BaseRedisCache
to use parallel get
commands instead.)
You may also use the older RedisCache
and RedisClusterCache
classes, which allow you to pass the ioredis constructor arguments directly to the cache class's constructor.
const { BaseRedisCache } = require('apollo-server-cache-redis');
const Redis = require('ioredis');
const server = new ApolloServer({
typeDefs,
resolvers,
cache: new BaseRedisCache({
client: new Redis({
host: 'redis-server',
}),
}),
dataSources: () => ({
moviesAPI: new MoviesAPI(),
}),
});
const { BaseRedisCache } = require('apollo-server-cache-redis');
const Redis = require('ioredis');
const server = new ApolloServer({
typeDefs,
resolvers,
cache: new BaseRedisCache({
client: new Redis({
sentinels: [{
host: 'sentinel-host-01',
port: 26379
}],
password: 'my_password',
name: 'service_name',
}),
}),
dataSources: () => ({
moviesAPI: new MoviesAPI(),
}),
});
const { BaseRedisCache } = require('apollo-server-cache-redis');
const Redis = require('ioredis');
const server = new ApolloServer({
typeDefs,
resolvers,
cache: new BaseRedisCache({
noMgetClient: new Redis.Cluster(
[{
host: 'redis-node-01-host',
// Options are passed through to the Redis cluster client
}],
{
// Redis cluster client options
}
),
}),
dataSources: () => ({
moviesAPI: new MoviesAPI(),
}),
});
For documentation of the options you can pass to the underlying redis client, look here.
FAQs
[](https://badge.fury.io/js/apollo-server-cache-redis) [](https://circleci.com/gh/apollograph
The npm package apollo-server-cache-redis receives a total of 13,228 weekly downloads. As such, apollo-server-cache-redis popularity was classified as popular.
We found that apollo-server-cache-redis 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
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.