From 584cb1a21e7f86d91ef392ed9b35d38fad516939 Mon Sep 17 00:00:00 2001 From: Phillip Date: Wed, 18 Dec 2024 14:22:51 +0100 Subject: [PATCH] BC-8592 add externalId to GroupProvisioningInfoLoggable (#5404) --- .../loggable/group-provisioning-info.loggable.spec.ts | 3 ++- .../loggable/group-provisioning-info.loggable.ts | 7 ++++++- .../provisioning/strategy/oidc/schulconnex.strategy.ts | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/server/src/modules/provisioning/loggable/group-provisioning-info.loggable.spec.ts b/apps/server/src/modules/provisioning/loggable/group-provisioning-info.loggable.spec.ts index fb67f57ea0..3e880155d4 100644 --- a/apps/server/src/modules/provisioning/loggable/group-provisioning-info.loggable.spec.ts +++ b/apps/server/src/modules/provisioning/loggable/group-provisioning-info.loggable.spec.ts @@ -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, @@ -31,6 +31,7 @@ describe(GroupProvisioningInfoLoggable.name, () => { groupCount, userCount: totalUserCount, durationMs: 100, + externalUserId: 'igorHatGesagt', }, }); }); diff --git a/apps/server/src/modules/provisioning/loggable/group-provisioning-info.loggable.ts b/apps/server/src/modules/provisioning/loggable/group-provisioning-info.loggable.ts index 537a31e785..57819c4538 100644 --- a/apps/server/src/modules/provisioning/loggable/group-provisioning-info.loggable.ts +++ b/apps/server/src/modules/provisioning/loggable/group-provisioning-info.loggable.ts @@ -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( @@ -16,6 +20,7 @@ export class GroupProvisioningInfoLoggable implements Loggable { groupCount: this.groups.length, userCount, durationMs: this.durationMs, + externalUserId: this.externalUserId, }, }; } diff --git a/apps/server/src/modules/provisioning/strategy/oidc/schulconnex.strategy.ts b/apps/server/src/modules/provisioning/strategy/oidc/schulconnex.strategy.ts index adbebd76b5..c2223ee9fc 100644 --- a/apps/server/src/modules/provisioning/strategy/oidc/schulconnex.strategy.ts +++ b/apps/server/src/modules/provisioning/strategy/oidc/schulconnex.strategy.ts @@ -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 {