Skip to content

Commit

Permalink
refactor/regen for upstream endpoint middleware/binding changes (#2293)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucix-aws committed Oct 27, 2023
1 parent 6cb7073 commit 53337e2
Show file tree
Hide file tree
Showing 225 changed files with 1,818 additions and 30,427 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import software.amazon.smithy.go.codegen.SymbolUtils;
import software.amazon.smithy.go.codegen.integration.GoIntegration;
import software.amazon.smithy.model.Model;
import software.amazon.smithy.model.shapes.OperationShape;
import software.amazon.smithy.model.shapes.ServiceShape;


Expand All @@ -37,9 +36,7 @@
public class AwsEndpointAuthSchemeGenerator implements GoIntegration {

@Override
public void renderPostEndpointResolutionHook(
GoSettings settings, GoWriter writer, Model model, Optional<OperationShape> operation
) {
public void renderPostEndpointResolutionHook(GoSettings settings, GoWriter writer, Model model) {
ServiceShape serviceShape = settings.getService(model);
writer.write(
"""
Expand Down Expand Up @@ -100,7 +97,7 @@ private GoWriter.Writable generateAuthSchemeDetection(ServiceShape serviceShape)
if $T(err, &nfe) {
// if no auth scheme is found, default to sigv4
signingName := \"$L\"
signingRegion := m.BuiltInResolver.(*$L).Region
signingRegion := *params.Region
ctx = $T(ctx, signingName)
ctx = $T(ctx, signingRegion)
$W
Expand All @@ -119,7 +116,6 @@ private GoWriter.Writable generateAuthSchemeDetection(ServiceShape serviceShape)
SymbolUtils.createPointableSymbolBuilder("NoAuthenticationSchemesFoundError", AwsGoDependency.INTERNAL_AUTH).build(),
SymbolUtils.createValueSymbolBuilder("As", SmithyGoDependency.ERRORS).build(),
signingNameDefault,
AwsEndpointResolverBuiltInGenerator.BUILTIN_RESOLVER_IMPLEMENTATION_TYPE,
SymbolUtils.createValueSymbolBuilder("SetSigningName", AwsGoDependency.AWS_MIDDLEWARE).build(),
SymbolUtils.createValueSymbolBuilder("SetSigningRegion", AwsGoDependency.AWS_MIDDLEWARE).build(),
signerVersion,
Expand Down Expand Up @@ -165,7 +161,7 @@ private GoWriter.Writable generateSigV4Resolution(ServiceShape serviceShape) {
signingName = *v4Scheme.SigningName
}
if v4Scheme.SigningRegion == nil {
signingRegion = m.BuiltInResolver.(*$L).Region
signingRegion = *params.Region
} else {
signingRegion = *v4Scheme.SigningRegion
}
Expand All @@ -181,7 +177,6 @@ private GoWriter.Writable generateSigV4Resolution(ServiceShape serviceShape) {
""",
SymbolUtils.createPointableSymbolBuilder("AuthenticationSchemeV4", AwsGoDependency.INTERNAL_AUTH).build(),
signingNameDefault,
AwsEndpointResolverBuiltInGenerator.BUILTIN_RESOLVER_IMPLEMENTATION_TYPE,
SymbolUtils.createValueSymbolBuilder("SetDisableDoubleEncoding", AwsGoDependency.INTERNAL_AUTH).build(),
SymbolUtils.createValueSymbolBuilder("SetSigningName", AwsGoDependency.AWS_MIDDLEWARE).build(),
SymbolUtils.createValueSymbolBuilder("SetSigningRegion", AwsGoDependency.AWS_MIDDLEWARE).build(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@

import java.util.List;
import java.util.function.Consumer;
import software.amazon.smithy.aws.go.codegen.customization.S3ModelUtils;
import software.amazon.smithy.aws.traits.ServiceTrait;
import software.amazon.smithy.codegen.core.SymbolProvider;
import software.amazon.smithy.go.codegen.GoSettings;
import software.amazon.smithy.go.codegen.GoWriter;
import software.amazon.smithy.go.codegen.SymbolUtils;
import software.amazon.smithy.go.codegen.TriConsumer;
import software.amazon.smithy.go.codegen.endpoints.EndpointResolutionGenerator;
import software.amazon.smithy.go.codegen.integration.ConfigField;
import software.amazon.smithy.go.codegen.integration.ConfigFieldResolver;
import software.amazon.smithy.go.codegen.integration.GoIntegration;
Expand Down
Loading

0 comments on commit 53337e2

Please sign in to comment.