API Gateway HTTP集成URL中的自定义授权者上下文变量 [英] Custom authorizer context variable in API Gateway HTTP integration URL

查看:274
本文介绍了API Gateway HTTP集成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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆