dherault / dherault/serverless-offline
Request Authorizer on API Gateway V2 fails before lambda is triggered
- Dominant language
- JavaScript
- Stars
- 5.3k
- Forks
- 811
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 3
Description
## 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**
- `serverless` version: 3.30.1
- `serverless-offline` version: 12.0.4
- `node.js` version: 18.14
- `OS`: Windows 10
**Possible Solution**
Remove the automatic fail [at these lines](https://github.com/dherault/serverless-offline/blob/5b198a752c8cfdcbde5e3eb7e041a64ac3626289/src/events/http/createAuthScheme.js#L84-L86).
Contributor guide
Assessment
This issue has not been assessed yet.