Open TriangularCube opened 1 year ago
The format returned from lambda authorizers with simple response is incorrect. What I get as event in subsequent lambdas are
{ ... requestContext: { authorizer: { // Context object passed from authorizer jwt: ... } } }
whereas the format in production should be
{ ... requestContext: { authorizer: { lambda: { // Context from authorizer } } } }
Sample Code
service: my-service plugins: - serverless-offline provider: runtime: nodejs18.x stage: dev httpApi: authorizers: - type: request functionName: authorizer payloadVersion: 2.0 enableSimpleResponses: true functions: authorizer: handler: handler.main hello: events: - httpApi: method: get path: /sample authorizer: name: some-name handler: handler.hello
exports.main = async () => { return { isAuthorized: true, context: { // whatever } } }
exports.hello = async (event) => { console.log(event) }
Environment
serverless
serverless-offline
node.js
OS
Bug Report
The format returned from lambda authorizers with simple response is incorrect. What I get as event in subsequent lambdas are
whereas the format in production should be
Sample Code
Environment
serverless
version: 3.30.1serverless-offline
version: 12.0.4node.js
version: 18.14OS
: Windows 10