Skip to content

Commit

Permalink
remove tls
Browse files Browse the repository at this point in the history
  • Loading branch information
octonato committed Nov 25, 2020
1 parent 99e359e commit 8c859e4
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 78 deletions.
12 changes: 2 additions & 10 deletions grpc-example/grpc-example-java/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ version in ThisBuild := "1.0-SNAPSHOT"
// the Java version that will be used for cross-compiled libraries
scalaVersion in ThisBuild := "2.12.12"

lagomServiceEnableSsl in ThisBuild := true
val `hello-impl-HTTPS-port` = 11000

val playGrpcRuntime = "com.lightbend.play" %% "play-grpc-runtime" % BuildInfo.playGrpcVersion
val lagomGrpcTestkit = "com.lightbend.play" %% "lagom-javadsl-grpc-testkit" % BuildInfo.playGrpcVersion % Test
// TODO remove after upgrade Akka gRPC
Expand Down Expand Up @@ -42,10 +39,6 @@ lazy val `hello-impl` = (project in file("hello-impl"))
),
akkaGrpcExtraGenerators in Compile += PlayJavaServerCodeGenerator,

// WORKAROUND: Lagom still can't register a service under the gRPC name so we hard-code
// the port and the use the value to add the entry on the Service Registry
lagomServiceHttpsPort := `hello-impl-HTTPS-port`,

libraryDependencies ++= Seq(
lagomJavadslTestKit,
lagomLogback,
Expand Down Expand Up @@ -92,9 +85,8 @@ lagomKafkaEnabled in ThisBuild := false

// This adds an entry on the LagomDevMode Service Registry. With this information on
// the Service Registry a client using Service Discovery to Lookup("helloworld.GreeterService")
// will get "https://localhost:11000" and then be able to send a request.
// See declaration and usages of `hello-impl-HTTPS-port`.
lagomUnmanagedServices in ThisBuild := Map("helloworld.GreeterService" -> s"https://localhost:${`hello-impl-HTTPS-port`}")
// will get "http://localhost:11000" and then be able to send a request.
lagomUnmanagedServices in ThisBuild := Map("helloworld.GreeterService" -> s"http://127.0.0.1:11000")


def common = Seq(
Expand Down
3 changes: 1 addition & 2 deletions grpc-example/grpc-example-java/hello-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,8 @@
<artifactId>lagom-maven-plugin</artifactId>
<configuration>
<lagomService>true</lagomService>
<serviceHttpsPort>${hello-impl.https.port}</serviceHttpsPort>
<serviceHttpPort>${hello-impl.http.port}</serviceHttpPort>
<serviceAddress>127.0.0.1</serviceAddress>
<serviceEnableSsl>true</serviceEnableSsl>
</configuration>
</plugin>

Expand Down
1 change: 0 additions & 1 deletion grpc-example/grpc-example-java/hello-proxy-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
<artifactId>lagom-maven-plugin</artifactId>
<configuration>
<lagomService>true</lagomService>
<serviceEnableSsl>true</serviceEnableSsl>
</configuration>
</plugin>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ akka.grpc.client {
service-discovery {
mechanism = "lagom-dev-mode"
service-name = "helloworld.GreeterService"
port-name = "https"
port-name = "http"
}
override-authority = "localhost"
deadline = 5s
connection-attempts = 5
use-tls = false
}

}

4 changes: 2 additions & 2 deletions grpc-example/grpc-example-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<kafkaEnabled>false</kafkaEnabled>
<cassandraEnabled>false</cassandraEnabled>
<unmanagedServices>
<helloworld.GreeterService>https://127.0.0.1:${hello-impl.https.port}</helloworld.GreeterService>
<helloworld.GreeterService>http://127.0.0.1:${hello-impl.http.port}</helloworld.GreeterService>
</unmanagedServices>
</configuration>
</plugin>
Expand Down Expand Up @@ -82,6 +82,6 @@
<akka.grpc.version>1.0.2</akka.grpc.version>
<play.grpc.version>0.9.1</play.grpc.version>

<hello-impl.https.port>11000</hello-impl.https.port>
<hello-impl.http.port>11000</hello-impl.http.port>
</properties>
</project>
23 changes: 0 additions & 23 deletions grpc-example/grpc-example-java/ssl-lagom

This file was deleted.

18 changes: 3 additions & 15 deletions grpc-example/grpc-example-scala/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,13 @@ val lagomGrpcTestkit = "com.lightbend.play" %% "lagom-scaladsl-grpc-testkit" % B
// TODO remove after upgrade Akka gRPC
val akkaHttp = "com.typesafe.akka" %% "akka-http2-support" % "10.1.12"

lagomServiceEnableSsl in ThisBuild := true
val `hello-impl-HTTPS-port` = 11000

def dockerSettings = Seq(
dockerUpdateLatest := true,
dockerBaseImage := "adoptopenjdk/openjdk8",
dockerUsername := sys.props.get("docker.username"),
dockerRepository := sys.props.get("docker.registry")
)

// ALL SETTINGS HERE ARE TEMPORARY WORKAROUNDS FOR KNOWN ISSUES OR WIP
def workaroundSettings: Seq[sbt.Setting[_]] = Seq(
// Lagom still can't register a service under the gRPC name so we hard-code
// the port and use the value to add the entry on the Service Registry
lagomServiceHttpsPort := `hello-impl-HTTPS-port`
)

lazy val `lagom-scala-grpc-example` = (project in file("."))
.aggregate(`hello-api`, `hello-impl`, `hello-proxy-api`, `hello-proxy-impl`)
Expand All @@ -51,8 +42,6 @@ lazy val `hello-impl` = (project in file("hello-impl"))
AkkaGrpc.Client // the client is only used in tests. See https://github.com/akka/akka-grpc/issues/410
),
akkaGrpcExtraGenerators in Compile += PlayScalaServerCodeGenerator,
).settings(
workaroundSettings:_*
).settings(
libraryDependencies ++= Seq(
lagomScaladslTestKit,
Expand Down Expand Up @@ -81,6 +70,7 @@ lazy val `hello-proxy-impl` = (project in file("hello-proxy-impl"))
libraryDependencies ++= Seq(
lagomScaladslAkkaDiscovery,
lagomScaladslTestKit,
playGrpcRuntime,
akkaHttp,
macwire,
scalaTest
Expand All @@ -101,13 +91,11 @@ lagomKafkaEnabled in ThisBuild := false

// This adds an entry on the LagomDevMode Service Registry. With this information on
// the Service Registry a client using Service Discovery to Lookup("helloworld.GreeterService")
// will get "https://localhost:11000" and then be able to send a request.
// See declaration and usages of `hello-impl-HTTPS-port`.
lagomUnmanagedServices in ThisBuild := Map("helloworld.GreeterService" -> s"https://localhost:${`hello-impl-HTTPS-port`}")
// will get "http://127.0.0.1:11000" and then be able to send a request.
lagomUnmanagedServices in ThisBuild := Map("helloworld.GreeterService" -> s"http://127.0.0.1:11000")

//----------------------------------


// Documentation for this project:
// sbt "project docs" "~ paradox"
// open docs/target/paradox/site/main/index.html
Expand Down
23 changes: 0 additions & 23 deletions grpc-example/grpc-example-scala/ssl-lagom

This file was deleted.

0 comments on commit 8c859e4

Please sign in to comment.