Skip to content

Commit

Permalink
Merge branch 'merge-upstream' into 'master'
Browse files Browse the repository at this point in the history
Merge upstream

See merge request torizon-platform/ota-tuf!331
  • Loading branch information
Ben Clouser committed Jun 18, 2024
2 parents 88b8080 + ed51764 commit bf50e25
Show file tree
Hide file tree
Showing 21 changed files with 40 additions and 34 deletions.
8 changes: 4 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ lazy val commonDeps = libraryDependencies ++= {
"com.typesafe.akka" %% "akka-http" % akkaHttpV,
"com.beachape" %% "enumeratum" % enumeratumV,
"com.beachape" %% "enumeratum-circe" % enumeratumV,
"io.github.uptane" %% "libats-http" % libatsVersion,
"io.github.uptane" %% "libats-http" % libatsVersion
)
}

Expand All @@ -49,16 +49,16 @@ lazy val serverDependencies = libraryDependencies ++= {
"io.github.uptane" %% "libats-metrics-prometheus" % libatsVersion,
"io.github.uptane" %% "libats-slick" % libatsVersion,
"io.github.uptane" %% "libats-logging" % libatsVersion,
"org.mariadb.jdbc" % "mariadb-java-client" % "3.3.3",
"org.mariadb.jdbc" % "mariadb-java-client" % "3.4.0",
"com.beachape" %% "enumeratum" % enumeratumV,
"com.beachape" %% "enumeratum-circe" % enumeratumV,
"io.scalaland" %% "chimney" % "1.1.0",
"io.scalaland" %% "chimney" % "1.1.0"
)
}

lazy val commonSettings = Seq(
organization := "io.github.uptane",
scalaVersion := "2.13.12",
scalaVersion := "2.13.14",
organizationName := "uptane",
organizationHomepage := Some(url("https://uptane.github.io/")),
scalacOptions := Seq("-unchecked", "-deprecation", "-encoding", "utf8", "-Xasync", "-Xsource:3"),
Expand Down
6 changes: 3 additions & 3 deletions cli/build.sbt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
libraryDependencies += "com.github.scopt" %% "scopt" % "4.1.0"

libraryDependencies += "org.slf4j" % "slf4j-api" % "2.0.12"
libraryDependencies += "org.slf4j" % "slf4j-api" % "2.0.13"

libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.5.0"
libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.5.6"

libraryDependencies += "io.circe" %% "circe-generic-extras" % "0.14.3"

libraryDependencies += "io.circe" %% "circe-literal" % "0.14.6" % Test
libraryDependencies += "io.circe" %% "circe-literal" % "0.14.7" % Test

fork := true
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ trait KeyTypeSpecSupport {
abstract class CliSpec extends AnyFunSuite with Matchers with ScalaFutures {
Security.addProvider(new BouncyCastleProvider)

override implicit def patienceConfig = PatienceConfig().copy(timeout = Span(10, Seconds))
override implicit def patienceConfig: PatienceConfig =
PatienceConfig().copy(timeout = Span(10, Seconds))

}

trait FakeTufServerClient extends TufServerClient {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class KeyGeneratorWorker(keyGenerationOp: KeyGenRequest => Future[Seq[Key]])(
log.info(s"Received key gen request for {}", kgr.id.show)

keyGenerationOp(kgr)
.map(Success)
.map(Success.apply)
.recoverWith { case ex =>
log.error("Key generation failed: {}", ex.getMessage)
keyGenRepo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class KeyserverHttpClientSpec

override val ec: scala.concurrent.ExecutionContextExecutor = this.executor

override implicit def patienceConfig =
override implicit def patienceConfig: PatienceConfig =
PatienceConfig(timeout = Span(20, Seconds), interval = Span(500, Millis))

implicit lazy val requestTracing: ServerRequestTracing = new NullServerRequestTracing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class KeyGeneratorLeaderSpec

lazy val actorRef = system.actorOf(KeyGeneratorLeader.props(testKeyGenOp))

override implicit def patienceConfig =
override implicit def patienceConfig: PatienceConfig =
PatienceConfig(timeout = Span(30, Seconds), interval = Span(300, Millis))

override def beforeAll(): Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class KeyGeneratorWorkerSpec
def findKey(keyId: KeyId): Future[Key] =
keyRepo.findAll(Seq(keyId)).map(_.head)

override implicit def patienceConfig =
override implicit def patienceConfig: PatienceConfig =
PatienceConfig().copy(timeout = timeout, interval = Span(300, Milliseconds))

def keyGenRequest(threshold: Int = 1)(implicit keyType: KeyType): Future[KeyGenRequest] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class KeysToJsonEncodedMigrationSpec

override implicit lazy val system: ActorSystem = ActorSystem(this.getClass.getSimpleName)

implicit val ec = ExecutionContext.Implicits.global
implicit val ec: ExecutionContext = ExecutionContext.Implicits.global

val migration = new KeysToJsonEncodedMigration()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class RootRoleResourceSpec

override val ec: scala.concurrent.ExecutionContextExecutor = this.executor

override implicit def patienceConfig =
override implicit def patienceConfig: PatienceConfig =
PatienceConfig(timeout = Span(20, Seconds), interval = Span(500, Millis))

test("GET returns NotFound if keys do not exist") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ class SignedRootRolesSpec

implicit val ec: scala.concurrent.ExecutionContextExecutor = ExecutionContext.global

override implicit def patienceConfig = PatienceConfig().copy(timeout = Span(10, Seconds))
override implicit def patienceConfig: PatienceConfig =
PatienceConfig().copy(timeout = Span(10, Seconds))

val signedRootRoles = new SignedRootRoles()
val keyGenerationOp = DefaultKeyGenerationOp()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ class RoleSigningSpec

implicit val ec: scala.concurrent.ExecutionContextExecutor = ExecutionContext.global

override implicit def patienceConfig = PatienceConfig().copy(timeout = Span(3, Seconds))
override implicit def patienceConfig: PatienceConfig =
PatienceConfig().copy(timeout = Span(3, Seconds))

implicit val encoder
: io.circe.Encoder.AsObject[com.advancedtelematic.tuf.keyserver.roles.TestPayload] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ object Requests {
Encoder.encodeString.contramap(_.value)

implicit val targetCommentDecoder: Decoder[TargetComment] =
Decoder.decodeString.map(TargetComment)
Decoder.decodeString.map(TargetComment.apply)

case class CommentRequest(comment: TargetComment)

Expand Down
8 changes: 4 additions & 4 deletions libtuf/build.sbt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
libraryDependencies ++= {
val bouncyCastleV = "1.77"
val bouncyCastleV = "1.78.1"

Seq(
"org.bouncycastle" % "bcprov-jdk18on" % bouncyCastleV,
"org.bouncycastle" % "bcpkix-jdk18on" % bouncyCastleV,
"net.i2p" % "i2p" % "2.3.0",
"net.i2p" % "i2p" % "2.5.2",
"com.softwaremill.sttp.client" %% "core" % "2.3.0",
"com.softwaremill.sttp.client" %% "slf4j-backend" % "2.3.0",
"com.softwaremill.sttp.client" %% "async-http-client-backend-future" % "2.3.0",
"org.slf4j" % "slf4j-api" % "1.7.16" % "provided",
"com.azure" % "azure-storage-blob" % "12.25.2",
"com.azure" % "azure-identity" % "1.11.2"
"com.azure" % "azure-storage-blob" % "12.26.1",
"com.azure" % "azure-identity" % "1.12.2"
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ object ClientCodecs {
import io.circe.generic.semiauto._
import com.advancedtelematic.libats.codecs.CirceCodecs._


implicit val targetFormatEncoder: Encoder[TargetFormat] = Encoder.encodeEnumeration(TargetFormat)
implicit val targetFormatDecoder: Decoder[TargetFormat] = Decoder.decodeEnumeration(TargetFormat)

Expand All @@ -40,13 +39,13 @@ object ClientCodecs {
implicit val roleKeyDecoder: Decoder[RoleKeys] = deriveDecoder

implicit val targetNameEncoder: Encoder[TargetName] = Encoder.encodeString.contramap(_.value)
implicit val targetNameDecoder: Decoder[TargetName] = Decoder.decodeString.map(TargetName)
implicit val targetNameDecoder: Decoder[TargetName] = Decoder.decodeString.map(TargetName.apply)

implicit val targetVersionEncoder: Encoder[TargetVersion] =
Encoder.encodeString.contramap(_.value)

implicit val targetVersionDecoder: Decoder[TargetVersion] =
Decoder.decodeString.map(TargetVersion)
Decoder.decodeString.map(TargetVersion.apply)

implicit val targetCustomDecoder: Decoder[TargetCustom] = Decoder.fromState {
import Decoder.state.decodeField
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sbt.version=1.9.9
sbt.version=1.10.0


4 changes: 2 additions & 2 deletions project/build.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
libraryDependencies += "com.amazonaws" % "aws-java-sdk-s3" % "1.12.668"
libraryDependencies += "com.amazonaws" % "aws-java-sdk-s3" % "1.12.743"

libraryDependencies += "org.apache.commons" % "commons-compress" % "1.26.0"
libraryDependencies += "org.apache.commons" % "commons-compress" % "1.26.2"
6 changes: 3 additions & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.16")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.12.0")
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.10.0")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1")
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.15")
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.18")
addSbtPlugin("com.github.sbt" % "sbt-git" % "2.0.1")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.4.0")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.10.0")
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ class RepoResource(keyserverClient: KeyserverClient,

def findComment(repoId: RepoId, filename: TargetFilename): Route =
complete {
filenameCommentRepo.find(repoId, filename).map(CommentRequest)
filenameCommentRepo.find(repoId, filename).map(CommentRequest.apply)
}

def findCommentsForFiles(repoId: RepoId, filenames: Seq[TargetFilename]): Route =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class ReposerverHttpClientSpec
with PatienceConfiguration
with Eventually {

override implicit def patienceConfig = PatienceConfig().copy(timeout = Span(30, Seconds))
override implicit def patienceConfig: PatienceConfig =
PatienceConfig().copy(timeout = Span(30, Seconds))

val client = new ReposerverHttpClient("http://localhost", testHttpClient)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ class DbSignedRoleRepositorySpec

implicit val ec: scala.concurrent.ExecutionContextExecutor = ExecutionContext.global

override implicit def patienceConfig = PatienceConfig().copy(timeout = Span(10, Seconds))
override implicit def patienceConfig: PatienceConfig =
PatienceConfig().copy(timeout = Span(10, Seconds))

test("Fails with Conflict if version cannot be bumped") {
val repo = new DbSignedRoleRepository()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class SignedRoleGenerationSpec
with ScalaFutures {
override implicit val ec: ExecutionContext = Implicits.global

override implicit def patienceConfig = PatienceConfig().copy(timeout = Span(5, Seconds))
override implicit def patienceConfig: PatienceConfig =
PatienceConfig().copy(timeout = Span(5, Seconds))

val fakeKeyserverClient: FakeKeyserverClient = new FakeKeyserverClient

Expand Down

0 comments on commit bf50e25

Please sign in to comment.