From 420da52983aee529efa65220863c49f7a61fce06 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Tue, 25 Jan 2022 15:59:23 -0800 Subject: [PATCH 1/4] Removes unused test parts --- aws_config_test.go | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/aws_config_test.go b/aws_config_test.go index e510de76..7d7c5a1b 100644 --- a/aws_config_test.go +++ b/aws_config_test.go @@ -41,7 +41,6 @@ func TestGetAwsConfig(t *testing.T) { EnvironmentVariables map[string]string ExpectedCredentialsValue aws.Credentials ExpectedRegion string - ExpectedUserAgent string ExpectedError func(err error) bool MockStsEndpoints []*servicemocks.MockEndpoint SharedConfigurationFile string @@ -942,24 +941,6 @@ source_profile = SourceSharedCredentials if expected, actual := testCase.ExpectedRegion, awsConfig.Region; expected != actual { t.Fatalf("expected region (%s), got: %s", expected, actual) } - - // if testCase.ExpectedUserAgent != "" { - // clientInfo := metadata.ClientInfo{ - // Endpoint: "http://endpoint", - // SigningName: "", - // } - // conn := client.New(*actualSession.Config, clientInfo, actualSession.Handlers) - - // req := conn.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) - - // if err := req.Build(); err != nil { - // t.Fatalf("expect no Request.Build() error, got %s", err) - // } - - // if e, a := testCase.ExpectedUserAgent, req.HTTPRequest.Header.Get("User-Agent"); e != a { - // t.Errorf("expected User-Agent (%s), got: %s", e, a) - // } - // } }) } } From e35db6671c860de5e65b7e1ab607d61f81759cba Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Tue, 25 Jan 2022 16:32:45 -0800 Subject: [PATCH 2/4] Updates dependencies --- aws_config.go | 2 +- endpoints.go | 6 +++--- go.mod | 16 ++++++++-------- go.sum | 26 ++++++++++++++++++++++++++ mockdata/mocks.go | 2 +- v2/awsv1shim/go.mod | 6 +++--- v2/awsv1shim/go.sum | 29 +++++++++++++++++++++++++++++ 7 files changed, 71 insertions(+), 16 deletions(-) diff --git a/aws_config.go b/aws_config.go index 682a56ce..b8fcd8aa 100644 --- a/aws_config.go +++ b/aws_config.go @@ -147,7 +147,7 @@ func commonLoadOptions(c *Config) ([]func(*config.LoadOptions) error, error) { loadOptions := []func(*config.LoadOptions) error{ config.WithRegion(c.Region), - config.WithEndpointResolver(endpointResolver(c)), + config.WithEndpointResolverWithOptions(endpointResolver(c)), config.WithHTTPClient(httpClient), config.WithAPIOptions(apiOptions), } diff --git a/endpoints.go b/endpoints.go index 0b61f587..12513aa6 100644 --- a/endpoints.go +++ b/endpoints.go @@ -8,8 +8,8 @@ import ( "github.com/aws/aws-sdk-go-v2/service/sts" ) -func endpointResolver(c *Config) aws.EndpointResolver { - resolver := func(service, region string) (aws.Endpoint, error) { +func endpointResolver(c *Config) aws.EndpointResolverWithOptions { + resolver := func(service, region string, options ...interface{}) (aws.Endpoint, error) { log.Printf("[DEBUG] Resolving endpoint for %q in %q", service, region) switch service { case iam.ServiceID: @@ -33,5 +33,5 @@ func endpointResolver(c *Config) aws.EndpointResolver { return aws.Endpoint{}, &aws.EndpointNotFoundError{} } - return aws.EndpointResolverFunc(resolver) + return aws.EndpointResolverWithOptionsFunc(resolver) } diff --git a/go.mod b/go.mod index ea70f858..9fa4955d 100644 --- a/go.mod +++ b/go.mod @@ -1,14 +1,14 @@ module github.com/hashicorp/aws-sdk-go-base/v2 require ( - github.com/aws/aws-sdk-go-v2 v1.9.0 - github.com/aws/aws-sdk-go-v2/config v1.7.0 - github.com/aws/aws-sdk-go-v2/credentials v1.4.0 - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.5.0 - github.com/aws/aws-sdk-go-v2/service/iam v1.9.0 - github.com/aws/aws-sdk-go-v2/service/sts v1.7.0 - github.com/aws/smithy-go v1.8.0 - github.com/google/go-cmp v0.5.6 + github.com/aws/aws-sdk-go-v2 v1.13.0 + github.com/aws/aws-sdk-go-v2/config v1.13.0 + github.com/aws/aws-sdk-go-v2/credentials v1.8.0 + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.10.0 + github.com/aws/aws-sdk-go-v2/service/iam v1.16.0 + github.com/aws/aws-sdk-go-v2/service/sts v1.14.0 + github.com/aws/smithy-go v1.10.0 + github.com/google/go-cmp v0.5.7 github.com/hashicorp/go-cleanhttp v0.5.2 github.com/hashicorp/go-multierror v1.1.1 ) diff --git a/go.sum b/go.sum index 29aac69e..e3c96a8e 100644 --- a/go.sum +++ b/go.sum @@ -1,27 +1,53 @@ github.com/aws/aws-sdk-go-v2 v1.9.0 h1:+S+dSqQCN3MSU5vJRu1HqHrq00cJn6heIMU7X9hcsoo= github.com/aws/aws-sdk-go-v2 v1.9.0/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= +github.com/aws/aws-sdk-go-v2 v1.13.0 h1:1XIXAfxsEmbhbj5ry3D3vX+6ZcUYvIqSm4CWWEuGZCA= +github.com/aws/aws-sdk-go-v2 v1.13.0/go.mod h1:L6+ZpqHaLbAaxsqV0L4cvxZY7QupWJB4fhkf8LXvC7w= github.com/aws/aws-sdk-go-v2/config v1.7.0 h1:J2cZ7qe+3IpqBEXnHUrFrOjoB9BlsXg7j53vxcl5IVg= github.com/aws/aws-sdk-go-v2/config v1.7.0/go.mod h1:w9+nMZ7soXCe5nT46Ri354SNhXDQ6v+V5wqDjnZE+GY= +github.com/aws/aws-sdk-go-v2/config v1.13.0 h1:1ij3YPk13RrIn1h+pH+dArh3lNPD5JSAP+ifOkNhnB0= +github.com/aws/aws-sdk-go-v2/config v1.13.0/go.mod h1:Pjv2OafecIn+4miw9VFDCr06YhKyf/oKOkIcpQOgWKk= github.com/aws/aws-sdk-go-v2/credentials v1.4.0 h1:kmvesfjY861FzlCU9mvAfe01D9aeXcG2ZuC+k9F2YLM= github.com/aws/aws-sdk-go-v2/credentials v1.4.0/go.mod h1:dgGR+Qq7Wjcd4AOAW5Rf5Tnv3+x7ed6kETXyS9WCuAY= +github.com/aws/aws-sdk-go-v2/credentials v1.8.0 h1:8Ow0WcyDesGNL0No11jcgb1JAtE+WtubqXjgxau+S0o= +github.com/aws/aws-sdk-go-v2/credentials v1.8.0/go.mod h1:gnMo58Vwx3Mu7hj1wpcG8DI0s57c9o42UQ6wgTQT5to= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.5.0 h1:OxTAgH8Y4BXHD6PGCJ8DHx2kaZPCQfSTqmDsdRZFezE= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.5.0/go.mod h1:CpNzHK9VEFUCknu50kkB8z58AH2B5DvPP7ea1LHve/Y= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.10.0 h1:NITDuUZO34mqtOwFWZiXo7yAHj7kf+XPE+EiKuCBNUI= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.10.0/go.mod h1:I6/fHT/fH460v09eg2gVrd8B/IqskhNdpcLH0WNO3QI= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.4 h1:CRiQJ4E2RhfDdqbie1ZYDo8QtIo75Mk7oTdJSfwJTMQ= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.4/go.mod h1:XHgQ7Hz2WY2GAn//UXHofLfPXWh+s62MbMOijrg12Lw= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.2.0 h1:3ADoioDMOtF4uiK59vCpplpCwugEU+v4ZFD29jDL3RQ= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.2.0/go.mod h1:BsCSJHx5DnDXIrOcqB8KN1/B+hXLG/bi4Y6Vjcx/x9E= github.com/aws/aws-sdk-go-v2/internal/ini v1.2.2 h1:d95cddM3yTm4qffj3P6EnP+TzX1SSkWaQypXSgT/hpA= github.com/aws/aws-sdk-go-v2/internal/ini v1.2.2/go.mod h1:BQV0agm+JEhqR+2RT5e1XTFIDcAAV0eW6z2trp+iduw= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.4 h1:0NrDHIwS1LIR750ltj6ciiu4NZLpr9rgq8vHi/4QD4s= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.4/go.mod h1:R3sWUqPcfXSiF/LSFJhjyJmpg9uV6yP2yv3YZZjldVI= github.com/aws/aws-sdk-go-v2/service/iam v1.9.0 h1:PkrJTTEtdXtx+SF74QTQ0tPcVS1Vu9hghYfWx0SmBCw= github.com/aws/aws-sdk-go-v2/service/iam v1.9.0/go.mod h1:aDjZkXLwXAd6Rn1cbiWnkGYBKXUb9fXO8UED20HwCnw= +github.com/aws/aws-sdk-go-v2/service/iam v1.16.0 h1:A4sCxN1jRqmF90FXjYpai1H4z2jeii4USIh12PAv9VQ= +github.com/aws/aws-sdk-go-v2/service/iam v1.16.0/go.mod h1:Nz3L2VG2bK1gJqZejQpBNpMHORGHre5GRAC2v8v8ZDM= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.0 h1:VNJ5NLBteVXEwE2F1zEXVmyIH58mZ6kIQGJoC7C+vkg= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.0/go.mod h1:R1KK+vY8AfalhG1AOu5e35pOD2SdoPKQCFLTvnxiohk= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.7.0 h1:4QAOB3KrvI1ApJK14sliGr3Ie2pjyvNypn/lfzDHfUw= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.7.0/go.mod h1:K/qPe6AP2TGYv4l6n7c88zh9jWBDf6nHhvg1fx/EWfU= github.com/aws/aws-sdk-go-v2/service/sso v1.4.0 h1:sHXMIKYS6YiLPzmKSvDpPmOpJDHxmAUgbiF49YNVztg= github.com/aws/aws-sdk-go-v2/service/sso v1.4.0/go.mod h1:+1fpWnL96DL23aXPpMGbsmKe8jLTEfbjuQoA4WS1VaA= +github.com/aws/aws-sdk-go-v2/service/sso v1.9.0 h1:1qLJeQGBmNQW3mBNzK2CFmrQNmoXWrscPqsrAaU1aTA= +github.com/aws/aws-sdk-go-v2/service/sso v1.9.0/go.mod h1:vCV4glupK3tR7pw7ks7Y4jYRL86VvxS+g5qk04YeWrU= github.com/aws/aws-sdk-go-v2/service/sts v1.7.0 h1:1at4e5P+lvHNl2nUktdM2/v+rpICg/QSEr9TO/uW9vU= github.com/aws/aws-sdk-go-v2/service/sts v1.7.0/go.mod h1:0qcSMCyASQPN2sk/1KQLQ2Fh6yq8wm0HSDAimPhzCoM= +github.com/aws/aws-sdk-go-v2/service/sts v1.14.0 h1:ksiDXhvNYg0D2/UFkLejsaz3LqpW5yjNQ8Nx9Sn2c0E= +github.com/aws/aws-sdk-go-v2/service/sts v1.14.0/go.mod h1:u0xMJKDvvfocRjiozsoZglVNXRG19043xzp3r2ivLIk= github.com/aws/smithy-go v1.8.0 h1:AEwwwXQZtUwP5Mz506FeXXrKBe0jA8gVM+1gEcSRooc= github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= +github.com/aws/smithy-go v1.10.0 h1:gsoZQMNHnX+PaghNw4ynPsyGP7aUCqx5sY2dlPQsZ0w= +github.com/aws/smithy-go v1.10.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= diff --git a/mockdata/mocks.go b/mockdata/mocks.go index 852aff8c..b37e6ba1 100644 --- a/mockdata/mocks.go +++ b/mockdata/mocks.go @@ -19,7 +19,7 @@ func GetMockedAwsApiSession(svcName string, endpoints []*servicemocks.MockEndpoi awsConfig := aws.Config{ Credentials: sc, Region: "us-east-1", - EndpointResolver: aws.EndpointResolverFunc(func(service, region string) (aws.Endpoint, error) { + EndpointResolverWithOptions: aws.EndpointResolverWithOptionsFunc(func(service, region string, options ...interface{}) (aws.Endpoint, error) { return aws.Endpoint{ URL: ts.URL, Source: aws.EndpointSourceCustom, diff --git a/v2/awsv1shim/go.mod b/v2/awsv1shim/go.mod index 15cbaa6b..1b17f2dd 100644 --- a/v2/awsv1shim/go.mod +++ b/v2/awsv1shim/go.mod @@ -1,9 +1,9 @@ module github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2 require ( - github.com/aws/aws-sdk-go v1.40.43 - github.com/aws/aws-sdk-go-v2 v1.9.0 - github.com/google/go-cmp v0.5.6 + github.com/aws/aws-sdk-go v1.42.41 + github.com/aws/aws-sdk-go-v2 v1.13.0 + github.com/google/go-cmp v0.5.7 github.com/hashicorp/aws-sdk-go-base/v2 v2.0.0-beta.3 ) diff --git a/v2/awsv1shim/go.sum b/v2/awsv1shim/go.sum index c20c8b33..f090fdbc 100644 --- a/v2/awsv1shim/go.sum +++ b/v2/awsv1shim/go.sum @@ -1,30 +1,58 @@ github.com/aws/aws-sdk-go v1.40.43 h1:froMtO2//9kCu1sK+dOfAcwxUu91p5KgUP4AL7SDwUQ= github.com/aws/aws-sdk-go v1.40.43/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= +github.com/aws/aws-sdk-go v1.42.41 h1:gmHgDzSiLYfHx0ZedcXtHjMXbVxBtyOcl/sy0wg9o2o= +github.com/aws/aws-sdk-go v1.42.41/go.mod h1:OGr6lGMAKGlG9CVrYnWYDKIyb829c6EVBRjxqjmPepc= github.com/aws/aws-sdk-go-v2 v1.9.0 h1:+S+dSqQCN3MSU5vJRu1HqHrq00cJn6heIMU7X9hcsoo= github.com/aws/aws-sdk-go-v2 v1.9.0/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= +github.com/aws/aws-sdk-go-v2 v1.13.0 h1:1XIXAfxsEmbhbj5ry3D3vX+6ZcUYvIqSm4CWWEuGZCA= +github.com/aws/aws-sdk-go-v2 v1.13.0/go.mod h1:L6+ZpqHaLbAaxsqV0L4cvxZY7QupWJB4fhkf8LXvC7w= github.com/aws/aws-sdk-go-v2/config v1.7.0 h1:J2cZ7qe+3IpqBEXnHUrFrOjoB9BlsXg7j53vxcl5IVg= github.com/aws/aws-sdk-go-v2/config v1.7.0/go.mod h1:w9+nMZ7soXCe5nT46Ri354SNhXDQ6v+V5wqDjnZE+GY= +github.com/aws/aws-sdk-go-v2/config v1.13.0 h1:1ij3YPk13RrIn1h+pH+dArh3lNPD5JSAP+ifOkNhnB0= +github.com/aws/aws-sdk-go-v2/config v1.13.0/go.mod h1:Pjv2OafecIn+4miw9VFDCr06YhKyf/oKOkIcpQOgWKk= github.com/aws/aws-sdk-go-v2/credentials v1.4.0 h1:kmvesfjY861FzlCU9mvAfe01D9aeXcG2ZuC+k9F2YLM= github.com/aws/aws-sdk-go-v2/credentials v1.4.0/go.mod h1:dgGR+Qq7Wjcd4AOAW5Rf5Tnv3+x7ed6kETXyS9WCuAY= +github.com/aws/aws-sdk-go-v2/credentials v1.8.0 h1:8Ow0WcyDesGNL0No11jcgb1JAtE+WtubqXjgxau+S0o= +github.com/aws/aws-sdk-go-v2/credentials v1.8.0/go.mod h1:gnMo58Vwx3Mu7hj1wpcG8DI0s57c9o42UQ6wgTQT5to= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.5.0 h1:OxTAgH8Y4BXHD6PGCJ8DHx2kaZPCQfSTqmDsdRZFezE= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.5.0/go.mod h1:CpNzHK9VEFUCknu50kkB8z58AH2B5DvPP7ea1LHve/Y= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.10.0 h1:NITDuUZO34mqtOwFWZiXo7yAHj7kf+XPE+EiKuCBNUI= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.10.0/go.mod h1:I6/fHT/fH460v09eg2gVrd8B/IqskhNdpcLH0WNO3QI= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.4 h1:CRiQJ4E2RhfDdqbie1ZYDo8QtIo75Mk7oTdJSfwJTMQ= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.4/go.mod h1:XHgQ7Hz2WY2GAn//UXHofLfPXWh+s62MbMOijrg12Lw= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.2.0 h1:3ADoioDMOtF4uiK59vCpplpCwugEU+v4ZFD29jDL3RQ= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.2.0/go.mod h1:BsCSJHx5DnDXIrOcqB8KN1/B+hXLG/bi4Y6Vjcx/x9E= github.com/aws/aws-sdk-go-v2/internal/ini v1.2.2 h1:d95cddM3yTm4qffj3P6EnP+TzX1SSkWaQypXSgT/hpA= github.com/aws/aws-sdk-go-v2/internal/ini v1.2.2/go.mod h1:BQV0agm+JEhqR+2RT5e1XTFIDcAAV0eW6z2trp+iduw= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.4 h1:0NrDHIwS1LIR750ltj6ciiu4NZLpr9rgq8vHi/4QD4s= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.4/go.mod h1:R3sWUqPcfXSiF/LSFJhjyJmpg9uV6yP2yv3YZZjldVI= github.com/aws/aws-sdk-go-v2/service/iam v1.9.0 h1:PkrJTTEtdXtx+SF74QTQ0tPcVS1Vu9hghYfWx0SmBCw= github.com/aws/aws-sdk-go-v2/service/iam v1.9.0/go.mod h1:aDjZkXLwXAd6Rn1cbiWnkGYBKXUb9fXO8UED20HwCnw= +github.com/aws/aws-sdk-go-v2/service/iam v1.16.0 h1:A4sCxN1jRqmF90FXjYpai1H4z2jeii4USIh12PAv9VQ= +github.com/aws/aws-sdk-go-v2/service/iam v1.16.0/go.mod h1:Nz3L2VG2bK1gJqZejQpBNpMHORGHre5GRAC2v8v8ZDM= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.0 h1:VNJ5NLBteVXEwE2F1zEXVmyIH58mZ6kIQGJoC7C+vkg= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.0/go.mod h1:R1KK+vY8AfalhG1AOu5e35pOD2SdoPKQCFLTvnxiohk= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.7.0 h1:4QAOB3KrvI1ApJK14sliGr3Ie2pjyvNypn/lfzDHfUw= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.7.0/go.mod h1:K/qPe6AP2TGYv4l6n7c88zh9jWBDf6nHhvg1fx/EWfU= github.com/aws/aws-sdk-go-v2/service/sso v1.4.0 h1:sHXMIKYS6YiLPzmKSvDpPmOpJDHxmAUgbiF49YNVztg= github.com/aws/aws-sdk-go-v2/service/sso v1.4.0/go.mod h1:+1fpWnL96DL23aXPpMGbsmKe8jLTEfbjuQoA4WS1VaA= +github.com/aws/aws-sdk-go-v2/service/sso v1.9.0 h1:1qLJeQGBmNQW3mBNzK2CFmrQNmoXWrscPqsrAaU1aTA= +github.com/aws/aws-sdk-go-v2/service/sso v1.9.0/go.mod h1:vCV4glupK3tR7pw7ks7Y4jYRL86VvxS+g5qk04YeWrU= github.com/aws/aws-sdk-go-v2/service/sts v1.7.0 h1:1at4e5P+lvHNl2nUktdM2/v+rpICg/QSEr9TO/uW9vU= github.com/aws/aws-sdk-go-v2/service/sts v1.7.0/go.mod h1:0qcSMCyASQPN2sk/1KQLQ2Fh6yq8wm0HSDAimPhzCoM= +github.com/aws/aws-sdk-go-v2/service/sts v1.14.0 h1:ksiDXhvNYg0D2/UFkLejsaz3LqpW5yjNQ8Nx9Sn2c0E= +github.com/aws/aws-sdk-go-v2/service/sts v1.14.0/go.mod h1:u0xMJKDvvfocRjiozsoZglVNXRG19043xzp3r2ivLIk= github.com/aws/smithy-go v1.8.0 h1:AEwwwXQZtUwP5Mz506FeXXrKBe0jA8gVM+1gEcSRooc= github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= +github.com/aws/smithy-go v1.10.0 h1:gsoZQMNHnX+PaghNw4ynPsyGP7aUCqx5sY2dlPQsZ0w= +github.com/aws/smithy-go v1.10.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= @@ -40,6 +68,7 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= From faee4e36b3916a2f40e1599853926838486619d2 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 26 Jan 2022 13:04:17 -0800 Subject: [PATCH 3/4] Adds support for FIPS and DualStack endpoints --- aws_config.go | 12 ++ aws_config_test.go | 237 ++++++++++++++++++++++++++++++++ internal/awsconfig/resolvers.go | 68 +++++++++ internal/config/config.go | 2 + v2/awsv1shim/session.go | 46 ++++++- v2/awsv1shim/session_test.go | 216 +++++++++++++++++++++++++++++ 6 files changed, 576 insertions(+), 5 deletions(-) create mode 100644 internal/awsconfig/resolvers.go diff --git a/aws_config.go b/aws_config.go index b8fcd8aa..b6a16fa4 100644 --- a/aws_config.go +++ b/aws_config.go @@ -175,5 +175,17 @@ func commonLoadOptions(c *Config) ([]func(*config.LoadOptions) error, error) { os.Setenv("AWS_EC2_METADATA_DISABLED", "true") } + if c.UseDualStackEndpoint { + loadOptions = append(loadOptions, + config.WithUseDualStackEndpoint(aws.DualStackEndpointStateEnabled), + ) + } + + if c.UseFIPSEndpoint { + loadOptions = append(loadOptions, + config.WithUseFIPSEndpoint(aws.FIPSEndpointStateEnabled), + ) + } + return loadOptions, nil } diff --git a/aws_config_test.go b/aws_config_test.go index 7d7c5a1b..5583e371 100644 --- a/aws_config_test.go +++ b/aws_config_test.go @@ -21,6 +21,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" + "github.com/hashicorp/aws-sdk-go-base/v2/internal/awsconfig" "github.com/hashicorp/aws-sdk-go-base/v2/internal/constants" "github.com/hashicorp/aws-sdk-go-base/v2/mockdata" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" @@ -1184,6 +1185,242 @@ func fullValueTypeName(v reflect.Value) string { return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } +func TestServiceEndpointTypes(t *testing.T) { + testCases := map[string]struct { + Config *Config + EnvironmentVariables map[string]string + SharedConfigurationFile string + ExpectedUseFIPSEndpointState aws.FIPSEndpointState + ExpectedUseDualStackEndpointState aws.DualStackEndpointState + }{ + "normal endpoint": { + Config: &Config{ + AccessKey: servicemocks.MockStaticAccessKey, + Region: "us-east-1", + SecretKey: servicemocks.MockStaticSecretKey, + }, + ExpectedUseFIPSEndpointState: aws.FIPSEndpointStateUnset, + ExpectedUseDualStackEndpointState: aws.DualStackEndpointStateUnset, + }, + + // FIPS Endpoint + "FIPS endpoint config": { + Config: &Config{ + AccessKey: servicemocks.MockStaticAccessKey, + Region: "us-east-1", + SecretKey: servicemocks.MockStaticSecretKey, + UseFIPSEndpoint: true, + }, + ExpectedUseFIPSEndpointState: aws.FIPSEndpointStateEnabled, + }, + "FIPS endpoint envvar": { + Config: &Config{ + AccessKey: servicemocks.MockStaticAccessKey, + Region: "us-east-1", + SecretKey: servicemocks.MockStaticSecretKey, + }, + EnvironmentVariables: map[string]string{ + "AWS_USE_FIPS_ENDPOINT": "true", + }, + ExpectedUseFIPSEndpointState: aws.FIPSEndpointStateEnabled, + }, + "FIPS endpoint shared configuration file": { + Config: &Config{ + AccessKey: servicemocks.MockStaticAccessKey, + Region: "us-east-1", + SecretKey: servicemocks.MockStaticSecretKey, + }, + SharedConfigurationFile: ` +[default] +use_fips_endpoint = true +`, + ExpectedUseFIPSEndpointState: aws.FIPSEndpointStateEnabled, + }, + "FIPS endpoint config overrides env var": { + Config: &Config{ + AccessKey: servicemocks.MockStaticAccessKey, + Region: "us-east-1", + SecretKey: servicemocks.MockStaticSecretKey, + UseFIPSEndpoint: true, + }, + EnvironmentVariables: map[string]string{ + "AWS_USE_FIPS_ENDPOINT": "true", + }, + ExpectedUseFIPSEndpointState: aws.FIPSEndpointStateEnabled, + }, + "FIPS endpoint env var overrides shared configuration file": { + Config: &Config{ + AccessKey: servicemocks.MockStaticAccessKey, + Region: "us-east-1", + SecretKey: servicemocks.MockStaticSecretKey, + }, + EnvironmentVariables: map[string]string{ + "AWS_USE_FIPS_ENDPOINT": "true", + }, + SharedConfigurationFile: ` +[default] +use_fips_endpoint = false +`, + ExpectedUseFIPSEndpointState: aws.FIPSEndpointStateEnabled, + }, + + // DualStack Endpoint + "DualStack endpoint config": { + Config: &Config{ + AccessKey: servicemocks.MockStaticAccessKey, + Region: "us-east-1", + SecretKey: servicemocks.MockStaticSecretKey, + UseDualStackEndpoint: true, + }, + ExpectedUseDualStackEndpointState: aws.DualStackEndpointStateEnabled, + }, + "DualStack endpoint envvar": { + Config: &Config{ + AccessKey: servicemocks.MockStaticAccessKey, + Region: "us-east-1", + SecretKey: servicemocks.MockStaticSecretKey, + }, + EnvironmentVariables: map[string]string{ + "AWS_USE_DUALSTACK_ENDPOINT": "true", + }, + ExpectedUseDualStackEndpointState: aws.DualStackEndpointStateEnabled, + }, + "DualStack endpoint shared configuration file": { + Config: &Config{ + AccessKey: servicemocks.MockStaticAccessKey, + Region: "us-east-1", + SecretKey: servicemocks.MockStaticSecretKey, + }, + SharedConfigurationFile: ` +[default] +use_dualstack_endpoint = true +`, + ExpectedUseDualStackEndpointState: aws.DualStackEndpointStateEnabled, + }, + "DualStack endpoint config overrides env var": { + Config: &Config{ + AccessKey: servicemocks.MockStaticAccessKey, + Region: "us-east-1", + SecretKey: servicemocks.MockStaticSecretKey, + UseDualStackEndpoint: true, + }, + EnvironmentVariables: map[string]string{ + "AWS_USE_DUALSTACK_ENDPOINT": "true", + }, + ExpectedUseDualStackEndpointState: aws.DualStackEndpointStateEnabled, + }, + "DualStack endpoint env var overrides shared configuration file": { + Config: &Config{ + AccessKey: servicemocks.MockStaticAccessKey, + Region: "us-east-1", + SecretKey: servicemocks.MockStaticSecretKey, + }, + EnvironmentVariables: map[string]string{ + "AWS_USE_DUALSTACK_ENDPOINT": "true", + }, + SharedConfigurationFile: ` +[default] +use_dualstack_endpoint = false +`, + ExpectedUseDualStackEndpointState: aws.DualStackEndpointStateEnabled, + }, + + // FIPS and DualStack Endpoint + "Both endpoints config": { + Config: &Config{ + AccessKey: servicemocks.MockStaticAccessKey, + Region: "us-east-1", + SecretKey: servicemocks.MockStaticSecretKey, + UseDualStackEndpoint: true, + UseFIPSEndpoint: true, + }, + ExpectedUseFIPSEndpointState: aws.FIPSEndpointStateEnabled, + ExpectedUseDualStackEndpointState: aws.DualStackEndpointStateEnabled, + }, + "Both endpoints FIPS config DualStack envvar": { + Config: &Config{ + AccessKey: servicemocks.MockStaticAccessKey, + Region: "us-east-1", + SecretKey: servicemocks.MockStaticSecretKey, + UseFIPSEndpoint: true, + }, + EnvironmentVariables: map[string]string{ + "AWS_USE_DUALSTACK_ENDPOINT": "true", + }, + ExpectedUseFIPSEndpointState: aws.FIPSEndpointStateEnabled, + ExpectedUseDualStackEndpointState: aws.DualStackEndpointStateEnabled, + }, + "Both endpoints FIPS shared configuration file DualStack config": { + Config: &Config{ + AccessKey: servicemocks.MockStaticAccessKey, + Region: "us-east-1", + SecretKey: servicemocks.MockStaticSecretKey, + UseDualStackEndpoint: true, + }, + SharedConfigurationFile: ` +[default] +use_fips_endpoint = true +`, + ExpectedUseFIPSEndpointState: aws.FIPSEndpointStateEnabled, + ExpectedUseDualStackEndpointState: aws.DualStackEndpointStateEnabled, + }, + } + + for testName, testCase := range testCases { + testCase := testCase + + t.Run(testName, func(t *testing.T) { + oldEnv := servicemocks.InitSessionTestEnv() + defer servicemocks.PopEnv(oldEnv) + + for k, v := range testCase.EnvironmentVariables { + os.Setenv(k, v) + } + + if testCase.SharedConfigurationFile != "" { + file, err := ioutil.TempFile("", "aws-sdk-go-base-shared-configuration-file") + + if err != nil { + t.Fatalf("unexpected error creating temporary shared configuration file: %s", err) + } + + defer os.Remove(file.Name()) + + err = ioutil.WriteFile(file.Name(), []byte(testCase.SharedConfigurationFile), 0600) + + if err != nil { + t.Fatalf("unexpected error writing shared configuration file: %s", err) + } + + testCase.Config.SharedConfigFiles = []string{file.Name()} + } + + testCase.Config.SkipCredsValidation = true + + awsConfig, err := GetAwsConfig(context.Background(), testCase.Config) + if err != nil { + t.Fatalf("error in GetAwsConfig() '%[1]T': %[1]s", err) + } + + useFIPSState, _, err := awsconfig.ResolveUseFIPSEndpoint(context.Background(), awsConfig.ConfigSources) + if err != nil { + t.Fatalf("error in ResolveUseFIPSEndpoint: %s", err) + } + if a, e := useFIPSState, testCase.ExpectedUseFIPSEndpointState; a != e { + t.Errorf("expected UseFIPSEndpoint %q, got: %q", awsconfig.FIPSEndpointStateString(e), awsconfig.FIPSEndpointStateString(a)) + } + + useDualStackState, _, err := awsconfig.ResolveUseDualStackEndpoint(context.Background(), awsConfig.ConfigSources) + if err != nil { + t.Fatalf("error in ResolveUseDualStackEndpoint: %s", err) + } + if a, e := useDualStackState, testCase.ExpectedUseDualStackEndpointState; a != e { + t.Errorf("expected UseDualStackEndpoint %q, got: %q", awsconfig.DualStackEndpointStateString(e), awsconfig.DualStackEndpointStateString(a)) + } + }) + } +} + func TestGetAwsConfigWithAccountIDAndPartition(t *testing.T) { oldEnv := servicemocks.InitSessionTestEnv() defer servicemocks.PopEnv(oldEnv) diff --git a/internal/awsconfig/resolvers.go b/internal/awsconfig/resolvers.go new file mode 100644 index 00000000..9db92753 --- /dev/null +++ b/internal/awsconfig/resolvers.go @@ -0,0 +1,68 @@ +package awsconfig + +import ( + "context" + "fmt" + + "github.com/aws/aws-sdk-go-v2/aws" +) + +// Copied from https://github.com/aws/aws-sdk-go-v2/blob/main/internal/configsources/config.go +type UseFIPSEndpointProvider interface { + GetUseFIPSEndpoint(context.Context) (value aws.FIPSEndpointState, found bool, err error) +} + +// Copied from https://github.com/aws/aws-sdk-go-v2/blob/main/internal/configsources/config.go +func ResolveUseFIPSEndpoint(ctx context.Context, configSources []interface{}) (value aws.FIPSEndpointState, found bool, err error) { + for _, cfg := range configSources { + if p, ok := cfg.(UseFIPSEndpointProvider); ok { + value, found, err = p.GetUseFIPSEndpoint(ctx) + if err != nil || found { + break + } + } + } + return +} + +func FIPSEndpointStateString(state aws.FIPSEndpointState) string { + switch state { + case aws.FIPSEndpointStateUnset: + return "FIPSEndpointStateUnset" + case aws.FIPSEndpointStateEnabled: + return "FIPSEndpointStateEnabled" + case aws.FIPSEndpointStateDisabled: + return "FIPSEndpointStateDisabled" + } + return fmt.Sprintf("unknown aws.FIPSEndpointState (%d)", state) +} + +// Copied from https://github.com/aws/aws-sdk-go-v2/blob/main/internal/configsources/config.go +type UseDualStackEndpointProvider interface { + GetUseDualStackEndpoint(context.Context) (value aws.DualStackEndpointState, found bool, err error) +} + +// Copied from https://github.com/aws/aws-sdk-go-v2/blob/main/internal/configsources/config.go +func ResolveUseDualStackEndpoint(ctx context.Context, configSources []interface{}) (value aws.DualStackEndpointState, found bool, err error) { + for _, cfg := range configSources { + if p, ok := cfg.(UseDualStackEndpointProvider); ok { + value, found, err = p.GetUseDualStackEndpoint(ctx) + if err != nil || found { + break + } + } + } + return +} + +func DualStackEndpointStateString(state aws.DualStackEndpointState) string { + switch state { + case aws.DualStackEndpointStateUnset: + return "DualStackEndpointStateUnset" + case aws.DualStackEndpointStateEnabled: + return "DualStackEndpointStateEnabled" + case aws.DualStackEndpointStateDisabled: + return "DualStackEndpointStateDisabled" + } + return fmt.Sprintf("unknown aws.FIPSEndpointStateUnset (%d)", state) +} diff --git a/internal/config/config.go b/internal/config/config.go index 2bacf38d..0c4dac0e 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -22,6 +22,8 @@ type Config struct { SkipMetadataApiCheck bool StsEndpoint string Token string + UseDualStackEndpoint bool + UseFIPSEndpoint bool UserAgent UserAgentProducts } diff --git a/v2/awsv1shim/session.go b/v2/awsv1shim/session.go index 7d56281e..4485d055 100644 --- a/v2/awsv1shim/session.go +++ b/v2/awsv1shim/session.go @@ -10,10 +10,12 @@ import ( // nosemgrep: no-sdkv2-imports-in-awsv1shim awsv2 "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/aws/session" awsbase "github.com/hashicorp/aws-sdk-go-base/v2" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" + "github.com/hashicorp/aws-sdk-go-base/v2/internal/awsconfig" "github.com/hashicorp/aws-sdk-go-base/v2/internal/constants" "github.com/hashicorp/aws-sdk-go-base/v2/internal/httpclient" ) @@ -27,6 +29,16 @@ func getSessionOptions(awsC *awsv2.Config, c *awsbase.Config) (*session.Options, return nil, fmt.Errorf("error accessing credentials: %w", err) } + useFIPSEndpoint, _, err := awsconfig.ResolveUseFIPSEndpoint(context.Background(), awsC.ConfigSources) + if err != nil { + return nil, fmt.Errorf("error resolving configuration: %w", err) + } + + useDualStackEndpoint, _, err := awsconfig.ResolveUseDualStackEndpoint(context.Background(), awsC.ConfigSources) + if err != nil { + return nil, fmt.Errorf("error resolving configuration: %w", err) + } + httpClient, ok := awsC.HTTPClient.(*http.Client) if !ok { // This is unlikely, but technically possible httpClient, err = httpclient.DefaultHttpClient(c) @@ -41,14 +53,16 @@ func getSessionOptions(awsC *awsv2.Config, c *awsbase.Config) (*session.Options, creds.SecretAccessKey, creds.SessionToken, ), - EndpointResolver: endpointResolver(c), - HTTPClient: httpClient, - MaxRetries: aws.Int(0), - Region: aws.String(awsC.Region), + EndpointResolver: endpointResolver(c), + HTTPClient: httpClient, + MaxRetries: aws.Int(0), + Region: aws.String(awsC.Region), + UseFIPSEndpoint: convertFIPSEndpointState(useFIPSEndpoint), + UseDualStackEndpoint: convertDualStackEndpointState(useDualStackEndpoint), }, } - // This needs its own debugger. Don't reuse or wrap the AWS SDK for Go v2 logger, since it hardcodes the string "aws-sdk-go-v2" + // This needs its own debug logger. Don't reuse or wrap the AWS SDK for Go v2 logger, since it hardcodes the string "aws-sdk-go-v2" if c.DebugLogging { options.Config.LogLevel = aws.LogLevel(aws.LogDebugWithHTTPBody | aws.LogDebugWithRequestRetries | aws.LogDebugWithRequestErrors) options.Config.Logger = debugLogger{} @@ -125,3 +139,25 @@ func GetSession(awsC *awsv2.Config, c *awsbase.Config) (*session.Session, error) return sess, nil } + +func convertFIPSEndpointState(value awsv2.FIPSEndpointState) endpoints.FIPSEndpointState { + switch value { + case awsv2.FIPSEndpointStateEnabled: + return endpoints.FIPSEndpointStateEnabled + case awsv2.FIPSEndpointStateDisabled: + return endpoints.FIPSEndpointStateDisabled + default: + return endpoints.FIPSEndpointStateUnset + } +} + +func convertDualStackEndpointState(value awsv2.DualStackEndpointState) endpoints.DualStackEndpointState { + switch value { + case awsv2.DualStackEndpointStateEnabled: + return endpoints.DualStackEndpointStateEnabled + case awsv2.DualStackEndpointStateDisabled: + return endpoints.DualStackEndpointStateDisabled + default: + return endpoints.DualStackEndpointStateUnset + } +} diff --git a/v2/awsv1shim/session_test.go b/v2/awsv1shim/session_test.go index 6a70cc22..ccba041a 100644 --- a/v2/awsv1shim/session_test.go +++ b/v2/awsv1shim/session_test.go @@ -16,6 +16,7 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/service/iam" "github.com/google/go-cmp/cmp" @@ -1205,6 +1206,221 @@ func awsSdkGoUserAgent() string { return fmt.Sprintf("%s/%s (%s; %s; %s)", aws.SDKName, aws.SDKVersion, runtime.Version(), runtime.GOOS, runtime.GOARCH) } +func TestServiceEndpointTypes(t *testing.T) { + testCases := map[string]struct { + Config *awsbase.Config + EnvironmentVariables map[string]string + SharedConfigurationFile string + ExpectedUseFIPSEndpoint endpoints.FIPSEndpointState + ExpectedUseDualStackEndpoint endpoints.DualStackEndpointState + }{ + "normal endpoint": { + Config: &awsbase.Config{ + AccessKey: servicemocks.MockStaticAccessKey, + Region: "us-east-1", + SecretKey: servicemocks.MockStaticSecretKey, + }, + ExpectedUseFIPSEndpoint: endpoints.FIPSEndpointStateUnset, + ExpectedUseDualStackEndpoint: endpoints.DualStackEndpointStateUnset, + }, + + // FIPS Endpoint + "FIPS endpoint config": { + Config: &awsbase.Config{ + AccessKey: servicemocks.MockStaticAccessKey, + Region: "us-east-1", + SecretKey: servicemocks.MockStaticSecretKey, + UseFIPSEndpoint: true, + }, + ExpectedUseFIPSEndpoint: endpoints.FIPSEndpointStateEnabled, + }, + "FIPS endpoint envvar": { + Config: &awsbase.Config{ + AccessKey: servicemocks.MockStaticAccessKey, + Region: "us-east-1", + SecretKey: servicemocks.MockStaticSecretKey, + }, + EnvironmentVariables: map[string]string{ + "AWS_USE_FIPS_ENDPOINT": "true", + }, + ExpectedUseFIPSEndpoint: endpoints.FIPSEndpointStateEnabled, + }, + "FIPS endpoint shared configuration file": { + Config: &awsbase.Config{ + AccessKey: servicemocks.MockStaticAccessKey, + Region: "us-east-1", + SecretKey: servicemocks.MockStaticSecretKey, + }, + SharedConfigurationFile: ` + [default] + use_fips_endpoint = true + `, + ExpectedUseFIPSEndpoint: endpoints.FIPSEndpointStateEnabled, + }, + + // DualStack Endpoint + "DualStack endpoint config": { + Config: &awsbase.Config{ + AccessKey: servicemocks.MockStaticAccessKey, + Region: "us-east-1", + SecretKey: servicemocks.MockStaticSecretKey, + UseDualStackEndpoint: true, + }, + ExpectedUseDualStackEndpoint: endpoints.DualStackEndpointStateEnabled, + }, + "DualStack endpoint envvar": { + Config: &awsbase.Config{ + AccessKey: servicemocks.MockStaticAccessKey, + Region: "us-east-1", + SecretKey: servicemocks.MockStaticSecretKey, + }, + EnvironmentVariables: map[string]string{ + "AWS_USE_DUALSTACK_ENDPOINT": "true", + }, + ExpectedUseDualStackEndpoint: endpoints.DualStackEndpointStateEnabled, + }, + "DualStack endpoint shared configuration file": { + Config: &awsbase.Config{ + AccessKey: servicemocks.MockStaticAccessKey, + Region: "us-east-1", + SecretKey: servicemocks.MockStaticSecretKey, + }, + SharedConfigurationFile: ` + [default] + use_dualstack_endpoint = true + `, + ExpectedUseDualStackEndpoint: endpoints.DualStackEndpointStateEnabled, + }, + + // FIPS and DualStack Endpoint + "Both endpoints config": { + Config: &awsbase.Config{ + AccessKey: servicemocks.MockStaticAccessKey, + Region: "us-east-1", + SecretKey: servicemocks.MockStaticSecretKey, + UseDualStackEndpoint: true, + UseFIPSEndpoint: true, + }, + ExpectedUseDualStackEndpoint: endpoints.DualStackEndpointStateEnabled, + ExpectedUseFIPSEndpoint: endpoints.FIPSEndpointStateEnabled, + }, + "Both endpoints FIPS config DualStack envvar": { + Config: &awsbase.Config{ + AccessKey: servicemocks.MockStaticAccessKey, + Region: "us-east-1", + SecretKey: servicemocks.MockStaticSecretKey, + UseFIPSEndpoint: true, + }, + EnvironmentVariables: map[string]string{ + "AWS_USE_DUALSTACK_ENDPOINT": "true", + }, + ExpectedUseDualStackEndpoint: endpoints.DualStackEndpointStateEnabled, + ExpectedUseFIPSEndpoint: endpoints.FIPSEndpointStateEnabled, + }, + "Both endpoints FIPS shared configuration file DualStack config": { + Config: &awsbase.Config{ + AccessKey: servicemocks.MockStaticAccessKey, + Region: "us-east-1", + SecretKey: servicemocks.MockStaticSecretKey, + UseDualStackEndpoint: true, + }, + SharedConfigurationFile: ` +[default] +use_fips_endpoint = true +`, + ExpectedUseDualStackEndpoint: endpoints.DualStackEndpointStateEnabled, + ExpectedUseFIPSEndpoint: endpoints.FIPSEndpointStateEnabled, + }, + } + + for testName, testCase := range testCases { + testCase := testCase + + t.Run(testName, func(t *testing.T) { + oldEnv := servicemocks.InitSessionTestEnv() + defer servicemocks.PopEnv(oldEnv) + + for k, v := range testCase.EnvironmentVariables { + os.Setenv(k, v) + } + + closeSts, mockStsSession, err := mockdata.GetMockedAwsApiSession("STS", []*servicemocks.MockEndpoint{ + servicemocks.MockStsGetCallerIdentityValidEndpoint, + }) + defer closeSts() + + if err != nil { + t.Fatalf("unexpected error creating mock STS server: %s", err) + } + + if mockStsSession != nil && mockStsSession.Config != nil { + testCase.Config.StsEndpoint = aws.StringValue(mockStsSession.Config.Endpoint) + } + + if testCase.SharedConfigurationFile != "" { + file, err := ioutil.TempFile("", "aws-sdk-go-base-shared-configuration-file") + + if err != nil { + t.Fatalf("unexpected error creating temporary shared configuration file: %s", err) + } + + defer os.Remove(file.Name()) + + err = ioutil.WriteFile(file.Name(), []byte(testCase.SharedConfigurationFile), 0600) + + if err != nil { + t.Fatalf("unexpected error writing shared configuration file: %s", err) + } + + testCase.Config.SharedConfigFiles = []string{file.Name()} + } + + testCase.Config.SkipCredsValidation = true + + awsConfig, err := awsbase.GetAwsConfig(context.Background(), testCase.Config) + if err != nil { + t.Fatalf("GetAwsConfig() returned error: %s", err) + } + actualSession, err := GetSession(&awsConfig, testCase.Config) + if err != nil { + t.Fatalf("error in GetSession() '%[1]T': %[1]s", err) + } + + if e, a := testCase.ExpectedUseFIPSEndpoint, actualSession.Config.UseFIPSEndpoint; e != a { + t.Errorf("expected UseFIPSEndpoint %q, got: %q", FIPSEndpointStateString(e), FIPSEndpointStateString(a)) + } + + if e, a := testCase.ExpectedUseDualStackEndpoint, actualSession.Config.UseDualStackEndpoint; e != a { + t.Errorf("expected UseDualStackEndpoint %q, got: %q", DualStackEndpointStateString(e), DualStackEndpointStateString(a)) + } + }) + } +} + +func FIPSEndpointStateString(state endpoints.FIPSEndpointState) string { + switch state { + case endpoints.FIPSEndpointStateUnset: + return "FIPSEndpointStateUnset" + case endpoints.FIPSEndpointStateEnabled: + return "FIPSEndpointStateEnabled" + case endpoints.FIPSEndpointStateDisabled: + return "FIPSEndpointStateDisabled" + } + return fmt.Sprintf("unknown endpoints.FIPSEndpointState (%d)", state) +} + +func DualStackEndpointStateString(state endpoints.DualStackEndpointState) string { + switch state { + case endpoints.DualStackEndpointStateUnset: + return "DualStackEndpointStateUnset" + case endpoints.DualStackEndpointStateEnabled: + return "DualStackEndpointStateEnabled" + case endpoints.DualStackEndpointStateDisabled: + return "DualStackEndpointStateDisabled" + } + return fmt.Sprintf("unknown endpoints.FIPSEndpointStateUnset (%d)", state) +} + func TestSessionRetryHandlers(t *testing.T) { const maxRetries = 25 From 81496a995e0cf569c0987aa7b8962f9a1d0b564c Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 26 Jan 2022 14:02:59 -0800 Subject: [PATCH 4/4] Go module cleanup --- go.sum | 21 --------------------- v2/awsv1shim/go.sum | 24 ------------------------ 2 files changed, 45 deletions(-) diff --git a/go.sum b/go.sum index e3c96a8e..72e15d6f 100644 --- a/go.sum +++ b/go.sum @@ -1,50 +1,29 @@ -github.com/aws/aws-sdk-go-v2 v1.9.0 h1:+S+dSqQCN3MSU5vJRu1HqHrq00cJn6heIMU7X9hcsoo= -github.com/aws/aws-sdk-go-v2 v1.9.0/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= github.com/aws/aws-sdk-go-v2 v1.13.0 h1:1XIXAfxsEmbhbj5ry3D3vX+6ZcUYvIqSm4CWWEuGZCA= github.com/aws/aws-sdk-go-v2 v1.13.0/go.mod h1:L6+ZpqHaLbAaxsqV0L4cvxZY7QupWJB4fhkf8LXvC7w= -github.com/aws/aws-sdk-go-v2/config v1.7.0 h1:J2cZ7qe+3IpqBEXnHUrFrOjoB9BlsXg7j53vxcl5IVg= -github.com/aws/aws-sdk-go-v2/config v1.7.0/go.mod h1:w9+nMZ7soXCe5nT46Ri354SNhXDQ6v+V5wqDjnZE+GY= github.com/aws/aws-sdk-go-v2/config v1.13.0 h1:1ij3YPk13RrIn1h+pH+dArh3lNPD5JSAP+ifOkNhnB0= github.com/aws/aws-sdk-go-v2/config v1.13.0/go.mod h1:Pjv2OafecIn+4miw9VFDCr06YhKyf/oKOkIcpQOgWKk= -github.com/aws/aws-sdk-go-v2/credentials v1.4.0 h1:kmvesfjY861FzlCU9mvAfe01D9aeXcG2ZuC+k9F2YLM= -github.com/aws/aws-sdk-go-v2/credentials v1.4.0/go.mod h1:dgGR+Qq7Wjcd4AOAW5Rf5Tnv3+x7ed6kETXyS9WCuAY= github.com/aws/aws-sdk-go-v2/credentials v1.8.0 h1:8Ow0WcyDesGNL0No11jcgb1JAtE+WtubqXjgxau+S0o= github.com/aws/aws-sdk-go-v2/credentials v1.8.0/go.mod h1:gnMo58Vwx3Mu7hj1wpcG8DI0s57c9o42UQ6wgTQT5to= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.5.0 h1:OxTAgH8Y4BXHD6PGCJ8DHx2kaZPCQfSTqmDsdRZFezE= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.5.0/go.mod h1:CpNzHK9VEFUCknu50kkB8z58AH2B5DvPP7ea1LHve/Y= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.10.0 h1:NITDuUZO34mqtOwFWZiXo7yAHj7kf+XPE+EiKuCBNUI= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.10.0/go.mod h1:I6/fHT/fH460v09eg2gVrd8B/IqskhNdpcLH0WNO3QI= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.4 h1:CRiQJ4E2RhfDdqbie1ZYDo8QtIo75Mk7oTdJSfwJTMQ= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.4/go.mod h1:XHgQ7Hz2WY2GAn//UXHofLfPXWh+s62MbMOijrg12Lw= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.2.0 h1:3ADoioDMOtF4uiK59vCpplpCwugEU+v4ZFD29jDL3RQ= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.2.0/go.mod h1:BsCSJHx5DnDXIrOcqB8KN1/B+hXLG/bi4Y6Vjcx/x9E= -github.com/aws/aws-sdk-go-v2/internal/ini v1.2.2 h1:d95cddM3yTm4qffj3P6EnP+TzX1SSkWaQypXSgT/hpA= -github.com/aws/aws-sdk-go-v2/internal/ini v1.2.2/go.mod h1:BQV0agm+JEhqR+2RT5e1XTFIDcAAV0eW6z2trp+iduw= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.4 h1:0NrDHIwS1LIR750ltj6ciiu4NZLpr9rgq8vHi/4QD4s= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.4/go.mod h1:R3sWUqPcfXSiF/LSFJhjyJmpg9uV6yP2yv3YZZjldVI= -github.com/aws/aws-sdk-go-v2/service/iam v1.9.0 h1:PkrJTTEtdXtx+SF74QTQ0tPcVS1Vu9hghYfWx0SmBCw= -github.com/aws/aws-sdk-go-v2/service/iam v1.9.0/go.mod h1:aDjZkXLwXAd6Rn1cbiWnkGYBKXUb9fXO8UED20HwCnw= github.com/aws/aws-sdk-go-v2/service/iam v1.16.0 h1:A4sCxN1jRqmF90FXjYpai1H4z2jeii4USIh12PAv9VQ= github.com/aws/aws-sdk-go-v2/service/iam v1.16.0/go.mod h1:Nz3L2VG2bK1gJqZejQpBNpMHORGHre5GRAC2v8v8ZDM= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.0 h1:VNJ5NLBteVXEwE2F1zEXVmyIH58mZ6kIQGJoC7C+vkg= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.0/go.mod h1:R1KK+vY8AfalhG1AOu5e35pOD2SdoPKQCFLTvnxiohk= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.7.0 h1:4QAOB3KrvI1ApJK14sliGr3Ie2pjyvNypn/lfzDHfUw= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.7.0/go.mod h1:K/qPe6AP2TGYv4l6n7c88zh9jWBDf6nHhvg1fx/EWfU= -github.com/aws/aws-sdk-go-v2/service/sso v1.4.0 h1:sHXMIKYS6YiLPzmKSvDpPmOpJDHxmAUgbiF49YNVztg= -github.com/aws/aws-sdk-go-v2/service/sso v1.4.0/go.mod h1:+1fpWnL96DL23aXPpMGbsmKe8jLTEfbjuQoA4WS1VaA= github.com/aws/aws-sdk-go-v2/service/sso v1.9.0 h1:1qLJeQGBmNQW3mBNzK2CFmrQNmoXWrscPqsrAaU1aTA= github.com/aws/aws-sdk-go-v2/service/sso v1.9.0/go.mod h1:vCV4glupK3tR7pw7ks7Y4jYRL86VvxS+g5qk04YeWrU= -github.com/aws/aws-sdk-go-v2/service/sts v1.7.0 h1:1at4e5P+lvHNl2nUktdM2/v+rpICg/QSEr9TO/uW9vU= -github.com/aws/aws-sdk-go-v2/service/sts v1.7.0/go.mod h1:0qcSMCyASQPN2sk/1KQLQ2Fh6yq8wm0HSDAimPhzCoM= github.com/aws/aws-sdk-go-v2/service/sts v1.14.0 h1:ksiDXhvNYg0D2/UFkLejsaz3LqpW5yjNQ8Nx9Sn2c0E= github.com/aws/aws-sdk-go-v2/service/sts v1.14.0/go.mod h1:u0xMJKDvvfocRjiozsoZglVNXRG19043xzp3r2ivLIk= -github.com/aws/smithy-go v1.8.0 h1:AEwwwXQZtUwP5Mz506FeXXrKBe0jA8gVM+1gEcSRooc= -github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/aws/smithy-go v1.10.0 h1:gsoZQMNHnX+PaghNw4ynPsyGP7aUCqx5sY2dlPQsZ0w= github.com/aws/smithy-go v1.10.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= diff --git a/v2/awsv1shim/go.sum b/v2/awsv1shim/go.sum index f090fdbc..53e4153e 100644 --- a/v2/awsv1shim/go.sum +++ b/v2/awsv1shim/go.sum @@ -1,55 +1,32 @@ -github.com/aws/aws-sdk-go v1.40.43 h1:froMtO2//9kCu1sK+dOfAcwxUu91p5KgUP4AL7SDwUQ= -github.com/aws/aws-sdk-go v1.40.43/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/aws/aws-sdk-go v1.42.41 h1:gmHgDzSiLYfHx0ZedcXtHjMXbVxBtyOcl/sy0wg9o2o= github.com/aws/aws-sdk-go v1.42.41/go.mod h1:OGr6lGMAKGlG9CVrYnWYDKIyb829c6EVBRjxqjmPepc= -github.com/aws/aws-sdk-go-v2 v1.9.0 h1:+S+dSqQCN3MSU5vJRu1HqHrq00cJn6heIMU7X9hcsoo= -github.com/aws/aws-sdk-go-v2 v1.9.0/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= github.com/aws/aws-sdk-go-v2 v1.13.0 h1:1XIXAfxsEmbhbj5ry3D3vX+6ZcUYvIqSm4CWWEuGZCA= github.com/aws/aws-sdk-go-v2 v1.13.0/go.mod h1:L6+ZpqHaLbAaxsqV0L4cvxZY7QupWJB4fhkf8LXvC7w= -github.com/aws/aws-sdk-go-v2/config v1.7.0 h1:J2cZ7qe+3IpqBEXnHUrFrOjoB9BlsXg7j53vxcl5IVg= -github.com/aws/aws-sdk-go-v2/config v1.7.0/go.mod h1:w9+nMZ7soXCe5nT46Ri354SNhXDQ6v+V5wqDjnZE+GY= github.com/aws/aws-sdk-go-v2/config v1.13.0 h1:1ij3YPk13RrIn1h+pH+dArh3lNPD5JSAP+ifOkNhnB0= github.com/aws/aws-sdk-go-v2/config v1.13.0/go.mod h1:Pjv2OafecIn+4miw9VFDCr06YhKyf/oKOkIcpQOgWKk= -github.com/aws/aws-sdk-go-v2/credentials v1.4.0 h1:kmvesfjY861FzlCU9mvAfe01D9aeXcG2ZuC+k9F2YLM= -github.com/aws/aws-sdk-go-v2/credentials v1.4.0/go.mod h1:dgGR+Qq7Wjcd4AOAW5Rf5Tnv3+x7ed6kETXyS9WCuAY= github.com/aws/aws-sdk-go-v2/credentials v1.8.0 h1:8Ow0WcyDesGNL0No11jcgb1JAtE+WtubqXjgxau+S0o= github.com/aws/aws-sdk-go-v2/credentials v1.8.0/go.mod h1:gnMo58Vwx3Mu7hj1wpcG8DI0s57c9o42UQ6wgTQT5to= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.5.0 h1:OxTAgH8Y4BXHD6PGCJ8DHx2kaZPCQfSTqmDsdRZFezE= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.5.0/go.mod h1:CpNzHK9VEFUCknu50kkB8z58AH2B5DvPP7ea1LHve/Y= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.10.0 h1:NITDuUZO34mqtOwFWZiXo7yAHj7kf+XPE+EiKuCBNUI= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.10.0/go.mod h1:I6/fHT/fH460v09eg2gVrd8B/IqskhNdpcLH0WNO3QI= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.4 h1:CRiQJ4E2RhfDdqbie1ZYDo8QtIo75Mk7oTdJSfwJTMQ= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.4/go.mod h1:XHgQ7Hz2WY2GAn//UXHofLfPXWh+s62MbMOijrg12Lw= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.2.0 h1:3ADoioDMOtF4uiK59vCpplpCwugEU+v4ZFD29jDL3RQ= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.2.0/go.mod h1:BsCSJHx5DnDXIrOcqB8KN1/B+hXLG/bi4Y6Vjcx/x9E= -github.com/aws/aws-sdk-go-v2/internal/ini v1.2.2 h1:d95cddM3yTm4qffj3P6EnP+TzX1SSkWaQypXSgT/hpA= -github.com/aws/aws-sdk-go-v2/internal/ini v1.2.2/go.mod h1:BQV0agm+JEhqR+2RT5e1XTFIDcAAV0eW6z2trp+iduw= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.4 h1:0NrDHIwS1LIR750ltj6ciiu4NZLpr9rgq8vHi/4QD4s= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.4/go.mod h1:R3sWUqPcfXSiF/LSFJhjyJmpg9uV6yP2yv3YZZjldVI= -github.com/aws/aws-sdk-go-v2/service/iam v1.9.0 h1:PkrJTTEtdXtx+SF74QTQ0tPcVS1Vu9hghYfWx0SmBCw= -github.com/aws/aws-sdk-go-v2/service/iam v1.9.0/go.mod h1:aDjZkXLwXAd6Rn1cbiWnkGYBKXUb9fXO8UED20HwCnw= github.com/aws/aws-sdk-go-v2/service/iam v1.16.0 h1:A4sCxN1jRqmF90FXjYpai1H4z2jeii4USIh12PAv9VQ= github.com/aws/aws-sdk-go-v2/service/iam v1.16.0/go.mod h1:Nz3L2VG2bK1gJqZejQpBNpMHORGHre5GRAC2v8v8ZDM= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.0 h1:VNJ5NLBteVXEwE2F1zEXVmyIH58mZ6kIQGJoC7C+vkg= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.0/go.mod h1:R1KK+vY8AfalhG1AOu5e35pOD2SdoPKQCFLTvnxiohk= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.7.0 h1:4QAOB3KrvI1ApJK14sliGr3Ie2pjyvNypn/lfzDHfUw= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.7.0/go.mod h1:K/qPe6AP2TGYv4l6n7c88zh9jWBDf6nHhvg1fx/EWfU= -github.com/aws/aws-sdk-go-v2/service/sso v1.4.0 h1:sHXMIKYS6YiLPzmKSvDpPmOpJDHxmAUgbiF49YNVztg= -github.com/aws/aws-sdk-go-v2/service/sso v1.4.0/go.mod h1:+1fpWnL96DL23aXPpMGbsmKe8jLTEfbjuQoA4WS1VaA= github.com/aws/aws-sdk-go-v2/service/sso v1.9.0 h1:1qLJeQGBmNQW3mBNzK2CFmrQNmoXWrscPqsrAaU1aTA= github.com/aws/aws-sdk-go-v2/service/sso v1.9.0/go.mod h1:vCV4glupK3tR7pw7ks7Y4jYRL86VvxS+g5qk04YeWrU= -github.com/aws/aws-sdk-go-v2/service/sts v1.7.0 h1:1at4e5P+lvHNl2nUktdM2/v+rpICg/QSEr9TO/uW9vU= -github.com/aws/aws-sdk-go-v2/service/sts v1.7.0/go.mod h1:0qcSMCyASQPN2sk/1KQLQ2Fh6yq8wm0HSDAimPhzCoM= github.com/aws/aws-sdk-go-v2/service/sts v1.14.0 h1:ksiDXhvNYg0D2/UFkLejsaz3LqpW5yjNQ8Nx9Sn2c0E= github.com/aws/aws-sdk-go-v2/service/sts v1.14.0/go.mod h1:u0xMJKDvvfocRjiozsoZglVNXRG19043xzp3r2ivLIk= -github.com/aws/smithy-go v1.8.0 h1:AEwwwXQZtUwP5Mz506FeXXrKBe0jA8gVM+1gEcSRooc= -github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/aws/smithy-go v1.10.0 h1:gsoZQMNHnX+PaghNw4ynPsyGP7aUCqx5sY2dlPQsZ0w= github.com/aws/smithy-go v1.10.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= @@ -67,7 +44,6 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=