Skip to content

Commit a36e29e

Browse files
committed
Document and test the Firebase Auth metadata timestamp mapping
1 parent 83aade8 commit a36e29e

File tree

6 files changed

+24
-9
lines changed

6 files changed

+24
-9
lines changed

docs/mapping.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,14 @@ TBD: Where the `app-id` part comes from.
184184

185185
The `subject` attribute of the CloudEvent is of the form `users/{uid}` where the
186186
`uid` value is taken from the `uid` property within the original
187-
`data` property. (This value is still populated within the CloudEvent data as well.)
187+
`data` property. This value is still retained within the CloudEvent data as well.
188+
189+
Additionally, two properties within the CloudEvent have different names
190+
to those in the GCF HTTP event. Within the `metadata` top-level
191+
property, there are two timestamps. In GCF HTTP events these have
192+
names of `createdAt` and `lastSignedInAt`; in the CloudEvent
193+
representation the names are `createTime` and `lastSignInTime`
194+
respectively.
188195

189196
### Firestore document events (tentative)
190197

events/events_data.go

Lines changed: 8 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

events/generate/data/firebase-auth-cloudevent-input.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"data": {
1010
"email": "[email protected]",
1111
"metadata": {
12-
"createdAt": "2020-05-26T10:42:27Z"
12+
"createTime": "2020-05-26T10:42:27Z",
13+
"lastSignInTime": "2020-10-24T11:00:00Z"
1314
},
1415
"providerData": [
1516
{

events/generate/data/firebase-auth-cloudevent-output.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"data": {
1010
"email": "[email protected]",
1111
"metadata": {
12-
"createdAt": "2020-05-26T10:42:27Z"
12+
"createTime": "2020-05-26T10:42:27Z",
13+
"lastSignInTime": "2020-10-24T11:00:00Z"
1314
},
1415
"providerData": [
1516
{

events/generate/data/firebase-auth-legacy-input.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"data": {
33
"email": "[email protected]",
44
"metadata": {
5-
"createdAt": "2020-05-26T10:42:27Z"
5+
"createdAt": "2020-05-26T10:42:27Z",
6+
"lastSignedInAt": "2020-10-24T11:00:00Z"
67
},
78
"providerData": [
89
{

events/generate/data/firebase-auth-legacy-output.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"data": {
33
"email": "[email protected]",
44
"metadata": {
5-
"createdAt": "2020-05-26T10:42:27Z"
5+
"createdAt": "2020-05-26T10:42:27Z",
6+
"lastSignedInAt": "2020-10-24T11:00:00Z"
67
},
78
"providerData": [
89
{

0 commit comments

Comments
 (0)