Aws lambda 如何在AWS lambda中创建自定义授权程序,该授权程序考虑API网关中自定义域名的基本路径映射?
授权人似乎没有收到任何与基本路径相关的信息。即使您在上下文中传递它,似乎也无法将其添加到策略中 例如: domain.com/basepath1**/resource/resourceID** domain.com/basepath2**/resource/resourceID** 当前政策声明: [{ 操作:“执行api:调用”, 效果:“允许”, Resource:'arn:aws:executeapi:us-east-1:accountID:apid/dev/GET**/Resource/resourceID**'Aws lambda 如何在AWS lambda中创建自定义授权程序,该授权程序考虑API网关中自定义域名的基本路径映射?,aws-lambda,aws-api-gateway,custom-authentication,base-path,Aws Lambda,Aws Api Gateway,Custom Authentication,Base Path,授权人似乎没有收到任何与基本路径相关的信息。即使您在上下文中传递它,似乎也无法将其添加到策略中 例如: domain.com/basepath1**/resource/resourceID** domain.com/basepath2**/resource/resourceID** 当前政策声明: [{ 操作:“执行api:调用”, 效果:“允许”, Resource:'arn:aws:executeapi:us-east-1:accountID:apid/dev/GET**/Resource/
}]API网关最近发布了一些对客户授权人的增强功能,包括一个新的请求类型授权人,它从传入的请求中传递更多信息。虽然未显式调用基本路径,但它可能存在于一个路径参数中
{
"type": "REQUEST",
"methodArn": "arn:aws:execute-api:us-east-1:123456789012:s4x3opwd6i/test/GET/request",
"resource": "/request",
"path": "/request",
"httpMethod": "GET",
"headers": {
"X-AMZ-Date": "20170718T062915Z",
"Accept": "*/*",
"HeaderAuth1": "headerValue1",
"CloudFront-Viewer-Country": "US",
"CloudFront-Forwarded-Proto": "https",
"CloudFront-Is-Tablet-Viewer": "false",
"CloudFront-Is-Mobile-Viewer": "false",
"User-Agent": "...",
"X-Forwarded-Proto": "https",
"CloudFront-Is-SmartTV-Viewer": "false",
"Host": "....execute-api.us-east-1.amazonaws.com",
"Accept-Encoding": "gzip, deflate",
"X-Forwarded-Port": "443",
"X-Amzn-Trace-Id": "...",
"Via": "...cloudfront.net (CloudFront)",
"X-Amz-Cf-Id": "...",
"X-Forwarded-For": "..., ...",
"Postman-Token": "...",
"cache-control": "no-cache",
"CloudFront-Is-Desktop-Viewer": "true",
"Content-Type": "application/x-www-form-urlencoded"
},
"queryStringParameters": {
"QueryString1": "queryValue1"
},
"pathParameters": {},
"stageVariables": {
"StageVar1": "stageValue1"
},
"requestContext": {
"path": "/request",
"accountId": "123456789012",
"resourceId": "05c7jb",
"stage": "test",
"requestId": "...",
"identity": {
"apiKey": "...",
"sourceIp": "..."
},
"resourcePath": "/request",
"httpMethod": "GET",
"apiId": "s4x3opwd6i"
}
}
从