0

オーサライザのように、基本パスに関連する情報はありません。たとえそれを文脈で渡しても、それをポリシーに追加する方法はないようです。APIゲートウェイのカスタムドメイン名からのベースパスマッピングを考慮に入れたAWSラムダでカスタムオーソライザを作成する方法は?

例: domain.com/basepath1**/resource/resourceID** domain.com/basepath2**/resource/resourceID**

現在のポリシー・ステートメント:

[{ アクション: 'execute-api:Invoke'、 効果: 'Allow'、 リソース: 'arn:aws:execute-api:us-east-1:accountID:apiID/dev/GET **/resource/resourceID **' }]

答えて

0

API Gatewayは最近、お客様にいくつかの機能拡張をリリースしました新しい承認タイプの承認者を含む承認者が、着信要求からさらに多くの情報を渡します。基本パスは明示的に呼び出されませんが、パスパラメータの1つに存在する可能性があります。 documentation here

から

{ 
    "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" 
    } 
} 

関連する問題