【发布时间】:2021-09-22 17:20:06
【问题描述】:
我有一个项目使用 Firebase Admin 上的默认存储桶。
我有以下行:
const [url] = await blob.getSignedUrl({ action: 'read', expires: Date.now() + 60 * 1000, contentType: mimetype })
当调用我的 HTTPS 可调用函数时,上面的行会抛出以下错误:
Unhandled error Error: The caller does not have permission
at Gaxios._request (/workspace/node_modules/gaxios/build/src/gaxios.js:129:23)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Compute.requestAsync (/workspace/node_modules/google-auth-library/build/src/auth/oauth2client.js:368:18)
at async GoogleAuth.signBlob (/workspace/node_modules/google-auth-library/build/src/auth/googleauth.js:655:21)
at async sign (/workspace/node_modules/@google-cloud/storage/build/src/signer.js:97:35) {
name: 'SigningError'
}
我做错了什么?
【问题讨论】:
-
请提供上传文件的完整代码并检查firebase控制台中的安全规则
-
这发生在 firebase admin SDK 上,所有规则都由管理员通过。并且所有规则都是开放的。
标签: javascript firebase google-cloud-storage