From bec58d026582f62160e44fbe442b16685e1b4b13 Mon Sep 17 00:00:00 2001 From: Steven Yuan Date: Tue, 19 Sep 2023 14:30:38 -0700 Subject: [PATCH] feat(experimentalIdentityAndAuth): add partial support for `aws.auth#sigv4a` (#950) --- .../amazon/smithy/typescript/codegen/auth/AuthUtils.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/AuthUtils.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/AuthUtils.java index d3c9093016b..0770e13c4b7 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/AuthUtils.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/AuthUtils.java @@ -82,6 +82,15 @@ public static Map getAllEffectiveNoAuthAwareAuthSchemes effectiveAuthSchemes.put(shapeId, authIndex.getHttpAuthScheme(shapeId)); } } + // TODO(experimentalIdentityAndAuth): remove after @aws.auth#sigv4a is fully supported + // BEGIN + HttpAuthScheme effectiveSigv4Scheme = effectiveAuthSchemes.get(ShapeId.from("aws.auth#sigv4")); + HttpAuthScheme effectiveSigv4aScheme = effectiveAuthSchemes.get(ShapeId.from("aws.auth#sigv4a")); + HttpAuthScheme supportedSigv4aScheme = authIndex.getHttpAuthScheme(ShapeId.from("aws.auth#sigv4a")); + if (effectiveSigv4Scheme != null && effectiveSigv4aScheme == null && supportedSigv4aScheme != null) { + effectiveAuthSchemes.put(supportedSigv4aScheme.getSchemeId(), supportedSigv4aScheme); + } + // END return effectiveAuthSchemes; } }