Add a function and map its result to a JS object.
https://linear.app/comm/issue/ENG-6082/allow-calling-getkeyserverkeys-on-web
Differential D10403
[web] Expose get keyserver keys Identity RPC tomek on Dec 19 2023, 6:13 AM. Authored by Tags None Referenced Files
Subscribers
Details Add a function and map its result to a JS object. https://linear.app/comm/issue/ENG-6082/allow-calling-getkeyserverkeys-on-web Call this function with hardcoded credentials taken from native and check if the keys are returned.
Diff Detail
Event TimelineComment Actions what's not working?
Comment Actions I've fetched the token on native using D10327 which gave me {"accessToken": "qYpfzfksj4rDWKSPwewFGH0v5vXAyf5T9pc4CSwLMl7QjRh0l52dvTkinbQohrjQStJAedHXFf9ZtxyZPUqZlZdxKGFdgW7No4yh62o4ts8iXEWzd5RxHL9I7MJbKWQZu0DxCrEVkcNbcZ1tG90wjowNb1K9EVxsNbcqvANJD1gDnc7eLXgfiUTHnAnHVGdnF987KNGDQeAOCizqaFJfJkUXNlBhutECAjnZhEdVJIekC94fmnvD6nwDzRVUud4rZMlAWcC2zQn1uTRXxJ5pRlH9708Z474TVzuR25WFzwzfagcJoDjJPBYzHDpHH9hZFbPJcBzNQ0BwFtS8zWagjeyvyMeQ06TXxipFZmKsna7juGW9XIhMKtoygTxdzCXJsoHkruvt7ZbEpOY3hIWcvZGWRNtbwQVvmOhYDfbJOcNd4uEtJPcfG1uhgIbIFXKs02Nm4sd6RshbjswlxWQm4m98gXtlBgeIr8KwGxtxLS1R3MdLHmJ6ChMZMNPCuR2f", "deviceID": "59WaR60E9uVlC/5KUuFTuq6XQfTTwgbh1BCQDct7GeQ", "userID": "4D33A7F6-0DB7-4652-BAC3-1B086C2E5D66"} then tried to use that on the web to auth and fetch keys for Ashoat's keyserver. The auth seems to be successful, but fetching fails with a quite useless error On Identity service, there's a log corresponding to the call [2m2023-12-21T10:29:34.333161Z[0m [31mERROR[0m [2midentity::client_service[0m[2m:[0m Encountered an unexpected error: MissingItem but it also doesn't tell too much. Comment Actions Debugged it a bit and figured out what's going on. It seems like the Identity service doesn't recognize ashoatKeyserverID to be an ID of Ashoat's user. Instead, in identity-users table there's an entry for the user whose value is some UUID (different for staging and prod). After using the ID from the table, this code works correctly. But it opens up a question of how to handle the keyserver - when interacting with the Identity service it is no longer correct to use ashoatKeyserverID as an ID. Ultimately, we won't need a hardcoded ID, but for some time it will be causing issues. Comment Actions
Identity service should be using the userIDs we already have set on the keyserver. We made this decision back in August on this thread. I'm worried that this is another case of something not being tracked that is critical for identity service launch... @varun and @bartek, some questions:
Comment Actions This discussion happened long before I touched Identity Service at all, but now I briefly looked at the code/RPCs and the RegisterReservedUserStart RPC should have the userID encrypted inside the "keyserver message+signature" payload (link to the code). The problem is that keyserver's registerOrLogin() JS function doesn't call the "reserved username" RPC but rather a normal registration, so the keyserver is registered as a new user. Edit: created ENG-6277
Comment Actions I feel like I don't have enough context to review this properly, but other reviewers seem to know this code better |