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
8
vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md
generated
vendored
8
vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md
generated
vendored
@ -1,3 +1,11 @@
|
||||
# v1.25.3 (2023-11-17)
|
||||
|
||||
* **Documentation**: API updates for the AWS Security Token Service
|
||||
|
||||
# v1.25.2 (2023-11-15)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.25.1 (2023-11-09)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
280
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go
generated
vendored
280
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go
generated
vendored
@ -12,7 +12,10 @@ import (
|
||||
"github.com/aws/aws-sdk-go-v2/aws/retry"
|
||||
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
|
||||
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
|
||||
internalauth "github.com/aws/aws-sdk-go-v2/internal/auth"
|
||||
internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy"
|
||||
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
|
||||
acceptencodingcust "github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding"
|
||||
presignedurlcust "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url"
|
||||
smithy "github.com/aws/smithy-go"
|
||||
smithydocument "github.com/aws/smithy-go/document"
|
||||
@ -49,10 +52,18 @@ func New(options Options, optFns ...func(*Options)) *Client {
|
||||
|
||||
resolveHTTPSignerV4(&options)
|
||||
|
||||
resolveEndpointResolverV2(&options)
|
||||
|
||||
resolveAuthSchemeResolver(&options)
|
||||
|
||||
for _, fn := range optFns {
|
||||
fn(&options)
|
||||
}
|
||||
|
||||
ignoreAnonymousAuth(&options)
|
||||
|
||||
resolveAuthSchemes(&options)
|
||||
|
||||
client := &Client{
|
||||
options: options,
|
||||
}
|
||||
@ -60,140 +71,10 @@ func New(options Options, optFns ...func(*Options)) *Client {
|
||||
return client
|
||||
}
|
||||
|
||||
type Options struct {
|
||||
// Set of options to modify how an operation is invoked. These apply to all
|
||||
// operations invoked for this client. Use functional options on operation call to
|
||||
// modify this list for per operation behavior.
|
||||
APIOptions []func(*middleware.Stack) error
|
||||
|
||||
// The optional application specific identifier appended to the User-Agent header.
|
||||
AppID string
|
||||
|
||||
// This endpoint will be given as input to an EndpointResolverV2. It is used for
|
||||
// providing a custom base endpoint that is subject to modifications by the
|
||||
// processing EndpointResolverV2.
|
||||
BaseEndpoint *string
|
||||
|
||||
// Configures the events that will be sent to the configured logger.
|
||||
ClientLogMode aws.ClientLogMode
|
||||
|
||||
// The credentials object to use when signing requests.
|
||||
Credentials aws.CredentialsProvider
|
||||
|
||||
// The configuration DefaultsMode that the SDK should use when constructing the
|
||||
// clients initial default settings.
|
||||
DefaultsMode aws.DefaultsMode
|
||||
|
||||
// The endpoint options to be used when attempting to resolve an endpoint.
|
||||
EndpointOptions EndpointResolverOptions
|
||||
|
||||
// The service endpoint resolver.
|
||||
//
|
||||
// Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. 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
|
||||
// the deprecated EndpointResolver
|
||||
EndpointResolverV2 EndpointResolverV2
|
||||
|
||||
// Signature Version 4 (SigV4) Signer
|
||||
HTTPSignerV4 HTTPSignerV4
|
||||
|
||||
// The logger writer interface to write logging messages to.
|
||||
Logger logging.Logger
|
||||
|
||||
// The region to send requests to. (Required)
|
||||
Region string
|
||||
|
||||
// RetryMaxAttempts specifies the maximum number attempts an API client will call
|
||||
// an operation that fails with a retryable error. A value of 0 is ignored, and
|
||||
// will not be used to configure the API client created default retryer, or modify
|
||||
// per operation call's retry max attempts. When creating a new API Clients this
|
||||
// member will only be used if the Retryer Options member is nil. This value will
|
||||
// be ignored if Retryer is not nil. If specified in an operation call's functional
|
||||
// options with a value that is different than the constructed client's Options,
|
||||
// the Client's Retryer will be wrapped to use the operation's specific
|
||||
// RetryMaxAttempts value.
|
||||
RetryMaxAttempts int
|
||||
|
||||
// RetryMode specifies the retry mode the API client will be created with, if
|
||||
// Retryer option is not also specified. When creating a new API Clients this
|
||||
// member will only be used if the Retryer Options member is nil. This value will
|
||||
// be ignored if Retryer is not nil. Currently does not support per operation call
|
||||
// overrides, may in the future.
|
||||
RetryMode aws.RetryMode
|
||||
|
||||
// Retryer guides how HTTP requests should be retried in case of recoverable
|
||||
// failures. When nil the API client will use a default retryer. The kind of
|
||||
// default retry created by the API client can be changed with the RetryMode
|
||||
// option.
|
||||
Retryer aws.Retryer
|
||||
|
||||
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
|
||||
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You
|
||||
// should not populate this structure programmatically, or rely on the values here
|
||||
// within your applications.
|
||||
RuntimeEnvironment aws.RuntimeEnvironment
|
||||
|
||||
// The initial DefaultsMode used when the client options were constructed. If the
|
||||
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
|
||||
// value was at that point in time. Currently does not support per operation call
|
||||
// overrides, may in the future.
|
||||
resolvedDefaultsMode aws.DefaultsMode
|
||||
|
||||
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
|
||||
// implementation if nil.
|
||||
HTTPClient HTTPClient
|
||||
}
|
||||
|
||||
// WithAPIOptions returns a functional option for setting the Client's APIOptions
|
||||
// option.
|
||||
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
|
||||
return func(o *Options) {
|
||||
o.APIOptions = append(o.APIOptions, optFns...)
|
||||
}
|
||||
}
|
||||
|
||||
// Deprecated: EndpointResolver and WithEndpointResolver. 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
|
||||
}
|
||||
}
|
||||
|
||||
// WithEndpointResolverV2 returns a functional option for setting the Client's
|
||||
// EndpointResolverV2 option.
|
||||
func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) {
|
||||
return func(o *Options) {
|
||||
o.EndpointResolverV2 = v
|
||||
}
|
||||
}
|
||||
|
||||
type HTTPClient interface {
|
||||
Do(*http.Request) (*http.Response, error)
|
||||
}
|
||||
|
||||
// Copy creates a clone where the APIOptions list is deep copied.
|
||||
func (o Options) Copy() Options {
|
||||
to := o
|
||||
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
|
||||
copy(to.APIOptions, o.APIOptions)
|
||||
|
||||
return to
|
||||
}
|
||||
func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {
|
||||
ctx = middleware.ClearStackValues(ctx)
|
||||
stack := middleware.NewStack(opID, smithyhttp.NewStackRequest)
|
||||
options := c.options.Copy()
|
||||
resolveEndpointResolverV2(&options)
|
||||
|
||||
for _, fn := range optFns {
|
||||
fn(&options)
|
||||
@ -227,6 +108,63 @@ func (c *Client) invokeOperation(ctx context.Context, opID string, params interf
|
||||
return result, metadata, err
|
||||
}
|
||||
|
||||
type operationInputKey struct{}
|
||||
|
||||
func setOperationInput(ctx context.Context, input interface{}) context.Context {
|
||||
return middleware.WithStackValue(ctx, operationInputKey{}, input)
|
||||
}
|
||||
|
||||
func getOperationInput(ctx context.Context) interface{} {
|
||||
return middleware.GetStackValue(ctx, operationInputKey{})
|
||||
}
|
||||
|
||||
type setOperationInputMiddleware struct {
|
||||
}
|
||||
|
||||
func (*setOperationInputMiddleware) ID() string {
|
||||
return "setOperationInput"
|
||||
}
|
||||
|
||||
func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
|
||||
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
ctx = setOperationInput(ctx, in.Parameters)
|
||||
return next.HandleSerialize(ctx, in)
|
||||
}
|
||||
|
||||
func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error {
|
||||
if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil {
|
||||
return fmt.Errorf("add ResolveAuthScheme: %v", err)
|
||||
}
|
||||
if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil {
|
||||
return fmt.Errorf("add GetIdentity: %v", err)
|
||||
}
|
||||
if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil {
|
||||
return fmt.Errorf("add ResolveEndpointV2: %v", err)
|
||||
}
|
||||
if err := stack.Finalize.Insert(&signRequestMiddleware{}, "ResolveEndpointV2", middleware.After); err != nil {
|
||||
return fmt.Errorf("add Signing: %v", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func resolveAuthSchemeResolver(options *Options) {
|
||||
if options.AuthSchemeResolver == nil {
|
||||
options.AuthSchemeResolver = &defaultAuthSchemeResolver{}
|
||||
}
|
||||
}
|
||||
|
||||
func resolveAuthSchemes(options *Options) {
|
||||
if options.AuthSchemes == nil {
|
||||
options.AuthSchemes = []smithyhttp.AuthScheme{
|
||||
internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{
|
||||
Signer: options.HTTPSignerV4,
|
||||
Logger: options.Logger,
|
||||
LogSigning: options.ClientLogMode.IsSigning(),
|
||||
}),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
type noSmithyDocumentSerde = smithydocument.NoSerde
|
||||
|
||||
type legacyEndpointContextSetter struct {
|
||||
@ -417,15 +355,6 @@ func addClientUserAgent(stack *middleware.Stack, options Options) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
|
||||
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
|
||||
CredentialsProvider: o.Credentials,
|
||||
Signer: o.HTTPSignerV4,
|
||||
LogSigning: o.ClientLogMode.IsSigning(),
|
||||
})
|
||||
return stack.Finalize.Add(mw, middleware.After)
|
||||
}
|
||||
|
||||
type HTTPSignerV4 interface {
|
||||
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
|
||||
}
|
||||
@ -560,20 +489,61 @@ func withNopHTTPClientAPIOption(o *Options) {
|
||||
o.HTTPClient = smithyhttp.NopClient{}
|
||||
}
|
||||
|
||||
type presignContextPolyfillMiddleware struct {
|
||||
}
|
||||
|
||||
func (*presignContextPolyfillMiddleware) ID() string {
|
||||
return "presignContextPolyfill"
|
||||
}
|
||||
|
||||
func (m *presignContextPolyfillMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (
|
||||
out middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
rscheme := getResolvedAuthScheme(ctx)
|
||||
if rscheme == nil {
|
||||
return out, metadata, fmt.Errorf("no resolved auth scheme")
|
||||
}
|
||||
|
||||
schemeID := rscheme.Scheme.SchemeID()
|
||||
|
||||
if schemeID == "aws.auth#sigv4" {
|
||||
if sn, ok := smithyhttp.GetSigV4SigningName(&rscheme.SignerProperties); ok {
|
||||
ctx = awsmiddleware.SetSigningName(ctx, sn)
|
||||
}
|
||||
if sr, ok := smithyhttp.GetSigV4SigningRegion(&rscheme.SignerProperties); ok {
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, sr)
|
||||
}
|
||||
} else if schemeID == "aws.auth#sigv4a" {
|
||||
if sn, ok := smithyhttp.GetSigV4ASigningName(&rscheme.SignerProperties); ok {
|
||||
ctx = awsmiddleware.SetSigningName(ctx, sn)
|
||||
}
|
||||
if sr, ok := smithyhttp.GetSigV4ASigningRegions(&rscheme.SignerProperties); ok {
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, sr[0])
|
||||
}
|
||||
}
|
||||
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
|
||||
type presignConverter PresignOptions
|
||||
|
||||
func (c presignConverter) convertToPresignMiddleware(stack *middleware.Stack, options Options) (err error) {
|
||||
stack.Finalize.Clear()
|
||||
if _, ok := stack.Finalize.Get((*acceptencodingcust.DisableGzip)(nil).ID()); ok {
|
||||
stack.Finalize.Remove((*acceptencodingcust.DisableGzip)(nil).ID())
|
||||
}
|
||||
stack.Deserialize.Clear()
|
||||
stack.Build.Remove((*awsmiddleware.ClientRequestID)(nil).ID())
|
||||
stack.Build.Remove("UserAgent")
|
||||
if err := stack.Finalize.Insert(&presignContextPolyfillMiddleware{}, "Signing", middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
pmw := v4.NewPresignHTTPRequestMiddleware(v4.PresignHTTPRequestMiddlewareOptions{
|
||||
CredentialsProvider: options.Credentials,
|
||||
Presigner: c.Presigner,
|
||||
LogSigning: options.ClientLogMode.IsSigning(),
|
||||
})
|
||||
err = stack.Finalize.Add(pmw, middleware.After)
|
||||
if err != nil {
|
||||
if _, err := stack.Finalize.Swap("Signing", pmw); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = smithyhttp.AddNoPayloadDefaultContentTypeRemover(stack); err != nil {
|
||||
@ -600,31 +570,31 @@ func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
|
||||
}, middleware.After)
|
||||
}
|
||||
|
||||
type endpointDisableHTTPSMiddleware struct {
|
||||
EndpointDisableHTTPS bool
|
||||
type disableHTTPSMiddleware struct {
|
||||
DisableHTTPS bool
|
||||
}
|
||||
|
||||
func (*endpointDisableHTTPSMiddleware) ID() string {
|
||||
return "endpointDisableHTTPSMiddleware"
|
||||
func (*disableHTTPSMiddleware) ID() string {
|
||||
return "disableHTTPS"
|
||||
}
|
||||
|
||||
func (m *endpointDisableHTTPSMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
|
||||
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
|
||||
func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (
|
||||
out middleware.FinalizeOutput, 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) {
|
||||
if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) {
|
||||
req.URL.Scheme = "http"
|
||||
}
|
||||
|
||||
return next.HandleSerialize(ctx, in)
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
|
||||
}
|
||||
func addendpointDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error {
|
||||
return stack.Serialize.Insert(&endpointDisableHTTPSMiddleware{
|
||||
EndpointDisableHTTPS: o.EndpointOptions.DisableHTTPS,
|
||||
}, "OperationSerializer", middleware.Before)
|
||||
func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error {
|
||||
return stack.Finalize.Insert(&disableHTTPSMiddleware{
|
||||
DisableHTTPS: o.EndpointOptions.DisableHTTPS,
|
||||
}, "ResolveEndpointV2", middleware.After)
|
||||
}
|
||||
|
149
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go
generated
vendored
149
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go
generated
vendored
@ -4,14 +4,10 @@ package sts
|
||||
|
||||
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"
|
||||
"github.com/aws/aws-sdk-go-v2/service/sts/types"
|
||||
smithyendpoints "github.com/aws/smithy-go/endpoints"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
)
|
||||
@ -204,7 +200,12 @@ type AssumeRoleInput struct {
|
||||
// in the IAM User Guide.
|
||||
PolicyArns []types.PolicyDescriptorType
|
||||
|
||||
// Reserved for future use.
|
||||
// A list of previously acquired trusted context assertions in the format of a
|
||||
// JSON array. The trusted context assertion is signed and encrypted by Amazon Web
|
||||
// Services STS. The following is an example of a ProvidedContext value that
|
||||
// includes a single trusted context assertion and the ARN of the context provider
|
||||
// from which the trusted context assertion was generated.
|
||||
// [{"ProviderArn":"arn:aws:iam::aws:contextProvider/identitycenter","ContextAssertion":"trusted-context-assertion"}]
|
||||
ProvidedContexts []types.ProvidedContext
|
||||
|
||||
// The identification number of the MFA device that is associated with the user
|
||||
@ -327,6 +328,9 @@ type AssumeRoleOutput struct {
|
||||
}
|
||||
|
||||
func (c *Client) addOperationAssumeRoleMiddlewares(stack *middleware.Stack, options Options) (err error) {
|
||||
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
|
||||
return err
|
||||
}
|
||||
err = stack.Serialize.Add(&awsAwsquery_serializeOpAssumeRole{}, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -335,6 +339,10 @@ func (c *Client) addOperationAssumeRoleMiddlewares(stack *middleware.Stack, opti
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := addProtocolFinalizerMiddlewares(stack, options, "AssumeRole"); err != nil {
|
||||
return fmt.Errorf("add protocol finalizers: %v", err)
|
||||
}
|
||||
|
||||
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -356,9 +364,6 @@ func (c *Client) addOperationAssumeRoleMiddlewares(stack *middleware.Stack, opti
|
||||
if err = addRetryMiddlewares(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -374,7 +379,7 @@ func (c *Client) addOperationAssumeRoleMiddlewares(stack *middleware.Stack, opti
|
||||
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addAssumeRoleResolveEndpointMiddleware(stack, options); err != nil {
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpAssumeRoleValidationMiddleware(stack); err != nil {
|
||||
@ -395,7 +400,7 @@ func (c *Client) addOperationAssumeRoleMiddlewares(stack *middleware.Stack, opti
|
||||
if err = addRequestResponseLogging(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
@ -405,7 +410,6 @@ func newServiceMetadataMiddleware_opAssumeRole(region string) *awsmiddleware.Reg
|
||||
return &awsmiddleware.RegisterServiceMetadata{
|
||||
Region: region,
|
||||
ServiceID: ServiceID,
|
||||
SigningName: "sts",
|
||||
OperationName: "AssumeRole",
|
||||
}
|
||||
}
|
||||
@ -433,126 +437,3 @@ func (c *PresignClient) PresignAssumeRole(ctx context.Context, params *AssumeRol
|
||||
out := result.(*v4.PresignedHTTPRequest)
|
||||
return out, nil
|
||||
}
|
||||
|
||||
type opAssumeRoleResolveEndpointMiddleware struct {
|
||||
EndpointResolver EndpointResolverV2
|
||||
BuiltInResolver builtInParameterResolver
|
||||
}
|
||||
|
||||
func (*opAssumeRoleResolveEndpointMiddleware) ID() string {
|
||||
return "ResolveEndpointV2"
|
||||
}
|
||||
|
||||
func (m *opAssumeRoleResolveEndpointMiddleware) 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)
|
||||
}
|
||||
|
||||
if m.EndpointResolver == nil {
|
||||
return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil")
|
||||
}
|
||||
|
||||
params := EndpointParameters{}
|
||||
|
||||
m.BuiltInResolver.ResolveBuiltIns(¶ms)
|
||||
|
||||
var resolvedEndpoint smithyendpoints.Endpoint
|
||||
resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params)
|
||||
if err != nil {
|
||||
return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err)
|
||||
}
|
||||
|
||||
req.URL = &resolvedEndpoint.URI
|
||||
|
||||
for k := range resolvedEndpoint.Headers {
|
||||
req.Header.Set(
|
||||
k,
|
||||
resolvedEndpoint.Headers.Get(k),
|
||||
)
|
||||
}
|
||||
|
||||
authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties)
|
||||
if err != nil {
|
||||
var nfe *internalauth.NoAuthenticationSchemesFoundError
|
||||
if errors.As(err, &nfe) {
|
||||
// if no auth scheme is found, default to sigv4
|
||||
signingName := "sts"
|
||||
signingRegion := m.BuiltInResolver.(*builtInResolver).Region
|
||||
ctx = awsmiddleware.SetSigningName(ctx, signingName)
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion)
|
||||
|
||||
}
|
||||
var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError
|
||||
if errors.As(err, &ue) {
|
||||
return out, metadata, fmt.Errorf(
|
||||
"This operation requests signer version(s) %v but the client only supports %v",
|
||||
ue.UnsupportedSchemes,
|
||||
internalauth.SupportedSchemes,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
for _, authScheme := range authSchemes {
|
||||
switch authScheme.(type) {
|
||||
case *internalauth.AuthenticationSchemeV4:
|
||||
v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4)
|
||||
var signingName, signingRegion string
|
||||
if v4Scheme.SigningName == nil {
|
||||
signingName = "sts"
|
||||
} 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.
|
||||
// Setting this context value will cause the signer to extract it
|
||||
// and override the value set at client initialization time.
|
||||
ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding)
|
||||
}
|
||||
ctx = awsmiddleware.SetSigningName(ctx, signingName)
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion)
|
||||
break
|
||||
case *internalauth.AuthenticationSchemeV4A:
|
||||
v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A)
|
||||
if v4aScheme.SigningName == nil {
|
||||
v4aScheme.SigningName = aws.String("sts")
|
||||
}
|
||||
if v4aScheme.DisableDoubleEncoding != nil {
|
||||
// The signer sets an equivalent value at client initialization time.
|
||||
// Setting this context value will cause the signer to extract it
|
||||
// and override the value set at client initialization time.
|
||||
ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding)
|
||||
}
|
||||
ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName)
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0])
|
||||
break
|
||||
case *internalauth.AuthenticationSchemeNone:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return next.HandleSerialize(ctx, in)
|
||||
}
|
||||
|
||||
func addAssumeRoleResolveEndpointMiddleware(stack *middleware.Stack, options Options) error {
|
||||
return stack.Serialize.Insert(&opAssumeRoleResolveEndpointMiddleware{
|
||||
EndpointResolver: options.EndpointResolverV2,
|
||||
BuiltInResolver: &builtInResolver{
|
||||
Region: options.Region,
|
||||
UseDualStack: options.EndpointOptions.UseDualStackEndpoint,
|
||||
UseFIPS: options.EndpointOptions.UseFIPSEndpoint,
|
||||
Endpoint: options.BaseEndpoint,
|
||||
},
|
||||
}, "ResolveEndpoint", middleware.After)
|
||||
}
|
||||
|
139
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go
generated
vendored
139
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go
generated
vendored
@ -4,13 +4,9 @@ package sts
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
internalauth "github.com/aws/aws-sdk-go-v2/internal/auth"
|
||||
"github.com/aws/aws-sdk-go-v2/service/sts/types"
|
||||
smithyendpoints "github.com/aws/smithy-go/endpoints"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
)
|
||||
@ -281,6 +277,9 @@ type AssumeRoleWithSAMLOutput struct {
|
||||
}
|
||||
|
||||
func (c *Client) addOperationAssumeRoleWithSAMLMiddlewares(stack *middleware.Stack, options Options) (err error) {
|
||||
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
|
||||
return err
|
||||
}
|
||||
err = stack.Serialize.Add(&awsAwsquery_serializeOpAssumeRoleWithSAML{}, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -289,6 +288,10 @@ func (c *Client) addOperationAssumeRoleWithSAMLMiddlewares(stack *middleware.Sta
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := addProtocolFinalizerMiddlewares(stack, options, "AssumeRoleWithSAML"); err != nil {
|
||||
return fmt.Errorf("add protocol finalizers: %v", err)
|
||||
}
|
||||
|
||||
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -322,7 +325,7 @@ func (c *Client) addOperationAssumeRoleWithSAMLMiddlewares(stack *middleware.Sta
|
||||
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addAssumeRoleWithSAMLResolveEndpointMiddleware(stack, options); err != nil {
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpAssumeRoleWithSAMLValidationMiddleware(stack); err != nil {
|
||||
@ -343,7 +346,7 @@ func (c *Client) addOperationAssumeRoleWithSAMLMiddlewares(stack *middleware.Sta
|
||||
if err = addRequestResponseLogging(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
@ -353,130 +356,6 @@ func newServiceMetadataMiddleware_opAssumeRoleWithSAML(region string) *awsmiddle
|
||||
return &awsmiddleware.RegisterServiceMetadata{
|
||||
Region: region,
|
||||
ServiceID: ServiceID,
|
||||
SigningName: "sts",
|
||||
OperationName: "AssumeRoleWithSAML",
|
||||
}
|
||||
}
|
||||
|
||||
type opAssumeRoleWithSAMLResolveEndpointMiddleware struct {
|
||||
EndpointResolver EndpointResolverV2
|
||||
BuiltInResolver builtInParameterResolver
|
||||
}
|
||||
|
||||
func (*opAssumeRoleWithSAMLResolveEndpointMiddleware) ID() string {
|
||||
return "ResolveEndpointV2"
|
||||
}
|
||||
|
||||
func (m *opAssumeRoleWithSAMLResolveEndpointMiddleware) 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)
|
||||
}
|
||||
|
||||
if m.EndpointResolver == nil {
|
||||
return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil")
|
||||
}
|
||||
|
||||
params := EndpointParameters{}
|
||||
|
||||
m.BuiltInResolver.ResolveBuiltIns(¶ms)
|
||||
|
||||
var resolvedEndpoint smithyendpoints.Endpoint
|
||||
resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params)
|
||||
if err != nil {
|
||||
return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err)
|
||||
}
|
||||
|
||||
req.URL = &resolvedEndpoint.URI
|
||||
|
||||
for k := range resolvedEndpoint.Headers {
|
||||
req.Header.Set(
|
||||
k,
|
||||
resolvedEndpoint.Headers.Get(k),
|
||||
)
|
||||
}
|
||||
|
||||
authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties)
|
||||
if err != nil {
|
||||
var nfe *internalauth.NoAuthenticationSchemesFoundError
|
||||
if errors.As(err, &nfe) {
|
||||
// if no auth scheme is found, default to sigv4
|
||||
signingName := "sts"
|
||||
signingRegion := m.BuiltInResolver.(*builtInResolver).Region
|
||||
ctx = awsmiddleware.SetSigningName(ctx, signingName)
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion)
|
||||
|
||||
}
|
||||
var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError
|
||||
if errors.As(err, &ue) {
|
||||
return out, metadata, fmt.Errorf(
|
||||
"This operation requests signer version(s) %v but the client only supports %v",
|
||||
ue.UnsupportedSchemes,
|
||||
internalauth.SupportedSchemes,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
for _, authScheme := range authSchemes {
|
||||
switch authScheme.(type) {
|
||||
case *internalauth.AuthenticationSchemeV4:
|
||||
v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4)
|
||||
var signingName, signingRegion string
|
||||
if v4Scheme.SigningName == nil {
|
||||
signingName = "sts"
|
||||
} 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.
|
||||
// Setting this context value will cause the signer to extract it
|
||||
// and override the value set at client initialization time.
|
||||
ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding)
|
||||
}
|
||||
ctx = awsmiddleware.SetSigningName(ctx, signingName)
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion)
|
||||
break
|
||||
case *internalauth.AuthenticationSchemeV4A:
|
||||
v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A)
|
||||
if v4aScheme.SigningName == nil {
|
||||
v4aScheme.SigningName = aws.String("sts")
|
||||
}
|
||||
if v4aScheme.DisableDoubleEncoding != nil {
|
||||
// The signer sets an equivalent value at client initialization time.
|
||||
// Setting this context value will cause the signer to extract it
|
||||
// and override the value set at client initialization time.
|
||||
ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding)
|
||||
}
|
||||
ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName)
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0])
|
||||
break
|
||||
case *internalauth.AuthenticationSchemeNone:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return next.HandleSerialize(ctx, in)
|
||||
}
|
||||
|
||||
func addAssumeRoleWithSAMLResolveEndpointMiddleware(stack *middleware.Stack, options Options) error {
|
||||
return stack.Serialize.Insert(&opAssumeRoleWithSAMLResolveEndpointMiddleware{
|
||||
EndpointResolver: options.EndpointResolverV2,
|
||||
BuiltInResolver: &builtInResolver{
|
||||
Region: options.Region,
|
||||
UseDualStack: options.EndpointOptions.UseDualStackEndpoint,
|
||||
UseFIPS: options.EndpointOptions.UseFIPSEndpoint,
|
||||
Endpoint: options.BaseEndpoint,
|
||||
},
|
||||
}, "ResolveEndpoint", middleware.After)
|
||||
}
|
||||
|
139
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go
generated
vendored
139
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go
generated
vendored
@ -4,13 +4,9 @@ package sts
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
internalauth "github.com/aws/aws-sdk-go-v2/internal/auth"
|
||||
"github.com/aws/aws-sdk-go-v2/service/sts/types"
|
||||
smithyendpoints "github.com/aws/smithy-go/endpoints"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
)
|
||||
@ -300,6 +296,9 @@ type AssumeRoleWithWebIdentityOutput struct {
|
||||
}
|
||||
|
||||
func (c *Client) addOperationAssumeRoleWithWebIdentityMiddlewares(stack *middleware.Stack, options Options) (err error) {
|
||||
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
|
||||
return err
|
||||
}
|
||||
err = stack.Serialize.Add(&awsAwsquery_serializeOpAssumeRoleWithWebIdentity{}, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -308,6 +307,10 @@ func (c *Client) addOperationAssumeRoleWithWebIdentityMiddlewares(stack *middlew
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := addProtocolFinalizerMiddlewares(stack, options, "AssumeRoleWithWebIdentity"); err != nil {
|
||||
return fmt.Errorf("add protocol finalizers: %v", err)
|
||||
}
|
||||
|
||||
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -341,7 +344,7 @@ func (c *Client) addOperationAssumeRoleWithWebIdentityMiddlewares(stack *middlew
|
||||
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addAssumeRoleWithWebIdentityResolveEndpointMiddleware(stack, options); err != nil {
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpAssumeRoleWithWebIdentityValidationMiddleware(stack); err != nil {
|
||||
@ -362,7 +365,7 @@ func (c *Client) addOperationAssumeRoleWithWebIdentityMiddlewares(stack *middlew
|
||||
if err = addRequestResponseLogging(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
@ -372,130 +375,6 @@ func newServiceMetadataMiddleware_opAssumeRoleWithWebIdentity(region string) *aw
|
||||
return &awsmiddleware.RegisterServiceMetadata{
|
||||
Region: region,
|
||||
ServiceID: ServiceID,
|
||||
SigningName: "sts",
|
||||
OperationName: "AssumeRoleWithWebIdentity",
|
||||
}
|
||||
}
|
||||
|
||||
type opAssumeRoleWithWebIdentityResolveEndpointMiddleware struct {
|
||||
EndpointResolver EndpointResolverV2
|
||||
BuiltInResolver builtInParameterResolver
|
||||
}
|
||||
|
||||
func (*opAssumeRoleWithWebIdentityResolveEndpointMiddleware) ID() string {
|
||||
return "ResolveEndpointV2"
|
||||
}
|
||||
|
||||
func (m *opAssumeRoleWithWebIdentityResolveEndpointMiddleware) 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)
|
||||
}
|
||||
|
||||
if m.EndpointResolver == nil {
|
||||
return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil")
|
||||
}
|
||||
|
||||
params := EndpointParameters{}
|
||||
|
||||
m.BuiltInResolver.ResolveBuiltIns(¶ms)
|
||||
|
||||
var resolvedEndpoint smithyendpoints.Endpoint
|
||||
resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params)
|
||||
if err != nil {
|
||||
return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err)
|
||||
}
|
||||
|
||||
req.URL = &resolvedEndpoint.URI
|
||||
|
||||
for k := range resolvedEndpoint.Headers {
|
||||
req.Header.Set(
|
||||
k,
|
||||
resolvedEndpoint.Headers.Get(k),
|
||||
)
|
||||
}
|
||||
|
||||
authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties)
|
||||
if err != nil {
|
||||
var nfe *internalauth.NoAuthenticationSchemesFoundError
|
||||
if errors.As(err, &nfe) {
|
||||
// if no auth scheme is found, default to sigv4
|
||||
signingName := "sts"
|
||||
signingRegion := m.BuiltInResolver.(*builtInResolver).Region
|
||||
ctx = awsmiddleware.SetSigningName(ctx, signingName)
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion)
|
||||
|
||||
}
|
||||
var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError
|
||||
if errors.As(err, &ue) {
|
||||
return out, metadata, fmt.Errorf(
|
||||
"This operation requests signer version(s) %v but the client only supports %v",
|
||||
ue.UnsupportedSchemes,
|
||||
internalauth.SupportedSchemes,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
for _, authScheme := range authSchemes {
|
||||
switch authScheme.(type) {
|
||||
case *internalauth.AuthenticationSchemeV4:
|
||||
v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4)
|
||||
var signingName, signingRegion string
|
||||
if v4Scheme.SigningName == nil {
|
||||
signingName = "sts"
|
||||
} 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.
|
||||
// Setting this context value will cause the signer to extract it
|
||||
// and override the value set at client initialization time.
|
||||
ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding)
|
||||
}
|
||||
ctx = awsmiddleware.SetSigningName(ctx, signingName)
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion)
|
||||
break
|
||||
case *internalauth.AuthenticationSchemeV4A:
|
||||
v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A)
|
||||
if v4aScheme.SigningName == nil {
|
||||
v4aScheme.SigningName = aws.String("sts")
|
||||
}
|
||||
if v4aScheme.DisableDoubleEncoding != nil {
|
||||
// The signer sets an equivalent value at client initialization time.
|
||||
// Setting this context value will cause the signer to extract it
|
||||
// and override the value set at client initialization time.
|
||||
ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding)
|
||||
}
|
||||
ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName)
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0])
|
||||
break
|
||||
case *internalauth.AuthenticationSchemeNone:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return next.HandleSerialize(ctx, in)
|
||||
}
|
||||
|
||||
func addAssumeRoleWithWebIdentityResolveEndpointMiddleware(stack *middleware.Stack, options Options) error {
|
||||
return stack.Serialize.Insert(&opAssumeRoleWithWebIdentityResolveEndpointMiddleware{
|
||||
EndpointResolver: options.EndpointResolverV2,
|
||||
BuiltInResolver: &builtInResolver{
|
||||
Region: options.Region,
|
||||
UseDualStack: options.EndpointOptions.UseDualStackEndpoint,
|
||||
UseFIPS: options.EndpointOptions.UseFIPSEndpoint,
|
||||
Endpoint: options.BaseEndpoint,
|
||||
},
|
||||
}, "ResolveEndpoint", middleware.After)
|
||||
}
|
||||
|
142
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_DecodeAuthorizationMessage.go
generated
vendored
142
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_DecodeAuthorizationMessage.go
generated
vendored
@ -4,13 +4,9 @@ package sts
|
||||
|
||||
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"
|
||||
smithyendpoints "github.com/aws/smithy-go/endpoints"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
)
|
||||
@ -78,6 +74,9 @@ type DecodeAuthorizationMessageOutput struct {
|
||||
}
|
||||
|
||||
func (c *Client) addOperationDecodeAuthorizationMessageMiddlewares(stack *middleware.Stack, options Options) (err error) {
|
||||
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
|
||||
return err
|
||||
}
|
||||
err = stack.Serialize.Add(&awsAwsquery_serializeOpDecodeAuthorizationMessage{}, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -86,6 +85,10 @@ func (c *Client) addOperationDecodeAuthorizationMessageMiddlewares(stack *middle
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := addProtocolFinalizerMiddlewares(stack, options, "DecodeAuthorizationMessage"); err != nil {
|
||||
return fmt.Errorf("add protocol finalizers: %v", err)
|
||||
}
|
||||
|
||||
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -107,9 +110,6 @@ func (c *Client) addOperationDecodeAuthorizationMessageMiddlewares(stack *middle
|
||||
if err = addRetryMiddlewares(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -125,7 +125,7 @@ func (c *Client) addOperationDecodeAuthorizationMessageMiddlewares(stack *middle
|
||||
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addDecodeAuthorizationMessageResolveEndpointMiddleware(stack, options); err != nil {
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpDecodeAuthorizationMessageValidationMiddleware(stack); err != nil {
|
||||
@ -146,7 +146,7 @@ func (c *Client) addOperationDecodeAuthorizationMessageMiddlewares(stack *middle
|
||||
if err = addRequestResponseLogging(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
@ -156,130 +156,6 @@ func newServiceMetadataMiddleware_opDecodeAuthorizationMessage(region string) *a
|
||||
return &awsmiddleware.RegisterServiceMetadata{
|
||||
Region: region,
|
||||
ServiceID: ServiceID,
|
||||
SigningName: "sts",
|
||||
OperationName: "DecodeAuthorizationMessage",
|
||||
}
|
||||
}
|
||||
|
||||
type opDecodeAuthorizationMessageResolveEndpointMiddleware struct {
|
||||
EndpointResolver EndpointResolverV2
|
||||
BuiltInResolver builtInParameterResolver
|
||||
}
|
||||
|
||||
func (*opDecodeAuthorizationMessageResolveEndpointMiddleware) ID() string {
|
||||
return "ResolveEndpointV2"
|
||||
}
|
||||
|
||||
func (m *opDecodeAuthorizationMessageResolveEndpointMiddleware) 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)
|
||||
}
|
||||
|
||||
if m.EndpointResolver == nil {
|
||||
return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil")
|
||||
}
|
||||
|
||||
params := EndpointParameters{}
|
||||
|
||||
m.BuiltInResolver.ResolveBuiltIns(¶ms)
|
||||
|
||||
var resolvedEndpoint smithyendpoints.Endpoint
|
||||
resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params)
|
||||
if err != nil {
|
||||
return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err)
|
||||
}
|
||||
|
||||
req.URL = &resolvedEndpoint.URI
|
||||
|
||||
for k := range resolvedEndpoint.Headers {
|
||||
req.Header.Set(
|
||||
k,
|
||||
resolvedEndpoint.Headers.Get(k),
|
||||
)
|
||||
}
|
||||
|
||||
authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties)
|
||||
if err != nil {
|
||||
var nfe *internalauth.NoAuthenticationSchemesFoundError
|
||||
if errors.As(err, &nfe) {
|
||||
// if no auth scheme is found, default to sigv4
|
||||
signingName := "sts"
|
||||
signingRegion := m.BuiltInResolver.(*builtInResolver).Region
|
||||
ctx = awsmiddleware.SetSigningName(ctx, signingName)
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion)
|
||||
|
||||
}
|
||||
var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError
|
||||
if errors.As(err, &ue) {
|
||||
return out, metadata, fmt.Errorf(
|
||||
"This operation requests signer version(s) %v but the client only supports %v",
|
||||
ue.UnsupportedSchemes,
|
||||
internalauth.SupportedSchemes,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
for _, authScheme := range authSchemes {
|
||||
switch authScheme.(type) {
|
||||
case *internalauth.AuthenticationSchemeV4:
|
||||
v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4)
|
||||
var signingName, signingRegion string
|
||||
if v4Scheme.SigningName == nil {
|
||||
signingName = "sts"
|
||||
} 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.
|
||||
// Setting this context value will cause the signer to extract it
|
||||
// and override the value set at client initialization time.
|
||||
ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding)
|
||||
}
|
||||
ctx = awsmiddleware.SetSigningName(ctx, signingName)
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion)
|
||||
break
|
||||
case *internalauth.AuthenticationSchemeV4A:
|
||||
v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A)
|
||||
if v4aScheme.SigningName == nil {
|
||||
v4aScheme.SigningName = aws.String("sts")
|
||||
}
|
||||
if v4aScheme.DisableDoubleEncoding != nil {
|
||||
// The signer sets an equivalent value at client initialization time.
|
||||
// Setting this context value will cause the signer to extract it
|
||||
// and override the value set at client initialization time.
|
||||
ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding)
|
||||
}
|
||||
ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName)
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0])
|
||||
break
|
||||
case *internalauth.AuthenticationSchemeNone:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return next.HandleSerialize(ctx, in)
|
||||
}
|
||||
|
||||
func addDecodeAuthorizationMessageResolveEndpointMiddleware(stack *middleware.Stack, options Options) error {
|
||||
return stack.Serialize.Insert(&opDecodeAuthorizationMessageResolveEndpointMiddleware{
|
||||
EndpointResolver: options.EndpointResolverV2,
|
||||
BuiltInResolver: &builtInResolver{
|
||||
Region: options.Region,
|
||||
UseDualStack: options.EndpointOptions.UseDualStackEndpoint,
|
||||
UseFIPS: options.EndpointOptions.UseFIPSEndpoint,
|
||||
Endpoint: options.BaseEndpoint,
|
||||
},
|
||||
}, "ResolveEndpoint", middleware.After)
|
||||
}
|
||||
|
142
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetAccessKeyInfo.go
generated
vendored
142
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetAccessKeyInfo.go
generated
vendored
@ -4,13 +4,9 @@ package sts
|
||||
|
||||
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"
|
||||
smithyendpoints "github.com/aws/smithy-go/endpoints"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
)
|
||||
@ -71,6 +67,9 @@ type GetAccessKeyInfoOutput struct {
|
||||
}
|
||||
|
||||
func (c *Client) addOperationGetAccessKeyInfoMiddlewares(stack *middleware.Stack, options Options) (err error) {
|
||||
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
|
||||
return err
|
||||
}
|
||||
err = stack.Serialize.Add(&awsAwsquery_serializeOpGetAccessKeyInfo{}, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -79,6 +78,10 @@ func (c *Client) addOperationGetAccessKeyInfoMiddlewares(stack *middleware.Stack
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := addProtocolFinalizerMiddlewares(stack, options, "GetAccessKeyInfo"); err != nil {
|
||||
return fmt.Errorf("add protocol finalizers: %v", err)
|
||||
}
|
||||
|
||||
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -100,9 +103,6 @@ func (c *Client) addOperationGetAccessKeyInfoMiddlewares(stack *middleware.Stack
|
||||
if err = addRetryMiddlewares(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -118,7 +118,7 @@ func (c *Client) addOperationGetAccessKeyInfoMiddlewares(stack *middleware.Stack
|
||||
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addGetAccessKeyInfoResolveEndpointMiddleware(stack, options); err != nil {
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpGetAccessKeyInfoValidationMiddleware(stack); err != nil {
|
||||
@ -139,7 +139,7 @@ func (c *Client) addOperationGetAccessKeyInfoMiddlewares(stack *middleware.Stack
|
||||
if err = addRequestResponseLogging(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
@ -149,130 +149,6 @@ func newServiceMetadataMiddleware_opGetAccessKeyInfo(region string) *awsmiddlewa
|
||||
return &awsmiddleware.RegisterServiceMetadata{
|
||||
Region: region,
|
||||
ServiceID: ServiceID,
|
||||
SigningName: "sts",
|
||||
OperationName: "GetAccessKeyInfo",
|
||||
}
|
||||
}
|
||||
|
||||
type opGetAccessKeyInfoResolveEndpointMiddleware struct {
|
||||
EndpointResolver EndpointResolverV2
|
||||
BuiltInResolver builtInParameterResolver
|
||||
}
|
||||
|
||||
func (*opGetAccessKeyInfoResolveEndpointMiddleware) ID() string {
|
||||
return "ResolveEndpointV2"
|
||||
}
|
||||
|
||||
func (m *opGetAccessKeyInfoResolveEndpointMiddleware) 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)
|
||||
}
|
||||
|
||||
if m.EndpointResolver == nil {
|
||||
return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil")
|
||||
}
|
||||
|
||||
params := EndpointParameters{}
|
||||
|
||||
m.BuiltInResolver.ResolveBuiltIns(¶ms)
|
||||
|
||||
var resolvedEndpoint smithyendpoints.Endpoint
|
||||
resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params)
|
||||
if err != nil {
|
||||
return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err)
|
||||
}
|
||||
|
||||
req.URL = &resolvedEndpoint.URI
|
||||
|
||||
for k := range resolvedEndpoint.Headers {
|
||||
req.Header.Set(
|
||||
k,
|
||||
resolvedEndpoint.Headers.Get(k),
|
||||
)
|
||||
}
|
||||
|
||||
authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties)
|
||||
if err != nil {
|
||||
var nfe *internalauth.NoAuthenticationSchemesFoundError
|
||||
if errors.As(err, &nfe) {
|
||||
// if no auth scheme is found, default to sigv4
|
||||
signingName := "sts"
|
||||
signingRegion := m.BuiltInResolver.(*builtInResolver).Region
|
||||
ctx = awsmiddleware.SetSigningName(ctx, signingName)
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion)
|
||||
|
||||
}
|
||||
var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError
|
||||
if errors.As(err, &ue) {
|
||||
return out, metadata, fmt.Errorf(
|
||||
"This operation requests signer version(s) %v but the client only supports %v",
|
||||
ue.UnsupportedSchemes,
|
||||
internalauth.SupportedSchemes,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
for _, authScheme := range authSchemes {
|
||||
switch authScheme.(type) {
|
||||
case *internalauth.AuthenticationSchemeV4:
|
||||
v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4)
|
||||
var signingName, signingRegion string
|
||||
if v4Scheme.SigningName == nil {
|
||||
signingName = "sts"
|
||||
} 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.
|
||||
// Setting this context value will cause the signer to extract it
|
||||
// and override the value set at client initialization time.
|
||||
ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding)
|
||||
}
|
||||
ctx = awsmiddleware.SetSigningName(ctx, signingName)
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion)
|
||||
break
|
||||
case *internalauth.AuthenticationSchemeV4A:
|
||||
v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A)
|
||||
if v4aScheme.SigningName == nil {
|
||||
v4aScheme.SigningName = aws.String("sts")
|
||||
}
|
||||
if v4aScheme.DisableDoubleEncoding != nil {
|
||||
// The signer sets an equivalent value at client initialization time.
|
||||
// Setting this context value will cause the signer to extract it
|
||||
// and override the value set at client initialization time.
|
||||
ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding)
|
||||
}
|
||||
ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName)
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0])
|
||||
break
|
||||
case *internalauth.AuthenticationSchemeNone:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return next.HandleSerialize(ctx, in)
|
||||
}
|
||||
|
||||
func addGetAccessKeyInfoResolveEndpointMiddleware(stack *middleware.Stack, options Options) error {
|
||||
return stack.Serialize.Insert(&opGetAccessKeyInfoResolveEndpointMiddleware{
|
||||
EndpointResolver: options.EndpointResolverV2,
|
||||
BuiltInResolver: &builtInResolver{
|
||||
Region: options.Region,
|
||||
UseDualStack: options.EndpointOptions.UseDualStackEndpoint,
|
||||
UseFIPS: options.EndpointOptions.UseFIPSEndpoint,
|
||||
Endpoint: options.BaseEndpoint,
|
||||
},
|
||||
}, "ResolveEndpoint", middleware.After)
|
||||
}
|
||||
|
142
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetCallerIdentity.go
generated
vendored
142
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetCallerIdentity.go
generated
vendored
@ -4,13 +4,9 @@ package sts
|
||||
|
||||
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"
|
||||
smithyendpoints "github.com/aws/smithy-go/endpoints"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
)
|
||||
@ -66,6 +62,9 @@ type GetCallerIdentityOutput struct {
|
||||
}
|
||||
|
||||
func (c *Client) addOperationGetCallerIdentityMiddlewares(stack *middleware.Stack, options Options) (err error) {
|
||||
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
|
||||
return err
|
||||
}
|
||||
err = stack.Serialize.Add(&awsAwsquery_serializeOpGetCallerIdentity{}, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -74,6 +73,10 @@ func (c *Client) addOperationGetCallerIdentityMiddlewares(stack *middleware.Stac
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := addProtocolFinalizerMiddlewares(stack, options, "GetCallerIdentity"); err != nil {
|
||||
return fmt.Errorf("add protocol finalizers: %v", err)
|
||||
}
|
||||
|
||||
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -95,9 +98,6 @@ func (c *Client) addOperationGetCallerIdentityMiddlewares(stack *middleware.Stac
|
||||
if err = addRetryMiddlewares(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -113,7 +113,7 @@ func (c *Client) addOperationGetCallerIdentityMiddlewares(stack *middleware.Stac
|
||||
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addGetCallerIdentityResolveEndpointMiddleware(stack, options); err != nil {
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCallerIdentity(options.Region), middleware.Before); err != nil {
|
||||
@ -131,7 +131,7 @@ func (c *Client) addOperationGetCallerIdentityMiddlewares(stack *middleware.Stac
|
||||
if err = addRequestResponseLogging(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
@ -141,7 +141,6 @@ func newServiceMetadataMiddleware_opGetCallerIdentity(region string) *awsmiddlew
|
||||
return &awsmiddleware.RegisterServiceMetadata{
|
||||
Region: region,
|
||||
ServiceID: ServiceID,
|
||||
SigningName: "sts",
|
||||
OperationName: "GetCallerIdentity",
|
||||
}
|
||||
}
|
||||
@ -169,126 +168,3 @@ func (c *PresignClient) PresignGetCallerIdentity(ctx context.Context, params *Ge
|
||||
out := result.(*v4.PresignedHTTPRequest)
|
||||
return out, nil
|
||||
}
|
||||
|
||||
type opGetCallerIdentityResolveEndpointMiddleware struct {
|
||||
EndpointResolver EndpointResolverV2
|
||||
BuiltInResolver builtInParameterResolver
|
||||
}
|
||||
|
||||
func (*opGetCallerIdentityResolveEndpointMiddleware) ID() string {
|
||||
return "ResolveEndpointV2"
|
||||
}
|
||||
|
||||
func (m *opGetCallerIdentityResolveEndpointMiddleware) 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)
|
||||
}
|
||||
|
||||
if m.EndpointResolver == nil {
|
||||
return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil")
|
||||
}
|
||||
|
||||
params := EndpointParameters{}
|
||||
|
||||
m.BuiltInResolver.ResolveBuiltIns(¶ms)
|
||||
|
||||
var resolvedEndpoint smithyendpoints.Endpoint
|
||||
resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params)
|
||||
if err != nil {
|
||||
return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err)
|
||||
}
|
||||
|
||||
req.URL = &resolvedEndpoint.URI
|
||||
|
||||
for k := range resolvedEndpoint.Headers {
|
||||
req.Header.Set(
|
||||
k,
|
||||
resolvedEndpoint.Headers.Get(k),
|
||||
)
|
||||
}
|
||||
|
||||
authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties)
|
||||
if err != nil {
|
||||
var nfe *internalauth.NoAuthenticationSchemesFoundError
|
||||
if errors.As(err, &nfe) {
|
||||
// if no auth scheme is found, default to sigv4
|
||||
signingName := "sts"
|
||||
signingRegion := m.BuiltInResolver.(*builtInResolver).Region
|
||||
ctx = awsmiddleware.SetSigningName(ctx, signingName)
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion)
|
||||
|
||||
}
|
||||
var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError
|
||||
if errors.As(err, &ue) {
|
||||
return out, metadata, fmt.Errorf(
|
||||
"This operation requests signer version(s) %v but the client only supports %v",
|
||||
ue.UnsupportedSchemes,
|
||||
internalauth.SupportedSchemes,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
for _, authScheme := range authSchemes {
|
||||
switch authScheme.(type) {
|
||||
case *internalauth.AuthenticationSchemeV4:
|
||||
v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4)
|
||||
var signingName, signingRegion string
|
||||
if v4Scheme.SigningName == nil {
|
||||
signingName = "sts"
|
||||
} 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.
|
||||
// Setting this context value will cause the signer to extract it
|
||||
// and override the value set at client initialization time.
|
||||
ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding)
|
||||
}
|
||||
ctx = awsmiddleware.SetSigningName(ctx, signingName)
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion)
|
||||
break
|
||||
case *internalauth.AuthenticationSchemeV4A:
|
||||
v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A)
|
||||
if v4aScheme.SigningName == nil {
|
||||
v4aScheme.SigningName = aws.String("sts")
|
||||
}
|
||||
if v4aScheme.DisableDoubleEncoding != nil {
|
||||
// The signer sets an equivalent value at client initialization time.
|
||||
// Setting this context value will cause the signer to extract it
|
||||
// and override the value set at client initialization time.
|
||||
ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding)
|
||||
}
|
||||
ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName)
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0])
|
||||
break
|
||||
case *internalauth.AuthenticationSchemeNone:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return next.HandleSerialize(ctx, in)
|
||||
}
|
||||
|
||||
func addGetCallerIdentityResolveEndpointMiddleware(stack *middleware.Stack, options Options) error {
|
||||
return stack.Serialize.Insert(&opGetCallerIdentityResolveEndpointMiddleware{
|
||||
EndpointResolver: options.EndpointResolverV2,
|
||||
BuiltInResolver: &builtInResolver{
|
||||
Region: options.Region,
|
||||
UseDualStack: options.EndpointOptions.UseDualStackEndpoint,
|
||||
UseFIPS: options.EndpointOptions.UseFIPSEndpoint,
|
||||
Endpoint: options.BaseEndpoint,
|
||||
},
|
||||
}, "ResolveEndpoint", middleware.After)
|
||||
}
|
||||
|
142
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go
generated
vendored
142
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go
generated
vendored
@ -4,14 +4,10 @@ package sts
|
||||
|
||||
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"
|
||||
"github.com/aws/aws-sdk-go-v2/service/sts/types"
|
||||
smithyendpoints "github.com/aws/smithy-go/endpoints"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
)
|
||||
@ -238,6 +234,9 @@ type GetFederationTokenOutput struct {
|
||||
}
|
||||
|
||||
func (c *Client) addOperationGetFederationTokenMiddlewares(stack *middleware.Stack, options Options) (err error) {
|
||||
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
|
||||
return err
|
||||
}
|
||||
err = stack.Serialize.Add(&awsAwsquery_serializeOpGetFederationToken{}, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -246,6 +245,10 @@ func (c *Client) addOperationGetFederationTokenMiddlewares(stack *middleware.Sta
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := addProtocolFinalizerMiddlewares(stack, options, "GetFederationToken"); err != nil {
|
||||
return fmt.Errorf("add protocol finalizers: %v", err)
|
||||
}
|
||||
|
||||
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -267,9 +270,6 @@ func (c *Client) addOperationGetFederationTokenMiddlewares(stack *middleware.Sta
|
||||
if err = addRetryMiddlewares(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -285,7 +285,7 @@ func (c *Client) addOperationGetFederationTokenMiddlewares(stack *middleware.Sta
|
||||
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addGetFederationTokenResolveEndpointMiddleware(stack, options); err != nil {
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpGetFederationTokenValidationMiddleware(stack); err != nil {
|
||||
@ -306,7 +306,7 @@ func (c *Client) addOperationGetFederationTokenMiddlewares(stack *middleware.Sta
|
||||
if err = addRequestResponseLogging(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
@ -316,130 +316,6 @@ func newServiceMetadataMiddleware_opGetFederationToken(region string) *awsmiddle
|
||||
return &awsmiddleware.RegisterServiceMetadata{
|
||||
Region: region,
|
||||
ServiceID: ServiceID,
|
||||
SigningName: "sts",
|
||||
OperationName: "GetFederationToken",
|
||||
}
|
||||
}
|
||||
|
||||
type opGetFederationTokenResolveEndpointMiddleware struct {
|
||||
EndpointResolver EndpointResolverV2
|
||||
BuiltInResolver builtInParameterResolver
|
||||
}
|
||||
|
||||
func (*opGetFederationTokenResolveEndpointMiddleware) ID() string {
|
||||
return "ResolveEndpointV2"
|
||||
}
|
||||
|
||||
func (m *opGetFederationTokenResolveEndpointMiddleware) 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)
|
||||
}
|
||||
|
||||
if m.EndpointResolver == nil {
|
||||
return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil")
|
||||
}
|
||||
|
||||
params := EndpointParameters{}
|
||||
|
||||
m.BuiltInResolver.ResolveBuiltIns(¶ms)
|
||||
|
||||
var resolvedEndpoint smithyendpoints.Endpoint
|
||||
resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params)
|
||||
if err != nil {
|
||||
return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err)
|
||||
}
|
||||
|
||||
req.URL = &resolvedEndpoint.URI
|
||||
|
||||
for k := range resolvedEndpoint.Headers {
|
||||
req.Header.Set(
|
||||
k,
|
||||
resolvedEndpoint.Headers.Get(k),
|
||||
)
|
||||
}
|
||||
|
||||
authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties)
|
||||
if err != nil {
|
||||
var nfe *internalauth.NoAuthenticationSchemesFoundError
|
||||
if errors.As(err, &nfe) {
|
||||
// if no auth scheme is found, default to sigv4
|
||||
signingName := "sts"
|
||||
signingRegion := m.BuiltInResolver.(*builtInResolver).Region
|
||||
ctx = awsmiddleware.SetSigningName(ctx, signingName)
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion)
|
||||
|
||||
}
|
||||
var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError
|
||||
if errors.As(err, &ue) {
|
||||
return out, metadata, fmt.Errorf(
|
||||
"This operation requests signer version(s) %v but the client only supports %v",
|
||||
ue.UnsupportedSchemes,
|
||||
internalauth.SupportedSchemes,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
for _, authScheme := range authSchemes {
|
||||
switch authScheme.(type) {
|
||||
case *internalauth.AuthenticationSchemeV4:
|
||||
v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4)
|
||||
var signingName, signingRegion string
|
||||
if v4Scheme.SigningName == nil {
|
||||
signingName = "sts"
|
||||
} 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.
|
||||
// Setting this context value will cause the signer to extract it
|
||||
// and override the value set at client initialization time.
|
||||
ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding)
|
||||
}
|
||||
ctx = awsmiddleware.SetSigningName(ctx, signingName)
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion)
|
||||
break
|
||||
case *internalauth.AuthenticationSchemeV4A:
|
||||
v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A)
|
||||
if v4aScheme.SigningName == nil {
|
||||
v4aScheme.SigningName = aws.String("sts")
|
||||
}
|
||||
if v4aScheme.DisableDoubleEncoding != nil {
|
||||
// The signer sets an equivalent value at client initialization time.
|
||||
// Setting this context value will cause the signer to extract it
|
||||
// and override the value set at client initialization time.
|
||||
ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding)
|
||||
}
|
||||
ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName)
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0])
|
||||
break
|
||||
case *internalauth.AuthenticationSchemeNone:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return next.HandleSerialize(ctx, in)
|
||||
}
|
||||
|
||||
func addGetFederationTokenResolveEndpointMiddleware(stack *middleware.Stack, options Options) error {
|
||||
return stack.Serialize.Insert(&opGetFederationTokenResolveEndpointMiddleware{
|
||||
EndpointResolver: options.EndpointResolverV2,
|
||||
BuiltInResolver: &builtInResolver{
|
||||
Region: options.Region,
|
||||
UseDualStack: options.EndpointOptions.UseDualStackEndpoint,
|
||||
UseFIPS: options.EndpointOptions.UseFIPSEndpoint,
|
||||
Endpoint: options.BaseEndpoint,
|
||||
},
|
||||
}, "ResolveEndpoint", middleware.After)
|
||||
}
|
||||
|
142
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go
generated
vendored
142
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go
generated
vendored
@ -4,14 +4,10 @@ package sts
|
||||
|
||||
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"
|
||||
"github.com/aws/aws-sdk-go-v2/service/sts/types"
|
||||
smithyendpoints "github.com/aws/smithy-go/endpoints"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
)
|
||||
@ -124,6 +120,9 @@ type GetSessionTokenOutput struct {
|
||||
}
|
||||
|
||||
func (c *Client) addOperationGetSessionTokenMiddlewares(stack *middleware.Stack, options Options) (err error) {
|
||||
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
|
||||
return err
|
||||
}
|
||||
err = stack.Serialize.Add(&awsAwsquery_serializeOpGetSessionToken{}, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -132,6 +131,10 @@ func (c *Client) addOperationGetSessionTokenMiddlewares(stack *middleware.Stack,
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := addProtocolFinalizerMiddlewares(stack, options, "GetSessionToken"); err != nil {
|
||||
return fmt.Errorf("add protocol finalizers: %v", err)
|
||||
}
|
||||
|
||||
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -153,9 +156,6 @@ func (c *Client) addOperationGetSessionTokenMiddlewares(stack *middleware.Stack,
|
||||
if err = addRetryMiddlewares(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -171,7 +171,7 @@ func (c *Client) addOperationGetSessionTokenMiddlewares(stack *middleware.Stack,
|
||||
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addGetSessionTokenResolveEndpointMiddleware(stack, options); err != nil {
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSessionToken(options.Region), middleware.Before); err != nil {
|
||||
@ -189,7 +189,7 @@ func (c *Client) addOperationGetSessionTokenMiddlewares(stack *middleware.Stack,
|
||||
if err = addRequestResponseLogging(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
@ -199,130 +199,6 @@ func newServiceMetadataMiddleware_opGetSessionToken(region string) *awsmiddlewar
|
||||
return &awsmiddleware.RegisterServiceMetadata{
|
||||
Region: region,
|
||||
ServiceID: ServiceID,
|
||||
SigningName: "sts",
|
||||
OperationName: "GetSessionToken",
|
||||
}
|
||||
}
|
||||
|
||||
type opGetSessionTokenResolveEndpointMiddleware struct {
|
||||
EndpointResolver EndpointResolverV2
|
||||
BuiltInResolver builtInParameterResolver
|
||||
}
|
||||
|
||||
func (*opGetSessionTokenResolveEndpointMiddleware) ID() string {
|
||||
return "ResolveEndpointV2"
|
||||
}
|
||||
|
||||
func (m *opGetSessionTokenResolveEndpointMiddleware) 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)
|
||||
}
|
||||
|
||||
if m.EndpointResolver == nil {
|
||||
return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil")
|
||||
}
|
||||
|
||||
params := EndpointParameters{}
|
||||
|
||||
m.BuiltInResolver.ResolveBuiltIns(¶ms)
|
||||
|
||||
var resolvedEndpoint smithyendpoints.Endpoint
|
||||
resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params)
|
||||
if err != nil {
|
||||
return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err)
|
||||
}
|
||||
|
||||
req.URL = &resolvedEndpoint.URI
|
||||
|
||||
for k := range resolvedEndpoint.Headers {
|
||||
req.Header.Set(
|
||||
k,
|
||||
resolvedEndpoint.Headers.Get(k),
|
||||
)
|
||||
}
|
||||
|
||||
authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties)
|
||||
if err != nil {
|
||||
var nfe *internalauth.NoAuthenticationSchemesFoundError
|
||||
if errors.As(err, &nfe) {
|
||||
// if no auth scheme is found, default to sigv4
|
||||
signingName := "sts"
|
||||
signingRegion := m.BuiltInResolver.(*builtInResolver).Region
|
||||
ctx = awsmiddleware.SetSigningName(ctx, signingName)
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion)
|
||||
|
||||
}
|
||||
var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError
|
||||
if errors.As(err, &ue) {
|
||||
return out, metadata, fmt.Errorf(
|
||||
"This operation requests signer version(s) %v but the client only supports %v",
|
||||
ue.UnsupportedSchemes,
|
||||
internalauth.SupportedSchemes,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
for _, authScheme := range authSchemes {
|
||||
switch authScheme.(type) {
|
||||
case *internalauth.AuthenticationSchemeV4:
|
||||
v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4)
|
||||
var signingName, signingRegion string
|
||||
if v4Scheme.SigningName == nil {
|
||||
signingName = "sts"
|
||||
} 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.
|
||||
// Setting this context value will cause the signer to extract it
|
||||
// and override the value set at client initialization time.
|
||||
ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding)
|
||||
}
|
||||
ctx = awsmiddleware.SetSigningName(ctx, signingName)
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion)
|
||||
break
|
||||
case *internalauth.AuthenticationSchemeV4A:
|
||||
v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A)
|
||||
if v4aScheme.SigningName == nil {
|
||||
v4aScheme.SigningName = aws.String("sts")
|
||||
}
|
||||
if v4aScheme.DisableDoubleEncoding != nil {
|
||||
// The signer sets an equivalent value at client initialization time.
|
||||
// Setting this context value will cause the signer to extract it
|
||||
// and override the value set at client initialization time.
|
||||
ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding)
|
||||
}
|
||||
ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName)
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0])
|
||||
break
|
||||
case *internalauth.AuthenticationSchemeNone:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return next.HandleSerialize(ctx, in)
|
||||
}
|
||||
|
||||
func addGetSessionTokenResolveEndpointMiddleware(stack *middleware.Stack, options Options) error {
|
||||
return stack.Serialize.Insert(&opGetSessionTokenResolveEndpointMiddleware{
|
||||
EndpointResolver: options.EndpointResolverV2,
|
||||
BuiltInResolver: &builtInResolver{
|
||||
Region: options.Region,
|
||||
UseDualStack: options.EndpointOptions.UseDualStackEndpoint,
|
||||
UseFIPS: options.EndpointOptions.UseFIPSEndpoint,
|
||||
Endpoint: options.BaseEndpoint,
|
||||
},
|
||||
}, "ResolveEndpoint", middleware.After)
|
||||
}
|
||||
|
290
vendor/github.com/aws/aws-sdk-go-v2/service/sts/auth.go
generated
vendored
Normal file
290
vendor/github.com/aws/aws-sdk-go-v2/service/sts/auth.go
generated
vendored
Normal file
@ -0,0 +1,290 @@
|
||||
// Code generated by smithy-go-codegen DO NOT EDIT.
|
||||
|
||||
package sts
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
smithy "github.com/aws/smithy-go"
|
||||
smithyauth "github.com/aws/smithy-go/auth"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
)
|
||||
|
||||
func bindAuthParamsRegion(params *AuthResolverParameters, _ interface{}, options Options) {
|
||||
params.Region = options.Region
|
||||
}
|
||||
|
||||
type setLegacyContextSigningOptionsMiddleware struct {
|
||||
}
|
||||
|
||||
func (*setLegacyContextSigningOptionsMiddleware) ID() string {
|
||||
return "setLegacyContextSigningOptions"
|
||||
}
|
||||
|
||||
func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (
|
||||
out middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
rscheme := getResolvedAuthScheme(ctx)
|
||||
schemeID := rscheme.Scheme.SchemeID()
|
||||
|
||||
if sn := awsmiddleware.GetSigningName(ctx); sn != "" {
|
||||
if schemeID == "aws.auth#sigv4" {
|
||||
smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn)
|
||||
} else if schemeID == "aws.auth#sigv4a" {
|
||||
smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn)
|
||||
}
|
||||
}
|
||||
|
||||
if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" {
|
||||
if schemeID == "aws.auth#sigv4" {
|
||||
smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr)
|
||||
} else if schemeID == "aws.auth#sigv4a" {
|
||||
smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr})
|
||||
}
|
||||
}
|
||||
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
|
||||
func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error {
|
||||
return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before)
|
||||
}
|
||||
|
||||
// AuthResolverParameters contains the set of inputs necessary for auth scheme
|
||||
// resolution.
|
||||
type AuthResolverParameters struct {
|
||||
// The name of the operation being invoked.
|
||||
Operation string
|
||||
|
||||
// The region in which the operation is being invoked.
|
||||
Region string
|
||||
}
|
||||
|
||||
func bindAuthResolverParams(operation string, input interface{}, options Options) *AuthResolverParameters {
|
||||
params := &AuthResolverParameters{
|
||||
Operation: operation,
|
||||
}
|
||||
|
||||
bindAuthParamsRegion(params, input, options)
|
||||
|
||||
return params
|
||||
}
|
||||
|
||||
// AuthSchemeResolver returns a set of possible authentication options for an
|
||||
// operation.
|
||||
type AuthSchemeResolver interface {
|
||||
ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error)
|
||||
}
|
||||
|
||||
type defaultAuthSchemeResolver struct{}
|
||||
|
||||
var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil)
|
||||
|
||||
func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) {
|
||||
if overrides, ok := operationAuthOptions[params.Operation]; ok {
|
||||
return overrides(params), nil
|
||||
}
|
||||
return serviceAuthOptions(params), nil
|
||||
}
|
||||
|
||||
var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{
|
||||
"AssumeRoleWithSAML": func(params *AuthResolverParameters) []*smithyauth.Option {
|
||||
return []*smithyauth.Option{
|
||||
{
|
||||
SchemeID: smithyauth.SchemeIDSigV4,
|
||||
SignerProperties: func() smithy.Properties {
|
||||
var props smithy.Properties
|
||||
smithyhttp.SetSigV4SigningName(&props, "sts")
|
||||
smithyhttp.SetSigV4SigningRegion(&props, params.Region)
|
||||
|
||||
return props
|
||||
}(),
|
||||
},
|
||||
|
||||
{SchemeID: smithyauth.SchemeIDAnonymous},
|
||||
}
|
||||
},
|
||||
|
||||
"AssumeRoleWithWebIdentity": func(params *AuthResolverParameters) []*smithyauth.Option {
|
||||
return []*smithyauth.Option{
|
||||
{
|
||||
SchemeID: smithyauth.SchemeIDSigV4,
|
||||
SignerProperties: func() smithy.Properties {
|
||||
var props smithy.Properties
|
||||
smithyhttp.SetSigV4SigningName(&props, "sts")
|
||||
smithyhttp.SetSigV4SigningRegion(&props, params.Region)
|
||||
|
||||
return props
|
||||
}(),
|
||||
},
|
||||
|
||||
{SchemeID: smithyauth.SchemeIDAnonymous},
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option {
|
||||
return []*smithyauth.Option{
|
||||
{
|
||||
SchemeID: smithyauth.SchemeIDSigV4,
|
||||
SignerProperties: func() smithy.Properties {
|
||||
var props smithy.Properties
|
||||
smithyhttp.SetSigV4SigningName(&props, "sts")
|
||||
smithyhttp.SetSigV4SigningRegion(&props, params.Region)
|
||||
return props
|
||||
}(),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
type resolveAuthSchemeMiddleware struct {
|
||||
operation string
|
||||
options Options
|
||||
}
|
||||
|
||||
func (*resolveAuthSchemeMiddleware) ID() string {
|
||||
return "ResolveAuthScheme"
|
||||
}
|
||||
|
||||
func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (
|
||||
out middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
params := bindAuthResolverParams(m.operation, getOperationInput(ctx), m.options)
|
||||
options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params)
|
||||
if err != nil {
|
||||
return out, metadata, fmt.Errorf("resolve auth scheme: %v", err)
|
||||
}
|
||||
|
||||
scheme, ok := m.selectScheme(options)
|
||||
if !ok {
|
||||
return out, metadata, fmt.Errorf("could not select an auth scheme")
|
||||
}
|
||||
|
||||
ctx = setResolvedAuthScheme(ctx, scheme)
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
|
||||
func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) {
|
||||
for _, option := range options {
|
||||
if option.SchemeID == smithyauth.SchemeIDAnonymous {
|
||||
return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true
|
||||
}
|
||||
|
||||
for _, scheme := range m.options.AuthSchemes {
|
||||
if scheme.SchemeID() != option.SchemeID {
|
||||
continue
|
||||
}
|
||||
|
||||
if scheme.IdentityResolver(m.options) != nil {
|
||||
return newResolvedAuthScheme(scheme, option), true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil, false
|
||||
}
|
||||
|
||||
type resolvedAuthSchemeKey struct{}
|
||||
|
||||
type resolvedAuthScheme struct {
|
||||
Scheme smithyhttp.AuthScheme
|
||||
IdentityProperties smithy.Properties
|
||||
SignerProperties smithy.Properties
|
||||
}
|
||||
|
||||
func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme {
|
||||
return &resolvedAuthScheme{
|
||||
Scheme: scheme,
|
||||
IdentityProperties: option.IdentityProperties,
|
||||
SignerProperties: option.SignerProperties,
|
||||
}
|
||||
}
|
||||
|
||||
func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context {
|
||||
return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme)
|
||||
}
|
||||
|
||||
func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme {
|
||||
v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme)
|
||||
return v
|
||||
}
|
||||
|
||||
type getIdentityMiddleware struct {
|
||||
options Options
|
||||
}
|
||||
|
||||
func (*getIdentityMiddleware) ID() string {
|
||||
return "GetIdentity"
|
||||
}
|
||||
|
||||
func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (
|
||||
out middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
rscheme := getResolvedAuthScheme(ctx)
|
||||
if rscheme == nil {
|
||||
return out, metadata, fmt.Errorf("no resolved auth scheme")
|
||||
}
|
||||
|
||||
resolver := rscheme.Scheme.IdentityResolver(m.options)
|
||||
if resolver == nil {
|
||||
return out, metadata, fmt.Errorf("no identity resolver")
|
||||
}
|
||||
|
||||
identity, err := resolver.GetIdentity(ctx, rscheme.IdentityProperties)
|
||||
if err != nil {
|
||||
return out, metadata, fmt.Errorf("get identity: %v", err)
|
||||
}
|
||||
|
||||
ctx = setIdentity(ctx, identity)
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
|
||||
type identityKey struct{}
|
||||
|
||||
func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context {
|
||||
return middleware.WithStackValue(ctx, identityKey{}, identity)
|
||||
}
|
||||
|
||||
func getIdentity(ctx context.Context) smithyauth.Identity {
|
||||
v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity)
|
||||
return v
|
||||
}
|
||||
|
||||
type signRequestMiddleware struct {
|
||||
}
|
||||
|
||||
func (*signRequestMiddleware) ID() string {
|
||||
return "Signing"
|
||||
}
|
||||
|
||||
func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (
|
||||
out middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
req, ok := in.Request.(*smithyhttp.Request)
|
||||
if !ok {
|
||||
return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request)
|
||||
}
|
||||
|
||||
rscheme := getResolvedAuthScheme(ctx)
|
||||
if rscheme == nil {
|
||||
return out, metadata, fmt.Errorf("no resolved auth scheme")
|
||||
}
|
||||
|
||||
identity := getIdentity(ctx)
|
||||
if identity == nil {
|
||||
return out, metadata, fmt.Errorf("no identity")
|
||||
}
|
||||
|
||||
signer := rscheme.Scheme.Signer()
|
||||
if signer == nil {
|
||||
return out, metadata, fmt.Errorf("no signer")
|
||||
}
|
||||
|
||||
if err := signer.SignRequest(ctx, req, identity, rscheme.SignerProperties); err != nil {
|
||||
return out, metadata, fmt.Errorf("sign request: %v", err)
|
||||
}
|
||||
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
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)
|
||||
}
|
||||
|
3
vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json
generated
vendored
@ -3,6 +3,7 @@
|
||||
"github.com/aws/aws-sdk-go-v2": "v1.4.0",
|
||||
"github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000",
|
||||
"github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000",
|
||||
"github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding": "v1.0.5",
|
||||
"github.com/aws/aws-sdk-go-v2/service/internal/presigned-url": "v1.0.7",
|
||||
"github.com/aws/smithy-go": "v1.4.0",
|
||||
"github.com/google/go-cmp": "v0.5.4"
|
||||
@ -18,6 +19,7 @@
|
||||
"api_op_GetCallerIdentity.go",
|
||||
"api_op_GetFederationToken.go",
|
||||
"api_op_GetSessionToken.go",
|
||||
"auth.go",
|
||||
"deserializers.go",
|
||||
"doc.go",
|
||||
"endpoints.go",
|
||||
@ -26,6 +28,7 @@
|
||||
"generated.json",
|
||||
"internal/endpoints/endpoints.go",
|
||||
"internal/endpoints/endpoints_test.go",
|
||||
"options.go",
|
||||
"protocol_test.go",
|
||||
"serializers.go",
|
||||
"types/errors.go",
|
||||
|
2
vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go
generated
vendored
2
vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go
generated
vendored
@ -3,4 +3,4 @@
|
||||
package sts
|
||||
|
||||
// goModuleVersion is the tagged release for this module
|
||||
const goModuleVersion = "1.25.1"
|
||||
const goModuleVersion = "1.25.3"
|
||||
|
219
vendor/github.com/aws/aws-sdk-go-v2/service/sts/options.go
generated
vendored
Normal file
219
vendor/github.com/aws/aws-sdk-go-v2/service/sts/options.go
generated
vendored
Normal file
@ -0,0 +1,219 @@
|
||||
// Code generated by smithy-go-codegen DO NOT EDIT.
|
||||
|
||||
package sts
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy"
|
||||
smithyauth "github.com/aws/smithy-go/auth"
|
||||
"github.com/aws/smithy-go/logging"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type HTTPClient interface {
|
||||
Do(*http.Request) (*http.Response, error)
|
||||
}
|
||||
|
||||
type Options struct {
|
||||
// Set of options to modify how an operation is invoked. These apply to all
|
||||
// operations invoked for this client. Use functional options on operation call to
|
||||
// modify this list for per operation behavior.
|
||||
APIOptions []func(*middleware.Stack) error
|
||||
|
||||
// The optional application specific identifier appended to the User-Agent header.
|
||||
AppID string
|
||||
|
||||
// This endpoint will be given as input to an EndpointResolverV2. It is used for
|
||||
// providing a custom base endpoint that is subject to modifications by the
|
||||
// processing EndpointResolverV2.
|
||||
BaseEndpoint *string
|
||||
|
||||
// Configures the events that will be sent to the configured logger.
|
||||
ClientLogMode aws.ClientLogMode
|
||||
|
||||
// The credentials object to use when signing requests.
|
||||
Credentials aws.CredentialsProvider
|
||||
|
||||
// The configuration DefaultsMode that the SDK should use when constructing the
|
||||
// clients initial default settings.
|
||||
DefaultsMode aws.DefaultsMode
|
||||
|
||||
// The endpoint options to be used when attempting to resolve an endpoint.
|
||||
EndpointOptions EndpointResolverOptions
|
||||
|
||||
// The service endpoint resolver.
|
||||
//
|
||||
// Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. 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 operation. This should be
|
||||
// used over the deprecated EndpointResolver.
|
||||
EndpointResolverV2 EndpointResolverV2
|
||||
|
||||
// Signature Version 4 (SigV4) Signer
|
||||
HTTPSignerV4 HTTPSignerV4
|
||||
|
||||
// The logger writer interface to write logging messages to.
|
||||
Logger logging.Logger
|
||||
|
||||
// The region to send requests to. (Required)
|
||||
Region string
|
||||
|
||||
// RetryMaxAttempts specifies the maximum number attempts an API client will call
|
||||
// an operation that fails with a retryable error. A value of 0 is ignored, and
|
||||
// will not be used to configure the API client created default retryer, or modify
|
||||
// per operation call's retry max attempts. When creating a new API Clients this
|
||||
// member will only be used if the Retryer Options member is nil. This value will
|
||||
// be ignored if Retryer is not nil. If specified in an operation call's functional
|
||||
// options with a value that is different than the constructed client's Options,
|
||||
// the Client's Retryer will be wrapped to use the operation's specific
|
||||
// RetryMaxAttempts value.
|
||||
RetryMaxAttempts int
|
||||
|
||||
// RetryMode specifies the retry mode the API client will be created with, if
|
||||
// Retryer option is not also specified. When creating a new API Clients this
|
||||
// member will only be used if the Retryer Options member is nil. This value will
|
||||
// be ignored if Retryer is not nil. Currently does not support per operation call
|
||||
// overrides, may in the future.
|
||||
RetryMode aws.RetryMode
|
||||
|
||||
// Retryer guides how HTTP requests should be retried in case of recoverable
|
||||
// failures. When nil the API client will use a default retryer. The kind of
|
||||
// default retry created by the API client can be changed with the RetryMode
|
||||
// option.
|
||||
Retryer aws.Retryer
|
||||
|
||||
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
|
||||
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You
|
||||
// should not populate this structure programmatically, or rely on the values here
|
||||
// within your applications.
|
||||
RuntimeEnvironment aws.RuntimeEnvironment
|
||||
|
||||
// The initial DefaultsMode used when the client options were constructed. If the
|
||||
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
|
||||
// value was at that point in time. Currently does not support per operation call
|
||||
// overrides, may in the future.
|
||||
resolvedDefaultsMode aws.DefaultsMode
|
||||
|
||||
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
|
||||
// implementation if nil.
|
||||
HTTPClient HTTPClient
|
||||
|
||||
// The auth scheme resolver which determines how to authenticate for each
|
||||
// operation.
|
||||
AuthSchemeResolver AuthSchemeResolver
|
||||
|
||||
// The list of auth schemes supported by the client.
|
||||
AuthSchemes []smithyhttp.AuthScheme
|
||||
}
|
||||
|
||||
// Copy creates a clone where the APIOptions list is deep copied.
|
||||
func (o Options) Copy() Options {
|
||||
to := o
|
||||
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
|
||||
copy(to.APIOptions, o.APIOptions)
|
||||
|
||||
return to
|
||||
}
|
||||
|
||||
func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver {
|
||||
if schemeID == "aws.auth#sigv4" {
|
||||
return getSigV4IdentityResolver(o)
|
||||
}
|
||||
if schemeID == "smithy.api#noAuth" {
|
||||
return &smithyauth.AnonymousIdentityResolver{}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// WithAPIOptions returns a functional option for setting the Client's APIOptions
|
||||
// option.
|
||||
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
|
||||
return func(o *Options) {
|
||||
o.APIOptions = append(o.APIOptions, optFns...)
|
||||
}
|
||||
}
|
||||
|
||||
// Deprecated: EndpointResolver and WithEndpointResolver. 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
|
||||
}
|
||||
}
|
||||
|
||||
// WithEndpointResolverV2 returns a functional option for setting the Client's
|
||||
// EndpointResolverV2 option.
|
||||
func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) {
|
||||
return func(o *Options) {
|
||||
o.EndpointResolverV2 = v
|
||||
}
|
||||
}
|
||||
|
||||
func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver {
|
||||
if o.Credentials != nil {
|
||||
return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// WithSigV4SigningName applies an override to the authentication workflow to
|
||||
// use the given signing name for SigV4-authenticated operations.
|
||||
//
|
||||
// This is an advanced setting. The value here is FINAL, taking precedence over
|
||||
// the resolved signing name from both auth scheme resolution and endpoint
|
||||
// resolution.
|
||||
func WithSigV4SigningName(name string) func(*Options) {
|
||||
fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
|
||||
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in)
|
||||
}
|
||||
return func(o *Options) {
|
||||
o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error {
|
||||
return s.Initialize.Add(
|
||||
middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn),
|
||||
middleware.Before,
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// WithSigV4SigningRegion applies an override to the authentication workflow to
|
||||
// use the given signing region for SigV4-authenticated operations.
|
||||
//
|
||||
// This is an advanced setting. The value here is FINAL, taking precedence over
|
||||
// the resolved signing region from both auth scheme resolution and endpoint
|
||||
// resolution.
|
||||
func WithSigV4SigningRegion(region string) func(*Options) {
|
||||
fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
|
||||
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in)
|
||||
}
|
||||
return func(o *Options) {
|
||||
o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error {
|
||||
return s.Initialize.Add(
|
||||
middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn),
|
||||
middleware.Before,
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func ignoreAnonymousAuth(options *Options) {
|
||||
if _, ok := options.Credentials.(aws.AnonymousCredentials); ok {
|
||||
options.Credentials = nil
|
||||
}
|
||||
}
|
10
vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/types.go
generated
vendored
10
vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/types.go
generated
vendored
@ -89,13 +89,17 @@ type PolicyDescriptorType struct {
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
// Reserved for future use.
|
||||
// Contains information about the provided context. This includes the signed and
|
||||
// encrypted trusted context assertion and the context provider ARN from which the
|
||||
// trusted context assertion was generated.
|
||||
type ProvidedContext struct {
|
||||
|
||||
// Reserved for future use.
|
||||
// The signed and encrypted trusted context assertion generated by the context
|
||||
// provider. The trusted context assertion is signed and encrypted by Amazon Web
|
||||
// Services STS.
|
||||
ContextAssertion *string
|
||||
|
||||
// Reserved for future use.
|
||||
// The context provider ARN from which the trusted context assertion was generated.
|
||||
ProviderArn *string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
|
Reference in New Issue
Block a user