Socket
Socket
Sign inDemoInstall

rate-limiter-flexible

Package Overview
Dependencies
Maintainers
1
Versions
163
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rate-limiter-flexible - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

18

lib/RateLimiterPostgres.js

@@ -59,3 +59,3 @@ const RateLimiterStoreAbstract = require('./RateLimiterStoreAbstract');

name: 'rlflx-clear-expired',
text: `DELETE FROM ${this.tableName} WHERE expire < $1`,
text: `DELETE FROM "${this.tableName}" WHERE expire < $1`,
values: [expire],

@@ -154,3 +154,3 @@ };

_getCreateTableStmt() {
return `CREATE TABLE IF NOT EXISTS ${this.tableName} (
return `CREATE TABLE IF NOT EXISTS "${this.tableName}" (
key varchar(255) PRIMARY KEY,

@@ -257,4 +257,4 @@ points integer NOT NULL DEFAULT 0,

: ` CASE
WHEN ${this.tableName}.expire <= $4 THEN $3
ELSE ${this.tableName}.expire
WHEN "${this.tableName}".expire <= $4 THEN $3
ELSE "${this.tableName}".expire
END `;

@@ -265,7 +265,7 @@

text: `
INSERT INTO ${this.tableName} VALUES ($1, $2, $3)
INSERT INTO "${this.tableName}" VALUES ($1, $2, $3)
ON CONFLICT(key) DO UPDATE SET
points = CASE
WHEN (${this.tableName}.expire <= $4 OR 1=${forceExpire ? 1 : 0}) THEN $2
ELSE ${this.tableName}.points + ($2)
WHEN ("${this.tableName}".expire <= $4 OR 1=${forceExpire ? 1 : 0}) THEN $2
ELSE "${this.tableName}".points + ($2)
END,

@@ -287,3 +287,3 @@ expire = ${expireQ}

text: `
SELECT points, expire FROM ${this.tableName} WHERE key = $1 AND (expire > $2 OR expire IS NULL);`,
SELECT points, expire FROM "${this.tableName}" WHERE key = $1 AND (expire > $2 OR expire IS NULL);`,
values: [rlKey, Date.now()],

@@ -310,3 +310,3 @@ })

name: 'rlflx-delete',
text: `DELETE FROM ${this.tableName} WHERE key = $1`,
text: `DELETE FROM "${this.tableName}" WHERE key = $1`,
values: [rlKey],

@@ -313,0 +313,0 @@ })

{
"name": "rate-limiter-flexible",
"version": "3.0.0",
"version": "3.0.1",
"description": "Node.js rate limiter by key and protection from DDoS and Brute-Force attacks in process Memory, Redis, MongoDb, Memcached, MySQL, PostgreSQL, Cluster or PM",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc