[Bug] Unable to use custom claims in firestore security rule when querying from C++ SDK
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- cpp, firebase
调研方向
首先,在 Mac 上使用 Firebase C++ SDK 13.0.0,以 desktop 或 iOS 为目标,使用所示的 Firestore 规则以及针对 subscriptions 的查询,复现 100% 的失败。检查 Auth 和 Firestore 请求路径,包括通过 Firebase Functions 获取的 custom claim。完成的标准是确定对于 C++ SDK 查询,该 claim 是否到达安全规则,并记录或修复 permission error 的原因。
由索引模型根据 Issue 内容生成。
描述
[REQUIRED] Please fill in the following fields:
- Pre-built SDK from the website
- Firebase C++ SDK version: 13.0.0
- Problematic Firebase Component: Auth and Firestore
- Other Firebase Components in use: Functions, Storage
- Platform you are using the C++ SDK on: Mac
- Platform you are targeting: Desktop and iOS
[REQUIRED] Please describe the issue here:
I get Missing or insufficient permissions when querying firestore collection that has a security rule that looks like:
match /subscriptions/{subscriptionId} {
allow read: if request.auth != null && request.auth.token.legacy_id == resource.data.user_id;
}
I am using the C++ SDK, which doesn't give direct access to the auth custom claims, but I am able to fetch custom claims via a Firebase function, and see the values correctly in the client after those are fetched.
If I write a security rule that depends on those claims, it fails. Does writing a rule that uses request.auth.token.legacy_id work when the request comes from the C++ SDK?
Steps to reproduce:
What's the issue repro rate? 100%
It appears that using a custom claim (say, a numeric secondary ID) and requiring that to match a field on a document doesn't work when the query is run from the C++ SDK.
- 主要语言
- C++
- 星标
- 326
- 派生
- 138
- 平均合并
- 2 天 16 小时
- 30 天内合并 PR
- 3
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
firebase/firebase-cpp-sdk 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
firebase/firebase-cpp-sdk#1905 · 2 条评论 ·
-
api: firestore
难度 5/5 一周以上 新手友好度 35/100
firebase/firebase-cpp-sdk#1920 · 3 条评论 ·
-
难度 3/5 1-2 天 新手友好度 70/100
firebase/firebase-cpp-sdk#1904 · 1 条评论 ·
-
new type: question
难度 4/5 3-5 天 新手友好度 45/100
firebase/firebase-cpp-sdk#1892 · 1 条评论 ·
-
nightly-testing
难度 4/5 3-5 天 新手友好度 25/100
firebase/firebase-cpp-sdk#1859 ·
查看 firebase/firebase-cpp-sdk 的全部 Issue
相似的 Issue
-
bug build
难度 1/5 1 小时以内 新手友好度 91/100
facebookincubator/velox#19194 ·
-
JIT-compiled number -> Decimal conversion silently overflows instead of raising DECIMAL_OVERFLOW 未关闭fuzz
难度 2/5 1-3 小时 新手友好度 82/100
ClickHouse/ClickHouse#122114 ·
-
难度 2/5 1-3 小时 新手友好度 84/100
-
module/agent platform/macos type/bug/regression
难度 2/5 1-3 小时 新手友好度 88/100
-
enhancement PyCDE
难度 2/5 1-3 小时 新手友好度 78/100