gpt4 book ai didi

python - Google Identity Toolkit (v3) 是否与 GAE/python 沙盒兼容?

转载 作者:行者123 更新时间:2023-11-28 21:50:59 24 4
gpt4 key购买 nike

我正在为一个网站开发一个 python GAE 应用程序,我正试图在它上面进行联合登录。

根据Identity Platform choosing guide网站的最佳解决方案似乎是 Google Identity Toolkit (web) .浏览了我能找到的所有相关文档,然后转到教程,在那里我遇到了一个问题——安装 identity-toolkit-python-client 包失败,出现与 相关的 C 编译错误cffi 库,类似于这个:

# python -m pip install identity-toolkit-python-client
...
gcc -pthread -fno-strict-aliasing -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -DNDEBUG -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -DOPENSSL_LOAD_CONF -fPIC -I/usr/include/python2.7 -c src/cryptography/hazmat/bindings/__pycache__/_Cryptography_cffi_a269d620xd5c405b7.c -o build/temp.linux-x86_64-2.7/src/cryptography/hazmat/bindings/__pycache__/_Cryptography_cffi_a269d620xd5c405b7.o

src/cryptography/hazmat/bindings/__pycache__/_Cryptography_cffi_a269d620xd5c405b7.c:2:20: fatal error: Python.h: No such file or directory

#include <Python.h>

^

compilation terminated.

error: command 'gcc' failed with exit status 1

在为我的 Linux 发行版安装了一些特定的包之后,我最终成功地安装了包,但是这些失败导致了我的实际问题(教程非常通用,我无法发现任何关于 GAE 限制的提示)。

来自GAE python sandbox documentation只有纯 python 代码应该出现在 GAE 应用程序中:

All code for the Python runtime environment must be pure Python, and not include any C extensions or other code that must be compiled.

我没有看到 GAE SDK 或其第三方库中包含身份工具包,据我所知,这意味着我必须 install it as a 3rd party library在我自己的应用程序中。但是纯 python 代码限制也适用于这些库:

You can add any third-party library to your application, as long as it is implemented in "pure Python" (no C extensions) and otherwise functions in the App Engine runtime environment.

因此标题中的问题。

我错过了什么吗?

谢谢。

到目前为止,我使用的是 webapp2 和 jinja2。

最佳答案

这不是 100%,支持的第 3 方库如 PyCrypto、numpy lxml 都有基于“C”的扩展,但这些都直接由谷歌支持。您只是无法添加不在列表中的内容。

参见第 3 方库文档 https://cloud.google.com/appengine/docs/python/tools/libraries27

您必须区分 Google 支持的“第 3 方库”与您自己提供的第 3 方库。

此外,您还没有说明您使用的是什么框架。您可能会发现值得一看的自动 http://peterhudec.github.io/authomatic/

开箱即用的支持:

  • OAuth 1.0a 提供商:Bitbucket、Flickr、Meetup、Plurk、Twitter、Tumblr、UbuntuOne、Vimeo、Xero、Xing 和雅虎。 OAuth 2.0 提供商:亚马逊、Behance、Bitly、Cosm、DeviantART、Eventbrite、Facebook、Foursquare、GitHub、谷歌、LinkedIn、PayPal、Reddit、Viadeo、VK、WindowsLive、Yammer 和 Yandex。 python-openid 和 Google App Engine基于 OpenID。

关于python - Google Identity Toolkit (v3) 是否与 GAE/python 沙盒兼容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31082344/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com