更改 Heroku API Key 会对我们的应用程序产生什么影响?
我们的组织有许多部署到 Heroku 的 Rails 应用程序(网站)。一名前开发人员已离开该组织,作为良好实践,我们希望更改与我们的帐户关联的 Heroku API 密钥,以防止通过 Heroku CLI 对应用程序进行任何修改。
我知道 Heroku API 密钥用于 Heroku CLI 访问(它缓存在 ~/.heroku/credentials 中),但不确定它还有什么用途。具体来说,Heroku 平台中的第 3 方附加组件(例如 New Relic、Hoptoad/Airbrake、Sendgrid 等)是否使用此功能,因此如果 API 密钥更改则需要重新配置?当您单击“重新生成”按钮进行更改时,Heroku 会抛出一条相当通用(且非信息性)的错误消息。
由于术语“API 密钥”非常通用,因此需要明确这是与可通过“我的帐户”链接访问的每个 Heroku 帐户关联的单个 API 密钥。下面的图像(和警告消息)。
Our organization has a number of Rails applications (websites) deployed to Heroku. A former devleoper has left the organization, and as good practice we want to change the Heroku API key associated with our account to prevent any modifications to the apps via the Heroku CLI.
I know that the Heroku API Key is used for Heroku CLI access (it gets cached in ~/.heroku/credentials), but not certain what else it is used for. Specifically, do 3rd-party add-ons in the Heroku platform (e.g. New Relic, Hoptoad/Airbrake, Sendgrid, etc) use this, and therefore require reconfiguring if the API Key is changed? Heroku throws up a fairly generic (and non-informative) error message when you click the "regenerate" button to change it.
Because the term "API Key" is so generic, want to be clear that this is the single API Key associated with each Heroku account accessible via "My Account" link. Image (and warning message) below.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
询问 Heroku 支持。这就是我得到的回复:
“您可以随时安全地更改您的 API 密钥,因为我们不会将其提供给任何附加提供商。该警报旨在提醒您,如果您将 API 密钥添加到任何应用程序或服务(即自动缩放、手动配置工作人员等),它将停止工作,直到您为其提供新密钥。”
我要求他们更新界面/文档以使这一点更加清晰。
Asked Heroku Support. This is what I got back:
"you can safely change your API key at any time, as we don't give it to any add-on providers. That alert is meant to remind you that if you added your API key to any application or service (ie for auto scaling, manually provision workers, etc) it will stop working until you provide it a new key."
I requested that they update the interface/documentation to make this more clear.
还要将他从您所有项目的协作者中删除,这样他就无法通过 git 推送这些项目。
出于好奇(我从未在管理员中见过重置键)我尝试了它。然后,当我尝试对我的一个应用程序使用 CLI 时,系统要求我重新进行身份验证 - 但我现在无法返回 - 哎呀!相同的用户名/密码可通过网站使用。我将 ping 支持并报告,
更新:
所以看来我的问题完全是由于我正在使用的 Heroku Accounts (https://github.com/ddollar/heroku-accounts) 插件造成的,该插件将密钥的副本存储在 ~/.heroku/accounts/ 文件中。支持人员让我删除了该文件夹,现在一切正常了 - 只是重置 API 密钥时需要注意的事情。
Also remove him from being a collaborator on all your projects so he can't push to them via git.
Out of curiousity (i'd never seen reset key in the admin) I tried it. When I then tried to use the CLI against one of my apps I was asked to reauthenticate - but i can't now get back in - doh! The same username/password works via the site. I'll ping support and report back,
UPDATE:
So it appears my problem is entirely due to the Heroku Accounts (https://github.com/ddollar/heroku-accounts) plugin that I'm using which stores a copy of the key in the ~/.heroku/accounts/ file. Support got me to remove the folder and it all works now - just something to be aware of if you reset your API key.