Skip to content

Commit

Permalink
Update to Panda v5
Browse files Browse the repository at this point in the history
This is pretty minor change, but due to guardian/pan-domain-authentication#147
and guardian/pan-domain-authentication#153, there are a couple of changes required:

* imports for `PublicKey`
* `settings.privateKey` becomes `settings.signingKeyPair.getPrivate`
  • Loading branch information
rtyley committed Aug 9, 2024
1 parent afb4e53 commit 5409609
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ target
/.project
/.settings
/RUNNING_PID
.bsp/
4 changes: 2 additions & 2 deletions app/controllers/DesktopLogin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name := "login"

version := "1.0.0"

scalaVersion := "2.13.12"
scalaVersion := "2.13.14"
scalacOptions := Seq(
"-unchecked",
"-deprecation",
Expand All @@ -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" % "5.0.0",
"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,
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.6
sbt.version=1.10.1

0 comments on commit 5409609

Please sign in to comment.