- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我在 Google App Engine 上有两个应用,都在同一个帐户下运行,一个通过 HTTPS 调用另一个提供的服务。确保只有第一个应用程序被允许调用第二个应用程序的推荐方法是什么?
或者,有没有办法指定给定的端点只能由在同一 GAE 帐户下运行的应用程序调用?
最佳答案
让您的应用检查“X-Appengine-Inbound-Appid” header 并确保应用 ID 正确。此 header 仅在请求由另一个 Google App Engine 应用程序发出且用户无法修改时才存在。
如果您使用的是 Python,您可以执行以下操作:
import webapp2
AUTHORIZED_APPS = ('my-first-app', 'my-other-app')
class MyHandler(webapp2.RequestHandler):
def dispatch(self):
app_id = self.request.headers.get('X-Appengine-Inbound-Appid', None)
if app_id in AUTHORIZED_APPS:
super(MyHandler, self).dispatch()
else:
self.abort(403)
对于 header 中没有 X-Appengine-Inbound-Appid 的任何请求,这将引发 403。
此外,当使用 urlfetch 从一个应用程序向另一个应用程序发出请求时,请确保您设置了 follow_redirects=False,否则不会添加 header 。
关于security - 谷歌应用引擎 : secure inter-app communication,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13245540/
我已经在 MULE 上探索了网络,并了解到应用程序之间的通信——即使它们部署在同一个 Mule 实例中——它们也必须使用 TCP、HTTP 或 JMS 传输。 不支持虚拟机。 然而,我发现这与 ESB
我已成功使用一个管道传输一个命令的输出。 我想用 N 个连续的命令来完成此操作,其中每个命令代表一个进程。 这是我对一个命令进行管道化的尝试,那么要制作 N 个命令序列,我需要 n-1 个管道吗?以及
我正在尝试创建一个正确的正则表达式来验证一些值,接下来我将解释: 我必须和他一起验证这一行: $_globalVariables/ns:GlobalVariables/VARIABLENAME/ESB
观察者模式?我在哪里可以找到 Java 中的示例(我知道谷歌,但也希望获得一些个人见解。) 正确解释我的问题: 我有 3 个表单/窗口。 “board”是作为应用程序加载的主要形式。 “聊天”是进行文
这是 Subtract previous year's from value from each grouped row in data frame 的扩展.使用 plyr 的选项完全有意义。 现在,
我正在使用 R 中的大型数据表,并尝试遍历整个表并根据单独列中前行的值设置给定列中的行值。 我试图在一个有 20 万行的表上运行这个循环,但它的移动速度非常慢。我怀疑我没有充分利用 data.tabl
我正在编写一个应用程序,它有一个主要的 Activity,它控制着用户查看和交互的主要显示。 它还有一个选项菜单,每个菜单项都有自己的 Activity 和布局来执行各种从属任务。其中一些任务可能会导
我尝试使用 docker stack deploy 运行我的应用程序服务命令。使用此命令,我收到以下错误: "starting container failed: error creating ext
我一直在寻找一个平台,使用 Java 等各种技术开发的小部件可以相互通信。换句话说 当我将小部件添加到界面时,我需要它们相互通信。例如,一个小部件中的 Click 事件应该触发其他小部件中的事件。 我
我在同一台服务器的 JBoss 中部署了两个 Web 应用程序。我观察到类路径在这两个 Web 应用程序之间共享。 那么如何防止应用程序之间的类路径共享。我的意思是在一个应用程序中可用的任何类和 ja
我知道您可以调试以“ Debug模式”启动的远程 JVM(远程 JVM 打开一个 TCP 端口与调试器通信)。 我的问题是,当调试不是远程而是本地时,这种通信是如何完成的?例如,当您使用 IDE 启动
我正在尝试为我的应用添加应用间音频支持。我在 iOS 门户的 App-ID 中启用了它,然后在 XCode 5 -> Capabilities 中,我将 Inter-App Audio 开关切换为打开
我正在使用以下代码从位图中获取像素数据,然后通过 JNI 将数组传递给 cocos2dx。当我在 cocos2d-x 中渲染图像时,红色和蓝色 channel 被颠倒了。有没有办法从像素的 int 值
当我使用 map.equal_range() 时,我在迭代 map 时遇到问题..我的编译器说没有's_it = Krange.std::pair<> 中的 'operator=' 不匹配,'oper
我正在尝试创建一个高度为 40 像素并占浏览器宽度 80% 的简单菜单栏。 这里的问题是我试图使文本居中,但是当使用不同的颜色(一种用于 div,另一种用于 ul,另一种用于 li)查看它时,我看到一
我有三个用于流畅 API 扩展方法的标记接口(interface): interface IOne { } interface ITwo { } interface IOneOrTwo : IOne,
我在 Google App Engine 上有两个应用,都在同一个帐户下运行,一个通过 HTTPS 调用另一个提供的服务。确保只有第一个应用程序被允许调用第二个应用程序的推荐方法是什么? 或者,有没有
我目前在 Apple 的 App Store 上有一个 Swift iOS 应用程序。我有很多用户,我想制作一个新版本并帮助当前用户迁移到新版本。仅供引用:新版本是一个 Ionic 应用程序。 在数据
我将从 JSON 加载的对象数组映射到已知类型的对象中。我使用了标准的 array.map,但我能够在没有编译器错误的情况下指定其他属性。但是如果我在 map 函数中显式指定返回值类型,编译器会禁止附
我有这个代码: #include int main() { int array[] = { 0 }; std::set stdset(&array[1], &array[1]); }
我是一名优秀的程序员,十分优秀!