API Gateway HTTP集成URL中的自定义授权者上下文变量 [英] Custom authorizer context variable in API Gateway HTTP integration URL
问题描述
我想对端点使用API网关HTTP集成,其中URL的某些部分由自定义授权者提供(例如,用户ID或用户授权).
I would like to use an API Gateway HTTP integration towards an endpoint, where certain parts of the URL are provided by the custom authorizer (e.g., user ID or user grants).
我肯定可以使用Lambda集成,但这会带来相当大的响应时间开销.
I could definitely use a Lambda integration but that introduces quite significant response time overhead.
不幸的是,适用于stageVariables的语法似乎不适用于自定义授权者上下文-${context.authorizer.variableName}
.
Unfortunately syntax that works for stageVariables does not seem to work for custom authorizer context - ${context.authorizer.variableName}
.
注意:要回答一些评论,是的,警告标志在那里,因为我使用了虚拟的url
字符串.不管URL是什么,替换授权者上下文变量对我都不起作用这一事实与无关.
Note: To answer some comments, yes, the warning sign is there bacause I used a dummy url
string. Has nothing to do with the fact that replacement of authorizer context variables does not work for me, no matter what the URL is.
推荐答案
URL必须有效,例如 https://example.com/foo 以及协议和主机名.
The URL needs to valid, meaning like https://example.com/foo with a protocol and hostname.
以url/
开头永远是无效的.
这篇关于API Gateway HTTP集成URL中的自定义授权者上下文变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!