Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

identity_fn.AuthBlockingEvent is still missing auth_type and resource

オープン 初心者向け
#316 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
84/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
api

調査の方向性

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 の本文から書いたものです。

説明

bug
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:

  • authType is "USER" when the token has a user_record, otherwise "UNAUTHENTICATED".
  • resource.service is identitytoolkit.googleapis.com, and resource.name is projects/<project-id>/tenants/<tenant_id> when the token has a tenant_id, otherwise projects/<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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

firebase/firebase-functions-python のほかの issue

firebase/firebase-functions-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。