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.
@nest-lab/throttler-storage-redis
Advanced tools
Redis storage provider for the @nestjs/throttler package
Redis storage provider for the @nestjs/throttler package.
yarn add @nest-lab/throttler-storage-redis ioredis
npm install --save @nest-lab/throttler-storage-redis ioredis
Basic usage:
import { ThrottlerModule, seconds } from '@nestjs/throttler';
import { ThrottlerStorageRedisService } from '@nest-lab/throttler-storage-redis';
import Redis from 'ioredis';
@Module({
imports: [
ThrottlerModule.forRoot({
throttlers: [{ limit: 5, ttl: seconds(60) }],
// Below are possible options on how to configure the storage service.
// default config (host = localhost, port = 6379)
storage: new ThrottlerStorageRedisService(),
// connection url
storage: new ThrottlerStorageRedisService('redis://'),
// redis object
storage: new ThrottlerStorageRedisService(new Redis()),
// redis clusters
storage: new ThrottlerStorageRedisService(
new Redis.Cluster(nodes, options)
),
}),
],
})
export class AppModule {}
Inject another config module and service:
import { ThrottlerModule } from '@nestjs/throttler';
import { ThrottlerStorageRedisService } from '@nest-lab/throttler-storage-redis';
@Module({
imports: [
ThrottlerModule.forRootAsync({
imports: [ConfigModule],
inject: [ConfigService],
useFactory: (config: ConfigService) => ({
throttlers: [
{
ttl: config.get('THROTTLE_TTL'),
limit: config.get('THROTTLE_LIMIT'),
},
],
storage: new ThrottlerStorageRedisService(),
}),
}),
],
})
export class AppModule {}
Bugs and features related to the redis implementation are welcome in this repository.
NestJS Throttler Redis Storage is licensed under the MIT license.
FAQs
Redis storage provider for the @nestjs/throttler package
The npm package @nest-lab/throttler-storage-redis receives a total of 17,852 weekly downloads. As such, @nest-lab/throttler-storage-redis popularity was classified as popular.
We found that @nest-lab/throttler-storage-redis demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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’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.