Skip to content

fix: KeyError for authtype #199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/firebase_functions/firestore_fn.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ def _firestore_endpoint_handler(
event_namespace = event_attributes["namespace"]
event_document = event_attributes["document"]
event_database = event_attributes["database"]
event_auth_type = event_attributes["authtype"]
event_auth_id = event_attributes["authid"]

time = event_attributes["time"]
event_time = _util.timestamp_conversion(time)
Expand Down Expand Up @@ -208,6 +206,8 @@ def _firestore_endpoint_handler(
func = _core._with_init(func)

if event_type.endswith(".withAuthContext"):
event_auth_type = event_attributes["authtype"]
event_auth_id = event_attributes["authid"]
database_event_with_auth_context = AuthEvent(**vars(database_event),
auth_type=event_auth_type,
auth_id=event_auth_id)
Expand Down Expand Up @@ -270,7 +270,7 @@ def on_document_written_with_auth_context(**kwargs
) -> _typing.Callable[[_C1], _C1]:
"""
Event handler that triggers when a document is created, updated, or deleted in Firestore.
This trigger will also provide the authentication context of the principal who triggered
This trigger will also provide the authentication context of the principal who triggered
the event.

Example:
Expand Down Expand Up @@ -369,7 +369,7 @@ def on_document_updated_with_auth_context(**kwargs
) -> _typing.Callable[[_C1], _C1]:
"""
Event handler that triggers when a document is updated in Firestore.
This trigger will also provide the authentication context of the principal who triggered
This trigger will also provide the authentication context of the principal who triggered
the event.

Example:
Expand Down Expand Up @@ -468,7 +468,7 @@ def on_document_created_with_auth_context(**kwargs
) -> _typing.Callable[[_C2], _C2]:
"""
Event handler that triggers when a document is created in Firestore.
This trigger will also provide the authentication context of the principal who triggered
This trigger will also provide the authentication context of the principal who triggered
the event.

Example:
Expand Down Expand Up @@ -567,7 +567,7 @@ def on_document_deleted_with_auth_context(**kwargs
) -> _typing.Callable[[_C2], _C2]:
"""
Event handler that triggers when a document is deleted in Firestore.
This trigger will also provide the authentication context of the principal who triggered
This trigger will also provide the authentication context of the principal who triggered
the event.

Example:
Expand Down
Loading