gpt4 book ai didi

aws-lambda - AWS Lambda Authorizer `body` 对象中不存在 `event` 参数

转载 作者:行者123 更新时间:2023-12-03 16:56:17 25 4
gpt4 key购买 nike

事件对象丢失 bodyisBase64Encoded特性。但是根据 docs 他们应该在那里完整的结构如下:

{
"type": "REQUEST",
"methodArn": "arn:aws:execute-api:us-west-2:*******:*******/development/POST/auth/login",
"resource": "/{proxy+}",
"path": "/auth/login",
"httpMethod": "ANY",
"headers": {
.....
},
"queryStringParameters": {
"test": "123"
},
"pathParameters": {
"proxy": "auth/login"
},
"stageVariables": {
"lambdaVersion": "development"
},
"requestContext": {
"path": "/development/auth/login",
"accountId": "*****",
"resourceId": "f8wvnk",
"stage": "development",
"requestId": "****",
"identity": {
....
},
"resourcePath": "/{proxy+}",
"httpMethod": "POST",
"apiId": "********"
}
}

有没有人有类似的问题?

最佳答案

在自定义授权方请求类型中,传递给授权方的事件中没有正文。根据文档:

For a custom authorizer of the REQUEST type, API Gateway passes the required request parameters to the authorizer Lambda function as part of the event object. The affected request parameters include headers, path parameters, query string parameters, stage variables, and some of request context variables.



没有 body !

关于aws-lambda - AWS Lambda Authorizer `body` 对象中不存在 `event` 参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47335042/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com