API Gateway中的客户端API限流

0

【以下的问题经过翻译处理】 客户希望通过API Gateway公开的API实施限流,并想知道该限流是否在他们正在实施的Lambda自定义授权程序调用之前发生。

profile picture
EXPERT
asked 5 months ago9 views
1 Answer
0

【以下的回答经过翻译处理】 可以在 API Gateway 上应用不同类型的速率限制。不同类型的速率限制可参见本安全白皮书第 11 页。 https://d1.awsstatic.com/whitepapers/api-gateway-security.pdf?svrd_sip6

如果速率限制利用带有 API 密钥的使用计划(apiKeySource 设置为 AUTHORIZER),则需要调用 Lambda Authorizer,因为 Lambda Authorizer 函数必须返回使用计划的 API 密钥作为 usageIdentifierKey 属性值。请参阅以下链接: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-lambda-authorizer-output.html

如果速率限制是由资源/方法上的API设置强制执行的,那么不需要调用自定义授权器。

如果超过了速率限制中的任何一个限制,Amazon API Gateway将阻止请求并向客户端返回429 Too Many Requests错误响应。客户端逻辑或SDK应配置为在重复相同类型的故障时使用增加的退避间隔进行重试。

profile picture
EXPERT
answered 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions