### fix: verbessere CORS-Konfiguration
All checks were successful
Build and Publish Docker Images / build-and-push (., backend/services/mail/Dockerfile, mail-service, mail-service) (push) Successful in 5m51s
Build and Publish Docker Images / build-and-push (., config/docker/caddy/web-app/Dockerfile, web-app, web-app) (push) Successful in 3m54s

- **GlobalSecurityConfig:** Füge `allowedOriginPatterns` für Subdomains von `mo-code.at` hinzu.
- **UI:** Aktualisiere Versionsmarker auf `v2026-04-23.18 - RADICAL CORS PERMISSIVENESS`.
This commit is contained in:
Stefan Mogeritsch 2026-04-23 12:15:46 +02:00
parent 92950dbbe6
commit 636ecc9883
3 changed files with 12 additions and 1 deletions

View File

@ -86,8 +86,12 @@ class GlobalSecurityConfig {
"https://api.mo-code.at", "https://api.mo-code.at",
"http://localhost:8080", "http://localhost:8080",
"http://localhost:8083", "http://localhost:8083",
"http://localhost:8092",
"http://localhost:4000" "http://localhost:4000"
) )
configuration.allowedOriginPatterns = listOf(
"https://*.mo-code.at"
)
configuration.allowedMethods = listOf("GET", "POST", "PUT", "DELETE", "OPTIONS") configuration.allowedMethods = listOf("GET", "POST", "PUT", "DELETE", "OPTIONS")
configuration.allowedHeaders = listOf("*") configuration.allowedHeaders = listOf("*")
configuration.allowCredentials = true configuration.allowCredentials = true

View File

@ -57,3 +57,10 @@ Die "Hallo Du!" Test-UI wurde durch produktive, fachlich korrekte Formulare erse
- **Lösung**: - **Lösung**:
- `build.gradle.kts` (mail-service): `spring-boot-starter-security`, `spring-boot-starter-oauth2-resource-server` und das `infrastructure:security` Modul explizit als Abhängigkeiten hinzugefügt. - `build.gradle.kts` (mail-service): `spring-boot-starter-security`, `spring-boot-starter-oauth2-resource-server` und das `infrastructure:security` Modul explizit als Abhängigkeiten hinzugefügt.
- UI-Marker auf `v2026-04-23.17 - SECURITY DEPENDENCY FIX` aktualisiert. - UI-Marker auf `v2026-04-23.17 - SECURITY DEPENDENCY FIX` aktualisiert.
### v2026-04-23.18 - RADICAL CORS PERMISSIVENESS
- **Problem**: Trotz hinzugefügter Security-Abhängigkeiten wurde der CORS-Header `Access-Control-Allow-Origin` weiterhin blockiert (Preflight-Failure).
- **Lösung**:
- `GlobalSecurityConfig.kt`: `allowedOriginPatterns` mit `https://*.mo-code.at` hinzugefügt, um alle Subdomains von mo-code.at explizit abzudecken.
- Prüfung der Filterkette: Sichergestellt, dass `.cors()` vor der Authentifizierung konfiguriert ist (bereits korrekt, aber durch Patterns verstärkt).
- **Status**: Bereit zum Test. Versionsmarker auf v18 aktualisiert.

View File

@ -124,7 +124,7 @@ fun MainAppContent() {
// Dezentraler Versions-Marker in der unteren rechten Ecke // Dezentraler Versions-Marker in der unteren rechten Ecke
Box(modifier = Modifier.fillMaxSize().padding(8.dp), contentAlignment = Alignment.BottomEnd) { Box(modifier = Modifier.fillMaxSize().padding(8.dp), contentAlignment = Alignment.BottomEnd) {
Text( Text(
text = "v2026-04-23.17 - SECURITY DEPENDENCY FIX", text = "v2026-04-23.18 - RADICAL CORS PERMISSIVENESS",
style = MaterialTheme.typography.labelSmall, style = MaterialTheme.typography.labelSmall,
color = Color.LightGray.copy(alpha = 0.5f) color = Color.LightGray.copy(alpha = 0.5f)
) )