From f7b8cc5f5e2cb3abee1abc1c3e713c02e99d696c Mon Sep 17 00:00:00 2001 From: Nael-Alshowaikh <153004766+Nael-Alshowaikh@users.noreply.github.com> Date: Wed, 26 Jun 2024 17:22:39 +0200 Subject: [PATCH 1/2] renamed to Land Schleswig Holstein (#556) * renamed to Land Schleswig Holstein * added - in Schleswig-Holstein --- .../dbildungs-iam-server/seeding/dev/01_organisation.json | 6 +++--- seeding/dev/01/01_organisation.json | 6 +++--- .../organisation/06_kuerzel-is-root.json | 4 +--- .../organisation/api/organisation.controller.spec.ts | 4 ++-- .../persistence/organisation.repository.integration-spec.ts | 4 ++-- 5 files changed, 11 insertions(+), 13 deletions(-) diff --git a/charts/dbildungs-iam-server/seeding/dev/01_organisation.json b/charts/dbildungs-iam-server/seeding/dev/01_organisation.json index c6bcac4b1..d594e850c 100644 --- a/charts/dbildungs-iam-server/seeding/dev/01_organisation.json +++ b/charts/dbildungs-iam-server/seeding/dev/01_organisation.json @@ -3,7 +3,7 @@ "entities": [ { "id": 0, - "name": "Wurzel Land Schleswig Holstein", + "name": "Land Schleswig-Holstein", "kuerzel": "Root", "typ": "ROOT", "administriertVon": null, @@ -11,7 +11,7 @@ }, { "id": 1, - "name": "Öffentliche Schulen Land Schleswig Holstein", + "name": "Öffentliche Schulen Land Schleswig-Holstein", "kuerzel": "Öffentl. Schulen", "typ": "LAND", "administriertVon": 0, @@ -19,7 +19,7 @@ }, { "id": 2, - "name": "Ersatzschulen Land Schleswig Holstein", + "name": "Ersatzschulen Land Schleswig-Holstein", "kuerzel": "Ersatzschulen", "typ": "LAND", "administriertVon": 0, diff --git a/seeding/dev/01/01_organisation.json b/seeding/dev/01/01_organisation.json index c6bcac4b1..d594e850c 100644 --- a/seeding/dev/01/01_organisation.json +++ b/seeding/dev/01/01_organisation.json @@ -3,7 +3,7 @@ "entities": [ { "id": 0, - "name": "Wurzel Land Schleswig Holstein", + "name": "Land Schleswig-Holstein", "kuerzel": "Root", "typ": "ROOT", "administriertVon": null, @@ -11,7 +11,7 @@ }, { "id": 1, - "name": "Öffentliche Schulen Land Schleswig Holstein", + "name": "Öffentliche Schulen Land Schleswig-Holstein", "kuerzel": "Öffentl. Schulen", "typ": "LAND", "administriertVon": 0, @@ -19,7 +19,7 @@ }, { "id": 2, - "name": "Ersatzschulen Land Schleswig Holstein", + "name": "Ersatzschulen Land Schleswig-Holstein", "kuerzel": "Ersatzschulen", "typ": "LAND", "administriertVon": 0, diff --git a/seeding/seeding-integration-test/organisation/06_kuerzel-is-root.json b/seeding/seeding-integration-test/organisation/06_kuerzel-is-root.json index 6b4e62919..90f6ebc14 100644 --- a/seeding/seeding-integration-test/organisation/06_kuerzel-is-root.json +++ b/seeding/seeding-integration-test/organisation/06_kuerzel-is-root.json @@ -3,7 +3,7 @@ "entities": [ { "id": 0, - "name": "Wurzel Land Schleswig Holstein", + "name": "Land Schleswig-Holstein", "kuerzel": "Root", "typ": "ROOT", "administriertVon": null, @@ -11,5 +11,3 @@ } ] } - - diff --git a/src/modules/organisation/api/organisation.controller.spec.ts b/src/modules/organisation/api/organisation.controller.spec.ts index 9c5c88e9a..b6f50ad76 100644 --- a/src/modules/organisation/api/organisation.controller.spec.ts +++ b/src/modules/organisation/api/organisation.controller.spec.ts @@ -336,7 +336,7 @@ describe('OrganisationController', () => { faker.string.uuid(), faker.string.uuid(), faker.string.numeric(), - 'Öffentliche Schulen Land Schleswig Holstein', + 'Öffentliche Schulen Land Schleswig-Holstein', faker.lorem.word(), faker.string.uuid(), OrganisationsTyp.ROOT, @@ -349,7 +349,7 @@ describe('OrganisationController', () => { faker.string.uuid(), faker.string.uuid(), faker.string.numeric(), - 'Ersatzschulen Land Schleswig Holstein', + 'Ersatzschulen Land Schleswig-Holstein', faker.lorem.word(), faker.string.uuid(), OrganisationsTyp.SCHULE, diff --git a/src/modules/organisation/persistence/organisation.repository.integration-spec.ts b/src/modules/organisation/persistence/organisation.repository.integration-spec.ts index ab82a0708..fa0593d4f 100644 --- a/src/modules/organisation/persistence/organisation.repository.integration-spec.ts +++ b/src/modules/organisation/persistence/organisation.repository.integration-spec.ts @@ -430,7 +430,7 @@ describe('OrganisationRepository', () => { ROOT_ORGANISATION_ID, faker.string.uuid(), faker.string.numeric(), - 'Öffentliche Schulen Land Schleswig Holstein', + 'Öffentliche Schulen Land Schleswig-Holstein', faker.lorem.word(), faker.string.uuid(), OrganisationsTyp.ROOT, @@ -443,7 +443,7 @@ describe('OrganisationRepository', () => { ROOT_ORGANISATION_ID, faker.string.uuid(), faker.string.numeric(), - 'Ersatzschulen Land Schleswig Holstein', + 'Ersatzschulen Land Schleswig-Holstein', faker.lorem.word(), faker.string.uuid(), OrganisationsTyp.SCHULE, From 596b93e8ab4fa4e11cf380b67ead46856413ce14 Mon Sep 17 00:00:00 2001 From: Caspar Neumann <146704428+casparneumann-cap@users.noreply.github.com> Date: Thu, 27 Jun 2024 11:07:06 +0200 Subject: [PATCH 2/2] SPSH-730 Clean Data (#555) --- seeding/dev/01/04_rolle.json | 9 +++++++++ .../domain/keycloak-user.service.ts | 7 +++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/seeding/dev/01/04_rolle.json b/seeding/dev/01/04_rolle.json index eb1d89673..b7f45cc04 100644 --- a/seeding/dev/01/04_rolle.json +++ b/seeding/dev/01/04_rolle.json @@ -116,6 +116,15 @@ "MIGRATION_DURCHFUEHREN" ], "serviceProviderIds": [] + }, + { + "id": 6, + "administeredBySchulstrukturknoten": 0, + "name": "Schulbegleitung", + "rollenart": "LERN", + "merkmale": [], + "systemrechte": [], + "serviceProviderIds": [] } ] } diff --git a/src/modules/keycloak-administration/domain/keycloak-user.service.ts b/src/modules/keycloak-administration/domain/keycloak-user.service.ts index 3440666fe..16d58b50e 100644 --- a/src/modules/keycloak-administration/domain/keycloak-user.service.ts +++ b/src/modules/keycloak-administration/domain/keycloak-user.service.ts @@ -87,9 +87,10 @@ export class KeycloakUserService { } let algorithm: string; let hashIterations: number | undefined; + let passwordValue: string; if (hashedPassword.startsWith('{BCRYPT}')) { algorithm = 'bcrypt'; - const parts: string[] = hashedPassword.split('$'); + const parts: string[] = hashedPassword.split('$'); //Only Everything After and including the First $ if (parts.length < 4 || !parts[2]) { return { ok: false, @@ -97,6 +98,7 @@ export class KeycloakUserService { }; } hashIterations = parseInt(parts[2]); + passwordValue = hashedPassword.substring(hashedPassword.indexOf('$')); } else if (hashedPassword.startsWith('{crypt}')) { algorithm = 'crypt'; const parts: string[] = hashedPassword.split('$'); @@ -107,6 +109,7 @@ export class KeycloakUserService { }; } hashIterations = undefined; + passwordValue = hashedPassword.substring(hashedPassword.indexOf('$')); } else { return { ok: false, @@ -144,7 +147,7 @@ export class KeycloakUserService { algorithm: algorithm, }), secretData: JSON.stringify({ - value: hashedPassword, + value: passwordValue, }), type: 'password', },