~jan0sch/smederee

Showing details for patch 053760453d3d83c50d87b900b23c84c7a9da80af.
2024-06-06 (Thu), 11:47 AM - Jens Grassel - 053760453d3d83c50d87b900b23c84c7a9da80af

hub: Add RequestId middleware to generate request id headers.

Summary of changes
1 files modified with 13 lines added and 10 lines removed
  • modules/hub/src/main/scala/de/smederee/hub/HubServer.scala with 13 added and 10 removed lines
diff -rN -u old-smederee/modules/hub/src/main/scala/de/smederee/hub/HubServer.scala new-smederee/modules/hub/src/main/scala/de/smederee/hub/HubServer.scala
--- old-smederee/modules/hub/src/main/scala/de/smederee/hub/HubServer.scala	2025-01-11 17:46:18.095991037 +0000
+++ new-smederee/modules/hub/src/main/scala/de/smederee/hub/HubServer.scala	2025-01-11 17:46:18.095991037 +0000
@@ -44,6 +44,7 @@
 import org.http4s.server.middleware.CSRF
 import org.http4s.server.middleware.ErrorAction
 import org.http4s.server.middleware.ErrorHandling
+import org.http4s.server.middleware.RequestId
 import org.http4s.server.staticcontent.resourceServiceBuilder
 import org.slf4j.LoggerFactory
 import pureconfig.*
@@ -523,16 +524,18 @@
                     )
                     hubWebService = Router(
                         Constants.assetsPath.path.toAbsolute.toString -> assetsRoutes,
-                        "/" -> (protectedRoutesWithFallThrough <+>
-                            authenticationRoutes.routes <+>
-                            resetPasswordRoutes.routes <+>
-                            accountManagementRoutes.routes <+>
-                            signUpRoutes.routes <+>
-                            ticketLabelRoutes.routes <+>
-                            ticketMilestoneRoutes.routes <+>
-                            ticketRoutes.routes <+>
-                            vcsRepoRoutes.routes <+>
-                            landingPages.routes)
+                        "/" -> RequestId.httpRoutes(
+                            protectedRoutesWithFallThrough <+>
+                                authenticationRoutes.routes <+>
+                                resetPasswordRoutes.routes <+>
+                                accountManagementRoutes.routes <+>
+                                signUpRoutes.routes <+>
+                                ticketLabelRoutes.routes <+>
+                                ticketMilestoneRoutes.routes <+>
+                                ticketRoutes.routes <+>
+                                vcsRepoRoutes.routes <+>
+                                landingPages.routes
+                        )
                     ).orNotFound
                     // Create our ssh server fiber (or a dummy one if disabled).
                     sshServerProvider = hubConfiguration.service.ssh.enabled match {