dherault / serverless-offline

Emulate AWS λ and API Gateway locally when developing your Serverless project
MIT License
5.16k stars 794 forks source link

Request Authorizer on API Gateway V2 fails before lambda is triggered #1699

Open TriangularCube opened 1 year ago

TriangularCube commented 1 year ago

Bug Report

Lambda based authorizers for API Gateway should not fail before the lambda itself gets called.

Current Behavior

If there is no identity source (either token or query string), the AuthScheme will automatically return an unauthorized result, leading to the API request to fail.

Expected behavior/code

The event passed into the Authorizer should have undefined authorizationToken and identitySource fields, but it should be up to the Authorizer Lambda to pass/fail the request. This would be in line with AWS's behaviour.

Environment

Possible Solution

Remove the automatic fail at these lines.