Skip to content

Commit 3d157ff

Browse files
committed
Action sbt scalafmtAll
1 parent dc0a330 commit 3d157ff

File tree

2 files changed

+30
-29
lines changed

2 files changed

+30
-29
lines changed

module/ldbc-connector/js/src/main/scala/ldbc/connector/SSLPlatform.scala

+9-8
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,20 @@
77
package ldbc.connector
88

99
import cats.ApplicativeError
10+
1011
import cats.effect.*
1112

13+
import fs2.io.net.tls.{ SecureContext, TLSContext }
1214
import fs2.io.net.Network
13-
import fs2.io.net.tls.{SecureContext, TLSContext}
1415

1516
private[ldbc] trait SSLPlatform:
1617

1718
def fromSecureContext(
18-
secureContext: SecureContext
19-
): SSL = new SSL:
20-
override def tlsContext[F[_] : Network](using ae: ApplicativeError[F, Throwable]): Resource[F, TLSContext[F]] =
21-
Resource.pure(
22-
Network[F].tlsContext.fromSecureContext(
23-
secureContext
24-
)
19+
secureContext: SecureContext
20+
): SSL = new SSL:
21+
override def tlsContext[F[_]: Network](using ae: ApplicativeError[F, Throwable]): Resource[F, TLSContext[F]] =
22+
Resource.pure(
23+
Network[F].tlsContext.fromSecureContext(
24+
secureContext
2525
)
26+
)

module/ldbc-connector/js/src/test/scala/ldbc/connector/TLSConnectionTest.scala

+21-21
Original file line numberDiff line numberDiff line change
@@ -10,38 +10,38 @@ import cats.syntax.all.*
1010

1111
import cats.effect.*
1212

13-
import fs2.text
1413
import fs2.io.file.*
1514
import fs2.io.net.tls.SecureContext
15+
import fs2.text
1616

1717
class TLSConnectionTest extends FTestPlatform:
1818

1919
test("Verify that you can connect to MySQL with a TLS connection") {
2020
assertIO(
2121
for
22-
ca <- Files[IO].readAll(Path("database/ssl/ca.pem")).through(text.utf8.decode).compile.string
22+
ca <- Files[IO].readAll(Path("database/ssl/ca.pem")).through(text.utf8.decode).compile.string
2323
cert <- Files[IO].readAll(Path("database/ssl/client-cert.pem")).through(text.utf8.decode).compile.string
24-
key <- Files[IO].readAll(Path("database/ssl/client-key.pem")).through(text.utf8.decode).compile.string
24+
key <- Files[IO].readAll(Path("database/ssl/client-key.pem")).through(text.utf8.decode).compile.string
2525
secureContext = SecureContext(
26-
ca = List(ca.asRight).some,
27-
cert = List(cert.asRight).some,
28-
key = List(SecureContext.Key(key.asRight, None)).some
29-
)
26+
ca = List(ca.asRight).some,
27+
cert = List(cert.asRight).some,
28+
key = List(SecureContext.Key(key.asRight, None)).some
29+
)
3030
result <- ConnectionProvider
31-
.default[IO](
32-
"127.0.0.1",
33-
13306,
34-
"ldbc_ssl_user",
35-
"securepassword",
36-
"world"
37-
)
38-
.setSSL(SSL.fromSecureContext(secureContext))
39-
.use { conn =>
40-
for
41-
statement <- conn.createStatement()
42-
result <- statement.executeQuery("SELECT 1")
43-
yield result.getInt(1)
44-
}
31+
.default[IO](
32+
"127.0.0.1",
33+
13306,
34+
"ldbc_ssl_user",
35+
"securepassword",
36+
"world"
37+
)
38+
.setSSL(SSL.fromSecureContext(secureContext))
39+
.use { conn =>
40+
for
41+
statement <- conn.createStatement()
42+
result <- statement.executeQuery("SELECT 1")
43+
yield result.getInt(1)
44+
}
4545
yield result,
4646
1
4747
)

0 commit comments

Comments
 (0)