Skip to content

Commit

Permalink
Merge branch 'main' into an/upgrade-tika
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-nowak authored Dec 18, 2024
2 parents ca903f1 + c6ed1ea commit 24a0b07
Show file tree
Hide file tree
Showing 12 changed files with 2 additions and 32 deletions.
1 change: 0 additions & 1 deletion auth/app/auth/AuthConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ import com.gu.mediaservice.lib.config.{CommonConfig, GridConfigResources}
class AuthConfig(resources: GridConfigResources) extends CommonConfig(resources) {
val rootUri: String = services.authBaseUri
val mediaApiUri: String = services.apiBaseUri
val kahunaUri = services.kahunaBaseUri
}
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ lazy val cropper = playProject("cropper", 9006)
lazy val imageLoader = playProject("image-loader", 9003).settings {
libraryDependencies ++= Seq(
"org.apache.tika" % "tika-core" % "1.28.5",
"com.drewnoakes" % "metadata-extractor" % "2.17.0"
"com.drewnoakes" % "metadata-extractor" % "2.19.0"
)
}

Expand Down
2 changes: 0 additions & 2 deletions collections/app/lib/CollectionsConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ class CollectionsConfig(resources: GridConfigResources) extends CommonConfig(res
val imageCollectionsTable = string("dynamo.table.imageCollections")

val rootUri = services.collectionsBaseUri
val kahunaUri = services.kahunaBaseUri
val loginUriTemplate = services.loginUriTemplate
}
2 changes: 1 addition & 1 deletion cropper/app/lib/CropStore.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class CropStore(config: CropperConfig) extends S3ImageStorage(config) with CropS
crops.foldLeft(Map[String, Crop]()) {
case (map, (s3Object)) => {
val filename::containingFolder::_ = s3Object.uri.getPath.split("/").reverse.toList
var isMaster = containingFolder == "master"
val isMaster = containingFolder == "master"
val userMetadata = s3Object.metadata.userMetadata
val objectMetadata = s3Object.metadata.objectMetadata

Expand Down
2 changes: 0 additions & 2 deletions cropper/app/lib/CropperConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ class CropperConfig(resources: GridConfigResources) extends CommonConfig(resourc

val rootUri = services.cropperBaseUri
val apiUri = services.apiBaseUri
val kahunaUri = services.kahunaBaseUri
val loginUriTemplate = services.loginUriTemplate

val tempDir: File = new File(stringDefault("crop.output.tmp.dir", "/tmp"))

Expand Down
2 changes: 0 additions & 2 deletions leases/app/lib/LeasesConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ class LeasesConfig(resources: GridConfigResources) extends CommonConfig(resource
val leasesTable = string("dynamo.tablename.leasesTable")

val rootUri: String = services.leasesBaseUri
val kahunaUri: String = services.kahunaBaseUri
val loginUriTemplate: String = services.loginUriTemplate

private def uri(u: String) = URI.create(u)

Expand Down
3 changes: 0 additions & 3 deletions media-api/app/MediaApiComponents.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import com.gu.mediaservice.lib.aws.ThrallMessageSender
import com.gu.mediaservice.lib.imaging.ImageOperations
import com.gu.mediaservice.lib.management.{ElasticSearchHealthCheck, InnerServiceStatusCheckController, Management}
import com.gu.mediaservice.lib.metadata.SoftDeletedMetadataTable
import com.gu.mediaservice.lib.play.GridComponents
Expand All @@ -14,8 +13,6 @@ import scala.concurrent.Future
class MediaApiComponents(context: Context) extends GridComponents(context, new MediaApiConfig(_)) {
final override val buildInfo = utils.buildinfo.BuildInfo

val imageOperations = new ImageOperations(context.environment.rootPath.getAbsolutePath)

val messageSender = new ThrallMessageSender(config.thrallKinesisStreamConfig)
val mediaApiMetrics = new MediaApiMetrics(config, actorSystem, applicationLifecycle)

Expand Down
4 changes: 0 additions & 4 deletions media-api/app/lib/ImageResponse.scala
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,6 @@ class ImageResponse(config: MediaApiConfig, s3Client: S3Client, usageQuota: Usag
def makeImgopsUri(uri: URI): String =
config.imgopsUri + List(uri.getPath, uri.getRawQuery).mkString("?") + "{&w,h,q}"

def makeOptimisedPngImageopsUri(uri: URI): String = {
config.imgopsUri + List(uri.getPath, uri.getRawQuery).mkString("?") + "{&w, h, q}"
}

private def updateCustomSpecialInstructions(source: JsValue): Reads[JsObject] = {
(source \ "usageRights" \ "category") match {
case JsDefined(category) =>
Expand Down
2 changes: 0 additions & 2 deletions media-api/app/lib/MediaApiConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,11 @@ class MediaApiConfig(resources: GridConfigResources) extends CommonConfigWithEla
val kahunaUri: String = services.kahunaBaseUri
val cropperUri: String = services.cropperBaseUri
val loaderUri: String = services.loaderBaseUri
val projectionUri: String = services.projectionBaseUri
val metadataUri: String = services.metadataBaseUri
val imgopsUri: String = services.imgopsBaseUri
val usageUri: String = services.usageBaseUri
val leasesUri: String = services.leasesBaseUri
val authUri: String = services.authBaseUri
val loginUriTemplate: String = services.loginUriTemplate
val collectionsUri: String = services.collectionsBaseUri

val requiredMetadata = NonEmptyList("credit", "description", "usageRights")
Expand Down
2 changes: 0 additions & 2 deletions metadata-editor/app/MetadataEditorComponents.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.gu.mediaservice.lib.imaging.ImageOperations
import com.gu.mediaservice.lib.management.InnerServiceStatusCheckController
import com.gu.mediaservice.lib.play.GridComponents
import controllers.{EditsApi, EditsController, SyndicationController}
Expand All @@ -12,7 +11,6 @@ class MetadataEditorComponents(context: Context) extends GridComponents(context,
val editsStore = new EditsStore(config)
val syndicationStore = new SyndicationStore(config)
val notifications = new Notifications(config)
val imageOperations = new ImageOperations(context.environment.rootPath.getAbsolutePath)

val metrics = new MetadataEditorMetrics(config, actorSystem, applicationLifecycle)
val messageConsumer = new MetadataSqsMessageConsumer(config, metrics, editsStore)
Expand Down
5 changes: 0 additions & 5 deletions metadata-editor/app/lib/EditsConfig.scala
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
package lib

import com.amazonaws.regions.{Region, RegionUtils}
import com.gu.mediaservice.lib.config.{CommonConfig, GridConfigResources}


class EditsConfig(resources: GridConfigResources) extends CommonConfig(resources) {
val dynamoRegion: Region = RegionUtils.getRegion(string("aws.region"))

val collectionsBucket: String = string("s3.collections.bucket")

val editsTable = string("dynamo.table.edits")
val editsTablePhotoshootIndex = string("dynamo.globalsecondaryindex.edits.photoshoots")
val syndicationTable = string("dynamo.table.syndication")
Expand Down
7 changes: 0 additions & 7 deletions usage/app/lib/UsageConfig.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package lib

import com.amazonaws.regions.{Region, RegionUtils}
import com.amazonaws.services.identitymanagement._
import com.gu.mediaservice.lib.config.{CommonConfig, GridConfigResources}
import com.gu.mediaservice.lib.logging.GridLogging
Expand All @@ -12,13 +11,9 @@ import scala.util.Try
case class KinesisReaderConfig(streamName: String, arn: String, appName: String)

class UsageConfig(resources: GridConfigResources) extends CommonConfig(resources) with GridLogging {
val rootUri: String = services.metadataBaseUri
val kahunaUri: String = services.kahunaBaseUri
val usageUri: String = services.usageBaseUri
val apiUri: String = services.apiBaseUri
val loginUriTemplate: String = services.loginUriTemplate

val defaultPageSize = 100
val defaultMaxRetries = 4
val defaultMaxPrintRequestSizeInKb = 500
val defaultDateLimit = "2016-01-01T00:00:00+00:00"
Expand All @@ -29,7 +24,6 @@ class UsageConfig(resources: GridConfigResources) extends CommonConfig(resources
val capiPreviewUrl = string("capi.preview.url")
val capiPreviewRole = stringOpt("capi.preview.role")
val capiApiKey = string("capi.apiKey")
val capiPageSize: Int = intDefault("capi.page.size", defaultPageSize)
val capiMaxRetries: Int = intDefault("capi.maxRetries", defaultMaxRetries)

val usageDateLimit: String = stringDefault("usage.dateLimit", defaultDateLimit)
Expand All @@ -41,7 +35,6 @@ class UsageConfig(resources: GridConfigResources) extends CommonConfig(resources

val usageRecordTable = string("dynamo.tablename.usageRecordTable")

val dynamoRegion: Region = RegionUtils.getRegion(string("aws.region"))
val awsRegionName = string("aws.region")

private val iamClient: AmazonIdentityManagement = withAWSCredentials(AmazonIdentityManagementClientBuilder.standard()).build()
Expand Down

0 comments on commit 24a0b07

Please sign in to comment.