Skip to content

Commit

Permalink
Update jjwt-api, jjwt-impl, jjwt-jackson to 0.12.3 (#3186)
Browse files Browse the repository at this point in the history
* Update jjwt-api, jjwt-impl, jjwt-jackson to 0.12.3

* Replace deprecated API calls

---------

Co-authored-by: Frank S. Thomas <[email protected]>
  • Loading branch information
scala-steward and fthomas authored Jan 3, 2024
1 parent 46307ca commit 77d868d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
3 changes: 3 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -429,12 +429,15 @@ lazy val runSteward = taskKey[Unit]("")
runSteward := Def.taskDyn {
val home = System.getenv("HOME")
val projectDir = (LocalRootProject / baseDirectory).value
// val ghAppDir = projectDir.getParentFile / "gh-app"
val args = Seq(
Seq("--workspace", s"$projectDir/workspace"),
Seq("--repos-file", s"$projectDir/repos.md"),
Seq("--git-author-email", s"me@$projectName.org"),
Seq("--forge-login", projectName),
Seq("--git-ask-pass", s"$home/.github/askpass/$projectName.sh"),
// Seq("--github-app-id", IO.read(ghAppDir / "scala-steward.app-id.txt").trim),
// Seq("--github-app-key-file", s"$ghAppDir/scala-steward.private-key.pem"),
Seq("--whitelist", s"$home/.cache/coursier"),
Seq("--whitelist", s"$home/.cache/JNA"),
Seq("--whitelist", s"$home/.cache/mill"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ package org.scalasteward.core.forge.github
import better.files.File
import cats.effect.Sync
import cats.implicits._
import io.jsonwebtoken.{Jwts, SignatureAlgorithm}
import org.bouncycastle.jce.provider.BouncyCastleProvider
import org.bouncycastle.util.io.pem.PemReader

import io.jsonwebtoken.Jwts
import java.io.FileReader
import java.security.spec.PKCS8EncodedKeySpec
import java.security.{KeyFactory, PrivateKey, Security}
import java.util.Date
import org.bouncycastle.jce.provider.BouncyCastleProvider
import org.bouncycastle.util.io.pem.PemReader
import scala.concurrent.duration.FiniteDuration
import scala.util.Using

Expand Down Expand Up @@ -72,13 +71,13 @@ object GitHubAuthAlg {
val signingKey = readPrivateKey(app.keyFile)
val builder = Jwts
.builder()
.setIssuedAt(now)
.setIssuer(app.id.toString)
.signWith(signingKey, SignatureAlgorithm.RS256)
.issuedAt(now)
.issuer(app.id.toString)
.signWith(signingKey, Jwts.SIG.RS256)
if (ttlMillis > 0) {
val expMillis = nowMillis + ttlMillis
val exp = new Date(expMillis)
builder.setExpiration(exp)
builder.expiration(exp)
}
builder.compact()
}
Expand Down
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ object Dependencies {
val http4sJdkhttpClient = "org.http4s" %% "http4s-jdk-http-client" % "1.0.0-M9"
val log4catsSlf4j = "org.typelevel" %% "log4cats-slf4j" % "2.6.0"
val logbackClassic = "ch.qos.logback" % "logback-classic" % "1.4.14"
val jjwtApi = "io.jsonwebtoken" % "jjwt-api" % "0.11.5"
val jjwtApi = "io.jsonwebtoken" % "jjwt-api" % "0.12.3"
val jjwtImpl = "io.jsonwebtoken" % "jjwt-impl" % jjwtApi.revision
val jjwtJackson = "io.jsonwebtoken" % "jjwt-jackson" % jjwtApi.revision
val millScriptVersion = "0.11.0-M10"
Expand Down

0 comments on commit 77d868d

Please sign in to comment.