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
@@ -237,18 +238,21 @@ class Credential:
237
238
sign_in_method : str
238
239
"""The user's sign-in method."""
239
240
241
+ class EmailType (str , Enum ):
242
+ EMAIL_SIGN_IN = "EMAIL_SIGN_IN"
243
+ PASSWORD_RESET = "PASSWORD_RESET"
244
+
245
+ class SmsType (str , Enum ):
246
+ SIGN_IN_OR_SIGN_UP = "SIGN_IN_OR_SIGN_UP"
247
+ MULTI_FACTOR_SIGN_IN = "MULTI_FACTOR_SIGN_IN"
248
+ MULTI_FACTOR_ENROLLMENT = "MULTI_FACTOR_ENROLLMENT"
240
249
241
250
@_dataclasses .dataclass (frozen = True )
242
251
class AuthBlockingEvent :
243
252
"""
244
253
Defines an auth event for identitytoolkit v2 auth blocking events.
245
254
"""
246
255
247
- data : AuthUserRecord
248
- """
249
- The UserRecord passed to auth blocking functions from the identity platform.
250
- """
251
-
252
256
locale : str | None
253
257
"""
254
258
The application locale. You can set the locale using the client SDK,
@@ -262,6 +266,13 @@ class AuthBlockingEvent:
262
266
Example: 'rWsyPtolplG2TBFoOkkgyg'
263
267
"""
264
268
269
+ event_type : str
270
+ """
271
+ The event type. This provides information on the event name, such as
272
+ beforeSignIn or beforeCreate, and the associated sign-in method used,
273
+ like Google or email/password.
274
+ """
275
+
265
276
ip_address : str
266
277
"""
267
278
The IP address of the device the end user is registering or signing in from.
@@ -280,10 +291,21 @@ class AuthBlockingEvent:
280
291
credential : Credential | None
281
292
"""An object containing information about the user's credential."""
282
293
294
+ email_type : EmailType | None
295
+ """The type of email event."""
296
+
297
+ sms_type : SmsType | None
298
+ """The type of SMS event."""
299
+
283
300
timestamp : _dt .datetime
284
301
"""
285
302
The time the event was triggered."""
286
303
304
+ data : AuthUserRecord
305
+ """
306
+ The UserRecord passed to auth blocking functions from the identity platform.
307
+ """
308
+
287
309
288
310
RecaptchaActionOptions = _typing .Literal ["ALLOW" , "BLOCK" ]
289
311
"""
0 commit comments