Skip to content

Commit 490cfe0

Browse files
committed
AET update: 64-char user_ids and relaxing validation
Fixes #571 Also allows `firefox-accounts` pings without an `ecosystem_client_id` value as long as `ecosystem_anon_id` is present. Server apps will need to send AET pings with anon_id but without any relevant client_id to be associated with, so we want to avoid having to introduce a static server-side client_id just to conform to the schema. Telemetry AET pings are still required to have an `ecosystem_client_id` as we expect the client should always be able to provide that value.
1 parent 8f22589 commit 490cfe0

File tree

8 files changed

+41
-17
lines changed

8 files changed

+41
-17
lines changed
Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,35 @@
11
{
22
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"anyOf": [
4+
{
5+
"required": [
6+
"ecosystem_client_id"
7+
]
8+
},
9+
{
10+
"required": [
11+
"ecosystem_user_id"
12+
]
13+
}
14+
],
315
"properties": {
416
"ecosystem_client_id": {
517
"type": "string"
618
},
719
"ecosystem_user_id": {
820
"description": "Account Ecosystem Telemetry user identifier; this value is not present in the original payload sent by clients, but is instead inserted by the pipeline after decrypting and removing ecosystem_anon_id",
9-
"pattern": "[a-zA-z0-9]{32}",
21+
"pattern": "[a-zA-z0-9]{64}",
1022
"type": "string"
1123
},
1224
"previous_ecosystem_user_ids": {
1325
"description": "Previous Account Ecosystem Telemetry identifiers associated with this user; this value is not present in the original payload sent by clients, but is instead inserted by the pipeline after decrypting and removing previous_ecosystem_anon_ids",
1426
"items": {
15-
"pattern": "[a-zA-z0-9]{32}",
27+
"pattern": "[a-zA-z0-9]{64}",
1628
"type": "string"
1729
},
1830
"type": "array"
1931
}
2032
},
21-
"required": [
22-
"ecosystem_client_id"
23-
],
2433
"title": "account-ecosystem",
2534
"type": "object"
2635
}

schemas/telemetry/account-ecosystem/account-ecosystem.4.schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@
6363
},
6464
"ecosystemUserId": {
6565
"description": "Account Ecosystem Telemetry user identifier; this value is not present in the original payload sent by clients, but is instead inserted by the pipeline after decrypting and removing ecosystemAnonId",
66-
"pattern": "[a-zA-z0-9]{32}",
66+
"pattern": "[a-zA-z0-9]{64}",
6767
"type": "string"
6868
},
6969
"previousEcosystemUserIds": {
7070
"description": "Previous Account Ecosystem Telemetry identifiers associated with this user; this value is not present in the original payload sent by clients, but is instead inserted by the pipeline after decrypting and removing previousEcosystemAnonIds",
7171
"items": {
72-
"pattern": "[a-zA-z0-9]{32}",
72+
"pattern": "[a-zA-z0-9]{64}",
7373
"type": "string"
7474
},
7575
"type": "array"

templates/firefox-accounts/account-ecosystem/account-ecosystem.1.schema.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,16 @@
1818
}
1919
}
2020
},
21-
"required": [
22-
"ecosystem_client_id"
21+
"anyOf": [
22+
{
23+
"required": [
24+
"ecosystem_client_id"
25+
]
26+
},
27+
{
28+
"required": [
29+
"ecosystem_user_id"
30+
]
31+
}
2332
]
2433
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"type": "string",
2-
"pattern": "[a-zA-z0-9]{32}"
2+
"pattern": "[a-zA-z0-9]{64}"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"previous_ecosystem_user_ids": [
3+
"2345678923456789234567892345678923456789234567892345678923456789"
4+
]
5+
}
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
"ecosystem_client_id": "foo",
3-
"ecosystem_device_id": "bar",
4-
"ecosystem_user_id": "abcdef01abcdef01abcdef01abcdef01",
3+
"ecosystem_user_id": "abcdef01abcdef01abcdef01abcdef01abcdef01abcdef01abcdef01abcdef01",
54
"previous_ecosystem_user_ids": [
6-
"23456789234567892345678923456789"
5+
"2345678923456789234567892345678923456789234567892345678923456789"
76
]
87
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"ecosystem_user_id": "abcdef01abcdef01abcdef01abcdef01abcdef01abcdef01abcdef01abcdef01"
3+
}

validation/telemetry/account-ecosystem.4.sample.pass.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
"channel": "default"
1616
},
1717
"payload": {
18-
"ecosystemClientId": "unknown",
19-
"ecosystemDeviceId": "unknown",
20-
"ecosystemUserId": "abcdefghabcdefghabcdefghabcdefgh",
21-
"previousEcosystemUserIds": ["1bcdefghabcdefghabcdefghabcdefgh"],
18+
"ecosystemClientId": "5bdc7cec-0b1d-ac42-a369-610223b7869d",
19+
"ecosystemUserId": "abcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefgh",
20+
"previousEcosystemUserIds": ["18cdefghabcdefghabcdefghabcdefgh1bcdefghabcdefghabcdefghabcdefg3"],
2221
"scalars": {
2322
"parent": {
2423
"browser.engagement.total_uri_count": 3

0 commit comments

Comments
 (0)