From cb88c4086c64c350eb34540488ae0d855ad76c64 Mon Sep 17 00:00:00 2001 From: Roberto Tyley <52038+rtyley@users.noreply.github.com> Date: Fri, 9 Aug 2024 17:41:05 +0100 Subject: [PATCH] Update to Panda v5 This is pretty minor change, but due to https://github.com/guardian/pan-domain-authentication/pull/147 and https://github.com/guardian/pan-domain-authentication/issues/153, there are a couple of changes required: * imports for `PublicKey` * `settings.privateKey` becomes `settings.signingKeyPair.getPrivate` --- .gitignore | 1 + app/controllers/DesktopLogin.scala | 4 ++-- build.sbt | 6 +++--- project/build.properties | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index eb372fc..0a52482 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ target /.project /.settings /RUNNING_PID +.bsp/ diff --git a/app/controllers/DesktopLogin.scala b/app/controllers/DesktopLogin.scala index 4a2e7d0..cabe69c 100644 --- a/app/controllers/DesktopLogin.scala +++ b/app/controllers/DesktopLogin.scala @@ -36,7 +36,7 @@ class DesktopLogin( request.headers.get(AUTHORIZATION) match { case Some(s"GU-Desktop-Panda $token") => PanDomain.authStatus(token, - publicKey = panDomainSettings.settings.publicKey, + publicKey = panDomainSettings.settings.signingKeyPair.getPublic, validateUser = PanDomain.guardianValidation, apiGracePeriod = 9.hours.toMillis, system = panDomainSettings.system, @@ -64,7 +64,7 @@ class DesktopLogin( if (validateUser(authedUserData)) { - val token = CookieUtils.generateCookieData(authedUserData, panDomainSettings.settings.privateKey) + val token = CookieUtils.generateCookieData(authedUserData, panDomainSettings.settings.signingKeyPair.getPrivate) Redirect(s"gu-panda://desktop?token=${URLEncoder.encode(token, "UTF-8")}&stage=${deps.config.stage.toLowerCase}") .withSession(session = request.session - ANTI_FORGERY_KEY - LOGIN_ORIGIN_KEY) } else { diff --git a/build.sbt b/build.sbt index 186c267..e726291 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ name := "login" version := "1.0.0" -scalaVersion := "2.13.12" +scalaVersion := "2.13.14" scalacOptions := Seq( "-unchecked", "-deprecation", @@ -16,12 +16,12 @@ scalacOptions := Seq( val awsSdkVersion = "1.12.130" val awsSdkVersionV2 = "2.17.101" -resolvers += "Sonatype releases" at "https://oss.sonatype.org/content/repositories/releases" +resolvers ++= Resolver.sonatypeOssRepos("releases") libraryDependencies ++= Seq( jdbc, ws, - "com.gu" %% "pan-domain-auth-play_3-0" % "4.0.0", + "com.gu" %% "pan-domain-auth-play_3-0" % "6.0.0-PREVIEW.update-settings-loading-and-parsing-code.2024-08-09T1450.4c87946a", "com.gu.play-secret-rotation" %% "aws-parameterstore-sdk-v1" % "7.1.1", "com.gu.play-secret-rotation" %% "play-v30" % "7.1.1", "com.amazonaws" % "aws-java-sdk-ec2" % awsSdkVersion, diff --git a/project/build.properties b/project/build.properties index 2743082..ee4c672 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.6 +sbt.version=1.10.1