Have cron job for prekeys lifecycle publish
the keys to identity service.
Part of https://linear.app/comm/issue/ENG-3944
Depends on D8475
Differential D8476
[Keyserver] Publish prekeys to identity service for cron job kamil on Jul 11 2023, 10:09 AM. Authored by Tags None Referenced Files
Details Have cron job for prekeys lifecycle publish Part of https://linear.app/comm/issue/ENG-3944 Depends on D8475 Run identity service + localstack
cd keyserver RUST_LOG=debug yarn dev
Diff Detail
Event Timeline
Comment Actions Only got through the first file. You still don't understand the feedback I've been repeating on every one of your keyserver diffs. You need to step back and try to understand async/await in JS. Please make sure I don't have to give you this feedback again.
Comment Actions I understand that I am not a reviewer but @kamil wanted me to see this diff and I would like to note one thing. This cron job will only fire if keyserver's very first prekey's were marked as published somewhere else. In practice keyserver prekeys are published for the first time here: https://github.com/CommE2E/comm/blob/master/keyserver/src/responders/keys-responders.js#L59. However the only reason prekeys are marked as published there is that at the time this code was implemented we wanted to launch e2e notifs ASAP but the identity service was not ready, so we agreed on a temporary solution to mark prekey's as published when user fetches them to initialise olm notifications session with the keyserver. That said as of this differential this line should be deleted and we should find a place to publish keyserver's prekeys for the very first time after olm accounts for the keyserver are created. Comment Actions Looking at the code of our Olm fork, it looks like the only effect of calling mark_prekey_as_published() is on the result of calling unpublished_prekey(). The only place we check unpublished_prekey is in the above code, where we use it to make sure that we don't throw away an old prekey before the newer prekey is published. @marcin correctly points out that we have some callsites today that set mark_prekey_as_published. These calls are potentially dangerous because of the following scenario:
We can instead consider removing the two linked callsites of mark_prekey_as_published, as @marcin suggested. The result will be that prekey rotation will be disabled until the existing prekey is successfully published to the identity service. However, we might still have a potential issue for the existing prekeys, which are marked as published but have not been published to the identity service. We will either need to make sure these prekeys are published to the identity service using some other mechanism, or else find some way to throw them away in favor of new prekeys that are only marked as published once they have been published to the identity service. This is admittedly a rather complex subject. I'm happy to discuss it in more depth, either async or in a meeting.
Comment Actions Here I described how to resolve all the issues: ENG-3944
|