使用Google Cloud Endpoint(Python)的简单访问API(开发人员密钥)

Dou*_*rea 6 python google-app-engine google-cloud-endpoints

有没有办法使用Simple Access API(开发人员密钥)而不是oAuth2密钥与Google Cloud Endpoint?

bos*_*ter 8

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

如果要将key字段用作查询参数,可以通过以下方式访问它

request.get_unrecognized_field_info('key')
Run Code Online (Sandbox Code Playgroud)

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

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

不幸的是,"Simple API Access"键给出的好的配额检查和其他相关部分并不容易获得.但是,您可以发出自己的密钥并手动检查列表中的密钥,并可能检查您已定义的配额.