Open tbehunin opened 1 month ago
It may have been broken by https://github.com/dherault/serverless-offline/pull/1786. That PR removes the authorizer
prop if no authorizer is configured for the endpoint. Downgrading to serverless-offline: "13.5.0"
resolved it for me, at least for now.
Bug Report
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 runningsls offline start
Example:
Ever since 13.x was released, this fails to work.
Sample Code
Run the following from a terminal window:
Expected behavior/code
The
event.requestContext
object should have anauthorizer
prop with what was set on the terminal:Environment
serverless
version: 4.4.5serverless-offline
version: 12.0.4 WORKS, but anything after (13.x+, 14.x+) is brokennode.js
version: 22.9.0OS
: macOS 15.0.1Possible Solution
PR that introduced this feature: https://github.com/dherault/serverless-offline/pull/475
Additional context/Screenshots