Skip to content

Commit

Permalink
feat: add configuration for gRPC usePlainText (enable TLS for gRPC) (#…
Browse files Browse the repository at this point in the history
…823)

Signed-off-by: David Poltorak <[email protected]>
Signed-off-by: Shota Jolbordi <[email protected]>
  • Loading branch information
davidpoltorak-io authored and Shota Jolbordi committed Mar 18, 2024
1 parent d80fe5e commit 63b7f7b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ prismNode {
host = ${?PRISM_NODE_HOST}
port = 50053
port = ${?PRISM_NODE_PORT}
usePlainText = true
usePlainText = ${?PRISM_NODE_USE_PLAIN_TEXT}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,15 @@ object GrpcModule {
.service[AppConfig]
.map(_.prismNode.service)
.flatMap(config =>
ZIO.attempt(
NodeServiceGrpc.stub(ManagedChannelBuilder.forAddress(config.host, config.port).usePlaintext.build)
)
if (config.usePlainText) {
ZIO.attempt(
NodeServiceGrpc.stub(ManagedChannelBuilder.forAddress(config.host, config.port).usePlaintext.build)
)
} else {
ZIO.attempt(
NodeServiceGrpc.stub(ManagedChannelBuilder.forAddress(config.host, config.port).build)
)
}
)
)
SystemModule.configLayer >>> stubLayer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ final case class ConnectConfig(

final case class PrismNodeConfig(service: GrpcServiceConfig)

final case class GrpcServiceConfig(host: String, port: Int)
final case class GrpcServiceConfig(host: String, port: Int, usePlainText: Boolean)

final case class StatusListRegistryConfig(
publicEndpointUrl: String
Expand Down

0 comments on commit 63b7f7b

Please sign in to comment.