Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Panda v7 - support key rotation #535

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions app/AppComponents.scala
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import com.amazonaws.auth.{AWSCredentialsProvider, DefaultAWSCredentialsProviderChain}
import com.gu.pandomainauth.PanDomainAuthSettingsRefresher
import com.gu.permissions.{PermissionsConfig, PermissionsProvider}
import com.gu.pandomainauth.{PanDomainAuthSettingsRefresher, S3BucketLoader}
import controllers.AssetsComponents
import model.jobs.JobRunner
import modules.clustersync.ClusterSynchronisation
import modules.sponsorshiplifecycle.SponsorshipLifecycleJobs
import permissions.Permissions
import play.api.ApplicationLoader.Context
import play.api.BuiltInComponentsFromContext
import play.api.libs.ws.ahc.AhcWSComponents
Expand All @@ -32,12 +29,10 @@ class AppComponents(context: Context, config: Config)
new JobRunner(context.lifecycle)
new SponsorshipLifecycleJobs(context.lifecycle)

val panDomainSettings = new PanDomainAuthSettingsRefresher(
val panDomainSettings = PanDomainAuthSettingsRefresher(
domain = config.pandaDomain,
system = config.pandaSystemIdentifier,
bucketName = config.pandaBucketName,
settingsFileKey= config.pandaSettingsFileKey,
s3Client = AWS.S3Client,
S3BucketLoader.forAwsSdkV1(AWS.S3Client, "pan-domain-auth-settings")
)

Comment on lines -35 to 36
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR:

...introduced the new S3BucketLoader abstraction, which simplifies constructing a PanDomainAuthSettingsRefresher and means that Panda is no longer tied to AWS SDK v1 - an alternative AWS SDK v2 implementation of S3BucketLoader could be introduced.

lazy val router: Router = new Routes(
Expand Down
5 changes: 3 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ scalacOptions ++= Seq(

lazy val awsVersion = "1.12.403"

val pandaVersion = "7.0.0"
lazy val dependencies = Seq(
"com.amazonaws" % "aws-java-sdk-dynamodb" % awsVersion,
"com.amazonaws" % "aws-java-sdk-ec2" % awsVersion,
Expand All @@ -26,7 +27,7 @@ lazy val dependencies = Seq(
"com.amazonaws" % "aws-java-sdk-sqs" % awsVersion,
"com.amazonaws" % "aws-java-sdk-sts" % awsVersion,
"com.amazonaws" % "amazon-kinesis-client" % "1.14.10",
"com.gu" %% "pan-domain-auth-play_2-8" % "4.0.0",
"com.gu" %% "pan-domain-auth-play_2-8" % pandaVersion,
"com.gu" %% "editorial-permissions-client" % "2.15",
ws, // for panda
"ai.x" %% "play-json-extensions" % "0.42.0",
Expand All @@ -37,7 +38,7 @@ lazy val dependencies = Seq(
"net.logstash.logback" % "logstash-logback-encoder" % "7.2",
"org.slf4j" % "slf4j-api" % "1.7.12",
"org.slf4j" % "jcl-over-slf4j" % "1.7.12",
"com.gu" %% "panda-hmac-play_2-8" % "4.0.0",
"com.gu" %% "panda-hmac-play_2-8" % pandaVersion,
"com.gu" %% "content-api-client-aws" % "0.7.4",
"com.beachape" %% "enumeratum" % "1.5.13",
"org.scalatest" %% "scalatest" % "3.2.19" % Test,
Expand Down
Loading