Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BC-8592 add externalId to GroupProvisioningInfoLoggable #5404

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe(GroupProvisioningInfoLoggable.name, () => {
otherUsers: externalGroupUserDtoFactory.buildList(otherUserCount),
});

const loggable = new GroupProvisioningInfoLoggable(externalGroups, 100);
const loggable = new GroupProvisioningInfoLoggable(externalGroups, 100, 'igorHatGesagt');

return {
loggable,
Expand All @@ -31,6 +31,7 @@ describe(GroupProvisioningInfoLoggable.name, () => {
groupCount,
userCount: totalUserCount,
durationMs: 100,
externalUserId: 'igorHatGesagt',
},
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import { ErrorLogMessage, Loggable, LogMessage, ValidationErrorLogMessage } from
import { ExternalGroupDto } from '../dto';

export class GroupProvisioningInfoLoggable implements Loggable {
constructor(private readonly groups: ExternalGroupDto[], private readonly durationMs: number) {}
constructor(
private readonly groups: ExternalGroupDto[],
private readonly durationMs: number,
private readonly externalUserId: string
) {}

public getLogMessage(): LogMessage | ErrorLogMessage | ValidationErrorLogMessage {
const userCount = this.groups.reduce(
Expand All @@ -16,6 +20,7 @@ export class GroupProvisioningInfoLoggable implements Loggable {
groupCount: this.groups.length,
userCount,
durationMs: this.durationMs,
externalUserId: this.externalUserId,
},
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ export abstract class SchulconnexProvisioningStrategy extends ProvisioningStrate
}

const endTime = performance.now();
this.logger.warning(new GroupProvisioningInfoLoggable(data.externalGroups ?? [], endTime - startTime));
this.logger.warning(
new GroupProvisioningInfoLoggable(data.externalGroups ?? [], endTime - startTime, data.externalUser.externalId)
);
}

private async removeUserFromGroups(data: OauthDataDto): Promise<void> {
Expand Down
Loading