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

SPSH-1137 #750

Merged
merged 37 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
305d183
Implement VIDIS module/service to request VIDIS offers from VIDIS Off…
he-meyer Nov 11, 2024
6776041
Implement new mapping table between Organisation and ServiceProvider
he-meyer Nov 11, 2024
4608900
Implement logic to create or update ServiceProviders for VIDIS offers
he-meyer Nov 11, 2024
59ff21e
Implement cron job endpoint for VIDIS ServiceProvider update
he-meyer Nov 11, 2024
7728bcf
Merge branch 'main' into SPSH-1137
he-meyer Nov 11, 2024
822b7ec
Use faker in test
he-meyer Nov 11, 2024
001557b
Add VIDIS config keys
he-meyer Nov 11, 2024
86a693e
Add config keys for test
he-meyer Nov 11, 2024
073649c
Add dummy test data for config test
he-meyer Nov 11, 2024
3f7d879
Fix tests
he-meyer Nov 11, 2024
98d5604
Add tests
he-meyer Nov 11, 2024
ad617ca
Add keys
he-meyer Nov 12, 2024
0a2f74f
Add and adapt tests
he-meyer Nov 12, 2024
1736010
Change arguments to correct parameter order
he-meyer Nov 12, 2024
81c8598
Add permission check to cron controller endpoint
he-meyer Nov 12, 2024
a9e5a2a
Adapt tests
he-meyer Nov 12, 2024
bb9b893
Use root Organisation as schulstrukturknoten for VIDIS offers
he-meyer Nov 14, 2024
2d37c69
Externalize VIDIS related config
he-meyer Nov 14, 2024
c362052
Use MissingPermissionsError, remove no longer required CronJobError
he-meyer Nov 14, 2024
74d4993
Remove unnecessary import
he-meyer Nov 14, 2024
9987ab0
Rename variable
he-meyer Nov 14, 2024
1a04cdd
Rename test files
he-meyer Nov 14, 2024
86b1af4
Fix vidisConfig declaration
he-meyer Nov 14, 2024
1ed5157
Change findByName
he-meyer Nov 14, 2024
73ae7f9
Avoid try-catch
he-meyer Nov 15, 2024
5ca53ca
Fix check
he-meyer Nov 15, 2024
dfec33d
Merge branch 'main' of https://github.com/dBildungsplattform/dbildung…
he-meyer Nov 15, 2024
3e65e3b
Fix migration
he-meyer Nov 15, 2024
7fe62ba
Add or adapt logs
he-meyer Nov 20, 2024
a1f319c
Fix missing logging dependency for test
he-meyer Nov 20, 2024
5a02eb2
Add missing import of ClassLogger
he-meyer Nov 21, 2024
bbc6d16
Change from offer to Angebot
he-meyer Nov 22, 2024
52ff52c
Add logging
he-meyer Nov 22, 2024
3fb0121
Use existing method to retrieve Organisationen, remove unnecessary me…
he-meyer Nov 22, 2024
fdafd0c
Avoid magic numbers for media type file signatures
he-meyer Nov 22, 2024
678c038
Merge branch 'main' of https://github.com/dBildungsplattform/dbildung…
he-meyer Nov 25, 2024
fd15659
Merge branch 'main' of https://github.com/dBildungsplattform/dbildung…
he-meyer Nov 29, 2024
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
8 changes: 8 additions & 0 deletions charts/dbildungs-iam-server/config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,13 @@
"RENAME_WAITING_TIME_IN_SECONDS": 3,
"STEP_UP_TIMEOUT_ENABLED": "true",
"STEP_UP_TIMEOUT_IN_SECONDS": 10
},
"VIDIS": {
"BASE_URL": "https://service-stage.vidis.schule",
"USERNAME": "",
"PASSWORD": "",
"REGION_NAME": "test-region",
"KEYCLOAK_GROUP": "VIDIS-service",
"KEYCLOAK_ROLE": "VIDIS-user"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,34 @@
secretKeyRef:
name: {{ default .Values.auth.existingSecret .Values.auth.secretName }}
key: redis-password
- name: VIDIS_BASE_URL
valueFrom:
secretKeyRef:
name: {{ default .Values.auth.existingSecret .Values.auth.secretName }}
key: vidis-base-url
- name: VIDIS_USERNAME
valueFrom:
secretKeyRef:
name: {{ default .Values.auth.existingSecret .Values.auth.secretName }}
key: vidis-username
- name: VIDIS_PASSWORD
valueFrom:
secretKeyRef:
name: {{ default .Values.auth.existingSecret .Values.auth.secretName }}
key: vidis-password
- name: VIDIS_REGION_NAME
valueFrom:
secretKeyRef:
name: {{ default .Values.auth.existingSecret .Values.auth.secretName }}
key: vidis-region-name
- name: VIDIS_KEYCLOAK_GROUP
valueFrom:
secretKeyRef:
name: {{ default .Values.auth.existingSecret .Values.auth.secretName }}
key: vidis-keycloak-group
- name: VIDIS_KEYCLOAK_ROLE
valueFrom:
secretKeyRef:
name: {{ default .Values.auth.existingSecret .Values.auth.secretName }}
key: vidis-keycloak-role
{{- end}}
6 changes: 6 additions & 0 deletions charts/dbildungs-iam-server/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,10 @@ data:
system-step-up-enabled: {{ .Values.auth.system_step_up_enabled }}
secrets-json: {{ .Values.auth.secrets_json }}
redis-password: {{ .Values.auth.redis_password }}
vidis-base-url: {{ .Values.auth.vidis_base_url }}
vidis-username: {{ .Values.auth.vidis_username }}
vidis-password: {{ .Values.auth.vidis_password }}
vidis-region-name: {{ .Values.auth.vidis_region_name }}
vidis-keycloak-group: {{ .Values.auth.vidis_keycloak_group }}
vidis-keycloak-role: {{ .Values.auth.vidis_keycloak_role }}
{{- end }}
6 changes: 6 additions & 0 deletions charts/dbildungs-iam-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ auth:
system_step_up_timeout_in_seconds: ''
system_step_up_timeout_enabled: ''
redis_password: ''
vidis_base_url: ''
vidis_username: ''
vidis_password: ''
vidis_region_name: ''
vidis_keycloak_group: ''
vidis_keycloak_role: ''

backend:
replicaCount: 1
Expand Down
8 changes: 8 additions & 0 deletions config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@
"USER_RESOLVER": "mariadb_resolver",
"REALM": "defrealm"
},
"VIDIS": {
"BASE_URL": "https://service-stage.vidis.schule",
"USERNAME": "username",
"PASSWORD": "password",
"REGION_NAME": "test-region",
"KEYCLOAK_GROUP": "VIDIS-service",
"KEYCLOAK_ROLE": "VIDIS-user"
},
"IMPORT": {
"IMPORT_FILE_MAXGROESSE_IN_MB": 10
},
Expand Down
230 changes: 230 additions & 0 deletions migrations/.snapshot-dbildungs-iam-server.json
Original file line number Diff line number Diff line change
Expand Up @@ -4523,6 +4523,236 @@
}
}
},
{
"columns": {
"organisation_id": {
"name": "organisation_id",
"type": "uuid",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "uuid"
},
"service_provider_id": {
"name": "service_provider_id",
"type": "uuid",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "uuid"
}
},
"name": "organisation_service_provider",
"schema": "public",
"indexes": [
{
"keyName": "organisation_service_provider_pkey",
"columnNames": [
"organisation_id",
"service_provider_id"
],
"composite": true,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"organisation_service_provider_organisation_id_foreign": {
"constraintName": "organisation_service_provider_organisation_id_foreign",
"columnNames": [
"organisation_id"
],
"localTableName": "public.organisation_service_provider",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.organisation",
"updateRule": "cascade"
},
"organisation_service_provider_service_provider_id_foreign": {
"constraintName": "organisation_service_provider_service_provider_id_foreign",
"columnNames": [
"service_provider_id"
],
"localTableName": "public.organisation_service_provider",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.service_provider",
"updateRule": "cascade"
}
},
"nativeEnums": {
"db_seed_status_enum": {
"name": "db_seed_status_enum",
"schema": "public",
"items": [
"STARTED",
"DONE",
"FAILED"
]
},
"referenced_entity_type_enum": {
"name": "referenced_entity_type_enum",
"schema": "public",
"items": [
"PERSON",
"ORGANISATION",
"ROLLE",
"SERVICE_PROVIDER"
]
},
"organisations_typ_enum": {
"name": "organisations_typ_enum",
"schema": "public",
"items": [
"ROOT",
"LAND",
"TRAEGER",
"SCHULE",
"KLASSE",
"ANBIETER",
"SONSTIGE ORGANISATION / EINRICHTUNG",
"UNBESTAETIGT"
]
},
"traegerschaft_enum": {
"name": "traegerschaft_enum",
"schema": "public",
"items": [
"01",
"02",
"03",
"04",
"05",
"06"
]
},
"geschlecht_enum": {
"name": "geschlecht_enum",
"schema": "public",
"items": [
"m",
"w",
"d",
"x"
]
},
"vertrauensstufe_enum": {
"name": "vertrauensstufe_enum",
"schema": "public",
"items": [
"KEIN",
"UNBE",
"TEIL",
"VOLL"
]
},
"email_address_status_enum": {
"name": "email_address_status_enum",
"schema": "public",
"items": [
"ENABLED",
"DISABLED",
"REQUESTED",
"FAILED"
]
},
"rollen_art_enum": {
"name": "rollen_art_enum",
"schema": "public",
"items": [
"LERN",
"LEHR",
"EXTERN",
"ORGADMIN",
"LEIT",
"SYSADMIN"
]
},
"personenstatus_enum": {
"name": "personenstatus_enum",
"schema": "public",
"items": [
"AKTIV"
]
},
"jahrgangsstufe_enum": {
"name": "jahrgangsstufe_enum",
"schema": "public",
"items": [
"01",
"02",
"03",
"04",
"05",
"06",
"07",
"08",
"09",
"10"
]
},
"rollen_merkmal_enum": {
"name": "rollen_merkmal_enum",
"schema": "public",
"items": [
"BEFRISTUNG_PFLICHT",
"KOPERS_PFLICHT"
]
},
"rollen_system_recht_enum": {
"name": "rollen_system_recht_enum",
"schema": "public",
"items": [
"ROLLEN_VERWALTEN",
"PERSONEN_SOFORT_LOESCHEN",
"PERSONEN_VERWALTEN",
"SCHULEN_VERWALTEN",
"KLASSEN_VERWALTEN",
"SCHULTRAEGER_VERWALTEN",
"MIGRATION_DURCHFUEHREN",
"PERSON_SYNCHRONISIEREN",
"CRON_DURCHFUEHREN",
"PERSONEN_ANLEGEN",
"IMPORT_DURCHFUEHREN"
]
},
"service_provider_target_enum": {
"name": "service_provider_target_enum",
"schema": "public",
"items": [
"URL",
"EMAIL",
"SCHULPORTAL_ADMINISTRATION"
]
},
"service_provider_kategorie_enum": {
"name": "service_provider_kategorie_enum",
"schema": "public",
"items": [
"EMAIL",
"UNTERRICHT",
"VERWALTUNG",
"HINWEISE",
"ANGEBOTE"
]
},
"service_provider_system_enum": {
"name": "service_provider_system_enum",
"schema": "public",
"items": [
"NONE",
"EMAIL",
"ITSLEARNING"
]
}
}
},
{
"columns": {
"id": {
Expand Down
20 changes: 20 additions & 0 deletions migrations/Migration20241115133701-S.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Migration } from '@mikro-orm/migrations';

export class Migration20241115133701 extends Migration {
async up(): Promise<void> {
this.addSql(
'create table "organisation_service_provider" ("organisation_id" uuid not null, "service_provider_id" uuid not null, constraint "organisation_service_provider_pkey" primary key ("organisation_id", "service_provider_id"));',
);

this.addSql(
'alter table "organisation_service_provider" add constraint "organisation_service_provider_organisation_id_foreign" foreign key ("organisation_id") references "organisation" ("id") on update cascade;',
);
this.addSql(
'alter table "organisation_service_provider" add constraint "organisation_service_provider_service_provider_id_foreign" foreign key ("service_provider_id") references "service_provider" ("id") on update cascade;',
);
}

override async down(): Promise<void> {
this.addSql('drop table if exists "organisation_service_provider" cascade;');
}
}
Loading
Loading