mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rebase: bump the github-dependencies group with 2 updates
Bumps the github-dependencies group with 2 updates: [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) and [github.com/aws/aws-sdk-go-v2/service/sts](https://github.com/aws/aws-sdk-go-v2). Updates `github.com/aws/aws-sdk-go` from 1.47.10 to 1.48.0 - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.47.10...v1.48.0) Updates `github.com/aws/aws-sdk-go-v2/service/sts` from 1.25.1 to 1.25.3 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.25.1...config/v1.25.3) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/service/sts dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-dependencies ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
committed by
mergify[bot]
parent
afe3873947
commit
b3ce6eff97
438
vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go
generated
vendored
438
vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go
generated
vendored
@ -9,9 +9,11 @@ import (
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
|
||||
"github.com/aws/aws-sdk-go-v2/internal/endpoints"
|
||||
"github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn"
|
||||
internalendpoints "github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints"
|
||||
smithy "github.com/aws/smithy-go"
|
||||
smithyauth "github.com/aws/smithy-go/auth"
|
||||
smithyendpoints "github.com/aws/smithy-go/endpoints"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
"github.com/aws/smithy-go/ptr"
|
||||
@ -215,77 +217,6 @@ func resolveBaseEndpoint(cfg aws.Config, o *Options) {
|
||||
}
|
||||
}
|
||||
|
||||
// Utility function to aid with translating pseudo-regions to classical regions
|
||||
// with the appropriate setting indicated by the pseudo-region
|
||||
func mapPseudoRegion(pr string) (region string, fips aws.FIPSEndpointState) {
|
||||
const fipsInfix = "-fips-"
|
||||
const fipsPrefix = "fips-"
|
||||
const fipsSuffix = "-fips"
|
||||
|
||||
if strings.Contains(pr, fipsInfix) ||
|
||||
strings.Contains(pr, fipsPrefix) ||
|
||||
strings.Contains(pr, fipsSuffix) {
|
||||
region = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(
|
||||
pr, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "")
|
||||
fips = aws.FIPSEndpointStateEnabled
|
||||
} else {
|
||||
region = pr
|
||||
}
|
||||
|
||||
return region, fips
|
||||
}
|
||||
|
||||
// builtInParameterResolver is the interface responsible for resolving BuiltIn
|
||||
// values during the sourcing of EndpointParameters
|
||||
type builtInParameterResolver interface {
|
||||
ResolveBuiltIns(*EndpointParameters) error
|
||||
}
|
||||
|
||||
// builtInResolver resolves modeled BuiltIn values using only the members defined
|
||||
// below.
|
||||
type builtInResolver struct {
|
||||
// The AWS region used to dispatch the request.
|
||||
Region string
|
||||
|
||||
// Sourced BuiltIn value in a historical enabled or disabled state.
|
||||
UseDualStack aws.DualStackEndpointState
|
||||
|
||||
// Sourced BuiltIn value in a historical enabled or disabled state.
|
||||
UseFIPS aws.FIPSEndpointState
|
||||
|
||||
// Base endpoint that can potentially be modified during Endpoint resolution.
|
||||
Endpoint *string
|
||||
|
||||
// Whether the global endpoint should be used, rather then the regional endpoint
|
||||
// for us-east-1.
|
||||
UseGlobalEndpoint bool
|
||||
}
|
||||
|
||||
// Invoked at runtime to resolve BuiltIn Values. Only resolution code specific to
|
||||
// each BuiltIn value is generated.
|
||||
func (b *builtInResolver) ResolveBuiltIns(params *EndpointParameters) error {
|
||||
|
||||
region, _ := mapPseudoRegion(b.Region)
|
||||
if len(region) == 0 {
|
||||
return fmt.Errorf("Could not resolve AWS::Region")
|
||||
} else {
|
||||
params.Region = aws.String(region)
|
||||
}
|
||||
if b.UseDualStack == aws.DualStackEndpointStateEnabled {
|
||||
params.UseDualStack = aws.Bool(true)
|
||||
} else {
|
||||
params.UseDualStack = aws.Bool(false)
|
||||
}
|
||||
if b.UseFIPS == aws.FIPSEndpointStateEnabled {
|
||||
params.UseFIPS = aws.Bool(true)
|
||||
} else {
|
||||
params.UseFIPS = aws.Bool(false)
|
||||
}
|
||||
params.Endpoint = b.Endpoint
|
||||
params.UseGlobalEndpoint = aws.Bool(b.UseGlobalEndpoint)
|
||||
return nil
|
||||
}
|
||||
|
||||
// EndpointParameters provides the parameters that influence how endpoints are
|
||||
// resolved.
|
||||
type EndpointParameters struct {
|
||||
@ -422,11 +353,17 @@ func (r *resolver) ResolveEndpoint(
|
||||
Headers: http.Header{},
|
||||
Properties: func() smithy.Properties {
|
||||
var out smithy.Properties
|
||||
out.Set("authSchemes", []interface{}{
|
||||
map[string]interface{}{
|
||||
"name": "sigv4",
|
||||
"signingName": "sts",
|
||||
"signingRegion": "us-east-1",
|
||||
smithyauth.SetAuthOptions(&out, []*smithyauth.Option{
|
||||
{
|
||||
SchemeID: "aws.auth#sigv4",
|
||||
SignerProperties: func() smithy.Properties {
|
||||
var sp smithy.Properties
|
||||
smithyhttp.SetSigV4SigningName(&sp, "sts")
|
||||
smithyhttp.SetSigV4ASigningName(&sp, "sts")
|
||||
|
||||
smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1")
|
||||
return sp
|
||||
}(),
|
||||
},
|
||||
})
|
||||
return out
|
||||
@ -446,11 +383,17 @@ func (r *resolver) ResolveEndpoint(
|
||||
Headers: http.Header{},
|
||||
Properties: func() smithy.Properties {
|
||||
var out smithy.Properties
|
||||
out.Set("authSchemes", []interface{}{
|
||||
map[string]interface{}{
|
||||
"name": "sigv4",
|
||||
"signingName": "sts",
|
||||
"signingRegion": "us-east-1",
|
||||
smithyauth.SetAuthOptions(&out, []*smithyauth.Option{
|
||||
{
|
||||
SchemeID: "aws.auth#sigv4",
|
||||
SignerProperties: func() smithy.Properties {
|
||||
var sp smithy.Properties
|
||||
smithyhttp.SetSigV4SigningName(&sp, "sts")
|
||||
smithyhttp.SetSigV4ASigningName(&sp, "sts")
|
||||
|
||||
smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1")
|
||||
return sp
|
||||
}(),
|
||||
},
|
||||
})
|
||||
return out
|
||||
@ -470,11 +413,17 @@ func (r *resolver) ResolveEndpoint(
|
||||
Headers: http.Header{},
|
||||
Properties: func() smithy.Properties {
|
||||
var out smithy.Properties
|
||||
out.Set("authSchemes", []interface{}{
|
||||
map[string]interface{}{
|
||||
"name": "sigv4",
|
||||
"signingName": "sts",
|
||||
"signingRegion": "us-east-1",
|
||||
smithyauth.SetAuthOptions(&out, []*smithyauth.Option{
|
||||
{
|
||||
SchemeID: "aws.auth#sigv4",
|
||||
SignerProperties: func() smithy.Properties {
|
||||
var sp smithy.Properties
|
||||
smithyhttp.SetSigV4SigningName(&sp, "sts")
|
||||
smithyhttp.SetSigV4ASigningName(&sp, "sts")
|
||||
|
||||
smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1")
|
||||
return sp
|
||||
}(),
|
||||
},
|
||||
})
|
||||
return out
|
||||
@ -494,11 +443,17 @@ func (r *resolver) ResolveEndpoint(
|
||||
Headers: http.Header{},
|
||||
Properties: func() smithy.Properties {
|
||||
var out smithy.Properties
|
||||
out.Set("authSchemes", []interface{}{
|
||||
map[string]interface{}{
|
||||
"name": "sigv4",
|
||||
"signingName": "sts",
|
||||
"signingRegion": "us-east-1",
|
||||
smithyauth.SetAuthOptions(&out, []*smithyauth.Option{
|
||||
{
|
||||
SchemeID: "aws.auth#sigv4",
|
||||
SignerProperties: func() smithy.Properties {
|
||||
var sp smithy.Properties
|
||||
smithyhttp.SetSigV4SigningName(&sp, "sts")
|
||||
smithyhttp.SetSigV4ASigningName(&sp, "sts")
|
||||
|
||||
smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1")
|
||||
return sp
|
||||
}(),
|
||||
},
|
||||
})
|
||||
return out
|
||||
@ -518,11 +473,17 @@ func (r *resolver) ResolveEndpoint(
|
||||
Headers: http.Header{},
|
||||
Properties: func() smithy.Properties {
|
||||
var out smithy.Properties
|
||||
out.Set("authSchemes", []interface{}{
|
||||
map[string]interface{}{
|
||||
"name": "sigv4",
|
||||
"signingName": "sts",
|
||||
"signingRegion": "us-east-1",
|
||||
smithyauth.SetAuthOptions(&out, []*smithyauth.Option{
|
||||
{
|
||||
SchemeID: "aws.auth#sigv4",
|
||||
SignerProperties: func() smithy.Properties {
|
||||
var sp smithy.Properties
|
||||
smithyhttp.SetSigV4SigningName(&sp, "sts")
|
||||
smithyhttp.SetSigV4ASigningName(&sp, "sts")
|
||||
|
||||
smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1")
|
||||
return sp
|
||||
}(),
|
||||
},
|
||||
})
|
||||
return out
|
||||
@ -542,11 +503,17 @@ func (r *resolver) ResolveEndpoint(
|
||||
Headers: http.Header{},
|
||||
Properties: func() smithy.Properties {
|
||||
var out smithy.Properties
|
||||
out.Set("authSchemes", []interface{}{
|
||||
map[string]interface{}{
|
||||
"name": "sigv4",
|
||||
"signingName": "sts",
|
||||
"signingRegion": "us-east-1",
|
||||
smithyauth.SetAuthOptions(&out, []*smithyauth.Option{
|
||||
{
|
||||
SchemeID: "aws.auth#sigv4",
|
||||
SignerProperties: func() smithy.Properties {
|
||||
var sp smithy.Properties
|
||||
smithyhttp.SetSigV4SigningName(&sp, "sts")
|
||||
smithyhttp.SetSigV4ASigningName(&sp, "sts")
|
||||
|
||||
smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1")
|
||||
return sp
|
||||
}(),
|
||||
},
|
||||
})
|
||||
return out
|
||||
@ -566,11 +533,17 @@ func (r *resolver) ResolveEndpoint(
|
||||
Headers: http.Header{},
|
||||
Properties: func() smithy.Properties {
|
||||
var out smithy.Properties
|
||||
out.Set("authSchemes", []interface{}{
|
||||
map[string]interface{}{
|
||||
"name": "sigv4",
|
||||
"signingName": "sts",
|
||||
"signingRegion": "us-east-1",
|
||||
smithyauth.SetAuthOptions(&out, []*smithyauth.Option{
|
||||
{
|
||||
SchemeID: "aws.auth#sigv4",
|
||||
SignerProperties: func() smithy.Properties {
|
||||
var sp smithy.Properties
|
||||
smithyhttp.SetSigV4SigningName(&sp, "sts")
|
||||
smithyhttp.SetSigV4ASigningName(&sp, "sts")
|
||||
|
||||
smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1")
|
||||
return sp
|
||||
}(),
|
||||
},
|
||||
})
|
||||
return out
|
||||
@ -590,11 +563,17 @@ func (r *resolver) ResolveEndpoint(
|
||||
Headers: http.Header{},
|
||||
Properties: func() smithy.Properties {
|
||||
var out smithy.Properties
|
||||
out.Set("authSchemes", []interface{}{
|
||||
map[string]interface{}{
|
||||
"name": "sigv4",
|
||||
"signingName": "sts",
|
||||
"signingRegion": "us-east-1",
|
||||
smithyauth.SetAuthOptions(&out, []*smithyauth.Option{
|
||||
{
|
||||
SchemeID: "aws.auth#sigv4",
|
||||
SignerProperties: func() smithy.Properties {
|
||||
var sp smithy.Properties
|
||||
smithyhttp.SetSigV4SigningName(&sp, "sts")
|
||||
smithyhttp.SetSigV4ASigningName(&sp, "sts")
|
||||
|
||||
smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1")
|
||||
return sp
|
||||
}(),
|
||||
},
|
||||
})
|
||||
return out
|
||||
@ -614,11 +593,17 @@ func (r *resolver) ResolveEndpoint(
|
||||
Headers: http.Header{},
|
||||
Properties: func() smithy.Properties {
|
||||
var out smithy.Properties
|
||||
out.Set("authSchemes", []interface{}{
|
||||
map[string]interface{}{
|
||||
"name": "sigv4",
|
||||
"signingName": "sts",
|
||||
"signingRegion": "us-east-1",
|
||||
smithyauth.SetAuthOptions(&out, []*smithyauth.Option{
|
||||
{
|
||||
SchemeID: "aws.auth#sigv4",
|
||||
SignerProperties: func() smithy.Properties {
|
||||
var sp smithy.Properties
|
||||
smithyhttp.SetSigV4SigningName(&sp, "sts")
|
||||
smithyhttp.SetSigV4ASigningName(&sp, "sts")
|
||||
|
||||
smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1")
|
||||
return sp
|
||||
}(),
|
||||
},
|
||||
})
|
||||
return out
|
||||
@ -638,11 +623,17 @@ func (r *resolver) ResolveEndpoint(
|
||||
Headers: http.Header{},
|
||||
Properties: func() smithy.Properties {
|
||||
var out smithy.Properties
|
||||
out.Set("authSchemes", []interface{}{
|
||||
map[string]interface{}{
|
||||
"name": "sigv4",
|
||||
"signingName": "sts",
|
||||
"signingRegion": "us-east-1",
|
||||
smithyauth.SetAuthOptions(&out, []*smithyauth.Option{
|
||||
{
|
||||
SchemeID: "aws.auth#sigv4",
|
||||
SignerProperties: func() smithy.Properties {
|
||||
var sp smithy.Properties
|
||||
smithyhttp.SetSigV4SigningName(&sp, "sts")
|
||||
smithyhttp.SetSigV4ASigningName(&sp, "sts")
|
||||
|
||||
smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1")
|
||||
return sp
|
||||
}(),
|
||||
},
|
||||
})
|
||||
return out
|
||||
@ -662,11 +653,17 @@ func (r *resolver) ResolveEndpoint(
|
||||
Headers: http.Header{},
|
||||
Properties: func() smithy.Properties {
|
||||
var out smithy.Properties
|
||||
out.Set("authSchemes", []interface{}{
|
||||
map[string]interface{}{
|
||||
"name": "sigv4",
|
||||
"signingName": "sts",
|
||||
"signingRegion": "us-east-1",
|
||||
smithyauth.SetAuthOptions(&out, []*smithyauth.Option{
|
||||
{
|
||||
SchemeID: "aws.auth#sigv4",
|
||||
SignerProperties: func() smithy.Properties {
|
||||
var sp smithy.Properties
|
||||
smithyhttp.SetSigV4SigningName(&sp, "sts")
|
||||
smithyhttp.SetSigV4ASigningName(&sp, "sts")
|
||||
|
||||
smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1")
|
||||
return sp
|
||||
}(),
|
||||
},
|
||||
})
|
||||
return out
|
||||
@ -686,11 +683,17 @@ func (r *resolver) ResolveEndpoint(
|
||||
Headers: http.Header{},
|
||||
Properties: func() smithy.Properties {
|
||||
var out smithy.Properties
|
||||
out.Set("authSchemes", []interface{}{
|
||||
map[string]interface{}{
|
||||
"name": "sigv4",
|
||||
"signingName": "sts",
|
||||
"signingRegion": "us-east-1",
|
||||
smithyauth.SetAuthOptions(&out, []*smithyauth.Option{
|
||||
{
|
||||
SchemeID: "aws.auth#sigv4",
|
||||
SignerProperties: func() smithy.Properties {
|
||||
var sp smithy.Properties
|
||||
smithyhttp.SetSigV4SigningName(&sp, "sts")
|
||||
smithyhttp.SetSigV4ASigningName(&sp, "sts")
|
||||
|
||||
smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1")
|
||||
return sp
|
||||
}(),
|
||||
},
|
||||
})
|
||||
return out
|
||||
@ -710,11 +713,17 @@ func (r *resolver) ResolveEndpoint(
|
||||
Headers: http.Header{},
|
||||
Properties: func() smithy.Properties {
|
||||
var out smithy.Properties
|
||||
out.Set("authSchemes", []interface{}{
|
||||
map[string]interface{}{
|
||||
"name": "sigv4",
|
||||
"signingName": "sts",
|
||||
"signingRegion": "us-east-1",
|
||||
smithyauth.SetAuthOptions(&out, []*smithyauth.Option{
|
||||
{
|
||||
SchemeID: "aws.auth#sigv4",
|
||||
SignerProperties: func() smithy.Properties {
|
||||
var sp smithy.Properties
|
||||
smithyhttp.SetSigV4SigningName(&sp, "sts")
|
||||
smithyhttp.SetSigV4ASigningName(&sp, "sts")
|
||||
|
||||
smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1")
|
||||
return sp
|
||||
}(),
|
||||
},
|
||||
})
|
||||
return out
|
||||
@ -734,11 +743,17 @@ func (r *resolver) ResolveEndpoint(
|
||||
Headers: http.Header{},
|
||||
Properties: func() smithy.Properties {
|
||||
var out smithy.Properties
|
||||
out.Set("authSchemes", []interface{}{
|
||||
map[string]interface{}{
|
||||
"name": "sigv4",
|
||||
"signingName": "sts",
|
||||
"signingRegion": "us-east-1",
|
||||
smithyauth.SetAuthOptions(&out, []*smithyauth.Option{
|
||||
{
|
||||
SchemeID: "aws.auth#sigv4",
|
||||
SignerProperties: func() smithy.Properties {
|
||||
var sp smithy.Properties
|
||||
smithyhttp.SetSigV4SigningName(&sp, "sts")
|
||||
smithyhttp.SetSigV4ASigningName(&sp, "sts")
|
||||
|
||||
smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1")
|
||||
return sp
|
||||
}(),
|
||||
},
|
||||
})
|
||||
return out
|
||||
@ -758,11 +773,17 @@ func (r *resolver) ResolveEndpoint(
|
||||
Headers: http.Header{},
|
||||
Properties: func() smithy.Properties {
|
||||
var out smithy.Properties
|
||||
out.Set("authSchemes", []interface{}{
|
||||
map[string]interface{}{
|
||||
"name": "sigv4",
|
||||
"signingName": "sts",
|
||||
"signingRegion": "us-east-1",
|
||||
smithyauth.SetAuthOptions(&out, []*smithyauth.Option{
|
||||
{
|
||||
SchemeID: "aws.auth#sigv4",
|
||||
SignerProperties: func() smithy.Properties {
|
||||
var sp smithy.Properties
|
||||
smithyhttp.SetSigV4SigningName(&sp, "sts")
|
||||
smithyhttp.SetSigV4ASigningName(&sp, "sts")
|
||||
|
||||
smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1")
|
||||
return sp
|
||||
}(),
|
||||
},
|
||||
})
|
||||
return out
|
||||
@ -782,11 +803,17 @@ func (r *resolver) ResolveEndpoint(
|
||||
Headers: http.Header{},
|
||||
Properties: func() smithy.Properties {
|
||||
var out smithy.Properties
|
||||
out.Set("authSchemes", []interface{}{
|
||||
map[string]interface{}{
|
||||
"name": "sigv4",
|
||||
"signingName": "sts",
|
||||
"signingRegion": "us-east-1",
|
||||
smithyauth.SetAuthOptions(&out, []*smithyauth.Option{
|
||||
{
|
||||
SchemeID: "aws.auth#sigv4",
|
||||
SignerProperties: func() smithy.Properties {
|
||||
var sp smithy.Properties
|
||||
smithyhttp.SetSigV4SigningName(&sp, "sts")
|
||||
smithyhttp.SetSigV4ASigningName(&sp, "sts")
|
||||
|
||||
smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1")
|
||||
return sp
|
||||
}(),
|
||||
},
|
||||
})
|
||||
return out
|
||||
@ -812,11 +839,17 @@ func (r *resolver) ResolveEndpoint(
|
||||
Headers: http.Header{},
|
||||
Properties: func() smithy.Properties {
|
||||
var out smithy.Properties
|
||||
out.Set("authSchemes", []interface{}{
|
||||
map[string]interface{}{
|
||||
"name": "sigv4",
|
||||
"signingName": "sts",
|
||||
"signingRegion": _Region,
|
||||
smithyauth.SetAuthOptions(&out, []*smithyauth.Option{
|
||||
{
|
||||
SchemeID: "aws.auth#sigv4",
|
||||
SignerProperties: func() smithy.Properties {
|
||||
var sp smithy.Properties
|
||||
smithyhttp.SetSigV4SigningName(&sp, "sts")
|
||||
smithyhttp.SetSigV4ASigningName(&sp, "sts")
|
||||
|
||||
smithyhttp.SetSigV4SigningRegion(&sp, _Region)
|
||||
return sp
|
||||
}(),
|
||||
},
|
||||
})
|
||||
return out
|
||||
@ -883,8 +916,8 @@ func (r *resolver) ResolveEndpoint(
|
||||
}
|
||||
}
|
||||
if _UseFIPS == true {
|
||||
if true == _PartitionResult.SupportsFIPS {
|
||||
if "aws-us-gov" == _PartitionResult.Name {
|
||||
if _PartitionResult.SupportsFIPS == true {
|
||||
if _PartitionResult.Name == "aws-us-gov" {
|
||||
uriString := func() string {
|
||||
var out strings.Builder
|
||||
out.WriteString("https://sts.")
|
||||
@ -960,11 +993,17 @@ func (r *resolver) ResolveEndpoint(
|
||||
Headers: http.Header{},
|
||||
Properties: func() smithy.Properties {
|
||||
var out smithy.Properties
|
||||
out.Set("authSchemes", []interface{}{
|
||||
map[string]interface{}{
|
||||
"name": "sigv4",
|
||||
"signingName": "sts",
|
||||
"signingRegion": "us-east-1",
|
||||
smithyauth.SetAuthOptions(&out, []*smithyauth.Option{
|
||||
{
|
||||
SchemeID: "aws.auth#sigv4",
|
||||
SignerProperties: func() smithy.Properties {
|
||||
var sp smithy.Properties
|
||||
smithyhttp.SetSigV4SigningName(&sp, "sts")
|
||||
smithyhttp.SetSigV4ASigningName(&sp, "sts")
|
||||
|
||||
smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1")
|
||||
return sp
|
||||
}(),
|
||||
},
|
||||
})
|
||||
return out
|
||||
@ -994,3 +1033,76 @@ func (r *resolver) ResolveEndpoint(
|
||||
}
|
||||
return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region")
|
||||
}
|
||||
|
||||
type endpointParamsBinder interface {
|
||||
bindEndpointParams(*EndpointParameters)
|
||||
}
|
||||
|
||||
func bindEndpointParams(input interface{}, options Options) *EndpointParameters {
|
||||
params := &EndpointParameters{}
|
||||
|
||||
params.Region = aws.String(endpoints.MapFIPSRegion(options.Region))
|
||||
params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled)
|
||||
params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled)
|
||||
params.Endpoint = options.BaseEndpoint
|
||||
|
||||
if b, ok := input.(endpointParamsBinder); ok {
|
||||
b.bindEndpointParams(params)
|
||||
}
|
||||
|
||||
return params
|
||||
}
|
||||
|
||||
type resolveEndpointV2Middleware struct {
|
||||
options Options
|
||||
}
|
||||
|
||||
func (*resolveEndpointV2Middleware) ID() string {
|
||||
return "ResolveEndpointV2"
|
||||
}
|
||||
|
||||
func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (
|
||||
out middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
if awsmiddleware.GetRequiresLegacyEndpoints(ctx) {
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
|
||||
req, ok := in.Request.(*smithyhttp.Request)
|
||||
if !ok {
|
||||
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
|
||||
}
|
||||
|
||||
if m.options.EndpointResolverV2 == nil {
|
||||
return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil")
|
||||
}
|
||||
|
||||
params := bindEndpointParams(getOperationInput(ctx), m.options)
|
||||
endpt, err := m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params)
|
||||
if err != nil {
|
||||
return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err)
|
||||
}
|
||||
|
||||
if endpt.URI.RawPath == "" && req.URL.RawPath != "" {
|
||||
endpt.URI.RawPath = endpt.URI.Path
|
||||
}
|
||||
req.URL.Scheme = endpt.URI.Scheme
|
||||
req.URL.Host = endpt.URI.Host
|
||||
req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path)
|
||||
req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath)
|
||||
for k := range endpt.Headers {
|
||||
req.Header.Set(k, endpt.Headers.Get(k))
|
||||
}
|
||||
|
||||
rscheme := getResolvedAuthScheme(ctx)
|
||||
if rscheme == nil {
|
||||
return out, metadata, fmt.Errorf("no resolved auth scheme")
|
||||
}
|
||||
|
||||
opts, _ := smithyauth.GetAuthOptions(&endpt.Properties)
|
||||
for _, o := range opts {
|
||||
rscheme.SignerProperties.SetAll(&o.SignerProperties)
|
||||
}
|
||||
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
|
Reference in New Issue
Block a user