Skip to content

Commit c5b1dcf

Browse files
committed
feat: lowercase authtype and authid accessors and add debug logs
1 parent 0935754 commit c5b1dcf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/firebase_functions/firestore_fn.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
from firebase_functions.options import FirestoreOptions
3434
from firebase_functions.core import Change
3535

36+
from firebase_functions import logger
37+
3638
_event_type_written = "google.cloud.firestore.document.v1.written"
3739
_event_type_created = "google.cloud.firestore.document.v1.created"
3840
_event_type_updated = "google.cloud.firestore.document.v1.updated"
@@ -129,13 +131,15 @@ def _firestore_endpoint_handler(
129131
raise TypeError(f"Firestore: Cannot parse event payload of data type "
130132
f"'{actual_type}' and content type '{content_type}'.")
131133

134+
logger.debug("Event Attributes", event_attributes=event_attributes)
135+
132136
event_location = event_attributes["location"]
133137
event_project = event_attributes["project"]
134138
event_namespace = event_attributes["namespace"]
135139
event_document = event_attributes["document"]
136140
event_database = event_attributes["database"]
137-
event_auth_type = event_attributes["authType"]
138-
event_auth_id = event_attributes["authId"]
141+
event_auth_type = event_attributes["authtype"]
142+
event_auth_id = event_attributes["authid"]
139143

140144
time = event_attributes["time"]
141145
event_time = _util.timestamp_conversion(time)

0 commit comments

Comments
 (0)