Skip to content

Commit

Permalink
Re-format code
Browse files Browse the repository at this point in the history
  • Loading branch information
danslapman committed Apr 4, 2023
1 parent c53bc33 commit abfa0e3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit abfa0e3

Please sign in to comment.