Socket
Socket
Sign inDemoInstall

aws-lambda-middleware

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-lambda-middleware - npm Package Compare versions

Comparing version 0.6.0 to 0.6.1

2

package.json
{
"name": "aws-lambda-middleware",
"version": "0.6.0",
"version": "0.6.1",
"engines": {

@@ -5,0 +5,0 @@ "node": ">=8.3.0"

@@ -257,4 +257,5 @@ # aws-lambda-middleware

#### 0.6.0
#### 0.6.1
- Lambda Payload 2.0 support
- Add Lambda error log

@@ -261,0 +262,0 @@ #### 0.5.3

@@ -88,2 +88,4 @@ const querystring = require('querystring')

} catch (error) {
console.error(error)
if (common.isError(error)) {

@@ -187,8 +189,2 @@ callback(error)

if (event.requestContext && event.requestContext.authorizer && common.isObject(event.requestContext.authorizer)) {
for (let key in event.requestContext.authorizer) {
event.requestContext.authorizer[key] = common.convertDataType(event.requestContext.authorizer[key])
}
}
return event

@@ -195,0 +191,0 @@ }

@@ -89,40 +89,97 @@ const { Middleware, PropTypes } = require('../index')

handler1({
"resource": "/users/create",
"source": "serverless-plugin-warmup",
"path": "/users/create",
"httpMethod": "GET",
"headers": {
"User-Agent": "PostmanRuntime/7.6.0",
"X-Forwarded-For": "175.1.1.1",
"Content-Type": "application/json",
const palyload1 = {
version: '1.0',
resource: '/my/path',
path: '/my/path',
httpMethod: 'GET',
headers: {
'Header1': 'value1',
'Header2': 'value2'
},
"queryStringParameters": {
"username": "test"
multiValueHeaders: {
'Header1': ['value1'],
'Header2': ['value1', 'value2']
},
"multiValueQueryStringParameters": null,
"pathParameters": {
"username": "test"
queryStringParameters: { parameter1: 'value1', parameter2: 'value' },
multiValueQueryStringParameters: { parameter1: ['value1', 'value2'], paramter2: ['value'] },
requestContext: {
accountId: '123456789012',
apiId: 'id',
authorizer: { claims: null, scopes: null },
domainName: 'id.execute-api.us-east-1.amazonaws.com',
domainPrefix: 'id',
extendedRequestId: 'request-id',
httpMethod: 'GET',
identity: {
accessKey: null,
accountId: null,
caller: null,
cognitoAuthenticationProvider: null,
cognitoAuthenticationType: null,
cognitoIdentityId: null,
cognitoIdentityPoolId: null,
principalOrgId: null,
sourceIp: 'IP',
user: null,
userAgent: 'user-agent',
userArn: null
},
path: '/my/path',
protocol: 'HTTP/1.1',
requestId: 'id=',
requestTime: '04/Mar/2020:19:15:17 +0000',
requestTimeEpoch: 1583349317135,
resourceId: null,
resourcePath: '/my/path',
stage: '$default'
},
"stageVariables": null,
"requestContext": {
"authorizer": {
"username": "testId",
"userId": 12
pathParameters: null,
stageVariables: null,
body: 'Hello from Lambda!',
isBase64Encoded: true
}
const palyload2 = {
version: '2.0',
routeKey: '$default',
rawPath: '/my/path',
rawQueryString: 'parameter1=value1&parameter1=value2&parameter2=value',
cookies: ['cookie1', 'cookie2'],
headers: {
'Header1': 'value1',
'Header2': 'value2'
},
queryStringParameters: { parameter1: 'value1,value2', parameter2: 'value' },
requestContext: {
accountId: '123456789012',
apiId: 'api-id',
authorizer: {
jwt: {
claims: { 'claim1': 'value1', 'claim2': 'value2' },
scopes: ['scope1', 'scope2']
}
},
"path": "/users/create",
"accountId": "000000000000",
"resourceId": "skkkk00",
"stage": "dev",
"domainPrefix": "testPrefix",
"domainName": "testPrefix.testDomainName",
"resourcePath": "/users/create",
"httpMethod": "GET",
"extendedRequestId": "VwTpXAACoE0FV7w=",
"apiId": "ujhfkdkd0988"
domainName: 'id.execute-api.us-east-1.amazonaws.com',
domainPrefix: 'id',
http: {
method: 'POST',
path: '/my/path',
protocol: 'HTTP/1.1',
sourceIp: 'IP',
userAgent: 'agent'
},
requestId: 'id',
routeKey: '$default',
stage: '$default',
time: '12/Mar/2020:19:03:58 +0000',
timeEpoch: 1583348638390
},
"body": "{\"username\":\"1\"}",
"isBase64Encoded": false
}, {
body: 'Hello from Lambda',
pathParameters: { 'parameter1': 'value1' },
isBase64Encoded: false,
stageVariables: { 'stageVariable1': 'value1', 'stageVariable2': 'value2' }
}
handler1(palyload2, {
}, (err, callbackData) => {

@@ -129,0 +186,0 @@ //callback

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