From 8d2432781a0fa860a282d75e6f9c3a4e3c25cb9c Mon Sep 17 00:00:00 2001 From: Isaiah Vita Date: Wed, 19 Jul 2023 12:14:02 -0700 Subject: [PATCH] regen s3 and eventbridge; add context checker to eb; eb tests passing --- service/eventbridge/api_client.go | 82 +++++++++--- .../eventbridge/api_op_ActivateEventSource.go | 24 +++- service/eventbridge/api_op_CancelReplay.go | 24 +++- .../api_op_CreateApiDestination.go | 24 +++- service/eventbridge/api_op_CreateArchive.go | 24 +++- .../eventbridge/api_op_CreateConnection.go | 24 +++- service/eventbridge/api_op_CreateEndpoint.go | 24 +++- service/eventbridge/api_op_CreateEventBus.go | 24 +++- .../api_op_CreatePartnerEventSource.go | 24 +++- .../api_op_DeactivateEventSource.go | 24 +++- .../api_op_DeauthorizeConnection.go | 24 +++- .../api_op_DeleteApiDestination.go | 24 +++- service/eventbridge/api_op_DeleteArchive.go | 24 +++- .../eventbridge/api_op_DeleteConnection.go | 24 +++- service/eventbridge/api_op_DeleteEndpoint.go | 24 +++- service/eventbridge/api_op_DeleteEventBus.go | 24 +++- .../api_op_DeletePartnerEventSource.go | 24 +++- service/eventbridge/api_op_DeleteRule.go | 24 +++- .../api_op_DescribeApiDestination.go | 24 +++- service/eventbridge/api_op_DescribeArchive.go | 24 +++- .../eventbridge/api_op_DescribeConnection.go | 24 +++- .../eventbridge/api_op_DescribeEndpoint.go | 24 +++- .../eventbridge/api_op_DescribeEventBus.go | 24 +++- .../eventbridge/api_op_DescribeEventSource.go | 24 +++- .../api_op_DescribePartnerEventSource.go | 24 +++- service/eventbridge/api_op_DescribeReplay.go | 24 +++- service/eventbridge/api_op_DescribeRule.go | 24 +++- service/eventbridge/api_op_DisableRule.go | 24 +++- service/eventbridge/api_op_EnableRule.go | 24 +++- .../eventbridge/api_op_ListApiDestinations.go | 24 +++- service/eventbridge/api_op_ListArchives.go | 24 +++- service/eventbridge/api_op_ListConnections.go | 24 +++- service/eventbridge/api_op_ListEndpoints.go | 24 +++- service/eventbridge/api_op_ListEventBuses.go | 24 +++- .../eventbridge/api_op_ListEventSources.go | 24 +++- .../api_op_ListPartnerEventSourceAccounts.go | 24 +++- .../api_op_ListPartnerEventSources.go | 24 +++- service/eventbridge/api_op_ListReplays.go | 24 +++- .../api_op_ListRuleNamesByTarget.go | 24 +++- service/eventbridge/api_op_ListRules.go | 24 +++- .../eventbridge/api_op_ListTagsForResource.go | 24 +++- .../eventbridge/api_op_ListTargetsByRule.go | 24 +++- service/eventbridge/api_op_PutEvents.go | 24 +++- .../eventbridge/api_op_PutPartnerEvents.go | 24 +++- service/eventbridge/api_op_PutPermission.go | 24 +++- service/eventbridge/api_op_PutRule.go | 24 +++- service/eventbridge/api_op_PutTargets.go | 24 +++- .../eventbridge/api_op_RemovePermission.go | 24 +++- service/eventbridge/api_op_RemoveTargets.go | 24 +++- service/eventbridge/api_op_StartReplay.go | 24 +++- service/eventbridge/api_op_TagResource.go | 24 +++- .../eventbridge/api_op_TestEventPattern.go | 24 +++- service/eventbridge/api_op_UntagResource.go | 24 +++- .../api_op_UpdateApiDestination.go | 24 +++- service/eventbridge/api_op_UpdateArchive.go | 24 +++- .../eventbridge/api_op_UpdateConnection.go | 24 +++- service/eventbridge/api_op_UpdateEndpoint.go | 24 +++- service/eventbridge/endpoints.go | 119 ++---------------- .../internal/customizations/endpoint.go | 5 + service/s3control/api_client.go | 14 ++- service/s3outposts/api_client.go | 14 ++- 61 files changed, 1219 insertions(+), 359 deletions(-) diff --git a/service/eventbridge/api_client.go b/service/eventbridge/api_client.go index 23e31efc49b..d4d15393be6 100644 --- a/service/eventbridge/api_client.go +++ b/service/eventbridge/api_client.go @@ -4,6 +4,7 @@ package eventbridge import ( "context" + "fmt" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/defaults" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" @@ -47,8 +48,6 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveHTTPSignerV4(&options) - resolveDefaultEndpointConfiguration(&options) - resolveHTTPSignerV4a(&options) for _, fn := range optFns { @@ -90,8 +89,11 @@ type Options struct { // The service endpoint resolver. // - // Deprecated: EndpointResolver and WithEndpointResolver are deprecated. See - // EndpointResolverV2 and WithEndpointResolverV2 + // Deprecated: EndpointResolver and WithEndpointResolver are deprecated. Providing + // a value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. To migrate an EndpointResolver implementation that uses a custom + // endpoint, set the client option BaseEndpoint instead. EndpointResolver EndpointResolver // Resolves the endpoint used for a particular service. This should be used over @@ -159,8 +161,11 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } -// EndpointResolver and WithEndpointResolver are deprecated. See -// EndpointResolverV2 and WithEndpointResolverV2 +// EndpointResolver and WithEndpointResolver are deprecated. Providing a value for +// this field will likely prevent you from using any endpoint-related service +// features released after the introduction of EndpointResolverV2 and BaseEndpoint. +// To migrate an EndpointResolver implementation that uses a custom endpoint, set +// the client option BaseEndpoint instead. func WithEndpointResolver(v EndpointResolver) func(*Options) { return func(o *Options) { o.EndpointResolver = v @@ -191,6 +196,8 @@ func (c *Client) invokeOperation(ctx context.Context, opID string, params interf ctx = middleware.ClearStackValues(ctx) stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) options := c.options.Copy() + resolveEndpointResolverV2(&options) + for _, fn := range optFns { fn(&options) } @@ -201,8 +208,6 @@ func (c *Client) invokeOperation(ctx context.Context, opID string, params interf resolveCredentialProvider(&options) - finalizeEndpointResolverV2(&options) - for _, fn := range stackFns { if err := fn(stack, options); err != nil { return nil, metadata, err @@ -229,6 +234,30 @@ func (c *Client) invokeOperation(ctx context.Context, opID string, params interf type noSmithyDocumentSerde = smithydocument.NoSerde +type LegacyEndpointContextSetter struct { + LegacyResolver EndpointResolver +} + +func (*LegacyEndpointContextSetter) ID() string { + return "LegacyEndpointContextSetter" +} + +func (m *LegacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.LegacyResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) + } + + return next.HandleInitialize(ctx, in) + +} +func addLegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { + return stack.Initialize.Add(&LegacyEndpointContextSetter{ + LegacyResolver: o.EndpointResolver, + }, middleware.Before) +} + func resolveDefaultLogger(o *Options) { if o.Logger != nil { return @@ -270,7 +299,6 @@ func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { resolveAWSRetryerProvider(cfg, &opts) resolveAWSRetryMaxAttempts(cfg, &opts) resolveAWSRetryMode(cfg, &opts) - resolveAWSEndpointResolver(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) return New(opts, optFns...) @@ -372,13 +400,6 @@ func finalizeRetryMaxAttemptOptions(o *Options, client Client) { o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) } -func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { - if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { - return - } - o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) -} - func addClientUserAgent(stack *middleware.Stack) error { return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "eventbridge", goModuleVersion)(stack) } @@ -512,3 +533,32 @@ func addRequestResponseLogging(stack *middleware.Stack, o Options) error { LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), }, middleware.After) } + +type EndpointDisableHTTPSMiddleware struct { + EndpointDisableHTTPS bool +} + +func (*EndpointDisableHTTPSMiddleware) ID() string { + return "EndpointDisableHTTPSMiddleware" +} + +func (m *EndpointDisableHTTPSMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointDisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { + req.URL.Scheme = "http" + } + + return next.HandleSerialize(ctx, in) + +} +func addEndpointDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&EndpointDisableHTTPSMiddleware{ + EndpointDisableHTTPS: o.EndpointOptions.DisableHTTPS, + }, "ResolveEndpointV2", middleware.After) +} diff --git a/service/eventbridge/api_op_ActivateEventSource.go b/service/eventbridge/api_op_ActivateEventSource.go index 991b7a22433..709bcd19952 100644 --- a/service/eventbridge/api_op_ActivateEventSource.go +++ b/service/eventbridge/api_op_ActivateEventSource.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -58,6 +59,9 @@ func (c *Client) addOperationActivateEventSourceMiddlewares(stack *middleware.St if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -115,6 +119,9 @@ func (c *Client) addOperationActivateEventSourceMiddlewares(stack *middleware.St if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -133,12 +140,16 @@ type opActivateEventSourceResolveEndpointMiddleware struct { } func (*opActivateEventSourceResolveEndpointMiddleware) ID() string { - return "opActivateEventSourceResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opActivateEventSourceResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -167,6 +178,8 @@ func (m *opActivateEventSourceResolveEndpointMiddleware) HandleSerialize(ctx con ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -195,9 +208,13 @@ func (m *opActivateEventSourceResolveEndpointMiddleware) HandleSerialize(ctx con var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -211,9 +228,8 @@ func (m *opActivateEventSourceResolveEndpointMiddleware) HandleSerialize(ctx con break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -221,7 +237,7 @@ func (m *opActivateEventSourceResolveEndpointMiddleware) HandleSerialize(ctx con // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_CancelReplay.go b/service/eventbridge/api_op_CancelReplay.go index 14e0a3496b6..614cd9b9e41 100644 --- a/service/eventbridge/api_op_CancelReplay.go +++ b/service/eventbridge/api_op_CancelReplay.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -68,6 +69,9 @@ func (c *Client) addOperationCancelReplayMiddlewares(stack *middleware.Stack, op if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -125,6 +129,9 @@ func (c *Client) addOperationCancelReplayMiddlewares(stack *middleware.Stack, op if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -143,12 +150,16 @@ type opCancelReplayResolveEndpointMiddleware struct { } func (*opCancelReplayResolveEndpointMiddleware) ID() string { - return "opCancelReplayResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opCancelReplayResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -177,6 +188,8 @@ func (m *opCancelReplayResolveEndpointMiddleware) HandleSerialize(ctx context.Co ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -205,9 +218,13 @@ func (m *opCancelReplayResolveEndpointMiddleware) HandleSerialize(ctx context.Co var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -221,9 +238,8 @@ func (m *opCancelReplayResolveEndpointMiddleware) HandleSerialize(ctx context.Co break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -231,7 +247,7 @@ func (m *opCancelReplayResolveEndpointMiddleware) HandleSerialize(ctx context.Co // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_CreateApiDestination.go b/service/eventbridge/api_op_CreateApiDestination.go index ee3c38d032c..01fbb5e9f45 100644 --- a/service/eventbridge/api_op_CreateApiDestination.go +++ b/service/eventbridge/api_op_CreateApiDestination.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -96,6 +97,9 @@ func (c *Client) addOperationCreateApiDestinationMiddlewares(stack *middleware.S if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -153,6 +157,9 @@ func (c *Client) addOperationCreateApiDestinationMiddlewares(stack *middleware.S if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -171,12 +178,16 @@ type opCreateApiDestinationResolveEndpointMiddleware struct { } func (*opCreateApiDestinationResolveEndpointMiddleware) ID() string { - return "opCreateApiDestinationResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opCreateApiDestinationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -205,6 +216,8 @@ func (m *opCreateApiDestinationResolveEndpointMiddleware) HandleSerialize(ctx co ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -233,9 +246,13 @@ func (m *opCreateApiDestinationResolveEndpointMiddleware) HandleSerialize(ctx co var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -249,9 +266,8 @@ func (m *opCreateApiDestinationResolveEndpointMiddleware) HandleSerialize(ctx co break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -259,7 +275,7 @@ func (m *opCreateApiDestinationResolveEndpointMiddleware) HandleSerialize(ctx co // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_CreateArchive.go b/service/eventbridge/api_op_CreateArchive.go index 4746e30b66b..2310e6294ae 100644 --- a/service/eventbridge/api_op_CreateArchive.go +++ b/service/eventbridge/api_op_CreateArchive.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -91,6 +92,9 @@ func (c *Client) addOperationCreateArchiveMiddlewares(stack *middleware.Stack, o if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -148,6 +152,9 @@ func (c *Client) addOperationCreateArchiveMiddlewares(stack *middleware.Stack, o if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -166,12 +173,16 @@ type opCreateArchiveResolveEndpointMiddleware struct { } func (*opCreateArchiveResolveEndpointMiddleware) ID() string { - return "opCreateArchiveResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opCreateArchiveResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -200,6 +211,8 @@ func (m *opCreateArchiveResolveEndpointMiddleware) HandleSerialize(ctx context.C ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -228,9 +241,13 @@ func (m *opCreateArchiveResolveEndpointMiddleware) HandleSerialize(ctx context.C var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -244,9 +261,8 @@ func (m *opCreateArchiveResolveEndpointMiddleware) HandleSerialize(ctx context.C break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -254,7 +270,7 @@ func (m *opCreateArchiveResolveEndpointMiddleware) HandleSerialize(ctx context.C // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_CreateConnection.go b/service/eventbridge/api_op_CreateConnection.go index ccab9ccd24e..584c0bcb12c 100644 --- a/service/eventbridge/api_op_CreateConnection.go +++ b/service/eventbridge/api_op_CreateConnection.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -88,6 +89,9 @@ func (c *Client) addOperationCreateConnectionMiddlewares(stack *middleware.Stack if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -145,6 +149,9 @@ func (c *Client) addOperationCreateConnectionMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -163,12 +170,16 @@ type opCreateConnectionResolveEndpointMiddleware struct { } func (*opCreateConnectionResolveEndpointMiddleware) ID() string { - return "opCreateConnectionResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opCreateConnectionResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -197,6 +208,8 @@ func (m *opCreateConnectionResolveEndpointMiddleware) HandleSerialize(ctx contex ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -225,9 +238,13 @@ func (m *opCreateConnectionResolveEndpointMiddleware) HandleSerialize(ctx contex var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -241,9 +258,8 @@ func (m *opCreateConnectionResolveEndpointMiddleware) HandleSerialize(ctx contex break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -251,7 +267,7 @@ func (m *opCreateConnectionResolveEndpointMiddleware) HandleSerialize(ctx contex // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_CreateEndpoint.go b/service/eventbridge/api_op_CreateEndpoint.go index 1908e23f706..003bfb5ef2f 100644 --- a/service/eventbridge/api_op_CreateEndpoint.go +++ b/service/eventbridge/api_op_CreateEndpoint.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -109,6 +110,9 @@ func (c *Client) addOperationCreateEndpointMiddlewares(stack *middleware.Stack, if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -166,6 +170,9 @@ func (c *Client) addOperationCreateEndpointMiddlewares(stack *middleware.Stack, if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -184,12 +191,16 @@ type opCreateEndpointResolveEndpointMiddleware struct { } func (*opCreateEndpointResolveEndpointMiddleware) ID() string { - return "opCreateEndpointResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opCreateEndpointResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -218,6 +229,8 @@ func (m *opCreateEndpointResolveEndpointMiddleware) HandleSerialize(ctx context. ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -246,9 +259,13 @@ func (m *opCreateEndpointResolveEndpointMiddleware) HandleSerialize(ctx context. var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -262,9 +279,8 @@ func (m *opCreateEndpointResolveEndpointMiddleware) HandleSerialize(ctx context. break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -272,7 +288,7 @@ func (m *opCreateEndpointResolveEndpointMiddleware) HandleSerialize(ctx context. // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_CreateEventBus.go b/service/eventbridge/api_op_CreateEventBus.go index 4e2ab7b6ba8..7cc83a9e1ce 100644 --- a/service/eventbridge/api_op_CreateEventBus.go +++ b/service/eventbridge/api_op_CreateEventBus.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -76,6 +77,9 @@ func (c *Client) addOperationCreateEventBusMiddlewares(stack *middleware.Stack, if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -133,6 +137,9 @@ func (c *Client) addOperationCreateEventBusMiddlewares(stack *middleware.Stack, if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -151,12 +158,16 @@ type opCreateEventBusResolveEndpointMiddleware struct { } func (*opCreateEventBusResolveEndpointMiddleware) ID() string { - return "opCreateEventBusResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opCreateEventBusResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -185,6 +196,8 @@ func (m *opCreateEventBusResolveEndpointMiddleware) HandleSerialize(ctx context. ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -213,9 +226,13 @@ func (m *opCreateEventBusResolveEndpointMiddleware) HandleSerialize(ctx context. var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -229,9 +246,8 @@ func (m *opCreateEventBusResolveEndpointMiddleware) HandleSerialize(ctx context. break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -239,7 +255,7 @@ func (m *opCreateEventBusResolveEndpointMiddleware) HandleSerialize(ctx context. // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_CreatePartnerEventSource.go b/service/eventbridge/api_op_CreatePartnerEventSource.go index 7b2ebc368ff..a825a24c3d2 100644 --- a/service/eventbridge/api_op_CreatePartnerEventSource.go +++ b/service/eventbridge/api_op_CreatePartnerEventSource.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -87,6 +88,9 @@ func (c *Client) addOperationCreatePartnerEventSourceMiddlewares(stack *middlewa if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -144,6 +148,9 @@ func (c *Client) addOperationCreatePartnerEventSourceMiddlewares(stack *middlewa if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -162,12 +169,16 @@ type opCreatePartnerEventSourceResolveEndpointMiddleware struct { } func (*opCreatePartnerEventSourceResolveEndpointMiddleware) ID() string { - return "opCreatePartnerEventSourceResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opCreatePartnerEventSourceResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -196,6 +207,8 @@ func (m *opCreatePartnerEventSourceResolveEndpointMiddleware) HandleSerialize(ct ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -224,9 +237,13 @@ func (m *opCreatePartnerEventSourceResolveEndpointMiddleware) HandleSerialize(ct var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -240,9 +257,8 @@ func (m *opCreatePartnerEventSourceResolveEndpointMiddleware) HandleSerialize(ct break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -250,7 +266,7 @@ func (m *opCreatePartnerEventSourceResolveEndpointMiddleware) HandleSerialize(ct // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_DeactivateEventSource.go b/service/eventbridge/api_op_DeactivateEventSource.go index 108a12d8280..1ab12ba7286 100644 --- a/service/eventbridge/api_op_DeactivateEventSource.go +++ b/service/eventbridge/api_op_DeactivateEventSource.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -62,6 +63,9 @@ func (c *Client) addOperationDeactivateEventSourceMiddlewares(stack *middleware. if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -119,6 +123,9 @@ func (c *Client) addOperationDeactivateEventSourceMiddlewares(stack *middleware. if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -137,12 +144,16 @@ type opDeactivateEventSourceResolveEndpointMiddleware struct { } func (*opDeactivateEventSourceResolveEndpointMiddleware) ID() string { - return "opDeactivateEventSourceResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opDeactivateEventSourceResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -171,6 +182,8 @@ func (m *opDeactivateEventSourceResolveEndpointMiddleware) HandleSerialize(ctx c ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -199,9 +212,13 @@ func (m *opDeactivateEventSourceResolveEndpointMiddleware) HandleSerialize(ctx c var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -215,9 +232,8 @@ func (m *opDeactivateEventSourceResolveEndpointMiddleware) HandleSerialize(ctx c break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -225,7 +241,7 @@ func (m *opDeactivateEventSourceResolveEndpointMiddleware) HandleSerialize(ctx c // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_DeauthorizeConnection.go b/service/eventbridge/api_op_DeauthorizeConnection.go index 5d7a44c0936..0124778c99c 100644 --- a/service/eventbridge/api_op_DeauthorizeConnection.go +++ b/service/eventbridge/api_op_DeauthorizeConnection.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -77,6 +78,9 @@ func (c *Client) addOperationDeauthorizeConnectionMiddlewares(stack *middleware. if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -134,6 +138,9 @@ func (c *Client) addOperationDeauthorizeConnectionMiddlewares(stack *middleware. if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -152,12 +159,16 @@ type opDeauthorizeConnectionResolveEndpointMiddleware struct { } func (*opDeauthorizeConnectionResolveEndpointMiddleware) ID() string { - return "opDeauthorizeConnectionResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opDeauthorizeConnectionResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -186,6 +197,8 @@ func (m *opDeauthorizeConnectionResolveEndpointMiddleware) HandleSerialize(ctx c ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -214,9 +227,13 @@ func (m *opDeauthorizeConnectionResolveEndpointMiddleware) HandleSerialize(ctx c var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -230,9 +247,8 @@ func (m *opDeauthorizeConnectionResolveEndpointMiddleware) HandleSerialize(ctx c break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -240,7 +256,7 @@ func (m *opDeauthorizeConnectionResolveEndpointMiddleware) HandleSerialize(ctx c // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_DeleteApiDestination.go b/service/eventbridge/api_op_DeleteApiDestination.go index bf9623fbb1f..38d4e702cdd 100644 --- a/service/eventbridge/api_op_DeleteApiDestination.go +++ b/service/eventbridge/api_op_DeleteApiDestination.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -57,6 +58,9 @@ func (c *Client) addOperationDeleteApiDestinationMiddlewares(stack *middleware.S if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -114,6 +118,9 @@ func (c *Client) addOperationDeleteApiDestinationMiddlewares(stack *middleware.S if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -132,12 +139,16 @@ type opDeleteApiDestinationResolveEndpointMiddleware struct { } func (*opDeleteApiDestinationResolveEndpointMiddleware) ID() string { - return "opDeleteApiDestinationResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opDeleteApiDestinationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -166,6 +177,8 @@ func (m *opDeleteApiDestinationResolveEndpointMiddleware) HandleSerialize(ctx co ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -194,9 +207,13 @@ func (m *opDeleteApiDestinationResolveEndpointMiddleware) HandleSerialize(ctx co var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -210,9 +227,8 @@ func (m *opDeleteApiDestinationResolveEndpointMiddleware) HandleSerialize(ctx co break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -220,7 +236,7 @@ func (m *opDeleteApiDestinationResolveEndpointMiddleware) HandleSerialize(ctx co // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_DeleteArchive.go b/service/eventbridge/api_op_DeleteArchive.go index 79a220a6950..c38812466d1 100644 --- a/service/eventbridge/api_op_DeleteArchive.go +++ b/service/eventbridge/api_op_DeleteArchive.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -57,6 +58,9 @@ func (c *Client) addOperationDeleteArchiveMiddlewares(stack *middleware.Stack, o if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -114,6 +118,9 @@ func (c *Client) addOperationDeleteArchiveMiddlewares(stack *middleware.Stack, o if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -132,12 +139,16 @@ type opDeleteArchiveResolveEndpointMiddleware struct { } func (*opDeleteArchiveResolveEndpointMiddleware) ID() string { - return "opDeleteArchiveResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opDeleteArchiveResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -166,6 +177,8 @@ func (m *opDeleteArchiveResolveEndpointMiddleware) HandleSerialize(ctx context.C ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -194,9 +207,13 @@ func (m *opDeleteArchiveResolveEndpointMiddleware) HandleSerialize(ctx context.C var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -210,9 +227,8 @@ func (m *opDeleteArchiveResolveEndpointMiddleware) HandleSerialize(ctx context.C break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -220,7 +236,7 @@ func (m *opDeleteArchiveResolveEndpointMiddleware) HandleSerialize(ctx context.C // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_DeleteConnection.go b/service/eventbridge/api_op_DeleteConnection.go index 6f2292356a4..8a04deae67a 100644 --- a/service/eventbridge/api_op_DeleteConnection.go +++ b/service/eventbridge/api_op_DeleteConnection.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -77,6 +78,9 @@ func (c *Client) addOperationDeleteConnectionMiddlewares(stack *middleware.Stack if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -134,6 +138,9 @@ func (c *Client) addOperationDeleteConnectionMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -152,12 +159,16 @@ type opDeleteConnectionResolveEndpointMiddleware struct { } func (*opDeleteConnectionResolveEndpointMiddleware) ID() string { - return "opDeleteConnectionResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opDeleteConnectionResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -186,6 +197,8 @@ func (m *opDeleteConnectionResolveEndpointMiddleware) HandleSerialize(ctx contex ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -214,9 +227,13 @@ func (m *opDeleteConnectionResolveEndpointMiddleware) HandleSerialize(ctx contex var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -230,9 +247,8 @@ func (m *opDeleteConnectionResolveEndpointMiddleware) HandleSerialize(ctx contex break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -240,7 +256,7 @@ func (m *opDeleteConnectionResolveEndpointMiddleware) HandleSerialize(ctx contex // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_DeleteEndpoint.go b/service/eventbridge/api_op_DeleteEndpoint.go index 2e855eaf5fb..af40f9ac84a 100644 --- a/service/eventbridge/api_op_DeleteEndpoint.go +++ b/service/eventbridge/api_op_DeleteEndpoint.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -61,6 +62,9 @@ func (c *Client) addOperationDeleteEndpointMiddlewares(stack *middleware.Stack, if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -118,6 +122,9 @@ func (c *Client) addOperationDeleteEndpointMiddlewares(stack *middleware.Stack, if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -136,12 +143,16 @@ type opDeleteEndpointResolveEndpointMiddleware struct { } func (*opDeleteEndpointResolveEndpointMiddleware) ID() string { - return "opDeleteEndpointResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opDeleteEndpointResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -170,6 +181,8 @@ func (m *opDeleteEndpointResolveEndpointMiddleware) HandleSerialize(ctx context. ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -198,9 +211,13 @@ func (m *opDeleteEndpointResolveEndpointMiddleware) HandleSerialize(ctx context. var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -214,9 +231,8 @@ func (m *opDeleteEndpointResolveEndpointMiddleware) HandleSerialize(ctx context. break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -224,7 +240,7 @@ func (m *opDeleteEndpointResolveEndpointMiddleware) HandleSerialize(ctx context. // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_DeleteEventBus.go b/service/eventbridge/api_op_DeleteEventBus.go index 41c39528377..1e442dcee8e 100644 --- a/service/eventbridge/api_op_DeleteEventBus.go +++ b/service/eventbridge/api_op_DeleteEventBus.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -59,6 +60,9 @@ func (c *Client) addOperationDeleteEventBusMiddlewares(stack *middleware.Stack, if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -116,6 +120,9 @@ func (c *Client) addOperationDeleteEventBusMiddlewares(stack *middleware.Stack, if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -134,12 +141,16 @@ type opDeleteEventBusResolveEndpointMiddleware struct { } func (*opDeleteEventBusResolveEndpointMiddleware) ID() string { - return "opDeleteEventBusResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opDeleteEventBusResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -168,6 +179,8 @@ func (m *opDeleteEventBusResolveEndpointMiddleware) HandleSerialize(ctx context. ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -196,9 +209,13 @@ func (m *opDeleteEventBusResolveEndpointMiddleware) HandleSerialize(ctx context. var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -212,9 +229,8 @@ func (m *opDeleteEventBusResolveEndpointMiddleware) HandleSerialize(ctx context. break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -222,7 +238,7 @@ func (m *opDeleteEventBusResolveEndpointMiddleware) HandleSerialize(ctx context. // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_DeletePartnerEventSource.go b/service/eventbridge/api_op_DeletePartnerEventSource.go index d7f3d07e54a..8fbb2dbb75c 100644 --- a/service/eventbridge/api_op_DeletePartnerEventSource.go +++ b/service/eventbridge/api_op_DeletePartnerEventSource.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -66,6 +67,9 @@ func (c *Client) addOperationDeletePartnerEventSourceMiddlewares(stack *middlewa if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -123,6 +127,9 @@ func (c *Client) addOperationDeletePartnerEventSourceMiddlewares(stack *middlewa if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -141,12 +148,16 @@ type opDeletePartnerEventSourceResolveEndpointMiddleware struct { } func (*opDeletePartnerEventSourceResolveEndpointMiddleware) ID() string { - return "opDeletePartnerEventSourceResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opDeletePartnerEventSourceResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -175,6 +186,8 @@ func (m *opDeletePartnerEventSourceResolveEndpointMiddleware) HandleSerialize(ct ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -203,9 +216,13 @@ func (m *opDeletePartnerEventSourceResolveEndpointMiddleware) HandleSerialize(ct var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -219,9 +236,8 @@ func (m *opDeletePartnerEventSourceResolveEndpointMiddleware) HandleSerialize(ct break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -229,7 +245,7 @@ func (m *opDeletePartnerEventSourceResolveEndpointMiddleware) HandleSerialize(ct // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_DeleteRule.go b/service/eventbridge/api_op_DeleteRule.go index 93d47f5f0b2..54f31f0f16b 100644 --- a/service/eventbridge/api_op_DeleteRule.go +++ b/service/eventbridge/api_op_DeleteRule.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -78,6 +79,9 @@ func (c *Client) addOperationDeleteRuleMiddlewares(stack *middleware.Stack, opti if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -135,6 +139,9 @@ func (c *Client) addOperationDeleteRuleMiddlewares(stack *middleware.Stack, opti if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -153,12 +160,16 @@ type opDeleteRuleResolveEndpointMiddleware struct { } func (*opDeleteRuleResolveEndpointMiddleware) ID() string { - return "opDeleteRuleResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opDeleteRuleResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -187,6 +198,8 @@ func (m *opDeleteRuleResolveEndpointMiddleware) HandleSerialize(ctx context.Cont ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -215,9 +228,13 @@ func (m *opDeleteRuleResolveEndpointMiddleware) HandleSerialize(ctx context.Cont var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -231,9 +248,8 @@ func (m *opDeleteRuleResolveEndpointMiddleware) HandleSerialize(ctx context.Cont break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -241,7 +257,7 @@ func (m *opDeleteRuleResolveEndpointMiddleware) HandleSerialize(ctx context.Cont // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_DescribeApiDestination.go b/service/eventbridge/api_op_DescribeApiDestination.go index a0167a7e695..515bf65c2f5 100644 --- a/service/eventbridge/api_op_DescribeApiDestination.go +++ b/service/eventbridge/api_op_DescribeApiDestination.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -96,6 +97,9 @@ func (c *Client) addOperationDescribeApiDestinationMiddlewares(stack *middleware if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -153,6 +157,9 @@ func (c *Client) addOperationDescribeApiDestinationMiddlewares(stack *middleware if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -171,12 +178,16 @@ type opDescribeApiDestinationResolveEndpointMiddleware struct { } func (*opDescribeApiDestinationResolveEndpointMiddleware) ID() string { - return "opDescribeApiDestinationResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opDescribeApiDestinationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -205,6 +216,8 @@ func (m *opDescribeApiDestinationResolveEndpointMiddleware) HandleSerialize(ctx ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -233,9 +246,13 @@ func (m *opDescribeApiDestinationResolveEndpointMiddleware) HandleSerialize(ctx var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -249,9 +266,8 @@ func (m *opDescribeApiDestinationResolveEndpointMiddleware) HandleSerialize(ctx break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -259,7 +275,7 @@ func (m *opDescribeApiDestinationResolveEndpointMiddleware) HandleSerialize(ctx // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_DescribeArchive.go b/service/eventbridge/api_op_DescribeArchive.go index 60d77618ca2..3faba4d1214 100644 --- a/service/eventbridge/api_op_DescribeArchive.go +++ b/service/eventbridge/api_op_DescribeArchive.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -93,6 +94,9 @@ func (c *Client) addOperationDescribeArchiveMiddlewares(stack *middleware.Stack, if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -150,6 +154,9 @@ func (c *Client) addOperationDescribeArchiveMiddlewares(stack *middleware.Stack, if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -168,12 +175,16 @@ type opDescribeArchiveResolveEndpointMiddleware struct { } func (*opDescribeArchiveResolveEndpointMiddleware) ID() string { - return "opDescribeArchiveResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opDescribeArchiveResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -202,6 +213,8 @@ func (m *opDescribeArchiveResolveEndpointMiddleware) HandleSerialize(ctx context ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -230,9 +243,13 @@ func (m *opDescribeArchiveResolveEndpointMiddleware) HandleSerialize(ctx context var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -246,9 +263,8 @@ func (m *opDescribeArchiveResolveEndpointMiddleware) HandleSerialize(ctx context break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -256,7 +272,7 @@ func (m *opDescribeArchiveResolveEndpointMiddleware) HandleSerialize(ctx context // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_DescribeConnection.go b/service/eventbridge/api_op_DescribeConnection.go index 297d21a82cc..c41c38544b3 100644 --- a/service/eventbridge/api_op_DescribeConnection.go +++ b/service/eventbridge/api_op_DescribeConnection.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -94,6 +95,9 @@ func (c *Client) addOperationDescribeConnectionMiddlewares(stack *middleware.Sta if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -151,6 +155,9 @@ func (c *Client) addOperationDescribeConnectionMiddlewares(stack *middleware.Sta if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -169,12 +176,16 @@ type opDescribeConnectionResolveEndpointMiddleware struct { } func (*opDescribeConnectionResolveEndpointMiddleware) ID() string { - return "opDescribeConnectionResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opDescribeConnectionResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -203,6 +214,8 @@ func (m *opDescribeConnectionResolveEndpointMiddleware) HandleSerialize(ctx cont ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -231,9 +244,13 @@ func (m *opDescribeConnectionResolveEndpointMiddleware) HandleSerialize(ctx cont var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -247,9 +264,8 @@ func (m *opDescribeConnectionResolveEndpointMiddleware) HandleSerialize(ctx cont break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -257,7 +273,7 @@ func (m *opDescribeConnectionResolveEndpointMiddleware) HandleSerialize(ctx cont // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_DescribeEndpoint.go b/service/eventbridge/api_op_DescribeEndpoint.go index 36bb7567b97..021f71a2dab 100644 --- a/service/eventbridge/api_op_DescribeEndpoint.go +++ b/service/eventbridge/api_op_DescribeEndpoint.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -108,6 +109,9 @@ func (c *Client) addOperationDescribeEndpointMiddlewares(stack *middleware.Stack if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -165,6 +169,9 @@ func (c *Client) addOperationDescribeEndpointMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -183,12 +190,16 @@ type opDescribeEndpointResolveEndpointMiddleware struct { } func (*opDescribeEndpointResolveEndpointMiddleware) ID() string { - return "opDescribeEndpointResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opDescribeEndpointResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -217,6 +228,8 @@ func (m *opDescribeEndpointResolveEndpointMiddleware) HandleSerialize(ctx contex ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -245,9 +258,13 @@ func (m *opDescribeEndpointResolveEndpointMiddleware) HandleSerialize(ctx contex var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -261,9 +278,8 @@ func (m *opDescribeEndpointResolveEndpointMiddleware) HandleSerialize(ctx contex break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -271,7 +287,7 @@ func (m *opDescribeEndpointResolveEndpointMiddleware) HandleSerialize(ctx contex // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_DescribeEventBus.go b/service/eventbridge/api_op_DescribeEventBus.go index 325310aa281..347fa883dfa 100644 --- a/service/eventbridge/api_op_DescribeEventBus.go +++ b/service/eventbridge/api_op_DescribeEventBus.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -74,6 +75,9 @@ func (c *Client) addOperationDescribeEventBusMiddlewares(stack *middleware.Stack if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -128,6 +132,9 @@ func (c *Client) addOperationDescribeEventBusMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -146,12 +153,16 @@ type opDescribeEventBusResolveEndpointMiddleware struct { } func (*opDescribeEventBusResolveEndpointMiddleware) ID() string { - return "opDescribeEventBusResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opDescribeEventBusResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -180,6 +191,8 @@ func (m *opDescribeEventBusResolveEndpointMiddleware) HandleSerialize(ctx contex ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -208,9 +221,13 @@ func (m *opDescribeEventBusResolveEndpointMiddleware) HandleSerialize(ctx contex var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -224,9 +241,8 @@ func (m *opDescribeEventBusResolveEndpointMiddleware) HandleSerialize(ctx contex break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -234,7 +250,7 @@ func (m *opDescribeEventBusResolveEndpointMiddleware) HandleSerialize(ctx contex // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_DescribeEventSource.go b/service/eventbridge/api_op_DescribeEventSource.go index 58fc0fa4fd5..6ce8a0cb18f 100644 --- a/service/eventbridge/api_op_DescribeEventSource.go +++ b/service/eventbridge/api_op_DescribeEventSource.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -84,6 +85,9 @@ func (c *Client) addOperationDescribeEventSourceMiddlewares(stack *middleware.St if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -141,6 +145,9 @@ func (c *Client) addOperationDescribeEventSourceMiddlewares(stack *middleware.St if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -159,12 +166,16 @@ type opDescribeEventSourceResolveEndpointMiddleware struct { } func (*opDescribeEventSourceResolveEndpointMiddleware) ID() string { - return "opDescribeEventSourceResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opDescribeEventSourceResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -193,6 +204,8 @@ func (m *opDescribeEventSourceResolveEndpointMiddleware) HandleSerialize(ctx con ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -221,9 +234,13 @@ func (m *opDescribeEventSourceResolveEndpointMiddleware) HandleSerialize(ctx con var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -237,9 +254,8 @@ func (m *opDescribeEventSourceResolveEndpointMiddleware) HandleSerialize(ctx con break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -247,7 +263,7 @@ func (m *opDescribeEventSourceResolveEndpointMiddleware) HandleSerialize(ctx con // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_DescribePartnerEventSource.go b/service/eventbridge/api_op_DescribePartnerEventSource.go index f038b3eff71..8f3b8ffa24d 100644 --- a/service/eventbridge/api_op_DescribePartnerEventSource.go +++ b/service/eventbridge/api_op_DescribePartnerEventSource.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -67,6 +68,9 @@ func (c *Client) addOperationDescribePartnerEventSourceMiddlewares(stack *middle if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -124,6 +128,9 @@ func (c *Client) addOperationDescribePartnerEventSourceMiddlewares(stack *middle if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -142,12 +149,16 @@ type opDescribePartnerEventSourceResolveEndpointMiddleware struct { } func (*opDescribePartnerEventSourceResolveEndpointMiddleware) ID() string { - return "opDescribePartnerEventSourceResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opDescribePartnerEventSourceResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -176,6 +187,8 @@ func (m *opDescribePartnerEventSourceResolveEndpointMiddleware) HandleSerialize( ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -204,9 +217,13 @@ func (m *opDescribePartnerEventSourceResolveEndpointMiddleware) HandleSerialize( var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -220,9 +237,8 @@ func (m *opDescribePartnerEventSourceResolveEndpointMiddleware) HandleSerialize( break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -230,7 +246,7 @@ func (m *opDescribePartnerEventSourceResolveEndpointMiddleware) HandleSerialize( // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_DescribeReplay.go b/service/eventbridge/api_op_DescribeReplay.go index 32ee46272e3..27559565b77 100644 --- a/service/eventbridge/api_op_DescribeReplay.go +++ b/service/eventbridge/api_op_DescribeReplay.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -104,6 +105,9 @@ func (c *Client) addOperationDescribeReplayMiddlewares(stack *middleware.Stack, if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -161,6 +165,9 @@ func (c *Client) addOperationDescribeReplayMiddlewares(stack *middleware.Stack, if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -179,12 +186,16 @@ type opDescribeReplayResolveEndpointMiddleware struct { } func (*opDescribeReplayResolveEndpointMiddleware) ID() string { - return "opDescribeReplayResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opDescribeReplayResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -213,6 +224,8 @@ func (m *opDescribeReplayResolveEndpointMiddleware) HandleSerialize(ctx context. ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -241,9 +254,13 @@ func (m *opDescribeReplayResolveEndpointMiddleware) HandleSerialize(ctx context. var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -257,9 +274,8 @@ func (m *opDescribeReplayResolveEndpointMiddleware) HandleSerialize(ctx context. break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -267,7 +283,7 @@ func (m *opDescribeReplayResolveEndpointMiddleware) HandleSerialize(ctx context. // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_DescribeRule.go b/service/eventbridge/api_op_DescribeRule.go index 931a231966a..7e4e2bd70d3 100644 --- a/service/eventbridge/api_op_DescribeRule.go +++ b/service/eventbridge/api_op_DescribeRule.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -102,6 +103,9 @@ func (c *Client) addOperationDescribeRuleMiddlewares(stack *middleware.Stack, op if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -159,6 +163,9 @@ func (c *Client) addOperationDescribeRuleMiddlewares(stack *middleware.Stack, op if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -177,12 +184,16 @@ type opDescribeRuleResolveEndpointMiddleware struct { } func (*opDescribeRuleResolveEndpointMiddleware) ID() string { - return "opDescribeRuleResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opDescribeRuleResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -211,6 +222,8 @@ func (m *opDescribeRuleResolveEndpointMiddleware) HandleSerialize(ctx context.Co ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -239,9 +252,13 @@ func (m *opDescribeRuleResolveEndpointMiddleware) HandleSerialize(ctx context.Co var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -255,9 +272,8 @@ func (m *opDescribeRuleResolveEndpointMiddleware) HandleSerialize(ctx context.Co break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -265,7 +281,7 @@ func (m *opDescribeRuleResolveEndpointMiddleware) HandleSerialize(ctx context.Co // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_DisableRule.go b/service/eventbridge/api_op_DisableRule.go index 63d04be378c..5ffa7f89fae 100644 --- a/service/eventbridge/api_op_DisableRule.go +++ b/service/eventbridge/api_op_DisableRule.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -64,6 +65,9 @@ func (c *Client) addOperationDisableRuleMiddlewares(stack *middleware.Stack, opt if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -121,6 +125,9 @@ func (c *Client) addOperationDisableRuleMiddlewares(stack *middleware.Stack, opt if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -139,12 +146,16 @@ type opDisableRuleResolveEndpointMiddleware struct { } func (*opDisableRuleResolveEndpointMiddleware) ID() string { - return "opDisableRuleResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opDisableRuleResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -173,6 +184,8 @@ func (m *opDisableRuleResolveEndpointMiddleware) HandleSerialize(ctx context.Con ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -201,9 +214,13 @@ func (m *opDisableRuleResolveEndpointMiddleware) HandleSerialize(ctx context.Con var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -217,9 +234,8 @@ func (m *opDisableRuleResolveEndpointMiddleware) HandleSerialize(ctx context.Con break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -227,7 +243,7 @@ func (m *opDisableRuleResolveEndpointMiddleware) HandleSerialize(ctx context.Con // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_EnableRule.go b/service/eventbridge/api_op_EnableRule.go index f4a0b584d7d..ced085b5fb7 100644 --- a/service/eventbridge/api_op_EnableRule.go +++ b/service/eventbridge/api_op_EnableRule.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -63,6 +64,9 @@ func (c *Client) addOperationEnableRuleMiddlewares(stack *middleware.Stack, opti if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -120,6 +124,9 @@ func (c *Client) addOperationEnableRuleMiddlewares(stack *middleware.Stack, opti if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -138,12 +145,16 @@ type opEnableRuleResolveEndpointMiddleware struct { } func (*opEnableRuleResolveEndpointMiddleware) ID() string { - return "opEnableRuleResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opEnableRuleResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -172,6 +183,8 @@ func (m *opEnableRuleResolveEndpointMiddleware) HandleSerialize(ctx context.Cont ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -200,9 +213,13 @@ func (m *opEnableRuleResolveEndpointMiddleware) HandleSerialize(ctx context.Cont var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -216,9 +233,8 @@ func (m *opEnableRuleResolveEndpointMiddleware) HandleSerialize(ctx context.Cont break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -226,7 +242,7 @@ func (m *opEnableRuleResolveEndpointMiddleware) HandleSerialize(ctx context.Cont // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_ListApiDestinations.go b/service/eventbridge/api_op_ListApiDestinations.go index 8daa9c4d069..c7e6bbf51c0 100644 --- a/service/eventbridge/api_op_ListApiDestinations.go +++ b/service/eventbridge/api_op_ListApiDestinations.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -74,6 +75,9 @@ func (c *Client) addOperationListApiDestinationsMiddlewares(stack *middleware.St if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -128,6 +132,9 @@ func (c *Client) addOperationListApiDestinationsMiddlewares(stack *middleware.St if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -146,12 +153,16 @@ type opListApiDestinationsResolveEndpointMiddleware struct { } func (*opListApiDestinationsResolveEndpointMiddleware) ID() string { - return "opListApiDestinationsResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opListApiDestinationsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -180,6 +191,8 @@ func (m *opListApiDestinationsResolveEndpointMiddleware) HandleSerialize(ctx con ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -208,9 +221,13 @@ func (m *opListApiDestinationsResolveEndpointMiddleware) HandleSerialize(ctx con var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -224,9 +241,8 @@ func (m *opListApiDestinationsResolveEndpointMiddleware) HandleSerialize(ctx con break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -234,7 +250,7 @@ func (m *opListApiDestinationsResolveEndpointMiddleware) HandleSerialize(ctx con // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_ListArchives.go b/service/eventbridge/api_op_ListArchives.go index cfe8b603d8d..734f3356fdf 100644 --- a/service/eventbridge/api_op_ListArchives.go +++ b/service/eventbridge/api_op_ListArchives.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -77,6 +78,9 @@ func (c *Client) addOperationListArchivesMiddlewares(stack *middleware.Stack, op if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -131,6 +135,9 @@ func (c *Client) addOperationListArchivesMiddlewares(stack *middleware.Stack, op if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -149,12 +156,16 @@ type opListArchivesResolveEndpointMiddleware struct { } func (*opListArchivesResolveEndpointMiddleware) ID() string { - return "opListArchivesResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opListArchivesResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -183,6 +194,8 @@ func (m *opListArchivesResolveEndpointMiddleware) HandleSerialize(ctx context.Co ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -211,9 +224,13 @@ func (m *opListArchivesResolveEndpointMiddleware) HandleSerialize(ctx context.Co var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -227,9 +244,8 @@ func (m *opListArchivesResolveEndpointMiddleware) HandleSerialize(ctx context.Co break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -237,7 +253,7 @@ func (m *opListArchivesResolveEndpointMiddleware) HandleSerialize(ctx context.Co // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_ListConnections.go b/service/eventbridge/api_op_ListConnections.go index 0ceb68f5e0f..508f34d7797 100644 --- a/service/eventbridge/api_op_ListConnections.go +++ b/service/eventbridge/api_op_ListConnections.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -73,6 +74,9 @@ func (c *Client) addOperationListConnectionsMiddlewares(stack *middleware.Stack, if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -127,6 +131,9 @@ func (c *Client) addOperationListConnectionsMiddlewares(stack *middleware.Stack, if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -145,12 +152,16 @@ type opListConnectionsResolveEndpointMiddleware struct { } func (*opListConnectionsResolveEndpointMiddleware) ID() string { - return "opListConnectionsResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opListConnectionsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -179,6 +190,8 @@ func (m *opListConnectionsResolveEndpointMiddleware) HandleSerialize(ctx context ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -207,9 +220,13 @@ func (m *opListConnectionsResolveEndpointMiddleware) HandleSerialize(ctx context var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -223,9 +240,8 @@ func (m *opListConnectionsResolveEndpointMiddleware) HandleSerialize(ctx context break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -233,7 +249,7 @@ func (m *opListConnectionsResolveEndpointMiddleware) HandleSerialize(ctx context // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_ListEndpoints.go b/service/eventbridge/api_op_ListEndpoints.go index 1520c9e990d..6e2b087992e 100644 --- a/service/eventbridge/api_op_ListEndpoints.go +++ b/service/eventbridge/api_op_ListEndpoints.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -86,6 +87,9 @@ func (c *Client) addOperationListEndpointsMiddlewares(stack *middleware.Stack, o if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -140,6 +144,9 @@ func (c *Client) addOperationListEndpointsMiddlewares(stack *middleware.Stack, o if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -158,12 +165,16 @@ type opListEndpointsResolveEndpointMiddleware struct { } func (*opListEndpointsResolveEndpointMiddleware) ID() string { - return "opListEndpointsResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opListEndpointsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -192,6 +203,8 @@ func (m *opListEndpointsResolveEndpointMiddleware) HandleSerialize(ctx context.C ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -220,9 +233,13 @@ func (m *opListEndpointsResolveEndpointMiddleware) HandleSerialize(ctx context.C var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -236,9 +253,8 @@ func (m *opListEndpointsResolveEndpointMiddleware) HandleSerialize(ctx context.C break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -246,7 +262,7 @@ func (m *opListEndpointsResolveEndpointMiddleware) HandleSerialize(ctx context.C // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_ListEventBuses.go b/service/eventbridge/api_op_ListEventBuses.go index 4f5aecca9e2..64670d54d0d 100644 --- a/service/eventbridge/api_op_ListEventBuses.go +++ b/service/eventbridge/api_op_ListEventBuses.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -74,6 +75,9 @@ func (c *Client) addOperationListEventBusesMiddlewares(stack *middleware.Stack, if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -128,6 +132,9 @@ func (c *Client) addOperationListEventBusesMiddlewares(stack *middleware.Stack, if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -146,12 +153,16 @@ type opListEventBusesResolveEndpointMiddleware struct { } func (*opListEventBusesResolveEndpointMiddleware) ID() string { - return "opListEventBusesResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opListEventBusesResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -180,6 +191,8 @@ func (m *opListEventBusesResolveEndpointMiddleware) HandleSerialize(ctx context. ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -208,9 +221,13 @@ func (m *opListEventBusesResolveEndpointMiddleware) HandleSerialize(ctx context. var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -224,9 +241,8 @@ func (m *opListEventBusesResolveEndpointMiddleware) HandleSerialize(ctx context. break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -234,7 +250,7 @@ func (m *opListEventBusesResolveEndpointMiddleware) HandleSerialize(ctx context. // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_ListEventSources.go b/service/eventbridge/api_op_ListEventSources.go index 3cc600f0e6d..cbbc6d8ef29 100644 --- a/service/eventbridge/api_op_ListEventSources.go +++ b/service/eventbridge/api_op_ListEventSources.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -76,6 +77,9 @@ func (c *Client) addOperationListEventSourcesMiddlewares(stack *middleware.Stack if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -130,6 +134,9 @@ func (c *Client) addOperationListEventSourcesMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -148,12 +155,16 @@ type opListEventSourcesResolveEndpointMiddleware struct { } func (*opListEventSourcesResolveEndpointMiddleware) ID() string { - return "opListEventSourcesResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opListEventSourcesResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -182,6 +193,8 @@ func (m *opListEventSourcesResolveEndpointMiddleware) HandleSerialize(ctx contex ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -210,9 +223,13 @@ func (m *opListEventSourcesResolveEndpointMiddleware) HandleSerialize(ctx contex var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -226,9 +243,8 @@ func (m *opListEventSourcesResolveEndpointMiddleware) HandleSerialize(ctx contex break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -236,7 +252,7 @@ func (m *opListEventSourcesResolveEndpointMiddleware) HandleSerialize(ctx contex // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_ListPartnerEventSourceAccounts.go b/service/eventbridge/api_op_ListPartnerEventSourceAccounts.go index 0d3f6ccd17f..4895e1954b0 100644 --- a/service/eventbridge/api_op_ListPartnerEventSourceAccounts.go +++ b/service/eventbridge/api_op_ListPartnerEventSourceAccounts.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -77,6 +78,9 @@ func (c *Client) addOperationListPartnerEventSourceAccountsMiddlewares(stack *mi if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -134,6 +138,9 @@ func (c *Client) addOperationListPartnerEventSourceAccountsMiddlewares(stack *mi if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -152,12 +159,16 @@ type opListPartnerEventSourceAccountsResolveEndpointMiddleware struct { } func (*opListPartnerEventSourceAccountsResolveEndpointMiddleware) ID() string { - return "opListPartnerEventSourceAccountsResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opListPartnerEventSourceAccountsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -186,6 +197,8 @@ func (m *opListPartnerEventSourceAccountsResolveEndpointMiddleware) HandleSerial ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -214,9 +227,13 @@ func (m *opListPartnerEventSourceAccountsResolveEndpointMiddleware) HandleSerial var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -230,9 +247,8 @@ func (m *opListPartnerEventSourceAccountsResolveEndpointMiddleware) HandleSerial break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -240,7 +256,7 @@ func (m *opListPartnerEventSourceAccountsResolveEndpointMiddleware) HandleSerial // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_ListPartnerEventSources.go b/service/eventbridge/api_op_ListPartnerEventSources.go index 31594f38234..aa7cf2faa37 100644 --- a/service/eventbridge/api_op_ListPartnerEventSources.go +++ b/service/eventbridge/api_op_ListPartnerEventSources.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -78,6 +79,9 @@ func (c *Client) addOperationListPartnerEventSourcesMiddlewares(stack *middlewar if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -135,6 +139,9 @@ func (c *Client) addOperationListPartnerEventSourcesMiddlewares(stack *middlewar if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -153,12 +160,16 @@ type opListPartnerEventSourcesResolveEndpointMiddleware struct { } func (*opListPartnerEventSourcesResolveEndpointMiddleware) ID() string { - return "opListPartnerEventSourcesResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opListPartnerEventSourcesResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -187,6 +198,8 @@ func (m *opListPartnerEventSourcesResolveEndpointMiddleware) HandleSerialize(ctx ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -215,9 +228,13 @@ func (m *opListPartnerEventSourcesResolveEndpointMiddleware) HandleSerialize(ctx var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -231,9 +248,8 @@ func (m *opListPartnerEventSourcesResolveEndpointMiddleware) HandleSerialize(ctx break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -241,7 +257,7 @@ func (m *opListPartnerEventSourcesResolveEndpointMiddleware) HandleSerialize(ctx // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_ListReplays.go b/service/eventbridge/api_op_ListReplays.go index 45700341373..9f6efa4d63d 100644 --- a/service/eventbridge/api_op_ListReplays.go +++ b/service/eventbridge/api_op_ListReplays.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -77,6 +78,9 @@ func (c *Client) addOperationListReplaysMiddlewares(stack *middleware.Stack, opt if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -131,6 +135,9 @@ func (c *Client) addOperationListReplaysMiddlewares(stack *middleware.Stack, opt if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -149,12 +156,16 @@ type opListReplaysResolveEndpointMiddleware struct { } func (*opListReplaysResolveEndpointMiddleware) ID() string { - return "opListReplaysResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opListReplaysResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -183,6 +194,8 @@ func (m *opListReplaysResolveEndpointMiddleware) HandleSerialize(ctx context.Con ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -211,9 +224,13 @@ func (m *opListReplaysResolveEndpointMiddleware) HandleSerialize(ctx context.Con var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -227,9 +244,8 @@ func (m *opListReplaysResolveEndpointMiddleware) HandleSerialize(ctx context.Con break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -237,7 +253,7 @@ func (m *opListReplaysResolveEndpointMiddleware) HandleSerialize(ctx context.Con // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_ListRuleNamesByTarget.go b/service/eventbridge/api_op_ListRuleNamesByTarget.go index c504e4c9615..4aad4429879 100644 --- a/service/eventbridge/api_op_ListRuleNamesByTarget.go +++ b/service/eventbridge/api_op_ListRuleNamesByTarget.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -76,6 +77,9 @@ func (c *Client) addOperationListRuleNamesByTargetMiddlewares(stack *middleware. if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -133,6 +137,9 @@ func (c *Client) addOperationListRuleNamesByTargetMiddlewares(stack *middleware. if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -151,12 +158,16 @@ type opListRuleNamesByTargetResolveEndpointMiddleware struct { } func (*opListRuleNamesByTargetResolveEndpointMiddleware) ID() string { - return "opListRuleNamesByTargetResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opListRuleNamesByTargetResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -185,6 +196,8 @@ func (m *opListRuleNamesByTargetResolveEndpointMiddleware) HandleSerialize(ctx c ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -213,9 +226,13 @@ func (m *opListRuleNamesByTargetResolveEndpointMiddleware) HandleSerialize(ctx c var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -229,9 +246,8 @@ func (m *opListRuleNamesByTargetResolveEndpointMiddleware) HandleSerialize(ctx c break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -239,7 +255,7 @@ func (m *opListRuleNamesByTargetResolveEndpointMiddleware) HandleSerialize(ctx c // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_ListRules.go b/service/eventbridge/api_op_ListRules.go index 44d368c7166..0beccd39abc 100644 --- a/service/eventbridge/api_op_ListRules.go +++ b/service/eventbridge/api_op_ListRules.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -78,6 +79,9 @@ func (c *Client) addOperationListRulesMiddlewares(stack *middleware.Stack, optio if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -132,6 +136,9 @@ func (c *Client) addOperationListRulesMiddlewares(stack *middleware.Stack, optio if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -150,12 +157,16 @@ type opListRulesResolveEndpointMiddleware struct { } func (*opListRulesResolveEndpointMiddleware) ID() string { - return "opListRulesResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opListRulesResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -184,6 +195,8 @@ func (m *opListRulesResolveEndpointMiddleware) HandleSerialize(ctx context.Conte ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -212,9 +225,13 @@ func (m *opListRulesResolveEndpointMiddleware) HandleSerialize(ctx context.Conte var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -228,9 +245,8 @@ func (m *opListRulesResolveEndpointMiddleware) HandleSerialize(ctx context.Conte break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -238,7 +254,7 @@ func (m *opListRulesResolveEndpointMiddleware) HandleSerialize(ctx context.Conte // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_ListTagsForResource.go b/service/eventbridge/api_op_ListTagsForResource.go index ee7d02b9b28..2411143fa15 100644 --- a/service/eventbridge/api_op_ListTagsForResource.go +++ b/service/eventbridge/api_op_ListTagsForResource.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -63,6 +64,9 @@ func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.St if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -120,6 +124,9 @@ func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.St if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -138,12 +145,16 @@ type opListTagsForResourceResolveEndpointMiddleware struct { } func (*opListTagsForResourceResolveEndpointMiddleware) ID() string { - return "opListTagsForResourceResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opListTagsForResourceResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -172,6 +183,8 @@ func (m *opListTagsForResourceResolveEndpointMiddleware) HandleSerialize(ctx con ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -200,9 +213,13 @@ func (m *opListTagsForResourceResolveEndpointMiddleware) HandleSerialize(ctx con var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -216,9 +233,8 @@ func (m *opListTagsForResourceResolveEndpointMiddleware) HandleSerialize(ctx con break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -226,7 +242,7 @@ func (m *opListTagsForResourceResolveEndpointMiddleware) HandleSerialize(ctx con // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_ListTargetsByRule.go b/service/eventbridge/api_op_ListTargetsByRule.go index de91adb2cd7..2aaa1ce6811 100644 --- a/service/eventbridge/api_op_ListTargetsByRule.go +++ b/service/eventbridge/api_op_ListTargetsByRule.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -76,6 +77,9 @@ func (c *Client) addOperationListTargetsByRuleMiddlewares(stack *middleware.Stac if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -133,6 +137,9 @@ func (c *Client) addOperationListTargetsByRuleMiddlewares(stack *middleware.Stac if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -151,12 +158,16 @@ type opListTargetsByRuleResolveEndpointMiddleware struct { } func (*opListTargetsByRuleResolveEndpointMiddleware) ID() string { - return "opListTargetsByRuleResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opListTargetsByRuleResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -185,6 +196,8 @@ func (m *opListTargetsByRuleResolveEndpointMiddleware) HandleSerialize(ctx conte ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -213,9 +226,13 @@ func (m *opListTargetsByRuleResolveEndpointMiddleware) HandleSerialize(ctx conte var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -229,9 +246,8 @@ func (m *opListTargetsByRuleResolveEndpointMiddleware) HandleSerialize(ctx conte break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -239,7 +255,7 @@ func (m *opListTargetsByRuleResolveEndpointMiddleware) HandleSerialize(ctx conte // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_PutEvents.go b/service/eventbridge/api_op_PutEvents.go index ff101ec65d3..d6e0fa6fe98 100644 --- a/service/eventbridge/api_op_PutEvents.go +++ b/service/eventbridge/api_op_PutEvents.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -77,6 +78,9 @@ func (c *Client) addOperationPutEventsMiddlewares(stack *middleware.Stack, optio if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -140,6 +144,9 @@ func (c *Client) addOperationPutEventsMiddlewares(stack *middleware.Stack, optio if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -176,12 +183,16 @@ type opPutEventsResolveEndpointMiddleware struct { } func (*opPutEventsResolveEndpointMiddleware) ID() string { - return "opPutEventsResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opPutEventsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -217,6 +228,8 @@ func (m *opPutEventsResolveEndpointMiddleware) HandleSerialize(ctx context.Conte ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -245,9 +258,13 @@ func (m *opPutEventsResolveEndpointMiddleware) HandleSerialize(ctx context.Conte var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -261,9 +278,8 @@ func (m *opPutEventsResolveEndpointMiddleware) HandleSerialize(ctx context.Conte break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -271,7 +287,7 @@ func (m *opPutEventsResolveEndpointMiddleware) HandleSerialize(ctx context.Conte // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_PutPartnerEvents.go b/service/eventbridge/api_op_PutPartnerEvents.go index 9daf88f9547..274a5017c11 100644 --- a/service/eventbridge/api_op_PutPartnerEvents.go +++ b/service/eventbridge/api_op_PutPartnerEvents.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -68,6 +69,9 @@ func (c *Client) addOperationPutPartnerEventsMiddlewares(stack *middleware.Stack if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -125,6 +129,9 @@ func (c *Client) addOperationPutPartnerEventsMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -143,12 +150,16 @@ type opPutPartnerEventsResolveEndpointMiddleware struct { } func (*opPutPartnerEventsResolveEndpointMiddleware) ID() string { - return "opPutPartnerEventsResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opPutPartnerEventsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -177,6 +188,8 @@ func (m *opPutPartnerEventsResolveEndpointMiddleware) HandleSerialize(ctx contex ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -205,9 +218,13 @@ func (m *opPutPartnerEventsResolveEndpointMiddleware) HandleSerialize(ctx contex var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -221,9 +238,8 @@ func (m *opPutPartnerEventsResolveEndpointMiddleware) HandleSerialize(ctx contex break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -231,7 +247,7 @@ func (m *opPutPartnerEventsResolveEndpointMiddleware) HandleSerialize(ctx contex // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_PutPermission.go b/service/eventbridge/api_op_PutPermission.go index 36de657c5b6..5ad1a749944 100644 --- a/service/eventbridge/api_op_PutPermission.go +++ b/service/eventbridge/api_op_PutPermission.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -106,6 +107,9 @@ func (c *Client) addOperationPutPermissionMiddlewares(stack *middleware.Stack, o if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -163,6 +167,9 @@ func (c *Client) addOperationPutPermissionMiddlewares(stack *middleware.Stack, o if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -181,12 +188,16 @@ type opPutPermissionResolveEndpointMiddleware struct { } func (*opPutPermissionResolveEndpointMiddleware) ID() string { - return "opPutPermissionResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opPutPermissionResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -215,6 +226,8 @@ func (m *opPutPermissionResolveEndpointMiddleware) HandleSerialize(ctx context.C ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -243,9 +256,13 @@ func (m *opPutPermissionResolveEndpointMiddleware) HandleSerialize(ctx context.C var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -259,9 +276,8 @@ func (m *opPutPermissionResolveEndpointMiddleware) HandleSerialize(ctx context.C break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -269,7 +285,7 @@ func (m *opPutPermissionResolveEndpointMiddleware) HandleSerialize(ctx context.C // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_PutRule.go b/service/eventbridge/api_op_PutRule.go index 29a58750341..5a491d5af19 100644 --- a/service/eventbridge/api_op_PutRule.go +++ b/service/eventbridge/api_op_PutRule.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -132,6 +133,9 @@ func (c *Client) addOperationPutRuleMiddlewares(stack *middleware.Stack, options if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -189,6 +193,9 @@ func (c *Client) addOperationPutRuleMiddlewares(stack *middleware.Stack, options if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -207,12 +214,16 @@ type opPutRuleResolveEndpointMiddleware struct { } func (*opPutRuleResolveEndpointMiddleware) ID() string { - return "opPutRuleResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opPutRuleResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -241,6 +252,8 @@ func (m *opPutRuleResolveEndpointMiddleware) HandleSerialize(ctx context.Context ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -269,9 +282,13 @@ func (m *opPutRuleResolveEndpointMiddleware) HandleSerialize(ctx context.Context var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -285,9 +302,8 @@ func (m *opPutRuleResolveEndpointMiddleware) HandleSerialize(ctx context.Context break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -295,7 +311,7 @@ func (m *opPutRuleResolveEndpointMiddleware) HandleSerialize(ctx context.Context // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_PutTargets.go b/service/eventbridge/api_op_PutTargets.go index 49071d58faa..952ff72eca1 100644 --- a/service/eventbridge/api_op_PutTargets.go +++ b/service/eventbridge/api_op_PutTargets.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -162,6 +163,9 @@ func (c *Client) addOperationPutTargetsMiddlewares(stack *middleware.Stack, opti if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -219,6 +223,9 @@ func (c *Client) addOperationPutTargetsMiddlewares(stack *middleware.Stack, opti if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -237,12 +244,16 @@ type opPutTargetsResolveEndpointMiddleware struct { } func (*opPutTargetsResolveEndpointMiddleware) ID() string { - return "opPutTargetsResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opPutTargetsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -271,6 +282,8 @@ func (m *opPutTargetsResolveEndpointMiddleware) HandleSerialize(ctx context.Cont ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -299,9 +312,13 @@ func (m *opPutTargetsResolveEndpointMiddleware) HandleSerialize(ctx context.Cont var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -315,9 +332,8 @@ func (m *opPutTargetsResolveEndpointMiddleware) HandleSerialize(ctx context.Cont break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -325,7 +341,7 @@ func (m *opPutTargetsResolveEndpointMiddleware) HandleSerialize(ctx context.Cont // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_RemovePermission.go b/service/eventbridge/api_op_RemovePermission.go index f011013f223..b6f667d4a17 100644 --- a/service/eventbridge/api_op_RemovePermission.go +++ b/service/eventbridge/api_op_RemovePermission.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -68,6 +69,9 @@ func (c *Client) addOperationRemovePermissionMiddlewares(stack *middleware.Stack if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -122,6 +126,9 @@ func (c *Client) addOperationRemovePermissionMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -140,12 +147,16 @@ type opRemovePermissionResolveEndpointMiddleware struct { } func (*opRemovePermissionResolveEndpointMiddleware) ID() string { - return "opRemovePermissionResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opRemovePermissionResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -174,6 +185,8 @@ func (m *opRemovePermissionResolveEndpointMiddleware) HandleSerialize(ctx contex ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -202,9 +215,13 @@ func (m *opRemovePermissionResolveEndpointMiddleware) HandleSerialize(ctx contex var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -218,9 +235,8 @@ func (m *opRemovePermissionResolveEndpointMiddleware) HandleSerialize(ctx contex break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -228,7 +244,7 @@ func (m *opRemovePermissionResolveEndpointMiddleware) HandleSerialize(ctx contex // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_RemoveTargets.go b/service/eventbridge/api_op_RemoveTargets.go index c995b7b7f1e..8b27950bb29 100644 --- a/service/eventbridge/api_op_RemoveTargets.go +++ b/service/eventbridge/api_op_RemoveTargets.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -89,6 +90,9 @@ func (c *Client) addOperationRemoveTargetsMiddlewares(stack *middleware.Stack, o if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -146,6 +150,9 @@ func (c *Client) addOperationRemoveTargetsMiddlewares(stack *middleware.Stack, o if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -164,12 +171,16 @@ type opRemoveTargetsResolveEndpointMiddleware struct { } func (*opRemoveTargetsResolveEndpointMiddleware) ID() string { - return "opRemoveTargetsResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opRemoveTargetsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -198,6 +209,8 @@ func (m *opRemoveTargetsResolveEndpointMiddleware) HandleSerialize(ctx context.C ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -226,9 +239,13 @@ func (m *opRemoveTargetsResolveEndpointMiddleware) HandleSerialize(ctx context.C var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -242,9 +259,8 @@ func (m *opRemoveTargetsResolveEndpointMiddleware) HandleSerialize(ctx context.C break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -252,7 +268,7 @@ func (m *opRemoveTargetsResolveEndpointMiddleware) HandleSerialize(ctx context.C // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_StartReplay.go b/service/eventbridge/api_op_StartReplay.go index ba9d91b4204..2165ad3d79f 100644 --- a/service/eventbridge/api_op_StartReplay.go +++ b/service/eventbridge/api_op_StartReplay.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -106,6 +107,9 @@ func (c *Client) addOperationStartReplayMiddlewares(stack *middleware.Stack, opt if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -163,6 +167,9 @@ func (c *Client) addOperationStartReplayMiddlewares(stack *middleware.Stack, opt if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -181,12 +188,16 @@ type opStartReplayResolveEndpointMiddleware struct { } func (*opStartReplayResolveEndpointMiddleware) ID() string { - return "opStartReplayResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opStartReplayResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -215,6 +226,8 @@ func (m *opStartReplayResolveEndpointMiddleware) HandleSerialize(ctx context.Con ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -243,9 +256,13 @@ func (m *opStartReplayResolveEndpointMiddleware) HandleSerialize(ctx context.Con var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -259,9 +276,8 @@ func (m *opStartReplayResolveEndpointMiddleware) HandleSerialize(ctx context.Con break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -269,7 +285,7 @@ func (m *opStartReplayResolveEndpointMiddleware) HandleSerialize(ctx context.Con // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_TagResource.go b/service/eventbridge/api_op_TagResource.go index fecef8aed4b..d3b3c956723 100644 --- a/service/eventbridge/api_op_TagResource.go +++ b/service/eventbridge/api_op_TagResource.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -73,6 +74,9 @@ func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, opt if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -130,6 +134,9 @@ func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, opt if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -148,12 +155,16 @@ type opTagResourceResolveEndpointMiddleware struct { } func (*opTagResourceResolveEndpointMiddleware) ID() string { - return "opTagResourceResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opTagResourceResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -182,6 +193,8 @@ func (m *opTagResourceResolveEndpointMiddleware) HandleSerialize(ctx context.Con ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -210,9 +223,13 @@ func (m *opTagResourceResolveEndpointMiddleware) HandleSerialize(ctx context.Con var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -226,9 +243,8 @@ func (m *opTagResourceResolveEndpointMiddleware) HandleSerialize(ctx context.Con break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -236,7 +252,7 @@ func (m *opTagResourceResolveEndpointMiddleware) HandleSerialize(ctx context.Con // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_TestEventPattern.go b/service/eventbridge/api_op_TestEventPattern.go index 4b22dd2d8dd..87b9b916a34 100644 --- a/service/eventbridge/api_op_TestEventPattern.go +++ b/service/eventbridge/api_op_TestEventPattern.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -80,6 +81,9 @@ func (c *Client) addOperationTestEventPatternMiddlewares(stack *middleware.Stack if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -137,6 +141,9 @@ func (c *Client) addOperationTestEventPatternMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -155,12 +162,16 @@ type opTestEventPatternResolveEndpointMiddleware struct { } func (*opTestEventPatternResolveEndpointMiddleware) ID() string { - return "opTestEventPatternResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opTestEventPatternResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -189,6 +200,8 @@ func (m *opTestEventPatternResolveEndpointMiddleware) HandleSerialize(ctx contex ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -217,9 +230,13 @@ func (m *opTestEventPatternResolveEndpointMiddleware) HandleSerialize(ctx contex var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -233,9 +250,8 @@ func (m *opTestEventPatternResolveEndpointMiddleware) HandleSerialize(ctx contex break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -243,7 +259,7 @@ func (m *opTestEventPatternResolveEndpointMiddleware) HandleSerialize(ctx contex // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_UntagResource.go b/service/eventbridge/api_op_UntagResource.go index ae44f0798fb..1d3057675e9 100644 --- a/service/eventbridge/api_op_UntagResource.go +++ b/service/eventbridge/api_op_UntagResource.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -63,6 +64,9 @@ func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, o if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -120,6 +124,9 @@ func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, o if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -138,12 +145,16 @@ type opUntagResourceResolveEndpointMiddleware struct { } func (*opUntagResourceResolveEndpointMiddleware) ID() string { - return "opUntagResourceResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opUntagResourceResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -172,6 +183,8 @@ func (m *opUntagResourceResolveEndpointMiddleware) HandleSerialize(ctx context.C ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -200,9 +213,13 @@ func (m *opUntagResourceResolveEndpointMiddleware) HandleSerialize(ctx context.C var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -216,9 +233,8 @@ func (m *opUntagResourceResolveEndpointMiddleware) HandleSerialize(ctx context.C break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -226,7 +242,7 @@ func (m *opUntagResourceResolveEndpointMiddleware) HandleSerialize(ctx context.C // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_UpdateApiDestination.go b/service/eventbridge/api_op_UpdateApiDestination.go index 3bf3733eb02..76d8939f4d5 100644 --- a/service/eventbridge/api_op_UpdateApiDestination.go +++ b/service/eventbridge/api_op_UpdateApiDestination.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -87,6 +88,9 @@ func (c *Client) addOperationUpdateApiDestinationMiddlewares(stack *middleware.S if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -144,6 +148,9 @@ func (c *Client) addOperationUpdateApiDestinationMiddlewares(stack *middleware.S if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -162,12 +169,16 @@ type opUpdateApiDestinationResolveEndpointMiddleware struct { } func (*opUpdateApiDestinationResolveEndpointMiddleware) ID() string { - return "opUpdateApiDestinationResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opUpdateApiDestinationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -196,6 +207,8 @@ func (m *opUpdateApiDestinationResolveEndpointMiddleware) HandleSerialize(ctx co ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -224,9 +237,13 @@ func (m *opUpdateApiDestinationResolveEndpointMiddleware) HandleSerialize(ctx co var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -240,9 +257,8 @@ func (m *opUpdateApiDestinationResolveEndpointMiddleware) HandleSerialize(ctx co break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -250,7 +266,7 @@ func (m *opUpdateApiDestinationResolveEndpointMiddleware) HandleSerialize(ctx co // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_UpdateArchive.go b/service/eventbridge/api_op_UpdateArchive.go index fefabc4ec66..f6452b4d8dd 100644 --- a/service/eventbridge/api_op_UpdateArchive.go +++ b/service/eventbridge/api_op_UpdateArchive.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -81,6 +82,9 @@ func (c *Client) addOperationUpdateArchiveMiddlewares(stack *middleware.Stack, o if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -138,6 +142,9 @@ func (c *Client) addOperationUpdateArchiveMiddlewares(stack *middleware.Stack, o if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -156,12 +163,16 @@ type opUpdateArchiveResolveEndpointMiddleware struct { } func (*opUpdateArchiveResolveEndpointMiddleware) ID() string { - return "opUpdateArchiveResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opUpdateArchiveResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -190,6 +201,8 @@ func (m *opUpdateArchiveResolveEndpointMiddleware) HandleSerialize(ctx context.C ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -218,9 +231,13 @@ func (m *opUpdateArchiveResolveEndpointMiddleware) HandleSerialize(ctx context.C var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -234,9 +251,8 @@ func (m *opUpdateArchiveResolveEndpointMiddleware) HandleSerialize(ctx context.C break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -244,7 +260,7 @@ func (m *opUpdateArchiveResolveEndpointMiddleware) HandleSerialize(ctx context.C // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_UpdateConnection.go b/service/eventbridge/api_op_UpdateConnection.go index a6619929c9f..4f99412a1ac 100644 --- a/service/eventbridge/api_op_UpdateConnection.go +++ b/service/eventbridge/api_op_UpdateConnection.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -84,6 +85,9 @@ func (c *Client) addOperationUpdateConnectionMiddlewares(stack *middleware.Stack if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -141,6 +145,9 @@ func (c *Client) addOperationUpdateConnectionMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -159,12 +166,16 @@ type opUpdateConnectionResolveEndpointMiddleware struct { } func (*opUpdateConnectionResolveEndpointMiddleware) ID() string { - return "opUpdateConnectionResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opUpdateConnectionResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -193,6 +204,8 @@ func (m *opUpdateConnectionResolveEndpointMiddleware) HandleSerialize(ctx contex ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -221,9 +234,13 @@ func (m *opUpdateConnectionResolveEndpointMiddleware) HandleSerialize(ctx contex var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -237,9 +254,8 @@ func (m *opUpdateConnectionResolveEndpointMiddleware) HandleSerialize(ctx contex break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -247,7 +263,7 @@ func (m *opUpdateConnectionResolveEndpointMiddleware) HandleSerialize(ctx contex // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/api_op_UpdateEndpoint.go b/service/eventbridge/api_op_UpdateEndpoint.go index e39734765b4..3900937e7ce 100644 --- a/service/eventbridge/api_op_UpdateEndpoint.go +++ b/service/eventbridge/api_op_UpdateEndpoint.go @@ -6,6 +6,7 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" @@ -107,6 +108,9 @@ func (c *Client) addOperationUpdateEndpointMiddlewares(stack *middleware.Stack, if err != nil { return err } + if err = addLegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -164,6 +168,9 @@ func (c *Client) addOperationUpdateEndpointMiddlewares(stack *middleware.Stack, if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addEndpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -182,12 +189,16 @@ type opUpdateEndpointResolveEndpointMiddleware struct { } func (*opUpdateEndpointResolveEndpointMiddleware) ID() string { - return "opUpdateEndpointResolveEndpointMiddleware" + return "ResolveEndpointV2" } func (m *opUpdateEndpointResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -216,6 +227,8 @@ func (m *opUpdateEndpointResolveEndpointMiddleware) HandleSerialize(ctx context. ) } + ctx = smithyhttp.DisableEndpointHostPrefix(ctx, true) + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) if err != nil { var nfe *internalauth.NoAuthenticationSchemesFoundError @@ -244,9 +257,13 @@ func (m *opUpdateEndpointResolveEndpointMiddleware) HandleSerialize(ctx context. var signingName, signingRegion string if v4Scheme.SigningName == nil { signingName = "events" + } else { + signingName = *v4Scheme.SigningName } if v4Scheme.SigningRegion == nil { signingRegion = m.BuiltInResolver.(*BuiltInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion } if v4Scheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -260,9 +277,8 @@ func (m *opUpdateEndpointResolveEndpointMiddleware) HandleSerialize(ctx context. break case *internalauth.AuthenticationSchemeV4A: v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - var signingName string if v4aScheme.SigningName == nil { - signingName = "events" + v4aScheme.SigningName = aws.String("events") } if v4aScheme.DisableDoubleEncoding != nil { // The signer sets an equivalent value at client initialization time. @@ -270,7 +286,7 @@ func (m *opUpdateEndpointResolveEndpointMiddleware) HandleSerialize(ctx context. // and override the value set at client initialization time. ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) } - ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) ctx = ebcust.SetSignerVersion(ctx, v4aScheme.Name) break diff --git a/service/eventbridge/endpoints.go b/service/eventbridge/endpoints.go index b2225ac1664..f42d02927c0 100644 --- a/service/eventbridge/endpoints.go +++ b/service/eventbridge/endpoints.go @@ -45,15 +45,6 @@ func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointRe return fn(region, options) } -func resolveDefaultEndpointConfiguration(o *Options) { - if o.EndpointResolver != nil { - return - } - o.EndpointResolver = &compatibleEndpointResolver{ - EndpointResolverV2: NewDefaultEndpointResolverV2(), - } -} - // EndpointResolverFromURL returns an EndpointResolver configured using the // provided endpoint url. By default, the resolved endpoint resolver uses the // client region as signing region, and the endpoint source is set to @@ -87,6 +78,10 @@ func (*ResolveEndpoint) ID() string { func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -207,90 +202,10 @@ func finalizeClientEndpointResolverOptions(options *Options) { } -type legacyEndpointResolverAdapter struct { - legacyResolver EndpointResolver - resolver EndpointResolverV2 -} - -func (l *legacyEndpointResolverAdapter) ResolveEndpoint(ctx context.Context, params EndpointParameters) (endpoint smithyendpoints.Endpoint, err error) { - var fips aws.FIPSEndpointState - var dualStack aws.DualStackEndpointState - - if aws.ToBool(params.UseFIPS) { - fips = aws.FIPSEndpointStateEnabled - } - if aws.ToBool(params.UseDualStack) { - dualStack = aws.DualStackEndpointStateEnabled - } - - resolveEndpoint, err := l.legacyResolver.ResolveEndpoint(aws.ToString(params.Region), EndpointResolverOptions{ - ResolvedRegion: aws.ToString(params.Region), - UseFIPSEndpoint: fips, - UseDualStackEndpoint: dualStack, - }) - if err != nil { - return endpoint, err - } - - if resolveEndpoint.HostnameImmutable { - uriString := resolveEndpoint.URL - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - }, nil - } - - if resolveEndpoint.Source == aws.EndpointSourceServiceMetadata { - return l.resolver.ResolveEndpoint(ctx, params) - } - - params = params.WithDefaults() - params.Endpoint = &resolveEndpoint.URL - - return l.resolver.ResolveEndpoint(ctx, params) -} - -type isDefaultProvidedImplementation interface { - isDefaultProvidedImplementation() -} - -type compatibleEndpointResolver struct { - EndpointResolverV2 EndpointResolverV2 -} - -func (n *compatibleEndpointResolver) isDefaultProvidedImplementation() {} - -func (n *compatibleEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { - reg := region - fips := options.UseFIPSEndpoint - if len(options.ResolvedRegion) > 0 { - reg = options.ResolvedRegion - } else { - // EndpointResolverV2 needs to support pseudo-regions to maintain backwards-compatibility - // with the legacy EndpointResolver - reg, fips = mapPseudoRegion(region) - } - ctx := context.Background() - resolved, err := n.EndpointResolverV2.ResolveEndpoint(ctx, EndpointParameters{ - Region: ®, - UseFIPS: aws.Bool(fips == aws.FIPSEndpointStateEnabled), - UseDualStack: aws.Bool(options.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled), - }) - if err != nil { - return endpoint, err - } - - endpoint = aws.Endpoint{ - URL: resolved.URI.String(), - HostnameImmutable: false, - Source: aws.EndpointSourceServiceMetadata, +func resolveEndpointResolverV2(options *Options) { + if options.EndpointResolverV2 == nil { + options.EndpointResolverV2 = NewDefaultEndpointResolverV2() } - - return endpoint, nil } // Utility function to aid with translating pseudo-regions to classical regions @@ -313,24 +228,6 @@ func mapPseudoRegion(pr string) (region string, fips aws.FIPSEndpointState) { return region, fips } -func finalizeEndpointResolverV2(options *Options) { - // Check if the EndpointResolver was not user provided - // but is the SDK's default provided version. - _, ok := options.EndpointResolver.(isDefaultProvidedImplementation) - if options.EndpointResolverV2 == nil { - options.EndpointResolverV2 = NewDefaultEndpointResolverV2() - } - if ok { - // Nothing further to do - return - } - - options.EndpointResolverV2 = &legacyEndpointResolverAdapter{ - legacyResolver: options.EndpointResolver, - resolver: NewDefaultEndpointResolverV2(), - } -} - // BuiltInParameterResolver is the interface responsible for resolving BuiltIn // values during the sourcing of EndpointParameters type BuiltInParameterResolver interface { @@ -735,7 +632,7 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, }, nil } - return endpoint, fmt.Errorf("no rules matched these parameters. This is a bug, %#v", params) + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") } return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") } diff --git a/service/eventbridge/internal/customizations/endpoint.go b/service/eventbridge/internal/customizations/endpoint.go index 59fe4bb3a40..1a3b71bb55e 100644 --- a/service/eventbridge/internal/customizations/endpoint.go +++ b/service/eventbridge/internal/customizations/endpoint.go @@ -49,6 +49,11 @@ func (u *updateEndpoint) ID() string { } func (u *updateEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (out middleware.SerializeOutput, metadata middleware.Metadata, err error) { + if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + // If getEndpointIDFromInput is nil but the middleware got attached just skip to the next handler if u.getEndpointIDFromInput == nil { return next.HandleSerialize(ctx, in) diff --git a/service/s3control/api_client.go b/service/s3control/api_client.go index c09846b676a..5b58dd5ef71 100644 --- a/service/s3control/api_client.go +++ b/service/s3control/api_client.go @@ -89,8 +89,11 @@ type Options struct { // The service endpoint resolver. // - // Deprecated: EndpointResolver and WithEndpointResolver are deprecated. See - // EndpointResolverV2 and WithEndpointResolverV2 + // Deprecated: EndpointResolver and WithEndpointResolver are deprecated. Providing + // a value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. To migrate an EndpointResolver implementation that uses a custom + // endpoint, set the client option BaseEndpoint instead. EndpointResolver EndpointResolver // Resolves the endpoint used for a particular service. This should be used over @@ -169,8 +172,11 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } -// EndpointResolver and WithEndpointResolver are deprecated. See -// EndpointResolverV2 and WithEndpointResolverV2 +// EndpointResolver and WithEndpointResolver are deprecated. Providing a value for +// this field will likely prevent you from using any endpoint-related service +// features released after the introduction of EndpointResolverV2 and BaseEndpoint. +// To migrate an EndpointResolver implementation that uses a custom endpoint, set +// the client option BaseEndpoint instead. func WithEndpointResolver(v EndpointResolver) func(*Options) { return func(o *Options) { o.EndpointResolver = v diff --git a/service/s3outposts/api_client.go b/service/s3outposts/api_client.go index d2a51eb8734..3bfcf53ac52 100644 --- a/service/s3outposts/api_client.go +++ b/service/s3outposts/api_client.go @@ -84,8 +84,11 @@ type Options struct { // The service endpoint resolver. // - // Deprecated: EndpointResolver and WithEndpointResolver are deprecated. See - // EndpointResolverV2 and WithEndpointResolverV2 + // Deprecated: EndpointResolver and WithEndpointResolver are deprecated. Providing + // a value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. To migrate an EndpointResolver implementation that uses a custom + // endpoint, set the client option BaseEndpoint instead. EndpointResolver EndpointResolver // Resolves the endpoint used for a particular service. This should be used over @@ -150,8 +153,11 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { } } -// EndpointResolver and WithEndpointResolver are deprecated. See -// EndpointResolverV2 and WithEndpointResolverV2 +// EndpointResolver and WithEndpointResolver are deprecated. Providing a value for +// this field will likely prevent you from using any endpoint-related service +// features released after the introduction of EndpointResolverV2 and BaseEndpoint. +// To migrate an EndpointResolver implementation that uses a custom endpoint, set +// the client option BaseEndpoint instead. func WithEndpointResolver(v EndpointResolver) func(*Options) { return func(o *Options) { o.EndpointResolver = v