简体   繁体   English

如何安全地将 API 凭据传递到托管我的 python 脚本的远程 Heroku 服务器?

[英]How do I securely pass API credentials to a remote Heroku server that my python script is hosted on?

I'm currently trying to host my first discord bot on heroku.我目前正在尝试在 heroku 上托管我的第一个 discord 机器人。 In order to get the bot up and running I have to pass several tokens for discord authentication such as authentication for some APIs I'm using.为了让机器人启动并运行,我必须为 discord 身份验证传递几个令牌,例如我正在使用的某些 API 的身份验证。

During development I was using a config.json file which contains all the information I need for the bot to work.在开发过程中,我使用了一个 config.json 文件,其中包含机器人工作所需的所有信息。 This works fine when hosted on my local machine, however I'm not sure if I should upload a file which contains passwords to a remote server like Heroku.这在我的本地机器上运行良好,但是我不确定是否应该将包含密码的文件上传到远程服务器,如 Heroku。

What would be a proper and secure way for me to pass my API credentials to Heroku?将我的 API 凭据传递给 Heroku 的正确且安全的方法是什么?

the way to provide credentials/tokens/pwd is to use Config Vars.提供凭证/令牌/密码的方法是使用 Config Vars。 Only the application admin has access to this info (in the Heroku Dashboard).只有应用程序管理员有权访问此信息(在 Heroku 仪表板中)。

It is acceptable to trust the hosting infrastructure with this data as your applications are running on it and require it.当您的应用程序在其上运行并需要它时,使用此数据信任托管基础架构是可以接受的。 For top security applications you would probably use a different hosting solution (private cloud) or run your own server.对于顶级安全应用程序,您可能会使用不同的托管解决方案(私有云)或运行您自己的服务器。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将sql查询传递到python脚本中,并使用我所有的登录凭据连接到sql oracle developer”? - how do i pass a sql query into a python script that connects to sql oracle developer with all my login credentials”? 我需要将变量从我的 python 脚本传递到远程服务器 - I need to pass variable from my python script to a remote server 在heroku上托管时如何让fibit python工作? - How do I get fibit python working when hosted on heroku? 如何在 Python 中使用 Cognito 凭据调用 API 网关 - How do I call an API Gateway with Cognito credentials in Python 如何将命令行参数传递给我的Python manage.py shell脚本? - How do I pass command line arguments to my Python manage.py shell script? 如何从 python 脚本传递 applescript arguments? - How do I pass applescript arguments from a python script? 如何通过 Python 请求将 API Token 传递到 Cookie 中? - How do I pass an API Token into Cookie via Python Request? 当我的 python 脚本在服务器上运行时,如何访问我的本地网络摄像头? (实时人脸识别) - How do I access my local webcam while my python script is running on a server? (Face-Recognition in real time) 我如何安全地防止用户在我的脚本中获取字符串? - How would I securely prevent a user from getting a string in my script? 如何从Python脚本向Google App Script API传递参数? - How can I pass an argument to Google App Script API from Python script?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM