Skip to content

Commit

Permalink
Merge pull request #1582 from guardian/update/gu
Browse files Browse the repository at this point in the history
chore(deps): Guardian library updates
  • Loading branch information
akash1810 authored Nov 28, 2024
2 parents afc4acf + f540603 commit efd0b1b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 35 deletions.
61 changes: 29 additions & 32 deletions app/components/AppComponents.scala
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
package components

import org.apache.pekko.actor.typed.ActorSystem
import org.apache.pekko.actor.{ActorSystem => UntypedActorSystem}
import com.amazonaws.{
AmazonClientException,
AmazonWebServiceRequest,
ClientConfiguration
}
import com.amazonaws.auth.profile.ProfileCredentialsProvider
import com.amazonaws.auth.{
AWSCredentialsProviderChain,
InstanceProfileCredentialsProvider
}
import com.amazonaws.auth.profile.ProfileCredentialsProvider
import com.amazonaws.regions.Regions
import com.amazonaws.retry.{PredefinedRetryPolicies, RetryPolicy}
import com.amazonaws.retry.PredefinedRetryPolicies.SDKDefaultRetryCondition
import software.amazon.awssdk.services.dynamodb.DynamoDbClient
import com.amazonaws.retry.{PredefinedRetryPolicies, RetryPolicy}
import com.amazonaws.services.ec2.{AmazonEC2, AmazonEC2ClientBuilder}
import com.amazonaws.services.s3.{AmazonS3, AmazonS3ClientBuilder}
import com.amazonaws.services.securitytoken.model.GetCallerIdentityRequest
import com.amazonaws.services.securitytoken.{
AWSSecurityTokenService,
AWSSecurityTokenServiceClientBuilder
}
import com.amazonaws.services.securitytoken.model.GetCallerIdentityRequest
import com.amazonaws.services.sns.{
AmazonSNSAsync,
AmazonSNSAsyncClientBuilder,
AmazonSNSClientBuilder
import com.amazonaws.services.sns.AmazonSNSClientBuilder
import com.amazonaws.{
AmazonClientException,
AmazonWebServiceRequest,
ClientConfiguration
}
import com.google.auth.oauth2.ServiceAccountCredentials
import com.gu.googleauth.{
AntiForgeryChecker,
AuthAction,
GoogleAuthConfig,
GoogleGroupChecker
}
import com.gu.{AppIdentity, AwsIdentity, DevIdentity}
import com.gu.googleauth.{AntiForgeryChecker, AuthAction, GoogleAuthConfig}
import com.gu.play.secretrotation.aws.parameterstore.{AwsSdkV2, SecretSupplier}
import com.gu.play.secretrotation.{
RotatingSecretComponents,
SnapshotProvider,
TransitionTiming
}
import java.time.Duration
import com.gu.{AppIdentity, AwsIdentity, DevIdentity}
import controllers._
import data.{Dynamo, Recipes}
import event.{ActorSystemWrapper, BakeEvent, Behaviours}
import housekeeping._
import housekeeping.utils.{BakesRepo, PackerEC2Client}
import models.NotificationConfig
import notification.{LambdaDistributionBucket, NotificationSender, SNS}
import org.apache.pekko.actor.typed.ActorSystem
import org.apache.pekko.actor.{ActorSystem => UntypedActorSystem}
import org.quartz.Scheduler
import org.quartz.impl.StdSchedulerFactory
import packer.{PackerConfig, PackerRunner}
import play.api.BuiltInComponentsFromContext
import play.api.ApplicationLoader.Context
import play.api.BuiltInComponentsFromContext
import play.api.i18n.I18nComponents
import play.api.libs.ws.ahc.AhcWSComponents
import play.api.mvc.{AnyContent, EssentialFilter}
Expand All @@ -59,26 +59,23 @@ import prism.Prism
import router.Routes
import schedule.{BakeScheduler, ScheduledBakeRunner}
import services.{AmiMetadataLookup, Loggable, PrismData}
import software.amazon.awssdk.services.ssm.SsmClient
import software.amazon.awssdk.auth.credentials.{
StaticCredentialsProvider,
AwsCredentialsProviderChain => AwsCredentialsProviderChainV2,
InstanceProfileCredentialsProvider => InstanceProfileCredentialsProviderV2,
ProfileCredentialsProvider => ProfileCredentialsProviderV2
}
import software.amazon.awssdk.regions.Region
import software.amazon.awssdk.services.dynamodb.DynamoDbClient
import software.amazon.awssdk.services.sns.SnsAsyncClient
import software.amazon.awssdk.services.ssm.SsmClient

import java.io.FileInputStream
import java.time.Duration
import java.time.Duration.{ofHours, ofMinutes}
import scala.concurrent.Await
import scala.concurrent.duration._
import scala.language.postfixOps
import java.io.FileInputStream
import com.google.api.client.googleapis.auth.oauth2.GoogleCredential
import scala.util.Try
import com.gu.googleauth.GoogleGroupChecker
import com.google.auth.oauth2.ServiceAccountCredentials
import com.google.api.client
import com.google.auth.oauth2.ServiceAccountCredentials

class LoggingRetryCondition extends SDKDefaultRetryCondition with Loggable {
private def exceptionInfo(e: Throwable): String = {
Expand Down Expand Up @@ -222,11 +219,11 @@ class AppComponents(context: Context, identity: AppIdentity)
.withClientConfiguration(clientConfiguration)
.build()

val anghammaradSNSClient: AmazonSNSAsync =
AmazonSNSAsyncClientBuilder.standard
.withRegion(region)
.withCredentials(awsCredsForV1)
.withClientConfiguration(clientConfiguration)
val anghammaradSNSClient: SnsAsyncClient =
SnsAsyncClient
.builder()
.region(Region.of(region.getName))
.credentialsProvider(awsCredsForV2)
.build()

val amigoUrl: String = configuration
Expand Down
4 changes: 2 additions & 2 deletions app/models/NotificationConfig.scala
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package models

import com.amazonaws.services.sns.AmazonSNSAsync
import software.amazon.awssdk.services.sns.SnsAsyncClient

case class NotificationConfig(
baseUrl: String,
snsTopicArn: String,
snsClient: AmazonSNSAsync,
snsClient: SnsAsyncClient,
amigoStage: String
)
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest-shouldmatchers" % "3.2.19" % Test,
"org.scalatestplus" %% "mockito-3-4" % "3.2.10.0" % Test,
"fun.mike" % "diff-match-patch" % "0.0.2",
"com.gu" %% "anghammarad-client" % "3.0.0"
"com.gu" %% "anghammarad-client" % "4.0.0"
)
routesGenerator := InjectedRoutesGenerator
routesImport += "models._"
Expand Down

0 comments on commit efd0b1b

Please sign in to comment.