diff --git a/keyserver/src/fetchers/user-fetchers.js b/keyserver/src/fetchers/user-fetchers.js --- a/keyserver/src/fetchers/user-fetchers.js +++ b/keyserver/src/fetchers/user-fetchers.js @@ -374,6 +374,12 @@ return row.username; } +async function fetchAllUsernames(): Promise { + const query = SQL`SELECT username FROM users`; + const [result] = await dbQuery(query); + return result.map(row => row.username); +} + async function fetchKeyserverAdminID(): Promise { const changeRoleExtractString = `$.${threadPermissions.CHANGE_ROLE}`; const query = SQL` @@ -415,6 +421,7 @@ fetchCurrentUserInfo, fetchAllUserIDs, fetchUsername, + fetchAllUsernames, fetchKnownUserInfos, fetchKeyserverAdminID, fetchUserIDForEthereumAddress,