diff --git a/backend/mockingbird-api/src/main/scala/ru/tinkoff/tcb/mockingbird/Mockingbird.scala b/backend/mockingbird-api/src/main/scala/ru/tinkoff/tcb/mockingbird/Mockingbird.scala index 07d80417..b1b6c2e0 100644 --- a/backend/mockingbird-api/src/main/scala/ru/tinkoff/tcb/mockingbird/Mockingbird.scala +++ b/backend/mockingbird-api/src/main/scala/ru/tinkoff/tcb/mockingbird/Mockingbird.scala @@ -21,6 +21,7 @@ import sttp.client3.armeria.zio.ArmeriaZioBackend import tofu.logging.Logging import tofu.logging.impl.ZUniversalLogging import zio.managed.* + import ru.tinkoff.tcb.mockingbird.api.AdminApiHandler import ru.tinkoff.tcb.mockingbird.api.AdminHttp import ru.tinkoff.tcb.mockingbird.api.MetricsHttp @@ -143,7 +144,9 @@ object Mockingbird extends scala.App { scopedBackend <- ArmeriaZioBackend.scopedUsingClient(webClient) } yield scopedBackend }, - (ZLayer.service[ServerConfig].project(_.sandbox) ++ ZLayer.fromZIO(ZIO.attempt(readStr("prelude.js")).map(Option(_)))) >>> GraalJsSandbox.live, + (ZLayer.service[ServerConfig].project(_.sandbox) ++ ZLayer.fromZIO( + ZIO.attempt(readStr("prelude.js")).map(Option(_)) + )) >>> GraalJsSandbox.live, mongoLayer, aesEncoder, collection(_.stub) >>> HttpStubDAOImpl.live, @@ -193,7 +196,8 @@ object Mockingbird extends scala.App { mongoLayer, collection(_.state) >>> PersistentStateDAOImpl.live, collection(_.grpcStub) >>> GrpcStubDAOImpl.live, - (ZLayer.service[ServerConfig].project(_.sandbox) ++ ZLayer.fromZIO(ZIO.attempt(readStr("prelude.js")).map(Option(_)))) >>> GraalJsSandbox.live, + (ZLayer.service[ServerConfig].project(_.sandbox) ++ ZLayer + .fromZIO(ZIO.attempt(readStr("prelude.js")).map(Option(_)))) >>> GraalJsSandbox.live, GrpcStubResolverImpl.live, GrpcRequestHandlerImpl.live ) diff --git a/backend/mockingbird/src/main/scala/ru/tinkoff/tcb/mockingbird/config/Configuration.scala b/backend/mockingbird/src/main/scala/ru/tinkoff/tcb/mockingbird/config/Configuration.scala index e45177f8..8c598382 100644 --- a/backend/mockingbird/src/main/scala/ru/tinkoff/tcb/mockingbird/config/Configuration.scala +++ b/backend/mockingbird/src/main/scala/ru/tinkoff/tcb/mockingbird/config/Configuration.scala @@ -10,7 +10,13 @@ import net.ceedubs.ficus.readers.EnumerationReader.* case class JsSandboxConfig(allowedClasses: Set[String] = Set()) -case class ServerConfig(interface: String, port: Int, allowedOrigins: Seq[String], healthCheckRoute: Option[String], sandbox: JsSandboxConfig) +case class ServerConfig( + interface: String, + port: Int, + allowedOrigins: Seq[String], + healthCheckRoute: Option[String], + sandbox: JsSandboxConfig +) case class SecurityConfig(secret: String)