Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make builtin resolver private #2208

Merged
merged 2 commits into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,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.(*BuiltInResolver).Region
signingRegion := m.BuiltInResolver.(*$L).Region
ctx = $T(ctx, signingName)
ctx = $T(ctx, signingRegion)
$W
Expand All @@ -119,6 +119,7 @@ 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 @@ -164,7 +165,7 @@ private GoWriter.Writable generateSigV4Resolution(ServiceShape serviceShape) {
signingName = *v4Scheme.SigningName
}
if v4Scheme.SigningRegion == nil {
signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region
signingRegion = m.BuiltInResolver.(*$L).Region
} else {
signingRegion = *v4Scheme.SigningRegion
}
Expand All @@ -180,6 +181,7 @@ 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 @@ -33,8 +33,8 @@

public class AwsEndpointResolverBuiltInGenerator implements GoIntegration {

public static final String BUILTIN_RESOLVER_INTERFACE_TYPE = "BuiltInParameterResolver";
public static final String BUILTIN_RESOLVER_IMPLEMENTATION_TYPE = "BuiltInResolver";
public static final String BUILTIN_RESOLVER_INTERFACE_TYPE = "builtInParameterResolver";
public static final String BUILTIN_RESOLVER_IMPLEMENTATION_TYPE = "builtInResolver";

private Map<String, Object> commonCodegenArgs;

Expand Down Expand Up @@ -186,12 +186,13 @@ private GoWriter.Writable generateBuiltInResolverMethod(Parameters parameters) {
writer.write(
"""
$W
func (b *BuiltInResolver) ResolveBuiltIns(params *$L) error {
func (b *$L) ResolveBuiltIns(params *$L) error {
""",
goDocTemplate(
"""
Invoked at runtime to resolve BuiltIn Values. Only resolution code specific to each BuiltIn value is generated.
"""),
AwsEndpointResolverBuiltInGenerator.BUILTIN_RESOLVER_IMPLEMENTATION_TYPE,
EndpointResolutionGenerator.PARAMETERS_TYPE_NAME);

parameters.toList().stream().filter(
Expand Down Expand Up @@ -316,7 +317,7 @@ private class AwsEndpointBuiltInHandler implements EndpointBuiltInHandler {
@Override
public void renderEndpointBuiltInField(GoWriter writer) {
writer.write("BuiltInResolver $T",
SymbolUtils.createValueSymbolBuilder("BuiltInParameterResolver").build());
SymbolUtils.createValueSymbolBuilder(BUILTIN_RESOLVER_INTERFACE_TYPE).build());
}

@Override
Expand All @@ -332,7 +333,7 @@ public void renderEndpointBuiltInInitialization(GoWriter writer, Parameters para
$W
},
""",
SymbolUtils.createValueSymbolBuilder("BuiltInResolver").build(),
SymbolUtils.createValueSymbolBuilder(BUILTIN_RESOLVER_IMPLEMENTATION_TYPE).build(),
generateBuiltInInitializeFieldMembers(parameters));
}

Expand Down
8 changes: 4 additions & 4 deletions service/s3/api_op_AbortMultipartUpload.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions service/s3/api_op_CompleteMultipartUpload.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions service/s3/api_op_CopyObject.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions service/s3/api_op_CreateBucket.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions service/s3/api_op_CreateMultipartUpload.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions service/s3/api_op_DeleteBucket.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions service/s3/api_op_DeleteBucketAnalyticsConfiguration.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions service/s3/api_op_DeleteBucketCors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading