This differential introduces methods in CommCoreModule to get one time keys batch and prekey for notifications olm account. Additionally corresponding method for primary olm account is
refactored. The refactor gives us control on how many one time keys are generated (previously we were restricted to the default value in CryptoModule.h). Implemented and refactored methods return JS
objects of types OLMOneTimeKeys or OLMPrekey respectively. Note that getUserOneTimeKeys returned raw string previously.
Details
In account-selectors place the following code under commCoreModule.initializeCryptoAccount():
const [notificationsOneTimeKeys, notificationsPrekey, userOneTimeKeys] = await Promise.all([ commCoreModule.getNotificationsOneTimeKeys(2), commCoreModule.getNotificationsPrekey(), commCoreModule.getUserOneTimeKeys(10), ]); console.log(notificationsOneTimeKeys); console.log(notificationsPrekey); console.log(userOneTimeKeys);
Build the app, log-in and examine content of keys logged to the console.
Diff Detail
- Repository
- rCOMM Comm
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
It's hard to know how to review this diff when we don't know how the types will be used. Is it possible to combine this diff with another one that uses the types?
Types OLMPrekey and OLMOneTimeKeys are used in very next differential to type data returned from CommCoreModule, so we add declaration of those two there. Type OLMSessionInitializationKeys will be used when I upload prekey and one time keys to the keyserver via login request, so it can be declared further in the stack. I will make those changes.
Initially this diff contained only type definitions which made it impossible to review without seeing the types usages. Then I merged changes from the very next differentials that use those types, but new I think it is better to abandon this revision and put type definitions in the next differential. I decided to do so since the next differential already contains some discussion.