diff --git a/keyserver/src/creators/invite-link-creator.js b/keyserver/src/creators/invite-link-creator.js --- a/keyserver/src/creators/invite-link-creator.js +++ b/keyserver/src/creators/invite-link-creator.js @@ -211,7 +211,7 @@ holder: string, ): Promise { const identityInfo = await fetchIdentityInfo(); - const keyserverID = identityInfo?.userId; + const keyserverID = identityInfo?.userID; if (!keyserverID) { throw new ServerError('invalid_credentials'); } diff --git a/keyserver/src/responders/user-responders.js b/keyserver/src/responders/user-responders.js --- a/keyserver/src/responders/user-responders.js +++ b/keyserver/src/responders/user-responders.js @@ -748,7 +748,7 @@ let inboundKeysForUser; try { inboundKeysForUser = await rustAPI.getInboundKeysForUserDevice( - identityInfo.userId, + identityInfo.userID, authDeviceID, identityInfo.accessToken, userID, diff --git a/keyserver/src/responders/version-responders.js b/keyserver/src/responders/version-responders.js --- a/keyserver/src/responders/version-responders.js +++ b/keyserver/src/responders/version-responders.js @@ -33,7 +33,7 @@ return { codeVersion: keyserverCodeVersion, ownerUsername: userInfo?.username, - ownerID: identityInfo?.userId, + ownerID: identityInfo?.userID, }; } diff --git a/keyserver/src/services/blob.js b/keyserver/src/services/blob.js --- a/keyserver/src/services/blob.js +++ b/keyserver/src/services/blob.js @@ -13,7 +13,7 @@ async function createRequestHeaders( includeContentType: boolean = true, ): Promise<{ [string]: string }> { - const [{ userId: userID, accessToken }, deviceID] = await Promise.all([ + const [{ userID, accessToken }, deviceID] = await Promise.all([ verifyUserLoggedIn(), getContentSigningKey(), ]); diff --git a/keyserver/src/socket/tunnelbroker.js b/keyserver/src/socket/tunnelbroker.js --- a/keyserver/src/socket/tunnelbroker.js +++ b/keyserver/src/socket/tunnelbroker.js @@ -39,7 +39,7 @@ type: 'ConnectionInitializationMessage', deviceID: deviceID, accessToken: identityInfo.accessToken, - userID: identityInfo.userId, + userID: identityInfo.userID, deviceType: 'keyserver', }; diff --git a/keyserver/src/user/identity.js b/keyserver/src/user/identity.js --- a/keyserver/src/user/identity.js +++ b/keyserver/src/user/identity.js @@ -13,8 +13,8 @@ const accessTokenMetadataKey = 'access_token'; // This information is minted when registering with identity service -// Naming should reflect the rust-bindings: userId -> user_id -export type IdentityInfo = { +userId: string, +accessToken: string }; +// Naming should reflect the rust-bindings: userID -> user_id +export type IdentityInfo = { +userID: string, +accessToken: string }; async function fetchIdentityInfo(): Promise { const versionQuery = SQL` @@ -36,7 +36,7 @@ if (!userID || !accessToken) { return null; } - return { userId: userID, accessToken }; + return { userID, accessToken }; } let cachedKeyserverID: ?string; @@ -53,7 +53,7 @@ return ashoatKeyserverID; } const identityInfo = await fetchIdentityInfo(); - cachedKeyserverID = identityInfo?.userId ?? ashoatKeyserverID; + cachedKeyserverID = identityInfo?.userID ?? ashoatKeyserverID; return cachedKeyserverID; } @@ -85,7 +85,7 @@ function saveIdentityInfo(userInfo: IdentityInfo): Promise { const updateQuery = SQL` REPLACE INTO metadata (name, data) - VALUES (${userIDMetadataKey}, ${userInfo.userId}), + VALUES (${userIDMetadataKey}, ${userInfo.userID}), (${accessTokenMetadataKey}, ${userInfo.accessToken}) `; diff --git a/keyserver/src/utils/olm-utils.js b/keyserver/src/utils/olm-utils.js --- a/keyserver/src/utils/olm-utils.js +++ b/keyserver/src/utils/olm-utils.js @@ -125,7 +125,7 @@ notifAccount.one_time_keys(), ); await rustAPI.uploadOneTimeKeys( - identityInfo.userId, + identityInfo.userID, deviceID, identityInfo.accessToken, contentOneTimeKeys, @@ -193,7 +193,7 @@ } await rustAPI.publishPrekeys( - identityInfo.userId, + identityInfo.userID, deviceID, identityInfo.accessToken, contentPrekey, diff --git a/lib/types/identity-service-types.js b/lib/types/identity-service-types.js --- a/lib/types/identity-service-types.js +++ b/lib/types/identity-service-types.js @@ -13,7 +13,7 @@ import { tShape } from '../utils/validation-utils.js'; export type UserLoginResponse = { - +userId: string, + +userID: string, +accessToken: string, }; diff --git a/native/identity-service/identity-service-context-provider.react.js b/native/identity-service/identity-service-context-provider.react.js --- a/native/identity-service/identity-service-context-provider.react.js +++ b/native/identity-service/identity-service-context-provider.react.js @@ -43,7 +43,7 @@ const subscription = metadataEmitter.addListener( 'commServicesAuthMetadata', (authMetadata: UserLoginResponse) => { - userIDPromiseRef.current = Promise.resolve(authMetadata.userId); + userIDPromiseRef.current = Promise.resolve(authMetadata.userID); }, ); return () => subscription.remove();