From 799e7d5d44a8904ba467e86077022d9d263ace9a Mon Sep 17 00:00:00 2001 From: Onno Vos Date: Fri, 7 Jun 2024 16:10:36 +0200 Subject: [PATCH] Fix correct signing_name based on aws.auth#sigv4 and fall back to endpoint_prefix only if not available --- lib/aws_codegen/post_service.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/aws_codegen/post_service.ex b/lib/aws_codegen/post_service.ex index bcdf314..9a4fb4f 100644 --- a/lib/aws_codegen/post_service.ex +++ b/lib/aws_codegen/post_service.ex @@ -84,12 +84,13 @@ defmodule AWS.CodeGen.PostService do content_type = @configuration[protocol][:content_type] content_type = content_type <> if protocol == "json", do: json_version, else: "" - signing_name = + maybe_signing_name = if String.starts_with?(endpoint_prefix, "api.") do String.replace(endpoint_prefix, "api.", "") else endpoint_prefix end + signing_name = traits["aws.auth#sigv4"]["name"] || maybe_signing_name %Service{ actions: actions,