1818import functools as _functools
1919import datetime as _dt
2020import dataclasses as _dataclasses
21+ from enum import Enum
2122
2223import firebase_functions .options as _options
2324import firebase_functions .private .util as _util
@@ -238,17 +239,23 @@ class Credential:
238239 """The user's sign-in method."""
239240
240241
242+ class EmailType (str , Enum ):
243+ EMAIL_SIGN_IN = "EMAIL_SIGN_IN"
244+ PASSWORD_RESET = "PASSWORD_RESET"
245+
246+
247+ class SmsType (str , Enum ):
248+ SIGN_IN_OR_SIGN_UP = "SIGN_IN_OR_SIGN_UP"
249+ MULTI_FACTOR_SIGN_IN = "MULTI_FACTOR_SIGN_IN"
250+ MULTI_FACTOR_ENROLLMENT = "MULTI_FACTOR_ENROLLMENT"
251+
252+
241253@_dataclasses .dataclass (frozen = True )
242254class AuthBlockingEvent :
243255 """
244256 Defines an auth event for identitytoolkit v2 auth blocking events.
245257 """
246258
247- data : AuthUserRecord
248- """
249- The UserRecord passed to auth blocking functions from the identity platform.
250- """
251-
252259 locale : str | None
253260 """
254261 The application locale. You can set the locale using the client SDK,
@@ -262,6 +269,13 @@ class AuthBlockingEvent:
262269 Example: 'rWsyPtolplG2TBFoOkkgyg'
263270 """
264271
272+ event_type : str
273+ """
274+ The event type. This provides information on the event name, such as
275+ beforeSignIn or beforeCreate, and the associated sign-in method used,
276+ like Google or email/password.
277+ """
278+
265279 ip_address : str
266280 """
267281 The IP address of the device the end user is registering or signing in from.
@@ -280,10 +294,21 @@ class AuthBlockingEvent:
280294 credential : Credential | None
281295 """An object containing information about the user's credential."""
282296
297+ email_type : EmailType | None
298+ """The type of email event."""
299+
300+ sms_type : SmsType | None
301+ """The type of SMS event."""
302+
283303 timestamp : _dt .datetime
284304 """
285305 The time the event was triggered."""
286306
307+ data : AuthUserRecord
308+ """
309+ The UserRecord passed to auth blocking functions from the identity platform.
310+ """
311+
287312
288313RecaptchaActionOptions = _typing .Literal ["ALLOW" , "BLOCK" ]
289314"""
0 commit comments