Skip to content

Commit

Permalink
Quick attempt at resolving AWS signing problems (#1568, #1532)
Browse files Browse the repository at this point in the history
  • Loading branch information
kubukoz committed Sep 27, 2024
1 parent b828a13 commit cac1af5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion modules/aws-http4s/src/smithy4s/aws/AwsClient.scala
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ object AwsClient {

def baseRequest(endpoint: OperationSchema[_, _, _, _, _]): F[HttpRequest[Blob]] = {
awsEnv.region.map { region =>
val endpointPrefix = awsService.endpointPrefix.getOrElse(endpoint.id.name)
val endpointPrefix =
awsService.endpointPrefix
.orElse(awsService.arnNamespace.map(_.value))
.getOrElse(endpoint.id.name)

val baseUri = HttpUri(
scheme = HttpUriScheme.Https,
host = s"$endpointPrefix.$region.amazonaws.com",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ private[aws] object AwsSigning {
): Client[F] => Client[F] = {
val endpointPrefix = serviceHints
.get(_root_.aws.api.Service)
.flatMap(_.endpointPrefix)
.flatMap { awsService =>
awsService.endpointPrefix
.orElse(awsService.arnNamespace.map(_.value))
}
.getOrElse(serviceId.name)
.toLowerCase()

Expand Down

0 comments on commit cac1af5

Please sign in to comment.