identity_fn.AuthBlockingEvent is still missing auth_type and resource
まだ誰も着手していません。
評価
調査の方向性
src/firebase_functions/identity_fn.py 内の AuthBlockingEvent dataclass から始める。そこには #231 で追加されたフィールド(event_type、email_type、sms_type)もある。リンクされている Node の parseAuthEventContext のロジックに従って 2 つの新しいプロパティを導出する:auth_type は user_record の有無から、resource は tenant_id とプロジェクト ID から得る。完了の条件は、リプロ スニペットが AttributeError を送出しなくなり、identity_fn の既存テストスイートが tenant および非 tenant の両ケースをカバーして通ることである。
索引モデルが issue の本文から書いたものです。
説明
Summary
#231 added event_type, email_type, and sms_type to identity_fn.AuthBlockingEvent (thanks!). Two properties from the blocking functions doc are still missing, so code written from the doc fails on Python:
| Doc property | Node firebase-functions |
Python firebase-functions |
|---|---|---|
authType |
authType: "USER" | "UNAUTHENTICATED" |
not present |
resource |
resource: { service, name } |
not present |
Repro
from firebase_functions import identity_fn
@identity_fn.before_user_signed_in()
def handle(event: identity_fn.AuthBlockingEvent):
event.auth_type # AttributeError
event.resource # AttributeError
Checked against the AuthBlockingEvent dataclass on main (identity_fn.py) and in 0.6.0.
Where the values come from
The Node SDK derives both from the blocking token rather than reading dedicated claims, so Python can do the same. From parseAuthEventContext:
authTypeis"USER"when the token has auser_record, otherwise"UNAUTHENTICATED".resource.serviceisidentitytoolkit.googleapis.com, andresource.nameisprojects/<project-id>/tenants/<tenant_id>when the token has atenant_id, otherwiseprojects/<project-id>.
Context
First reported in firebase/functions-samples#1129 and in #224, which #231 partly addressed. I'm closing the samples issue in favor of this one, since the fix belongs in the SDK. Until then, the tenant is available as event.data.tenant_id.
- 主要言語
- Python
- スター
- 167
- フォーク
- 36
- 平均マージ
- 4日 3時間
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
firebase/firebase-functions-python のほかの issue
-
HttpsError.__init__ does not pass message to super().__init__()対応中かも @Aayush99910 が 1 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
firebase/firebase-functions-python#314 · コメント 1 件 ·
-
Add support for VPC direct connect対応中かも @IzaakGough が 106 日前に担当しました。 オープンfeature-request
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
firebase/firebase-functions-python#275 · コメント 1 件 · リアクション 1 件 ·
-
feature-request
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
firebase/firebase-functions-python#271 · コメント 3 件 ·
-
[Bug] stability_digest_payload_from_ce_payload fails with AttributeError: 'dict' object has no attribute 'split'再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンbug unable to reproduce
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
firebase/firebase-functions-python#260 · コメント 6 件 ·
-
feature-request
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
firebase/firebase-functions-python#249 · コメント 2 件 ·
firebase/firebase-functions-python の issue をすべて見る
似ている issue
-
bug ready for review
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
odysseus-dev/odysseus#6641 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
happypawspillaro/happypaws#78 ·
メンテナーはふだん 4 日以内に返信
-
pydanty:is-working
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
pydantic/pydantic-ai#10020 ·
メンテナーはふだん 1 日以内に返信
-
Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
ansible-collections/ibm_zos_core#2650 ·
-
hw: pvc tests: vllm vllm
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
intel/intel-xpu-backend-for-triton#8362 ·
メンテナーはふだん 1 日以内に返信