[Bug] Unable to use custom claims in firestore security rule when querying from C++ SDK
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- cpp, firebase
調査の方向性
まず、Mac 上で Firebase C++ SDK 13.0.0 を使用し、desktop または iOS を対象として、提示された Firestore ルールと subscriptions に対するクエリを使った 100% の失敗を再現します。Firebase Functions を通じて取得される custom claim を含め、Auth と Firestore のリクエスト経路を確認します。完了条件は、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時間
- マージ済み PR(30日)
- 3
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
firebase/firebase-cpp-sdk のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
firebase/firebase-cpp-sdk#1905 · コメント 2 件 ·
-
api: firestore
難易度 5/5 1週間以上 初心者へのやさしさ 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