~jan0sch/smederee

Showing details for patch 8a10cb439f354d4a32551937d1d40a67ddc61033.
2023-07-24 (Mon), 6:48 PM - Jens Grassel - 8a10cb439f354d4a32551937d1d40a67ddc61033

Update http4s to 1.0.0-M40

Summary of changes
4 files modified with 13 lines added and 6 lines removed
  • build.sbt with 7 added and 1 removed lines
  • modules/hub/src/main/scala/de/smederee/hub/HubServer.scala with 4 added and 3 removed lines
  • modules/hub/src/main/scala/de/smederee/hub/VcsRepositoryRoutes.scala with 2 added and 1 removed lines
  • modules/tickets/src/test/scala/de/smederee/tickets/config/SmedereeTicketsConfigurationTest.scala with 0 added and 1 removed lines
diff -rN -u old-smederee/build.sbt new-smederee/build.sbt
--- old-smederee/build.sbt	2025-01-15 18:34:18.232312929 +0000
+++ new-smederee/build.sbt	2025-01-15 18:34:18.236312936 +0000
@@ -161,12 +161,14 @@
         library.doobiePostgres,
         library.flywayCore,
         library.http4sCirce,
+        library.http4sCore,
         library.http4sDsl,
         library.http4sEmberClient,
         library.http4sEmberServer,
         //library.http4sTwirl,
         library.jansi,
         library.jclOverSlf4j, // Bridge Java Commons Logging to SLF4J.
+        library.log4catsSlf4j,
         library.logback,
         library.osLib,
         library.postgresql,
@@ -315,11 +317,13 @@
         library.doobiePostgres,
         library.flywayCore,
         library.http4sCirce,
+        library.http4sCore,
         library.http4sDsl,
         library.http4sEmberClient,
         library.http4sEmberServer,
         //library.http4sTwirl,
         library.jclOverSlf4j, // Bridge Java Commons Logging to SLF4J.
+        library.log4catsSlf4j,
         library.logback,
         library.postgresql,
         library.pureConfig,
@@ -436,10 +440,11 @@
       val doobie          = "1.0.0-RC4"
       val flyway          = "9.20.1"
       val fs2             = "3.5.0"
-      val http4s          = "1.0.0-M39"
+      val http4s          = "1.0.0-M40"
       val ip4s            = "3.3.0"
       val jansi           = "2.4.2"
       val jclOverSlf4j    = "2.0.7"
+      val log4cats        = "2.6.0"
       val logback         = "1.4.8"
       val munit           = "0.7.29"
       val munitCatsEffect = "1.0.7"
@@ -480,6 +485,7 @@
     val ip4sCore                   = "com.comcast"                  %% "ip4s-core"                      % Version.ip4s
     val jansi                      = "com.github.Osiris-Team"       %  "jansi"                          % Version.jansi
     val jclOverSlf4j               = "org.slf4j"                    %  "jcl-over-slf4j"                 % Version.jclOverSlf4j
+    val log4catsSlf4j              = "org.typelevel"                %% "log4cats-slf4j"                    % Version.log4cats
     val logback                    = "ch.qos.logback"               %  "logback-classic"                % Version.logback
     val munit                      = "org.scalameta"                %% "munit"                          % Version.munit
     val munitCatsEffect            = "org.typelevel"                %% "munit-cats-effect-3"            % Version.munitCatsEffect
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-15 18:34:18.232312929 +0000
+++ new-smederee/modules/hub/src/main/scala/de/smederee/hub/HubServer.scala	2025-01-15 18:34:18.236312936 +0000
@@ -107,6 +107,8 @@
 object HubServer extends IOApp with AuthenticationMiddleware {
   private val log = LoggerFactory.getLogger(getClass)
 
+  given org.typelevel.log4cats.LoggerFactory[IO] = org.typelevel.log4cats.slf4j.Slf4jFactory.create[IO]
+
   /** Create a function to perform the origin checks for the CSRF protection middleware using the configuration.
     *
     * @param allowedOrigins
@@ -391,7 +393,6 @@
            * the CSRF secret key will change then and thus all requests are invalid.
            */
           csrfMiddleware = csrfBuilder
-            .withClock(cryptoClock)
             .withCookieDomain(Option(hubConfiguration.service.external.host.toString))
             .withCookieName(Constants.csrfCookieName.toString)
             .withCookiePath(Option("/"))
@@ -403,8 +404,8 @@
               ).removeCookie(Constants.csrfCookieName.toString)
             )
             .build
-          signAndValidate    = SignAndValidate(hubConfiguration.service.authentication.cookieSecret)
-          assetsRoutes       = resourceServiceBuilder[IO](Constants.assetsPath.path.toAbsolute.toString).toRoutes
+          signAndValidate = SignAndValidate(hubConfiguration.service.authentication.cookieSecret)
+          assetsRoutes <- resourceServiceBuilder[IO](Constants.assetsPath.path.toAbsolute.toString).toRoutes
           authenticationRepo = new DoobieAuthenticationRepository[IO](hubTransactor)
           authenticationWithFallThrough = AuthMiddleware.withFallThrough(
             authenticateUserWithFallThrough(
diff -rN -u old-smederee/modules/hub/src/main/scala/de/smederee/hub/VcsRepositoryRoutes.scala new-smederee/modules/hub/src/main/scala/de/smederee/hub/VcsRepositoryRoutes.scala
--- old-smederee/modules/hub/src/main/scala/de/smederee/hub/VcsRepositoryRoutes.scala	2025-01-15 18:34:18.232312929 +0000
+++ new-smederee/modules/hub/src/main/scala/de/smederee/hub/VcsRepositoryRoutes.scala	2025-01-15 18:34:18.236312936 +0000
@@ -63,7 +63,8 @@
     vcsMetadataRepo: VcsMetadataRepository[F],
     ticketsProjectRepo: ProjectRepository[F]
 ) extends Http4sDsl[F] {
-  private val log = LoggerFactory.getLogger(getClass)
+  private val log                               = LoggerFactory.getLogger(getClass)
+  given org.typelevel.log4cats.LoggerFactory[F] = org.typelevel.log4cats.slf4j.Slf4jFactory.create[F]
 
   private val MaximumFileSize     = configuration.renderMaximumFileSize
   private val createRepoPath      = uri"/repo/create"
diff -rN -u old-smederee/modules/tickets/src/test/scala/de/smederee/tickets/config/SmedereeTicketsConfigurationTest.scala new-smederee/modules/tickets/src/test/scala/de/smederee/tickets/config/SmedereeTicketsConfigurationTest.scala
--- old-smederee/modules/tickets/src/test/scala/de/smederee/tickets/config/SmedereeTicketsConfigurationTest.scala	2025-01-15 18:34:18.236312936 +0000
+++ new-smederee/modules/tickets/src/test/scala/de/smederee/tickets/config/SmedereeTicketsConfigurationTest.scala	2025-01-15 18:34:18.236312936 +0000
@@ -17,7 +17,6 @@
 
 package de.smederee.tickets.config
 
-import cats.syntax.all._
 import com.typesafe.config._
 import org.http4s.Uri
 import org.http4s.implicits._