0

我正在生成以下缓存策略:

{
    'principalId': 'test_user_user_ea8a2822-0b00-4a9c-ad79-27af44700801@123.com',
    'policyDocument': {
        'Version': '2012-10-17',
        'Statement': [{
            'Action': 'execute-api:*',
            'Effect': 'Deny',
            'Resource': 'arn:aws:execute-api:us-east-1:12345:hahd712723/active/GET/v1/AccountA'
        }]
    }
}

然后我提出请求arn:aws:execute-api:us-east-1:12345:hahd712723/active/GET/v1/AccountB'

这应该产生:

{
    'principalId': 'test_user_user_ea8a2822-0b00-4a9c-ad79-27af44700801@123.com',
    'policyDocument': {
        'Version': '2012-10-17',
        'Statement': [{
            'Action': 'execute-api:*',
            'Effect': 'Allow',
            'Resource': 'arn:aws:execute-api:us-east-1:12345:hahd712723/active/GET/v1/AccountB'
        }]
    }
}

但不是新的缓存集,而是我错误地获得了拒绝策略。

似乎主要 Id 是唯一看到的东西,并且资源不受尊重。

4

1 回答 1

1

该策略基于您选择的标头/API 密钥进行缓存,而不是基于标头和资源。应该为所有资源构建策略,而不仅仅是请求的资源。

于 2019-05-01T23:54:03.347 回答