Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

fibasebase-admin 13.2.0 serviceusage.serviceUsageConsumer missing error

未关闭
#2,896 1 条评论 5 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
nodejs, typescript

调研方向

使用 issue 中所示的服务账号初始化方式和 auth.revokeRefreshTokens(uid),在 Firebase Admin SDK 13.2.0 的 Cloud Functions 模拟器中复现该故障;将其行为与 12.7.0 进行比较。跟踪身份验证调用以及报告的 serviceusage.serviceUsageConsumer 权限响应。确定这是 13.2.0 的回归问题还是预期的权限要求,并记录经过验证的解决方案后,即视为完成。

由索引模型根据 Issue 内容生成。

描述

api: auth
[REQUIRED] Step 2: Describe your environment
  • Operating System version: Cloud Functions (running in emulator on windows)
  • Firebase SDK version: 13.2.0 (updated from 12.7.0)
  • Firebase Product: auth
  • Node.js version: 20
[REQUIRED] Step 3: Describe the problem

When upgrading to the latest firebase-admin sdk (13.2.0) we now receive the following error for auth.revokeToken(uid). This only happens when running the functions locally in the emulator. The admin sdk is being initialised with a service account file because we mint tokens with custom claims.

We tried previously to migrated to 12.7.* but we were effected by the now closed issue https://github.com/firebase/firebase-admin-node/issues/2658 most of the issues documented there seem to be resolved.

The happens on various api calls.

Error: //console.developers.google.com/iam-admin/iam/project?project={REDACTED-PROJECTID} and then retry. Propagation of the new permission may take a few minutes. Raw server response: "{"error":{"code":403,"message":"Caller does not have required permission to use project {REDACTED-PROJECTID}. Grant the caller the roles/serviceusage.serviceUsageConsumer role, or a custom role with the serviceusage.services.use permission, by visiting https://console.developers.google.com/iam-admin/iam/project?project={REDACTED-PROJECTID} and then retry. Propagation of the new permission may take a few minutes.","errors":[{"message":"Caller does not have required permission to use project {REDACTED-PROJECTID}. Grant the caller the roles/serviceusage.serviceUsageConsumer role, or a custom role with the serviceusage.services.use permission, by visiting https://console.developers.google.com/iam-admin/iam/project?project={REDACTED-PROJECTID} and then retry. Propagation of the new permission may take a few minutes.","domain":"global","reason":"forbidden"}],"status":"PERMISSION_DENIED","details":[{"@type":"type.googleapis.com/google.rpc.ErrorInfo","reason":"USER_PROJECT_DENIED","domain":"googleapis.com","metadata":{"containerInfo":"{REDACTED}","service":"identitytoolkit.googleapis.com","consumer":"projects/{REDACTED-PROJECTID}"}},{"@type":"type.googleapis.com/google.rpc.LocalizedMessage","locale":"en-US","message":"Caller does not have required permission to use project {REDACTED-PROJECTID} Grant the caller the roles/serviceusage.serviceUsageConsumer role, or a custom role with the serviceusage.services.use permission, by visiting https://console.developers.google.com/iam-admin/iam/project?project={REDACTED} and then retry. Propagation of the new permission may take a few minutes."},{"@type":"type.googleapis.com/google.rpc.Help","links":[{"description":"Google developer console IAM admin","url":"https://console.developers.google.com/iam-admin/iam/project?project={REDACTED-PROJECTID}"}]}]}}"

Steps to reproduce:

What happened? How can we make the problem occur?
This could be a description, log/console output, etc.

Relevant Code:
 const serviceAccount = require(serviceAccountPath);

  admin.initializeApp({
    credential: admin.credential.cert({
      clientEmail: serviceAccount.client_email,
      projectId: serviceAccount.project_id,
      privateKey: serviceAccount.private_key,
    });
const auth = admin.auth();

await auth.createUser({
  email: lowerCaseEmail,
  displayName: lowerCaseEmail,
   disabled: false,
})

 // This throws the error. 
  await auth.revokeRefreshTokens(uid);
``

主要语言
TypeScript
星标
1.7k
派生
419
平均合并
4 天 20 小时
30 天内合并 PR
16

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

firebase/firebase-admin-node 的其他 Issue

查看 firebase/firebase-admin-node 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。