From d7fe791fd7451df8387652bf0475cbd60585dab7 Mon Sep 17 00:00:00 2001 From: DaSCH Bot <50987250+daschbot@users.noreply.github.com> Date: Mon, 3 Jun 2024 13:07:11 +0200 Subject: [PATCH] chore: Patch dependency updates (#3261) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Christian Kleinbölting Co-authored-by: Christian Kleinbölting --- .../test/scala/org/knora/sipi/SipiIT.scala | 26 +++++++++---------- project/Dependencies.scala | 4 +-- .../slice/infrastructure/MetricsServer.scala | 10 +++---- ...etheusApp.scala => PrometheusRoutes.scala} | 8 +++--- 4 files changed, 24 insertions(+), 24 deletions(-) rename webapi/src/main/scala/org/knora/webapi/slice/infrastructure/api/{PrometheusApp.scala => PrometheusRoutes.scala} (61%) diff --git a/integration/src/test/scala/org/knora/sipi/SipiIT.scala b/integration/src/test/scala/org/knora/sipi/SipiIT.scala index 82a8ddb7b5..c13f3a20da 100644 --- a/integration/src/test/scala/org/knora/sipi/SipiIT.scala +++ b/integration/src/test/scala/org/knora/sipi/SipiIT.scala @@ -74,7 +74,7 @@ object SipiIT extends ZIOSpecDefault { _ <- MockDspApiServer.resetAndAllowWithPermissionCode(prefix, imageTestfile, 2) jwt <- createJwt(AuthScope.admin) response <- requestGet( - Root / prefix / imageTestfile / "file", + Path.root / prefix / imageTestfile / "file", Header.Cookie( NonEmptyChunk( Cookie.Request( @@ -98,7 +98,7 @@ object SipiIT extends ZIOSpecDefault { _ <- MockDspApiServer.resetAndAllowWithPermissionCode(prefix, imageTestfile, 2) jwt <- createJwt(AuthScope.admin) response <- requestGet( - Root / prefix / imageTestfile / "file", + Path.root / prefix / imageTestfile / "file", Header.Cookie(NonEmptyChunk(Cookie.Request("KnoraAuthenticationGAXDALRQFYYDUMZTGMZQ9999", jwt))), ) requestToDspApiContainsJwt <- MockDspApiServer.verifyAuthBearerTokenReceived(jwt) @@ -113,7 +113,7 @@ object SipiIT extends ZIOSpecDefault { _ <- MockDspApiServer.resetAndAllowWithPermissionCode(prefix, imageTestfile, 2) jwt <- createJwt(AuthScope.write(Shortcode.unsafeFrom(prefix))) response <- requestGet( - Root / prefix / imageTestfile / "full" / "max" / "0" / "default.jpg", + Path.root / prefix / imageTestfile / "full" / "max" / "0" / "default.jpg", Header.Cookie(NonEmptyChunk(Cookie.Request("KnoraAuthenticationGAXDALRQFYYDUMZTGMZQ9999", jwt))), ) noInteraction <- MockDspApiServer.verifyNoInteraction @@ -144,7 +144,7 @@ object SipiIT extends ZIOSpecDefault { |}""".stripMargin.fromJson[Json] for { _ <- MockDspApiServer.resetAndAllowWithPermissionCode(prefix, imageTestfile, permissionCode = 2) - response <- requestGet(Root / prefix / imageTestfile / "knora.json") + response <- requestGet(Path.root / prefix / imageTestfile / "knora.json") json <- response.body.asString.map(_.fromJson[Json]) expected <- SipiTestContainer.portAndHost.map { case (port, host) => expectedJson(port, host) } } yield assertTrue( @@ -163,7 +163,7 @@ object SipiIT extends ZIOSpecDefault { test("When getting the file, then Sipi responds with Not Found") { for { server <- MockDspApiServer.resetAndGetWireMockServer - response <- requestGet(Root / prefix / "doesnotexist.jp2" / "file") + response <- requestGet(Path.root / prefix / "doesnotexist.jp2" / "file") } yield assertTrue(response.status == Status.NotFound, verifyNoInteractionWith(server)) }, ), @@ -178,7 +178,7 @@ object SipiIT extends ZIOSpecDefault { val dspApiPermissionPath = s"/admin/files/$prefix/$imageTestfile" for { server <- MockDspApiServer.resetAndStubGetResponse(dspApiPermissionPath, 200, dspApiResponse) - response <- requestGet(Root / prefix / imageTestfile / "file") + response <- requestGet(Path.root / prefix / imageTestfile / "file") } yield assertTrue( response.status == Status.Ok, verifySingleGetRequest(server, dspApiPermissionPath), @@ -194,7 +194,7 @@ object SipiIT extends ZIOSpecDefault { val dspApiPermissionPath = s"/admin/files/$prefix/$imageTestfile" for { server <- MockDspApiServer.resetAndStubGetResponse(dspApiPermissionPath, 200, dspApiResponse) - response <- requestGet(Root / prefix / imageTestfile / "file") + response <- requestGet(Path.root / prefix / imageTestfile / "file") } yield assertTrue( response.status == Status.Unauthorized, verifySingleGetRequest(server, dspApiPermissionPath), @@ -208,7 +208,7 @@ object SipiIT extends ZIOSpecDefault { val dspApiPermissionPath = s"/admin/files/$prefix/$imageTestfile" for { server <- MockDspApiServer.resetAndStubGetResponse(dspApiPermissionPath, 404) - response <- requestGet(Root / prefix / imageTestfile / "file") + response <- requestGet(Path.root / prefix / imageTestfile / "file") } yield assertTrue( response.status == Status.NotFound, verifySingleGetRequest(server, dspApiPermissionPath), @@ -228,7 +228,7 @@ object SipiIT extends ZIOSpecDefault { for { server <- MockDspApiServer.resetAndGetWireMockServer response <- - requestGet(Root / prefix / "doesnotexist.jp2" / "full" / "max" / "0" / "default.jp2") + requestGet(Path.root / prefix / "doesnotexist.jp2" / "full" / "max" / "0" / "default.jp2") } yield assertTrue(response.status == Status.NotFound, verifyNoInteractionWith(server)) }, ), @@ -243,7 +243,7 @@ object SipiIT extends ZIOSpecDefault { val dspApiPermissionPath = s"/admin/files/$prefix/$imageTestfile" for { server <- MockDspApiServer.resetAndStubGetResponse(dspApiPermissionPath, 200, dspApiResponse) - response <- requestGet(Root / prefix / imageTestfile / "full/max/0/default.jp2") + response <- requestGet(Path.root / prefix / imageTestfile / "full/max/0/default.jp2") } yield assertTrue( response.status == Status.Ok, verifySingleGetRequest(server, dspApiPermissionPath), @@ -259,7 +259,7 @@ object SipiIT extends ZIOSpecDefault { val dspApiPermissionPath = s"/admin/files/$prefix/$imageTestfile" for { server <- MockDspApiServer.resetAndStubGetResponse(dspApiPermissionPath, 200, dspApiResponse) - response <- requestGet(Root / prefix / imageTestfile / "full/max/0/default.jp2") + response <- requestGet(Path.root / prefix / imageTestfile / "full/max/0/default.jp2") } yield assertTrue( response.status == Status.Unauthorized, verifySingleGetRequest(server, dspApiPermissionPath), @@ -273,7 +273,7 @@ object SipiIT extends ZIOSpecDefault { val dspApiPermissionPath = s"/admin/files/$prefix/$imageTestfile" for { server <- MockDspApiServer.resetAndStubGetResponse(dspApiPermissionPath, 404) - response <- requestGet(Root / prefix / imageTestfile / "full/max/0/default.jp2") + response <- requestGet(Path.root / prefix / imageTestfile / "full/max/0/default.jp2") } yield assertTrue( response.status == Status.NotFound, verifySingleGetRequest(server, dspApiPermissionPath), @@ -291,7 +291,7 @@ object SipiIT extends ZIOSpecDefault { test("health check works") { for { server <- MockDspApiServer.resetAndGetWireMockServer - response <- requestGet(Root / "server" / "test.html") + response <- requestGet(Path.root / "server" / "test.html") } yield assertTrue(response.status.isSuccess, verifyNoInteractionWith(server)) }, ) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index f21de2f456..57b303aa40 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -42,7 +42,7 @@ object Dependencies { val zioNio = "dev.zio" %% "zio-nio" % ZioNioVersion val zioMacros = "dev.zio" %% "zio-macros" % ZioVersion val zioPrelude = "dev.zio" %% "zio-prelude" % ZioPreludeVersion - val zioSttp = "com.softwaremill.sttp.client3" %% "zio" % "3.9.6" + val zioSttp = "com.softwaremill.sttp.client3" %% "zio" % "3.9.7" // refined val refined = Seq( @@ -112,7 +112,7 @@ object Dependencies { // found/added by the plugin but deleted anyway val commonsLang3 = "org.apache.commons" % "commons-lang3" % "3.14.0" - val tapirVersion = "1.10.7" + val tapirVersion = "1.10.8" val tapir = Seq( "com.softwaremill.sttp.tapir" %% "tapir-pekko-http-server" % tapirVersion, diff --git a/webapi/src/main/scala/org/knora/webapi/slice/infrastructure/MetricsServer.scala b/webapi/src/main/scala/org/knora/webapi/slice/infrastructure/MetricsServer.scala index 4e2d68c890..020008de5a 100644 --- a/webapi/src/main/scala/org/knora/webapi/slice/infrastructure/MetricsServer.scala +++ b/webapi/src/main/scala/org/knora/webapi/slice/infrastructure/MetricsServer.scala @@ -22,15 +22,15 @@ import org.knora.webapi.config.KnoraApi import org.knora.webapi.core.State import org.knora.webapi.slice.admin.api.AdminApiEndpoints import org.knora.webapi.slice.common.api.ApiV2Endpoints -import org.knora.webapi.slice.infrastructure.api.PrometheusApp +import org.knora.webapi.slice.infrastructure.api.PrometheusRoutes object MetricsServer { private val metricsServer - : ZIO[AdminApiEndpoints & ApiV2Endpoints & KnoraApi & PrometheusApp & Server, Nothing, Unit] = for { + : ZIO[AdminApiEndpoints & ApiV2Endpoints & KnoraApi & PrometheusRoutes & Server, Nothing, Unit] = for { docs <- DocsServer.docsEndpoints.map(endpoints => ZioHttpInterpreter().toHttp(endpoints)) - prometheus <- ZIO.service[PrometheusApp] - _ <- Server.install(prometheus.route ++ docs) + prometheus <- ZIO.service[PrometheusRoutes] + _ <- Server.install(prometheus.routes ++ docs) _ <- ZIO.never.as(()) } yield () @@ -58,7 +58,7 @@ object MetricsServer { Runtime.enableRuntimeMetrics, Runtime.enableFiberRoots, DefaultJvmMetrics.live.unit, - PrometheusApp.layer, + PrometheusRoutes.layer, ) } yield () } diff --git a/webapi/src/main/scala/org/knora/webapi/slice/infrastructure/api/PrometheusApp.scala b/webapi/src/main/scala/org/knora/webapi/slice/infrastructure/api/PrometheusRoutes.scala similarity index 61% rename from webapi/src/main/scala/org/knora/webapi/slice/infrastructure/api/PrometheusApp.scala rename to webapi/src/main/scala/org/knora/webapi/slice/infrastructure/api/PrometheusRoutes.scala index 104dc6f611..4b8b3ea670 100644 --- a/webapi/src/main/scala/org/knora/webapi/slice/infrastructure/api/PrometheusApp.scala +++ b/webapi/src/main/scala/org/knora/webapi/slice/infrastructure/api/PrometheusRoutes.scala @@ -12,9 +12,9 @@ import zio.metrics.connectors.prometheus.PrometheusPublisher /** * Provides the '/metrics' endpoint serving the metrics in prometheus format. */ -final case class PrometheusApp(prometheus: PrometheusPublisher) { - val route: HttpApp[Any] = Routes(Method.GET / "metrics" -> handler(prometheus.get.map(Response.text(_)))).toHttpApp +final case class PrometheusRoutes(prometheus: PrometheusPublisher) { + val routes: Routes[Any, Nothing] = Routes(Method.GET / "metrics" -> handler(prometheus.get.map(Response.text))) } -object PrometheusApp { - val layer = ZLayer.derive[PrometheusApp] +object PrometheusRoutes { + val layer = ZLayer.derive[PrometheusRoutes] }