SCIM: Implement egress + tests

This commit is contained in:
fflorent
2024-09-02 17:50:42 +02:00
parent 92b4a65da0
commit 98f50d3c81
12 changed files with 142 additions and 63 deletions

View File

@@ -441,6 +441,10 @@ export class HomeDBManager extends EventEmitter {
return this._usersManager.getUser(userId, options);
}
public async getUsers() {
return this._usersManager.getUsers();
}
public async getFullUser(userId: number) {
return this._usersManager.getFullUser(userId);
}
@@ -3271,7 +3275,7 @@ export class HomeDBManager extends EventEmitter {
// Get the user objects which map to non-null values in the userDelta.
const userIds = Object.keys(userDelta).filter(userId => userDelta[userId])
.map(userIdStr => parseInt(userIdStr, 10));
const users = await this._usersManager.getUsers(userIds, manager);
const users = await this._usersManager.getUsersByIds(userIds, manager);
// Add unaffected users to the delta so that we have a record of where they are.
groups.forEach(grp => {

View File

@@ -657,10 +657,14 @@ export class UsersManager {
return [this.getSupportUserId(), this.getAnonymousUserId(), this.getEveryoneUserId()];
}
public async getUsers() {
return await User.find({relations: ["logins"]});
}
/**
* Returns a Promise for an array of User entites for the given userIds.
*/
public async getUsers(userIds: number[], optManager?: EntityManager): Promise<User[]> {
public async getUsersByIds(userIds: number[], optManager?: EntityManager): Promise<User[]> {
if (userIds.length === 0) {
return [];
}