Skip to content

Commit bd64c25

Browse files
committed
refactor: Update Firestore trigger functions to use get method for auth attributes.
1 parent 1bdc7a2 commit bd64c25

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/firebase_functions/firestore_fn.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ def _firestore_endpoint_handler(
134134
event_namespace = event_attributes["namespace"]
135135
event_document = event_attributes["document"]
136136
event_database = event_attributes["database"]
137-
event_auth_type = event_attributes["authtype"]
138-
event_auth_id = event_attributes["authid"]
137+
event_auth_type = event_attributes.get("authtype")
138+
event_auth_id = event_attributes.get("authid")
139139

140140
time = event_attributes["time"]
141141
event_time = _util.timestamp_conversion(time)
@@ -270,7 +270,7 @@ def on_document_written_with_auth_context(**kwargs
270270
) -> _typing.Callable[[_C1], _C1]:
271271
"""
272272
Event handler that triggers when a document is created, updated, or deleted in Firestore.
273-
This trigger will also provide the authentication context of the principal who triggered
273+
This trigger will also provide the authentication context of the principal who triggered
274274
the event.
275275
276276
Example:
@@ -369,7 +369,7 @@ def on_document_updated_with_auth_context(**kwargs
369369
) -> _typing.Callable[[_C1], _C1]:
370370
"""
371371
Event handler that triggers when a document is updated in Firestore.
372-
This trigger will also provide the authentication context of the principal who triggered
372+
This trigger will also provide the authentication context of the principal who triggered
373373
the event.
374374
375375
Example:
@@ -468,7 +468,7 @@ def on_document_created_with_auth_context(**kwargs
468468
) -> _typing.Callable[[_C2], _C2]:
469469
"""
470470
Event handler that triggers when a document is created in Firestore.
471-
This trigger will also provide the authentication context of the principal who triggered
471+
This trigger will also provide the authentication context of the principal who triggered
472472
the event.
473473
474474
Example:
@@ -567,7 +567,7 @@ def on_document_deleted_with_auth_context(**kwargs
567567
) -> _typing.Callable[[_C2], _C2]:
568568
"""
569569
Event handler that triggers when a document is deleted in Firestore.
570-
This trigger will also provide the authentication context of the principal who triggered
570+
This trigger will also provide the authentication context of the principal who triggered
571571
the event.
572572
573573
Example:

0 commit comments

Comments
 (0)