是否可以以编程方式从启用了 api 的服务帐户凭据中检索? (在nodejs中,不是云环境中)
我有一个带有 client_email 和 private_key 的服务帐户凭据 json 文件。 那么是否可以以编程方式从服务帐户凭据中检索启用了哪些 api?我指的不是像访问 console.cloud.google.com 这样的解决方案,而是来自 Nodejs 内部的解决方案。谢谢!
I have a service account credentials json file with client_email and private_key.
Is it then possible to programmatically retrieve from serviceaccount credentials which api's are enabled? I don't mean a solution like go to console.cloud.google.com but from within nodejs. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您还需要知道项目 ID。 @wardenunleashed 的答案是针对 API 网关的。这不包括启用哪些 Google API。
API 是按项目启用的,因此您必须指定要查询的项目。
服务帐户 JSON 密钥文件包含拥有服务帐户的项目的项目 ID。
private_key_id 也很重要。该 ID 用于查找公钥以验证私钥签名。
You will need to know the Project ID as well. The answer from @wardenunleashed is for API Gateway. That does not cover which Google APIs are enabled.
APIs are enabled per project, so you must specify the project to query.
A service account JSON key file contains the Project ID for the project that owns the service account.
The private_key_id is also important. That ID is used to lookup the public key for validating private key signatures.
Google 有一个适用于 NodeJS 的 API 网关客户端库,具有所需的功能
Google has an API Gateway Client Library for NodeJS with the desired capability