1313# limitations under the License.
1414"""Cloud functions to handle Eventarc events."""
1515
16- # pylint: disable=protected-access
16+ # pylint: disable=protected-access,cyclic-import
1717import typing as _typing
1818import functools as _functools
1919import datetime as _dt
@@ -36,7 +36,7 @@ class AuthUserInfo:
3636 """The user identifier for the linked provider."""
3737
3838 provider_id : str
39- """The linked provider ID (e.g., "google.com" for the Google provider)."""
39+ """The linked provider ID (such as "google.com" for the Google provider)."""
4040
4141 display_name : str | None = None
4242 """The display name for the linked provider."""
@@ -59,7 +59,7 @@ class AuthUserMetadata:
5959 creation_time : _dt .datetime
6060 """The date the user was created."""
6161
62- last_sign_in_time : _dt .datetime
62+ last_sign_in_time : _typing . Optional [ _dt .datetime ]
6363 """The date the user last signed in."""
6464
6565
@@ -110,7 +110,7 @@ class AuthMultiFactorSettings:
110110@_dataclasses .dataclass (frozen = True )
111111class AuthUserRecord :
112112 """
113- The UserRecord passed to auth blocking Cloud Functions from the identity platform.
113+ The UserRecord passed to auth blocking functions from the identity platform.
114114 """
115115
116116 uid : str
@@ -123,7 +123,7 @@ class AuthUserRecord:
123123 The user's primary email, if set.
124124 """
125125
126- email_verified : bool
126+ email_verified : bool | None
127127 """
128128 Whether or not the user's primary email is verified.
129129 """
@@ -155,7 +155,7 @@ class AuthUserRecord:
155155
156156 provider_data : list [AuthUserInfo ]
157157 """
158- An array of providers (e.g., Google, Facebook) linked to the user.
158+ An array of providers (such as Google or Facebook) linked to the user.
159159 """
160160
161161 password_hash : str | None
@@ -203,6 +203,9 @@ class AdditionalUserInfo:
203203 is_new_user : bool
204204 """A boolean indicating if the user is new or not."""
205205
206+ recaptcha_score : float | None
207+ """The user's reCAPTCHA score, if available."""
208+
206209
207210@_dataclasses .dataclass (frozen = True )
208211class Credential :
@@ -243,12 +246,12 @@ class AuthBlockingEvent:
243246
244247 data : AuthUserRecord
245248 """
246- The UserRecord passed to auth blocking Cloud Functions from the identity platform.
249+ The UserRecord passed to auth blocking functions from the identity platform.
247250 """
248251
249252 locale : str | None
250253 """
251- The application locale. You can set the locale using the client SDK,
254+ The application locale. You can set the locale using the client SDK,
252255 or by passing the locale header in the REST API.
253256 Example: 'fr' or 'sv-SE'
254257 """
@@ -282,6 +285,12 @@ class AuthBlockingEvent:
282285 The time the event was triggered."""
283286
284287
288+ RecaptchaActionOptions = _typing .Literal ["ALLOW" , "BLOCK" ]
289+ """
290+ The reCAPTCHA action options.
291+ """
292+
293+
285294class BeforeCreateResponse (_typing .TypedDict , total = False ):
286295 """
287296 The handler response type for 'before_user_created' blocking events.
@@ -302,6 +311,8 @@ class BeforeCreateResponse(_typing.TypedDict, total=False):
302311 custom_claims : dict [str , _typing .Any ] | None
303312 """The user's custom claims object if available."""
304313
314+ recaptcha_action_override : RecaptchaActionOptions | None
315+
305316
306317class BeforeSignInResponse (BeforeCreateResponse , total = False ):
307318 """
@@ -345,7 +356,7 @@ def example(event: identity_fn.AuthBlockingEvent) -> identity_fn.BeforeSignInRes
345356 :param \\ *\\ *kwargs: Options.
346357 :type \\ *\\ *kwargs: as :exc:`firebase_functions.options.BlockingOptions`
347358 :rtype: :exc:`typing.Callable`
348- \\ [ \\ [ :exc:`firebase_functions.identity_fn.AuthBlockingEvent` \\ ],
359+ \\ [ \\ [ :exc:`firebase_functions.identity_fn.AuthBlockingEvent` \\ ],
349360 :exc:`firebase_functions.identity_fn.BeforeSignInResponse` \\ | `None` \\ ]
350361 A function that takes a AuthBlockingEvent and optionally returns BeforeSignInResponse.
351362 """
@@ -399,7 +410,7 @@ def example(event: identity_fn.AuthBlockingEvent) -> identity_fn.BeforeCreateRes
399410 :param \\ *\\ *kwargs: Options.
400411 :type \\ *\\ *kwargs: as :exc:`firebase_functions.options.BlockingOptions`
401412 :rtype: :exc:`typing.Callable`
402- \\ [ \\ [ :exc:`firebase_functions.identity_fn.AuthBlockingEvent` \\ ],
413+ \\ [ \\ [ :exc:`firebase_functions.identity_fn.AuthBlockingEvent` \\ ],
403414 :exc:`firebase_functions.identity_fn.BeforeCreateResponse` \\ | `None` \\ ]
404415 A function that takes a AuthBlockingEvent and optionally returns BeforeCreateResponse.
405416 """
0 commit comments