带有 Google Cloud Endpoint (Python) 的 Simple Access API(开发人员密钥) [英] Simple Access API (Developer Key) with Google Cloud Endpoint (Python)

查看:22
本文介绍了带有 Google Cloud Endpoint (Python) 的 Simple Access API(开发人员密钥)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过 Google Cloud Endpoint 使用 Simple Access API(开发人员密钥)而不是 oAuth2 密钥?

Is there a way to use Simple Access API (Developer Key) instead of oAuth2 key with Google Cloud Endpoint?

推荐答案

protorpc 请求对象中不属于定义的额外字段仍与请求一起存储.

Extra fields in your protorpc request object that aren't part of the definition are still stored with the request.

如果您想使用 key 字段作为查询参数,您可以通过

If you wanted to use a key field as a query parameter, you could access it via

request.get_unrecognized_field_info('key')

即使 key 不是您的消息定义中的字段.

even if key is not a field in your message definition.

这是在users_id_token.py(endpoints 库的 Auth 部分)允许发送 bearer_tokenaccess_token 作为查询参数而不是标头值.

This is done in users_id_token.py (the Auth part of the endpoints library) to allow sending bearer_token or access_token as query parameters instead of as header values.

不幸的是,简单 API 访问"密钥提供的良好的配额检查和其他相关部分并不容易获得.但是,您可以发布自己的密钥并根据您的列表手动检查密钥,并可能根据您定义的配额进行检查.

Unfortunately, the nice quota checking and other associated pieces that a "Simple API Access" key gives are not readily available. However, you could issue your own keys and manually check a key against your list and potentially check against quotas that you have defined.

这篇关于带有 Google Cloud Endpoint (Python) 的 Simple Access API(开发人员密钥)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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