in chalice/local.py [0:0]
def _check_can_invoke_view_function(self,
arn: str,
auth_result: ResponseType) -> bool:
policy = auth_result.get('policyDocument', {})
statements = policy.get('Statement', [])
allow_resource_statements = []
for statement in statements:
if statement.get('Effect') == 'Allow' and \
(statement.get('Action') == 'execute-api:Invoke' or
'execute-api:Invoke' in statement.get('Action')):
for resource in statement.get('Resource'):
allow_resource_statements.append(resource)
arn_matcher = ARNMatcher(arn)
return arn_matcher.does_any_resource_match(allow_resource_statements)