Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lambda-serverless-api

Package Overview
Dependencies
Maintainers
1
Versions
396
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lambda-serverless-api - npm Package Compare versions

Comparing version 10.0.0 to 10.0.1

2

lib/plugin/rate-limit.js

@@ -15,2 +15,3 @@ import assert from 'assert';

this.limiter = Limiter({
S3: get(options, 'S3', null),
bucket: get(options, 'bucket', null),

@@ -27,2 +28,3 @@ globalLimit: get(options, 'globalLimit', 200),

identifierPaths: Joi.array().items(Joi.string()).optional(),
S3: Joi.function(),
bucket: Joi.string().optional(),

@@ -29,0 +31,0 @@ // eslint-disable-next-line

6

lib/util/limiter.js

@@ -11,5 +11,7 @@ import crypto from 'crypto';

export default ({ bucket, globalLimit, defaultRouteLimit }) => {
export default ({
S3, bucket, globalLimit, defaultRouteLimit
}) => {
const memoryCache = new LRU({ maxAge: 60 * 1000 });
const storage = Storage(bucket);
const storage = Storage(S3, bucket);

@@ -16,0 +18,0 @@ return async ({

@@ -5,13 +5,4 @@ import assert from 'assert';

import AwsSdkWrap from 'aws-sdk-wrap';
import AWS from './aws.cjs';
const aws = AwsSdkWrap({
logger,
services: {
S3: AWS.S3
}
});
const { s3 } = aws;
export default (bucket) => {
export default (S3, bucket) => {
assert(bucket === null || typeof bucket === 'string');

@@ -21,2 +12,7 @@ const memoryStorage = new LRU({ maxAge: 60 * 1000 });

const { s3 } = AwsSdkWrap({
logger,
services: { S3 }
});
return {

@@ -23,0 +19,0 @@ set: async (key, data) => {

@@ -22,2 +22,3 @@ {

"@blackflux/robo-config-plugin": "7.4.2",
"aws-sdk": "2.1104.0",
"c8": "7.11.0",

@@ -42,3 +43,3 @@ "chai": "4.3.6",

},
"version": "10.0.0",
"version": "10.0.1",
"scripts": {

@@ -100,4 +101,3 @@ "clean": "rm -rf lib",

"turf-polygon": "1.0.3"
},
"peerDependencies": {}
}
}
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