Skip to content

Commit

Permalink
Merge branch 'main' into spsh-665-send-persons-to-itslearning
Browse files Browse the repository at this point in the history
  • Loading branch information
marode-cap authored Jul 1, 2024
2 parents 1417aaa + 596b93e commit e7a3c92
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 15 deletions.
6 changes: 3 additions & 3 deletions charts/dbildungs-iam-server/seeding/dev/01_organisation.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
"entities": [
{
"id": 0,
"name": "Wurzel Land Schleswig Holstein",
"name": "Land Schleswig-Holstein",
"kuerzel": "Root",
"typ": "ROOT",
"administriertVon": null,
"zugehoerigZu": null
},
{
"id": 1,
"name": "Öffentliche Schulen Land Schleswig Holstein",
"name": "Öffentliche Schulen Land Schleswig-Holstein",
"kuerzel": "Öffentl. Schulen",
"typ": "LAND",
"administriertVon": 0,
"zugehoerigZu": 0
},
{
"id": 2,
"name": "Ersatzschulen Land Schleswig Holstein",
"name": "Ersatzschulen Land Schleswig-Holstein",
"kuerzel": "Ersatzschulen",
"typ": "LAND",
"administriertVon": 0,
Expand Down
6 changes: 3 additions & 3 deletions seeding/dev/01/01_organisation.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
"entities": [
{
"id": 0,
"name": "Wurzel Land Schleswig Holstein",
"name": "Land Schleswig-Holstein",
"kuerzel": "Root",
"typ": "ROOT",
"administriertVon": null,
"zugehoerigZu": null
},
{
"id": 1,
"name": "Öffentliche Schulen Land Schleswig Holstein",
"name": "Öffentliche Schulen Land Schleswig-Holstein",
"kuerzel": "Öffentl. Schulen",
"typ": "LAND",
"administriertVon": 0,
"zugehoerigZu": 0
},
{
"id": 2,
"name": "Ersatzschulen Land Schleswig Holstein",
"name": "Ersatzschulen Land Schleswig-Holstein",
"kuerzel": "Ersatzschulen",
"typ": "LAND",
"administriertVon": 0,
Expand Down
9 changes: 9 additions & 0 deletions seeding/dev/01/04_rolle.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@
"MIGRATION_DURCHFUEHREN"
],
"serviceProviderIds": []
},
{
"id": 6,
"administeredBySchulstrukturknoten": 0,
"name": "Schulbegleitung",
"rollenart": "LERN",
"merkmale": [],
"systemrechte": [],
"serviceProviderIds": []
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
"entities": [
{
"id": 0,
"name": "Wurzel Land Schleswig Holstein",
"name": "Land Schleswig-Holstein",
"kuerzel": "Root",
"typ": "ROOT",
"administriertVon": null,
"zugehoerigZu": null
}
]
}


Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,18 @@ 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,
error: new KeycloakClientError('Invalid bcrypt hash format'),
};
}
hashIterations = parseInt(parts[2]);
passwordValue = hashedPassword.substring(hashedPassword.indexOf('$'));
} else if (hashedPassword.startsWith('{crypt}')) {
algorithm = 'crypt';
const parts: string[] = hashedPassword.split('$');
Expand All @@ -107,6 +109,7 @@ export class KeycloakUserService {
};
}
hashIterations = undefined;
passwordValue = hashedPassword.substring(hashedPassword.indexOf('$'));
} else {
return {
ok: false,
Expand Down Expand Up @@ -144,7 +147,7 @@ export class KeycloakUserService {
algorithm: algorithm,
}),
secretData: JSON.stringify({
value: hashedPassword,
value: passwordValue,
}),
type: 'password',
},
Expand Down
4 changes: 2 additions & 2 deletions src/modules/organisation/api/organisation.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit e7a3c92

Please sign in to comment.