From 9ecd11ed7f280decb444fa4ed09e19e8f8e085c4 Mon Sep 17 00:00:00 2001 From: eikek Date: Sun, 5 Nov 2023 23:15:52 +0100 Subject: [PATCH] Update jwt-circe --- .../scala/docspell/oidc/SignatureAlgo.scala | 34 +++++++++---------- project/Dependencies.scala | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/modules/oidc/src/main/scala/docspell/oidc/SignatureAlgo.scala b/modules/oidc/src/main/scala/docspell/oidc/SignatureAlgo.scala index 3c74c2da..de335ae9 100644 --- a/modules/oidc/src/main/scala/docspell/oidc/SignatureAlgo.scala +++ b/modules/oidc/src/main/scala/docspell/oidc/SignatureAlgo.scala @@ -32,7 +32,7 @@ object SignatureAlgo { case object ES256 extends SignatureAlgo case object ES384 extends SignatureAlgo case object ES512 extends SignatureAlgo - case object Ed25519 extends SignatureAlgo + case object EdDSA extends SignatureAlgo case object HMD5 extends SignatureAlgo case object HS224 extends SignatureAlgo @@ -48,7 +48,7 @@ object SignatureAlgo { ES256, ES384, ES512, - Ed25519, + EdDSA, HMD5, HS224, HS256, @@ -58,19 +58,19 @@ object SignatureAlgo { def fromString(str: String): Either[String, SignatureAlgo] = str.toUpperCase() match { - case "RS256" => Right(RS256) - case "RS384" => Right(RS384) - case "RS512" => Right(RS512) - case "ES256" => Right(ES256) - case "ES384" => Right(ES384) - case "ES512" => Right(ES512) - case "ED25519" => Right(Ed25519) - case "HMD5" => Right(HMD5) - case "HS224" => Right(HS224) - case "HS256" => Right(HS256) - case "HS384" => Right(HS384) - case "HS512" => Right(HS512) - case _ => Left(s"Unknown signature algo: $str") + case "RS256" => Right(RS256) + case "RS384" => Right(RS384) + case "RS512" => Right(RS512) + case "ES256" => Right(ES256) + case "ES384" => Right(ES384) + case "ES512" => Right(ES512) + case "EDDSA" => Right(EdDSA) + case "HMD5" => Right(HMD5) + case "HS224" => Right(HS224) + case "HS256" => Right(HS256) + case "HS384" => Right(HS384) + case "HS512" => Right(HS512) + case _ => Left(s"Unknown signature algo: $str") } def unsafeFromString(str: String): SignatureAlgo = @@ -127,11 +127,11 @@ object SignatureAlgo { .toEither } yield Jwt.create(decoded) - case Ed25519 => + case EdDSA => for { pubKey <- createPublicKey(sigKey, "EdDSA") decoded <- JwtCirce - .decodeJsonAll(token, pubKey, Seq(JwtAlgorithm.Ed25519)) + .decodeJsonAll(token, pubKey, Seq(JwtAlgorithm.EdDSA)) .toEither } yield Jwt.create(decoded) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index fa7beffa..dd036bd6 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -26,7 +26,7 @@ object Dependencies { val Icu4jVersion = "74.1" val JavaOtpVersion = "0.4.0" val JsoupVersion = "1.16.2" - val JwtScalaVersion = "9.2.0" + val JwtScalaVersion = "9.4.4" val KindProjectorVersion = "0.10.3" val KittensVersion = "3.1.0" val LevigoJbig2Version = "2.0"