HomePhabricator
Diffusion Comm 4be92668a75c

[keyserver][lib][native] Refactor getVersion action

Description

[keyserver][lib][native] Refactor getVersion action

Summary:
issue: https://linear.app/comm/issue/ENG-5282/refactor-getversion-action
We need to get from the keyserver the username and id of the owner.
getVersion action is called before we have ever talked to the keyserver - we don't know its id, we don't have a cookie or session set, we don't have an entry for it in the keyserver store. To use the useKeyserverCall we create a temporary entry. We could probably do this better, but I'm low on time and I don't think it's worth doing now. This solution won't make it harder to upgrade later.
This mirors how it was done before in useServerCall, but there we were also sending the cookie and any other values that were already in our store, nevermind it was for a different keyserver potentially. This was actually a security breach

Test Plan:
Passed parramOverride to useKeyserverCall:

{
      keyserverInfos: {
        [TEMPORARY_KS_ID]: {
          urlPrefix: 'http://localhost:3000/comm',
        },
      },
}

and called the action. Checked that the correct values are returned from the keyserver.

Reviewers: michal, kamil, ginsu

Reviewed By: michal

Subscribers: ashoat, tomek, wyilio

Differential Revision: https://phab.comm.dev/D9636

Details

Provenance
inkaAuthored on Oct 30 2023, 11:08 AM
Reviewer
michal
Differential Revision
D9636: [keyserver][lib][native] Refactor getVersion action
Parents
rCOMM59848f1aa297: [lib][web][native] Refactor setDeviceToken action
Branches
Unknown
Tags
Unknown