使用无服务器,我在Node.js中部署了具有若干lambda函数的API网关。我还使用lambda authorizor(authenticate.js)将身份验证添加到一个GET端点。我没有主意,因此不胜感激。我唯一看到的是没有分配给授权者的Lambda调用角色。我没有找到有关如何将其添加到无服务器yaml中的任何文档,但是Cloudwatch日志未显示任何授权者执行,因此我期望403或类似的内容。
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: The request could not be satisfied</TITLE>
</HEAD>
<BODY>
<H1>403 ERROR</H1>
<H2>The request could not be satisfied.</H2>
<HR noshade size="1px">
Bad request.
We can't connect to the server for this app or website at this time. There might be too much traffic or a
configuration error. Try again later, or contact the app or website owner.
<BR clear="all">
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
<BR clear="all">
<HR noshade size="1px">
<PRE>
Generated by cloudfront (CloudFront)
Request ID: yx1B1i6k_J1nqf_jPMTN4AyHD8gKE85KajxhcosOMUZ-tHWoU1E54w==
</PRE>
<ADDRESS>
</ADDRESS>
</BODY>
</HTML>
serverless.yaml:
functions:
authenticate:
handler: src/handlers/auth.authenticate
list:
handler: src/handlers/api.list
events:
- http:
path: todos
method: get
cors: true
authorizer: authenticate
Lambda授权者: