未触发无服务器框架自定义lambda授权程序
因此,我使用的是无服务器框架,而自定义lambda授权程序没有被触发。当我检查应该授权的函数时,API网关控制台说它没有授权。我也找不到授权人下的授权功能。任何指点都将不胜感激未触发无服务器框架自定义lambda授权程序,lambda,frameworks,authorization,token,serverless,Lambda,Frameworks,Authorization,Token,Serverless,因此,我使用的是无服务器框架,而自定义lambda授权程序没有被触发。当我检查应该授权的函数时,API网关控制台说它没有授权。我也找不到授权人下的授权功能。任何指点都将不胜感激 loginUser: handler: loginUser.loginUser module: src/functions/loginFunction events: - http: path: /user/login method: post
loginUser:
handler: loginUser.loginUser
module: src/functions/loginFunction
events:
- http:
path: /user/login
method: post
request:
schema:
application/json: ${file(src/schema/loginUser_request.json)}
getCats:
handler: catCrud.getCats
module: src/functions/catCrud
events:
- http:
path: /cat
method: get
authoirzer:
name: authorizeFunc
identitySource: method.request.header.Authorization
type: token
authorizeFunc:
handler: authorizeFunc.authorizeFunc
module: src/functions/loginFunction
另外,我不确定这是否有价值,但是我使用无服务器python要求来打包我的lambda,authorizeFunc与loginFunction共享同一个模块,因为它们具有相同的libs。您在
无服务器.yml
的事件部分拼错了authorizer
尝试:
哇!我为这个愚蠢的错误道歉。我从来没有想到这会是一个打字错误,因为它部署得很好,没有错误。我会花一天的时间寻找答案。谢谢D
getCats:
handler: catCrud.getCats
module: src/functions/catCrud
events:
- http:
path: /cat
method: get
authorizer:
name: authorizeFunc
identitySource: method.request.header.Authorization
type: token