You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my project, I am utilizing AWS PowerTools for Lambda to validate APIGatewayProxyEventV2. In this model, there's an assumption that the authorizer in RequestContext is optional, and likewise, jwt within authorizer is optional. However, when I invoke Lambda using serverless-offline through sls offline, I receive a model like this: 'authorizer': {'lambda': {}, 'jwt': {}}, which contradicts the APIGatewayProxyEventV2 model from aws-powertools.
Expected behavior/code
Alignment with AWS typing.
Environment
serverless version: 3.36.0
serverless-offline version: 13.3.0
node.js version: 21.1.0
OS: macOS 13.2.1
python version: 3.11
Possible Solution
ntroduce an option to customize what is included in authorizer, or if no custom authorizer is provided, simply send 'authorizer': None.
Additional context/Screenshots
'requestContext': {'accountId': 'offlineContext_accountId', 'apiId': 'offlineContext_apiId', 'authorizer': {'lambda': {}, 'jwt': {}}, 'domainName': 'offlineContext_domainName', 'domainPrefix': 'offlineContext_domainPrefix', 'http': {'method': 'GET', 'path': '/saleor/app', 'protocol': 'HTTP/1.1', 'sourceIp': '192.168.65.1', 'userAgent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36'}
The text was updated successfully, but these errors were encountered:
Sorry for the late response, but you just need to specify python version in serverless.yml, and just try to run serverless-offline with your lambda. Like this: serverless.yml
provider:
runtime: python3.11
Bug Report
Current Behavior
In my project, I am utilizing AWS PowerTools for Lambda to validate APIGatewayProxyEventV2. In this model, there's an assumption that the authorizer in RequestContext is optional, and likewise, jwt within authorizer is optional. However, when I invoke Lambda using serverless-offline through sls offline, I receive a model like this:
'authorizer': {'lambda': {}, 'jwt': {}}
, which contradicts the APIGatewayProxyEventV2 model from aws-powertools.Expected behavior/code
Alignment with AWS typing.
Environment
serverless
version: 3.36.0serverless-offline
version: 13.3.0node.js
version: 21.1.0OS
: macOS 13.2.1python
version: 3.11Possible Solution
ntroduce an option to customize what is included in authorizer, or if no custom authorizer is provided, simply send
'authorizer': None
.Additional context/Screenshots
'requestContext': {'accountId': 'offlineContext_accountId', 'apiId': 'offlineContext_apiId', 'authorizer': {'lambda': {}, 'jwt': {}}, 'domainName': 'offlineContext_domainName', 'domainPrefix': 'offlineContext_domainPrefix', 'http': {'method': 'GET', 'path': '/saleor/app', 'protocol': 'HTTP/1.1', 'sourceIp': '192.168.65.1', 'userAgent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36'}
The text was updated successfully, but these errors were encountered: