Emulate AWS λ and API Gateway locally when developing your Serverless project
## Bug Report <!-- Before you create a bug report, please make sure to update `serverless` as well as `serverless-offline` to the latest version and make sure the bug hasn't been fixed already. Please add as much information as you can. e.g. links to any `serverless` or `AWS` documentation, github issues, etc. --> **Current Behavior** From (at least) version 9.x up through 12.x, we were able to mock authorizers, based on what the readme currently says: ### Remote authorizers You are able to mock the response from remote authorizers by setting the environmental variable `AUTHORIZER` before running `sls offline start` Example: > Unix: `export AUTHORIZER='{"principalId": "123"}'` > Windows: `SET AUTHORIZER='{"principalId": "123"}'` Ever since 13.x was released, this fails to work. **Sample Code** <!-- Please reduce the sample code to an absolute minimum needed to show the problem. Even better, create a small repository and link to it. --> - file: serverless.yml ```yaml service: sls-playground provider: name: aws runtime: nodejs16.x custom: serverless-offline: httpPort: 4000 websocketPort: 4001 lambdaPort: 4002 functions: hello: handler: handler.hello events: - httpApi: path: / method: get plugins: - serverless-offline ``` - file: handler.js ```js exports.hello = async (event) => { return { statusCode: 200, body: JSON.stringify({ message: "Go Serverless v4! Your function executed successfully!", event }), }; }; ``` Run the following from a terminal window: ``` export AUTHORIZER='{"principalId":"123"}' && sls offline start ``` **Expected behavior/code** The `event.requestContext` object should have an `authorizer` prop with what was set on the terminal: ``` "requestContext": { "accountId": "offlineContext_accountId", "apiId": "offlineContext_apiId", "authorizer": { "principalId": "123" }, ``` **Environment** - `serverless` version: 4.4.5 - `serverless-offline` version: 12.0.4 WORKS, but anything after (13.x+, 14.x+) is broken - `node.js` version: 22.9.0 - `OS`: macOS 15.0.1 **Possible Solution** PR that introduced this feature: https://github.com/dherault/serverless-offline/pull/475 **Additional context/Screenshots** <!-- Add any other context about the problem here. If applicable, add screenshots to help explain. -->
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by tbehunin and has received 2 comments.