我发现自己需要登录google才能使用远程api,但是它需要电子邮件和密码来验证进程。有没有我可以隐藏他们两个,并要求项目的其他贡献者添加他们自己的(安全)?你知道吗
from google.appengine.ext.remote_api import remote_api_stub
import database
import getpass
email = "gmail@gmail.com" #can't show this line
password = "password" #can't show this line
def auth_func():
return (email, password)
remote_api_stub.ConfigureRemoteApi(None, '/_ah/remote_api', auth_func,
'app.appspot.com')
我会把它放在另一个文件里(配置.xml例如)而不是承诺。在构建应用程序之前,您可以验证它是否存在。你知道吗
您可以将敏感信息保存在环境变量中,并在运行应用程序之前在应用程序文档中包含设置环境变量的说明。你知道吗
要从Python中检索变量(从here):
如果您使用的是virtualenv(您应该这么做!)您可能还想使用autoenv(或在this问题中提到的其他工具)这样的工具,当您
cd
进入项目目录时,它可以为单个命令行/控制台会话设置相关的环境变量。你知道吗您也可以将命令放在shell脚本/批处理文件中,只需确保不提交它。你知道吗
相关问题 更多 >
编程相关推荐