LambdaRequestAuthorizationIdentity - AWS Serverless Application Model

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

LambdaRequestAuthorizationIdentity

此属性可用于在授权方的传入请求 IdentitySource 中指定。有关更多信息, IdentitySource 请参阅ApiGateway 授权器 OpenApi 扩展

语法

要在您的 AWS Serverless Application Model (AWS SAM) 模板中声明此实体,请使用以下语法。

YAML

Context: List Headers: List QueryStrings: List ReauthorizeEvery: Integer StageVariables: List

属性

Context

将给定的上下文字符串转换为格式 context.contextString 的映射表达式。

类型:列表

必需:否

AWS CloudFormation 兼容性:此属性为 AWS SAM 独有,没有 AWS CloudFormation 等效属性。

Headers

将标头转换为格式 method.request.header.name 的映射表达式的逗号分隔字符串。

类型:列表

必需:否

AWS CloudFormation 兼容性:此属性为 AWS SAM 独有,没有 AWS CloudFormation 等效属性。

QueryStrings

将给定的查询字符串转换为格式 method.request.querystring.queryString 的映射表达式的逗号分隔字符串。

类型:列表

必需:否

AWS CloudFormation 兼容性:此属性为 AWS SAM 独有,没有 AWS CloudFormation 等效属性。

ReauthorizeEvery

time-to-live (TTL) 周期,以秒为单位,用于指定 API Gateway 缓存授权方结果的时长。如果您指定一个大于 0 的值,API Gateway 将缓存授权方响应。默认情况下,API Gateway 将此属性设为 300。最大值为 3600 秒(1 小时)。

类型:整数

必需:否

默认值:300

AWS CloudFormation 兼容性:此属性为 AWS SAM 独有,没有 AWS CloudFormation 等效属性。

StageVariables

将给定的阶段变量转换为格式 stageVariables.stageVariable 的映射表达式的逗号分隔字符串。

类型:列表

必需:否

AWS CloudFormation 兼容性:此属性为 AWS SAM 独有,没有 AWS CloudFormation 等效属性。

示例

LambdaRequestIdentity

YAML

Identity: QueryStrings: - auth Headers: - Authorization StageVariables: - VARIABLE Context: - authcontext ReauthorizeEvery: 100