18
18
import functools as _functools
19
19
import datetime as _dt
20
20
import dataclasses as _dataclasses
21
+ from enum import Enum
21
22
22
23
import firebase_functions .options as _options
23
24
import firebase_functions .private .util as _util
@@ -238,17 +239,23 @@ class Credential:
238
239
"""The user's sign-in method."""
239
240
240
241
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
+
241
253
@_dataclasses .dataclass (frozen = True )
242
254
class AuthBlockingEvent :
243
255
"""
244
256
Defines an auth event for identitytoolkit v2 auth blocking events.
245
257
"""
246
258
247
- data : AuthUserRecord
248
- """
249
- The UserRecord passed to auth blocking functions from the identity platform.
250
- """
251
-
252
259
locale : str | None
253
260
"""
254
261
The application locale. You can set the locale using the client SDK,
@@ -262,6 +269,13 @@ class AuthBlockingEvent:
262
269
Example: 'rWsyPtolplG2TBFoOkkgyg'
263
270
"""
264
271
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
+
265
279
ip_address : str
266
280
"""
267
281
The IP address of the device the end user is registering or signing in from.
@@ -280,10 +294,21 @@ class AuthBlockingEvent:
280
294
credential : Credential | None
281
295
"""An object containing information about the user's credential."""
282
296
297
+ email_type : EmailType | None
298
+ """The type of email event."""
299
+
300
+ sms_type : SmsType | None
301
+ """The type of SMS event."""
302
+
283
303
timestamp : _dt .datetime
284
304
"""
285
305
The time the event was triggered."""
286
306
307
+ data : AuthUserRecord
308
+ """
309
+ The UserRecord passed to auth blocking functions from the identity platform.
310
+ """
311
+
287
312
288
313
RecaptchaActionOptions = _typing .Literal ["ALLOW" , "BLOCK" ]
289
314
"""
0 commit comments