Skip to content

Commit 56d9b3e

Browse files
committed
update docs for daily keys
1 parent a5a5fc2 commit 56d9b3e

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

proto/README.md

+10-13
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ in this repository at [covidshield.proto](covidshield.proto).
1616
The Diagnosis Server implements five main endpoints:
1717

1818

19-
* `/retrieve`: Fetch a set of Diagnosis Keys for a given two-hour period
19+
* `/retrieve`: Fetch a set of Diagnosis Keys for a given UTC date number
2020
* `/upload`: Upload a batch of Diagnosis Keys
2121
* `/new-key-claim`: Generate One-Time-Code to permit an app user to upload keys
2222
* `/claim-key`: Convert One-Time-Code into a credential that permits upload
@@ -86,23 +86,20 @@ positive diagnosis, and then should call it again each subsequent day, for days
8686
Duplicate keys will be filtered by the server. Some time on day T+14, the keypairs used for
8787
encryption and authorization will become invalid and be purged.
8888

89-
## `/retrieve/:region/:period/:hmac`
89+
## `/retrieve/:region/:datenumber/:hmac`
9090

9191
The `region` is an [MCC](https://www.mcc-mnc.com/) (e.g. "302" for Canada).
9292

93-
An "hour number" in this system is a UTC timestamp divided (using integer division) by 3600. This
94-
quantity increases by 1 each hour.
95-
96-
A period is an hour number, rounded down to the next lower even number. So for example, the period
97-
for hours 3 and 2 is 2, in both cases. The period increases by 2 every 2 hours.
93+
A "date number" in this system is a UTC timestamp divided (using integer division) by 86400. This
94+
quantity increases by 1 each day, at UTC midnight.
9895

9996
the hmac parameter in this case must be a hex-encoded SHA256 HMAC (64 characters) of:
10097

101-
region + ":" + period + ":" + currentHour
98+
region + ":" + date-number + ":" + currentHour
10299

103-
where `period` is provided in the URL (e.g. `441670`), and `currentHour` is the current UTC hour
104-
number (e.g. `441683`). `currentHour` must agree with the server to within +/- 1 hour in order for
105-
the request to be accepted.
100+
where `date-number` is provided in the URL (e.g. `18431`), and `currentHour` is the current UTC hour
101+
number (timestamp / 3600; e.g. `441683`). `currentHour` must agree with the server to within +/- 1
102+
hour in order for the request to be accepted.
106103

107104
Of course there's no reliable way to truly authenticate these requests in an environment where
108105
millions of devices have immediate access to them upon downloading an Application: this scheme is
@@ -129,8 +126,8 @@ The rationale for this is: a client should fetch the key data for the past 14 da
129126
There's no need to cache historical keys locally, or to ever fetch them again or feed them into
130127
future ExposureSessions, as long as the application has recorded locally that keys have been fetched
131128
and checked for that range of historical time. This implementation is designed in a way that a
132-
device can check every two hours for newly-available unprocessed data packs and expect to find one
133-
new one each two hours to feed into an ExposureSession.
129+
device can check every day for newly-available unprocessed data packs and expect to find one
130+
new one each day to feed into an ExposureSession.
134131

135132
Note that, over time, historical packs will get smaller: the server will prune keys that, at the
136133
time of pack generation, are more than 14 days old. However, no new keys will ever be added to a

0 commit comments

Comments
 (0)