From c2b8ba9569d0734bd2202cb679d654b6f718e273 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 22:41:22 +0000 Subject: [PATCH] build(deps): bump github.com/aws/aws-sdk-go-v2/config in /ecr-login Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.19.1 to 1.23.0. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.19.1...config/v1.23.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/config dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- ecr-login/go.mod | 16 +-- ecr-login/go.sum | 32 +++--- .../aws/aws-sdk-go-v2/config/CHANGELOG.md | 32 ++++++ .../aws/aws-sdk-go-v2/config/config.go | 4 +- .../aws/aws-sdk-go-v2/config/env_config.go | 65 ++++++++++- .../config/go_module_metadata.go | 2 +- .../aws/aws-sdk-go-v2/config/provider.go | 34 +++++- .../aws/aws-sdk-go-v2/config/resolve.go | 23 ++++ .../aws/aws-sdk-go-v2/config/shared_config.go | 107 ++++++++++++++++++ .../aws-sdk-go-v2/credentials/CHANGELOG.md | 18 +++ .../credentials/go_module_metadata.go | 2 +- .../feature/ec2/imds/CHANGELOG.md | 17 +++ .../feature/ec2/imds/api_client.go | 18 +++ .../feature/ec2/imds/go_module_metadata.go | 2 +- .../ec2/imds/internal/config/resolvers.go | 16 +++ .../aws-sdk-go-v2/internal/ini/CHANGELOG.md | 22 ++++ .../internal/ini/go_module_metadata.go | 2 +- .../aws-sdk-go-v2/internal/ini/ini_lexer.go | 4 + .../aws-sdk-go-v2/internal/ini/ini_parser.go | 7 ++ .../internal/ini/literal_tokens.go | 80 ++++++++++++- .../aws/aws-sdk-go-v2/internal/ini/visitor.go | 19 ++++ .../internal/presigned-url/CHANGELOG.md | 13 +++ .../presigned-url/go_module_metadata.go | 2 +- .../aws-sdk-go-v2/service/sso/CHANGELOG.md | 14 +++ .../aws-sdk-go-v2/service/sso/api_client.go | 1 + .../aws-sdk-go-v2/service/sso/endpoints.go | 20 ++++ .../aws-sdk-go-v2/service/sso/generated.json | 1 + .../service/sso/go_module_metadata.go | 2 +- .../service/ssooidc/CHANGELOG.md | 14 +++ .../service/ssooidc/api_client.go | 1 + .../service/ssooidc/endpoints.go | 20 ++++ .../service/ssooidc/generated.json | 1 + .../service/ssooidc/go_module_metadata.go | 2 +- .../aws-sdk-go-v2/service/sts/CHANGELOG.md | 14 +++ .../aws-sdk-go-v2/service/sts/api_client.go | 1 + .../aws-sdk-go-v2/service/sts/endpoints.go | 20 ++++ .../aws-sdk-go-v2/service/sts/generated.json | 1 + .../service/sts/go_module_metadata.go | 2 +- ecr-login/vendor/modules.txt | 32 +++--- 39 files changed, 629 insertions(+), 54 deletions(-) diff --git a/ecr-login/go.mod b/ecr-login/go.mod index 8ee85164..bb52d17d 100644 --- a/ecr-login/go.mod +++ b/ecr-login/go.mod @@ -4,8 +4,8 @@ go 1.19 require ( github.com/aws/aws-sdk-go-v2 v1.22.2 - github.com/aws/aws-sdk-go-v2/config v1.19.1 - github.com/aws/aws-sdk-go-v2/credentials v1.13.43 + github.com/aws/aws-sdk-go-v2/config v1.23.0 + github.com/aws/aws-sdk-go-v2/credentials v1.15.2 github.com/aws/aws-sdk-go-v2/service/ecr v1.22.1 github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.18.2 github.com/aws/smithy-go v1.16.0 @@ -16,14 +16,14 @@ require ( ) require ( - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.3 // indirect github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.2 // indirect github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.2 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.15.2 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.23.2 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.6.0 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.2 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.17.1 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.19.1 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.25.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect diff --git a/ecr-login/go.sum b/ecr-login/go.sum index 510fcd1c..01edbe9a 100644 --- a/ecr-login/go.sum +++ b/ecr-login/go.sum @@ -1,32 +1,32 @@ github.com/aws/aws-sdk-go-v2 v1.21.2/go.mod h1:ErQhvNuEMhJjweavOYhxVkn2RUx7kQXVATHrjKtxIpM= github.com/aws/aws-sdk-go-v2 v1.22.2 h1:lV0U8fnhAnPz8YcdmZVV60+tr6CakHzqA6P8T46ExJI= github.com/aws/aws-sdk-go-v2 v1.22.2/go.mod h1:Kd0OJtkW3Q0M0lUWGszapWjEvrXDzRW+D21JNsroB+c= -github.com/aws/aws-sdk-go-v2/config v1.19.1 h1:oe3vqcGftyk40icfLymhhhNysAwk0NfiwkDi2GTPMXs= -github.com/aws/aws-sdk-go-v2/config v1.19.1/go.mod h1:ZwDUgFnQgsazQTnWfeLWk5GjeqTQTL8lMkoE1UXzxdE= -github.com/aws/aws-sdk-go-v2/credentials v1.13.43 h1:LU8vo40zBlo3R7bAvBVy/ku4nxGEyZe9N8MqAeFTzF8= -github.com/aws/aws-sdk-go-v2/credentials v1.13.43/go.mod h1:zWJBz1Yf1ZtX5NGax9ZdNjhhI4rgjfgsyk6vTY1yfVg= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13 h1:PIktER+hwIG286DqXyvVENjgLTAwGgoeriLDD5C+YlQ= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13/go.mod h1:f/Ib/qYjhV2/qdsf79H3QP/eRE4AkVyEf6sk7XfZ1tg= +github.com/aws/aws-sdk-go-v2/config v1.23.0 h1:kqzEfGGDIrRJpfJckgwuZfFTbU9NB1jZnRcaO9MpOqE= +github.com/aws/aws-sdk-go-v2/config v1.23.0/go.mod h1:p7wbxKXXjS1GGQOss7VXOazVMFF9bjUGq85/4wR/fSw= +github.com/aws/aws-sdk-go-v2/credentials v1.15.2 h1:rKH7khRMxPdD0u3dHecd0Q7NOVw3EUe7AqdkUOkiOGI= +github.com/aws/aws-sdk-go-v2/credentials v1.15.2/go.mod h1:tXM8wmaeAhfC7nZoCxb0FzM/aRaB1m1WQ7x0qlBLq80= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.3 h1:G5KawTAkyHH6WyKQCdHiW4h3PmAXNJpOgwKg3H7sDRE= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.3/go.mod h1:hugKmSFnZB+HgNI1sYGT14BUPZkO6alC/e0AWu+0IAQ= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43/go.mod h1:auo+PiyLl0n1l8A0e8RIeR8tOzYPfZZH/JNlrJ8igTQ= github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.2 h1:AaQsr5vvGR7rmeSWBtTCcw16tT9r51mWijuCQhzLnq8= github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.2/go.mod h1:o1IiRn7CWocIFTXJjGKJDOwxv1ibL53NpcvcqGWyRBA= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37/go.mod h1:Qe+2KtKml+FEsQF/DHmDV+xjtche/hwoF75EG4UlHW8= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.2 h1:UZx8SXZ0YtzRiALzYAWcjb9Y9hZUR7MBKaBQ5ouOjPs= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.2/go.mod h1:ipuRpcSaklmxR6C39G187TpBAO132gUfleTGccUPs8c= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45 h1:hze8YsjSh8Wl1rYa1CJpRmXP21BvOBuc76YhW0HsuQ4= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45/go.mod h1:lD5M20o09/LCuQ2mE62Mb/iSdSlCNuj6H5ci7tW7OsE= +github.com/aws/aws-sdk-go-v2/internal/ini v1.6.0 h1:hwZB07/beLiCopuRKF0t+dEHmP39iN4YtDh3X5d3hrg= +github.com/aws/aws-sdk-go-v2/internal/ini v1.6.0/go.mod h1:rdAuXeHWhI/zkpYcO5n8WCpaIgY9MUxFyBsuqq3kjyA= github.com/aws/aws-sdk-go-v2/service/ecr v1.22.1 h1:ekQH3O3gUYin2nZ2t0oI0E7FJbnb5WxoyfD6G3YFO1Q= github.com/aws/aws-sdk-go-v2/service/ecr v1.22.1/go.mod h1:EJ/S70FD7FPFMbEK/YXW8bXzdk3i8+i9WTNsRxNm+xI= github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.18.2 h1:PpbXaecV3sLAS6rjQiaKw4/jyq3Z8gNzmoJupHAoBp0= github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.18.2/go.mod h1:fUHpGXr4DrXkEDpGAjClPsviWf+Bszeb0daKE0blxv8= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37 h1:WWZA/I2K4ptBS1kg0kV1JbBtG/umed0vwHRrmcr9z7k= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37/go.mod h1:vBmDnwWXWxNPFRMmG2m/3MKOe+xEcMDo1tanpaWCcck= -github.com/aws/aws-sdk-go-v2/service/sso v1.15.2 h1:JuPGc7IkOP4AaqcZSIcyqLpFSqBWK32rM9+a1g6u73k= -github.com/aws/aws-sdk-go-v2/service/sso v1.15.2/go.mod h1:gsL4keucRCgW+xA85ALBpRFfdSLH4kHOVSnLMSuBECo= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3 h1:HFiiRkf1SdaAmV3/BHOFZ9DjFynPHj8G/UIO1lQS+fk= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3/go.mod h1:a7bHA82fyUXOm+ZSWKU6PIoBxrjSprdLoM8xPYvzYVg= -github.com/aws/aws-sdk-go-v2/service/sts v1.23.2 h1:0BkLfgeDjfZnZ+MhB3ONb01u9pwFYTCZVhlsSSBvlbU= -github.com/aws/aws-sdk-go-v2/service/sts v1.23.2/go.mod h1:Eows6e1uQEsc4ZaHANmsPRzAKcVDrcmjjWiih2+HUUQ= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.2 h1:h7j73yuAVVjic8pqswh+L/7r2IHP43QwRyOu6zcCDDE= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.2/go.mod h1:H07AHdK5LSy8F7EJUQhoxyiCNkePoHj2D8P2yGTWafo= +github.com/aws/aws-sdk-go-v2/service/sso v1.17.1 h1:km+ZNjtLtpXYf42RdaDZnNHm9s7SYAuDGTafy6nd89A= +github.com/aws/aws-sdk-go-v2/service/sso v1.17.1/go.mod h1:aHBr3pvBSD5MbzOvQtYutyPLLRPbl/y9x86XyJJnUXQ= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.19.1 h1:iRFNqZH4a67IqPvK8xxtyQYnyrlsvwmpHOe9r55ggBA= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.19.1/go.mod h1:pTy5WM+6sNv2tB24JNKFtn6EvciQ5k40ZJ0pq/Iaxj0= +github.com/aws/aws-sdk-go-v2/service/sts v1.25.1 h1:txgVXIXWPXyqdiVn92BV6a/rgtpX31HYdsOYj0sVQQQ= +github.com/aws/aws-sdk-go-v2/service/sts v1.25.1/go.mod h1:VAiJiNaoP1L89STFlEMgmHX1bKixY+FaP+TpRFrmyZ4= github.com/aws/smithy-go v1.15.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aws/smithy-go v1.16.0 h1:gJZEH/Fqh+RsvlJ1Zt4tVAtV6bKkp3cC+R6FCZMNzik= github.com/aws/smithy-go v1.16.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE= diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md index a1ecda86..cb9e9218 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md @@ -1,3 +1,35 @@ +# v1.23.0 (2023-11-09.2) + +* **Feature**: BREAKFIX: In order to support subproperty parsing, invalid property definitions must not be ignored +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.22.3 (2023-11-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.22.2 (2023-11-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.22.1 (2023-11-06) + +* No change notes available for this release. + +# v1.22.0 (2023-11-02) + +* **Feature**: Add env and shared config settings for disabling IMDSv1 fallback. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.0 (2023-11-01) + +* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + # v1.19.1 (2023-10-24) * No change notes available for this release. diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/config/config.go b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/config/config.go index bf26eab9..dfe62973 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/config/config.go +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/config/config.go @@ -72,6 +72,8 @@ var defaultAWSConfigResolvers = []awsConfigResolver{ // Sets the sdk app ID if present in shared config profile resolveAppID, + + resolveBaseEndpoint, } // A Config represents a generic configuration value or set of values. This type @@ -163,7 +165,7 @@ func (cs configs) ResolveConfig(f func(configs []interface{}) error) error { // or the custom data will be ignored by the resolvers and config loaders. // // cfg, err := config.LoadDefaultConfig( context.TODO(), -// WithSharedConfigProfile("test-profile"), +// config.WithSharedConfigProfile("test-profile"), // ) // if err != nil { // panic(fmt.Sprintf("failed loading config, %v", err)) diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/config/env_config.go b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/config/env_config.go index a142a45c..78bc1493 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/config/env_config.go +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/config/env_config.go @@ -57,7 +57,8 @@ const ( awsEc2MetadataServiceEndpointEnvVar = "AWS_EC2_METADATA_SERVICE_ENDPOINT" - awsEc2MetadataDisabled = "AWS_EC2_METADATA_DISABLED" + awsEc2MetadataDisabled = "AWS_EC2_METADATA_DISABLED" + awsEc2MetadataV1DisabledEnvVar = "AWS_EC2_METADATA_V1_DISABLED" awsS3DisableMultiRegionAccessPointEnvVar = "AWS_S3_DISABLE_MULTIREGION_ACCESS_POINTS" @@ -70,6 +71,9 @@ const ( awsRetryMaxAttempts = "AWS_MAX_ATTEMPTS" awsRetryMode = "AWS_RETRY_MODE" awsSdkAppID = "AWS_SDK_UA_APP_ID" + + awsIgnoreConfiguredEndpoints = "AWS_IGNORE_CONFIGURED_ENDPOINT_URLS" + awsEndpointURL = "AWS_ENDPOINT_URL" ) var ( @@ -206,6 +210,11 @@ type EnvConfig struct { // AWS_EC2_METADATA_DISABLED=true EC2IMDSClientEnableState imds.ClientEnableState + // Specifies if EC2 IMDSv1 fallback is disabled. + // + // AWS_EC2_METADATA_V1_DISABLED=true + EC2IMDSv1Disabled *bool + // Specifies the EC2 Instance Metadata Service default endpoint selection mode (IPv4 or IPv6) // // AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE=IPv6 @@ -252,6 +261,13 @@ type EnvConfig struct { // aws sdk app ID that can be added to user agent header string AppID string + + // Flag used to disable configured endpoints. + IgnoreConfiguredEndpoints *bool + + // Value to contain configured endpoints to be propagated to + // corresponding endpoint resolution field. + BaseEndpoint string } // loadEnvConfig reads configuration values from the OS's environment variables. @@ -307,6 +323,9 @@ func NewEnvConfig() (EnvConfig, error) { return cfg, err } cfg.EC2IMDSEndpoint = os.Getenv(awsEc2MetadataServiceEndpointEnvVar) + if err := setBoolPtrFromEnvVal(&cfg.EC2IMDSv1Disabled, []string{awsEc2MetadataV1DisabledEnvVar}); err != nil { + return cfg, err + } if err := setBoolPtrFromEnvVal(&cfg.S3DisableMultiRegionAccessPoints, []string{awsS3DisableMultiRegionAccessPointEnvVar}); err != nil { return cfg, err @@ -331,6 +350,12 @@ func NewEnvConfig() (EnvConfig, error) { return cfg, err } + setStringFromEnvVal(&cfg.BaseEndpoint, []string{awsEndpointURL}) + + if err := setBoolPtrFromEnvVal(&cfg.IgnoreConfiguredEndpoints, []string{awsIgnoreConfiguredEndpoints}); err != nil { + return cfg, err + } + return cfg, nil } @@ -482,6 +507,34 @@ func (c EnvConfig) getCustomCABundle(context.Context) (io.Reader, bool, error) { return bytes.NewReader(b), true, nil } +// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured +// endpoints feature. +func (c EnvConfig) GetIgnoreConfiguredEndpoints(context.Context) (bool, bool, error) { + if c.IgnoreConfiguredEndpoints == nil { + return false, false, nil + } + + return *c.IgnoreConfiguredEndpoints, true, nil +} + +func (c EnvConfig) getBaseEndpoint(context.Context) (string, bool, error) { + return c.BaseEndpoint, len(c.BaseEndpoint) > 0, nil +} + +// GetServiceBaseEndpoint is used to retrieve a normalized SDK ID for use +// with configured endpoints. +func (c EnvConfig) GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error) { + if endpt := os.Getenv(fmt.Sprintf("%s_%s", awsEndpointURL, normalizeEnv(sdkID))); endpt != "" { + return endpt, true, nil + } + return "", false, nil +} + +func normalizeEnv(sdkID string) string { + upper := strings.ToUpper(sdkID) + return strings.ReplaceAll(upper, " ", "_") +} + // GetS3UseARNRegion returns whether to allow ARNs to direct the region // the S3 client's requests are sent to. func (c EnvConfig) GetS3UseARNRegion(ctx context.Context) (value, ok bool, err error) { @@ -673,3 +726,13 @@ func (c EnvConfig) GetEC2IMDSEndpoint() (string, bool, error) { return c.EC2IMDSEndpoint, true, nil } + +// GetEC2IMDSV1FallbackDisabled implements an EC2IMDSV1FallbackDisabled option +// resolver interface. +func (c EnvConfig) GetEC2IMDSV1FallbackDisabled() (bool, bool) { + if c.EC2IMDSv1Disabled == nil { + return false, false + } + + return *c.EC2IMDSv1Disabled, true +} diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go index 887131d0..93e6f634 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go @@ -3,4 +3,4 @@ package config // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.19.1" +const goModuleVersion = "1.23.0" diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/config/provider.go b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/config/provider.go index b0562351..d5235846 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/config/provider.go +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/config/provider.go @@ -130,7 +130,7 @@ type IgnoreConfiguredEndpointsProvider interface { // GetIgnoreConfiguredEndpoints is used in knowing when to disable configured // endpoints feature. -func GetIgnoreConfiguredEndpoints(ctx context.Context, configs []Config) (value bool, found bool, err error) { +func GetIgnoreConfiguredEndpoints(ctx context.Context, configs []interface{}) (value bool, found bool, err error) { for _, cfg := range configs { if p, ok := cfg.(IgnoreConfiguredEndpointsProvider); ok { value, found, err = p.GetIgnoreConfiguredEndpoints(ctx) @@ -142,6 +142,38 @@ func GetIgnoreConfiguredEndpoints(ctx context.Context, configs []Config) (value return } +type baseEndpointProvider interface { + getBaseEndpoint(ctx context.Context) (string, bool, error) +} + +func getBaseEndpoint(ctx context.Context, configs configs) (value string, found bool, err error) { + for _, cfg := range configs { + if p, ok := cfg.(baseEndpointProvider); ok { + value, found, err = p.getBaseEndpoint(ctx) + if err != nil || found { + break + } + } + } + return +} + +type servicesObjectProvider interface { + getServicesObject(ctx context.Context) (map[string]map[string]string, bool, error) +} + +func getServicesObject(ctx context.Context, configs configs) (value map[string]map[string]string, found bool, err error) { + for _, cfg := range configs { + if p, ok := cfg.(servicesObjectProvider); ok { + value, found, err = p.getServicesObject(ctx) + if err != nil || found { + break + } + } + } + return +} + // appIDProvider provides access to the sdk app ID value type appIDProvider interface { getAppID(ctx context.Context) (string, bool, error) diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/config/resolve.go b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/config/resolve.go index 1187e8c4..b5a74b23 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/config/resolve.go +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/config/resolve.go @@ -106,6 +106,29 @@ func resolveRegion(ctx context.Context, cfg *aws.Config, configs configs) error return nil } +func resolveBaseEndpoint(ctx context.Context, cfg *aws.Config, configs configs) error { + var downcastCfgSources []interface{} + for _, cs := range configs { + downcastCfgSources = append(downcastCfgSources, interface{}(cs)) + } + + if val, found, err := GetIgnoreConfiguredEndpoints(ctx, downcastCfgSources); found && val && err == nil { + cfg.BaseEndpoint = nil + return nil + } + + v, found, err := getBaseEndpoint(ctx, configs) + if err != nil { + return err + } + + if !found { + return nil + } + cfg.BaseEndpoint = aws.String(v) + return nil +} + // resolveAppID extracts the sdk app ID from the configs slice's SharedConfig or env var func resolveAppID(ctx context.Context, cfg *aws.Config, configs configs) error { ID, _, err := getAppID(ctx, configs) diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go index ae5ba765..20683bf5 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go @@ -28,6 +28,10 @@ const ( // the shared config file, not the credentials file. ssoSectionPrefix = `sso-session ` + // Prefix for services section. It is referenced in profile via the services + // parameter to configure clients for service-specific parameters. + servicesPrefix = `services` + // string equivalent for boolean endpointDiscoveryDisabled = `false` endpointDiscoveryEnabled = `true` @@ -75,6 +79,8 @@ const ( ec2MetadataServiceEndpointKey = "ec2_metadata_service_endpoint" + ec2MetadataV1DisabledKey = "ec2_metadata_v1_disabled" + // Use DualStack Endpoint Resolution useDualStackEndpoint = "use_dualstack_endpoint" @@ -97,6 +103,10 @@ const ( caBundleKey = "ca_bundle" sdkAppID = "sdk_ua_app_id" + + ignoreConfiguredEndpoints = "ignore_configured_endpoint_urls" + + endpointURL = "endpoint_url" ) // defaultSharedConfigProfile allows for swapping the default profile for testing @@ -150,6 +160,24 @@ func (s *SSOSession) setFromIniSection(section ini.Section) { updateString(&s.SSOStartURL, section, ssoStartURLKey) } +// Services contains values configured in the services section +// of the AWS configuration file. +type Services struct { + // Services section values + // {"serviceId": {"key": "value"}} + // e.g. {"s3": {"endpoint_url": "example.com"}} + ServiceValues map[string]map[string]string +} + +func (s *Services) setFromIniSection(section ini.Section) { + if s.ServiceValues == nil { + s.ServiceValues = make(map[string]map[string]string) + } + for _, service := range section.List() { + s.ServiceValues[service] = section.Map(service) + } +} + // SharedConfig represents the configuration fields of the SDK config files. type SharedConfig struct { Profile string @@ -220,6 +248,12 @@ type SharedConfig struct { // ec2_metadata_service_endpoint=http://fd00:ec2::254 EC2IMDSEndpoint string + // Specifies that IMDS clients should not fallback to IMDSv1 if token + // requests fail. + // + // ec2_metadata_v1_disabled=true + EC2IMDSv1Disabled *bool + // Specifies if the S3 service should disable support for Multi-Region // access-points // @@ -272,6 +306,16 @@ type SharedConfig struct { // aws sdk app ID that can be added to user agent header string AppID string + + // Flag used to disable configured endpoints. + IgnoreConfiguredEndpoints *bool + + // Value to contain configured endpoints to be propagated to + // corresponding endpoint resolution field. + BaseEndpoint string + + // Value to contain services section content. + Services Services } func (c SharedConfig) getDefaultsMode(ctx context.Context) (value aws.DefaultsMode, ok bool, err error) { @@ -361,6 +405,16 @@ func (c SharedConfig) GetEC2IMDSEndpoint() (string, bool, error) { return c.EC2IMDSEndpoint, true, nil } +// GetEC2IMDSV1FallbackDisabled implements an EC2IMDSV1FallbackDisabled option +// resolver interface. +func (c SharedConfig) GetEC2IMDSV1FallbackDisabled() (bool, bool) { + if c.EC2IMDSv1Disabled == nil { + return false, false + } + + return *c.EC2IMDSv1Disabled, true +} + // GetUseDualStackEndpoint returns whether the service's dual-stack endpoint should be // used for requests. func (c SharedConfig) GetUseDualStackEndpoint(ctx context.Context) (value aws.DualStackEndpointState, found bool, err error) { @@ -399,6 +453,40 @@ func (c SharedConfig) getAppID(context.Context) (string, bool, error) { return c.AppID, len(c.AppID) > 0, nil } +// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured +// endpoints feature. +func (c SharedConfig) GetIgnoreConfiguredEndpoints(context.Context) (bool, bool, error) { + if c.IgnoreConfiguredEndpoints == nil { + return false, false, nil + } + + return *c.IgnoreConfiguredEndpoints, true, nil +} + +func (c SharedConfig) getBaseEndpoint(context.Context) (string, bool, error) { + return c.BaseEndpoint, len(c.BaseEndpoint) > 0, nil +} + +// GetServiceBaseEndpoint is used to retrieve a normalized SDK ID for use +// with configured endpoints. +func (c SharedConfig) GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error) { + if service, ok := c.Services.ServiceValues[normalizeShared(sdkID)]; ok { + if endpt, ok := service[endpointURL]; ok { + return endpt, true, nil + } + } + return "", false, nil +} + +func normalizeShared(sdkID string) string { + lower := strings.ToLower(sdkID) + return strings.ReplaceAll(lower, " ", "_") +} + +func (c SharedConfig) getServicesObject(context.Context) (map[string]map[string]string, bool, error) { + return c.Services.ServiceValues, c.Services.ServiceValues != nil, nil +} + // loadSharedConfigIgnoreNotExist is an alias for loadSharedConfig with the // addition of ignoring when none of the files exist or when the profile // is not found in any of the files. @@ -548,6 +636,7 @@ func LoadSharedConfigProfile(ctx context.Context, profile string, optFns ...func cfg := SharedConfig{} profiles := map[string]struct{}{} + if err = cfg.setFromIniSections(profiles, profile, configSections, option.Logger); err != nil { return SharedConfig{}, err } @@ -576,6 +665,7 @@ func processConfigSections(ctx context.Context, sections *ini.Sections, logger l skipSections[newName] = struct{}{} case strings.HasPrefix(section, ssoSectionPrefix): + case strings.HasPrefix(section, servicesPrefix): case strings.EqualFold(section, "default"): default: // drop this section, as invalid profile name @@ -735,6 +825,7 @@ func mergeSections(dst *ini.Sections, src ini.Sections) error { s3DisableMultiRegionAccessPointsKey, ec2MetadataServiceEndpointModeKey, ec2MetadataServiceEndpointKey, + ec2MetadataV1DisabledKey, useDualStackEndpoint, useFIPSEndpointKey, defaultsModeKey, @@ -884,6 +975,17 @@ func (c *SharedConfig) setFromIniSections(profiles map[string]struct{}, profile c.SSOSession = &ssoSession } + for _, sectionName := range sections.List() { + if strings.HasPrefix(sectionName, servicesPrefix) { + section, ok := sections.GetSection(sectionName) + if ok { + var svcs Services + svcs.setFromIniSection(section) + c.Services = svcs + } + } + } + return nil } @@ -957,6 +1059,7 @@ func (c *SharedConfig) setFromIniSection(profile string, section ini.Section) er return fmt.Errorf("failed to load %s from shared config, %v", ec2MetadataServiceEndpointModeKey, err) } updateString(&c.EC2IMDSEndpoint, section, ec2MetadataServiceEndpointKey) + updateBoolPtr(&c.EC2IMDSv1Disabled, section, ec2MetadataV1DisabledKey) updateUseDualStackEndpoint(&c.UseDualStackEndpoint, section, useDualStackEndpoint) updateUseFIPSEndpoint(&c.UseFIPSEndpoint, section, useFIPSEndpointKey) @@ -977,6 +1080,10 @@ func (c *SharedConfig) setFromIniSection(profile string, section ini.Section) er // user agent app ID added to request User-Agent header updateString(&c.AppID, section, sdkAppID) + updateBoolPtr(&c.IgnoreConfiguredEndpoints, section, ignoreConfiguredEndpoints) + + updateString(&c.BaseEndpoint, section, endpointURL) + // Shared Credentials creds := aws.Credentials{ AccessKeyID: section.String(accessKeyIDKey), diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md index ed558d3b..65c8de85 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md @@ -1,3 +1,21 @@ +# v1.15.2 (2023-11-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.1 (2023-11-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.0 (2023-11-01) + +* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + # v1.13.43 (2023-10-12) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go index 5cf1064a..365a8554 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go @@ -3,4 +3,4 @@ package credentials // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.13.43" +const goModuleVersion = "1.15.2" diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md index 5605f42d..c566941f 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md @@ -1,3 +1,20 @@ +# v1.14.3 (2023-11-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.2 (2023-11-02) + +* No change notes available for this release. + +# v1.14.1 (2023-11-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + # v1.13.13 (2023-10-12) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_client.go b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_client.go index e55edd99..46e144d9 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_client.go +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_client.go @@ -119,6 +119,7 @@ func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { resolveClientEnableState(cfg, &opts) resolveEndpointConfig(cfg, &opts) resolveEndpointModeConfig(cfg, &opts) + resolveEnableFallback(cfg, &opts) return New(opts, optFns...) } @@ -328,3 +329,20 @@ func resolveEndpointConfig(cfg aws.Config, options *Options) error { options.Endpoint = value return nil } + +func resolveEnableFallback(cfg aws.Config, options *Options) { + if options.EnableFallback != aws.UnknownTernary { + return + } + + disabled, ok := internalconfig.ResolveV1FallbackDisabled(cfg.ConfigSources) + if !ok { + return + } + + if disabled { + options.EnableFallback = aws.FalseTernary + } else { + options.EnableFallback = aws.TrueTernary + } +} diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go index ab96ef61..eea16310 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go @@ -3,4 +3,4 @@ package imds // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.13.13" +const goModuleVersion = "1.14.3" diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config/resolvers.go b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config/resolvers.go index d72fcb56..ce774558 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config/resolvers.go +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config/resolvers.go @@ -58,6 +58,10 @@ type EndpointResolver interface { GetEC2IMDSEndpoint() (string, bool, error) } +type v1FallbackDisabledResolver interface { + GetEC2IMDSV1FallbackDisabled() (bool, bool) +} + // ResolveClientEnableState resolves the ClientEnableState from a list of configuration sources. func ResolveClientEnableState(sources []interface{}) (value ClientEnableState, found bool, err error) { for _, source := range sources { @@ -96,3 +100,15 @@ func ResolveEndpointConfig(sources []interface{}) (value string, found bool, err } return value, found, err } + +// ResolveV1FallbackDisabled ... +func ResolveV1FallbackDisabled(sources []interface{}) (bool, bool) { + for _, source := range sources { + if resolver, ok := source.(v1FallbackDisabledResolver); ok { + if v, found := resolver.GetEC2IMDSV1FallbackDisabled(); found { + return v, true + } + } + } + return false, false +} diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md index 8aab6618..7ac3ab57 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md @@ -1,3 +1,25 @@ +# v1.6.0 (2023-11-09.2) + +* **Feature**: BREAKFIX: In order to support subproperty parsing, invalid property definitions must not be ignored + +# v1.5.2 (2023-11-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.1 (2023-11-07) + +* **Bug Fix**: Fix subproperty performance regression + +# v1.5.0 (2023-11-01) + +* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + # v1.3.45 (2023-10-12) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go index f92dc23c..8ceb1de6 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go @@ -3,4 +3,4 @@ package ini // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.3.45" +const goModuleVersion = "1.6.0" diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini_lexer.go b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini_lexer.go index abf1fb03..ab16760d 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini_lexer.go +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini_lexer.go @@ -67,6 +67,8 @@ func (l *iniLexer) tokenize(b []byte) ([]Token, error) { for len(runes) > 0 && count < tokenAmount { switch { + case isSubProperty(runes): + tokens[count], n, err = newLitToken(runes) case isWhitespace(runes[0]): tokens[count], n, err = newWSToken(runes) case isComma(runes[0]): @@ -101,6 +103,8 @@ func countTokens(runes []rune) int { for len(runes) > 0 { switch { + case isSubProperty(runes): + _, n, err = newLitToken(runes) case isWhitespace(runes[0]): _, n, err = newWSToken(runes) case isComma(runes[0]): diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini_parser.go b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini_parser.go index 12fc7d5a..e7f8edab 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini_parser.go +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini_parser.go @@ -187,6 +187,13 @@ loop: stack.Push(k) case StatementState: if k.Kind != ASTKindStart { + if tok.Type() == TokenLit && isSubProperty(tok.raw) { + return nil, NewParseError( + fmt.Sprintf( + "Invalid token, remove leading whitespace %s", + string(tok.raw)), + ) + } stack.MarkComplete(k) } expr := newExpression(tok) diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/literal_tokens.go b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/literal_tokens.go index efcd2e6c..f5a5c9e2 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/literal_tokens.go +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/literal_tokens.go @@ -60,7 +60,6 @@ const ( NoneType = ValueType(iota) StringType QuotedStringType - // FUTURE(2226) MapType ) // Value is a union container @@ -69,7 +68,7 @@ type Value struct { raw []rune str string - // FUTURE(2226) mp map[string]string + mp map[string]string } func newValue(t ValueType, base int, raw []rune) (Value, error) { @@ -81,6 +80,9 @@ func newValue(t ValueType, base int, raw []rune) (Value, error) { switch t { case StringType: v.str = string(raw) + if isSubProperty(raw) { + v.mp = v.MapValue() + } case QuotedStringType: v.str = string(raw[1 : len(raw)-1]) } @@ -114,8 +116,15 @@ func newLitToken(b []rune) (Token, int, error) { if err != nil { return token, n, err } - token = newToken(TokenLit, b[:n], QuotedStringType) + } else if isSubProperty(b) { + offset := 0 + end, err := getSubProperty(b, offset) + if err != nil { + return token, n, err + } + token = newToken(TokenLit, b[offset:end], StringType) + n = end } else { n, err = getValue(b) token = newToken(TokenLit, b[:n], StringType) @@ -124,6 +133,70 @@ func newLitToken(b []rune) (Token, int, error) { return token, n, err } +// replace with slices.Contains when Go 1.21 +// is min supported Go version in the SDK +func containsRune(runes []rune, val rune) bool { + for i := range runes { + if val == runes[i] { + return true + } + } + return false +} + +func isSubProperty(runes []rune) bool { + // needs at least + // (1) newline (2) whitespace (3) literal + if len(runes) < 3 { + return false + } + + // must have an equal expression + if !containsRune(runes, '=') && !containsRune(runes, ':') { + return false + } + + // must start with a new line + if !isNewline(runes) { + return false + } + _, n, err := newNewlineToken(runes) + if err != nil { + return false + } + // whitespace must follow newline + return isWhitespace(runes[n]) +} + +// getSubProperty pulls all subproperties and terminates when +// it hits a newline that is not the start of another subproperty. +// offset allows for removal of leading newline and whitespace +// characters +func getSubProperty(runes []rune, offset int) (int, error) { + for idx, val := range runes[offset:] { + if val == '\n' && !isSubProperty(runes[offset+idx:]) { + return offset + idx, nil + } + } + return offset + len(runes), nil +} + +// MapValue returns a map value for sub properties +func (v Value) MapValue() map[string]string { + newlineParts := strings.Split(string(v.raw), "\n") + mp := make(map[string]string) + for _, part := range newlineParts { + operandParts := strings.Split(part, "=") + if len(operandParts) < 2 { + continue + } + key := strings.TrimSpace(operandParts[0]) + val := strings.TrimSpace(operandParts[1]) + mp[key] = val + } + return mp +} + // IntValue returns an integer value func (v Value) IntValue() (int64, bool) { i, err := strconv.ParseInt(string(v.raw), 0, 64) @@ -165,6 +238,7 @@ func isTrimmable(r rune) bool { // StringValue returns the string value func (v Value) StringValue() string { switch v.Type { + case StringType: return strings.TrimFunc(string(v.raw), isTrimmable) case QuotedStringType: diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/visitor.go b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/visitor.go index 97fb3d7f..c124ad61 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/visitor.go +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/visitor.go @@ -220,6 +220,20 @@ func NewSection(name string) Section { } } +// List will return a list of all +// services in values +func (t Section) List() []string { + keys := make([]string, len(t.values)) + i := 0 + for k := range t.values { + keys[i] = k + i++ + } + + sort.Strings(keys) + return keys +} + // UpdateSourceFile updates source file for a property to provided filepath. func (t Section) UpdateSourceFile(property string, filepath string) { t.SourceFile[property] = filepath @@ -254,6 +268,11 @@ func (t Section) Int(k string) (int64, bool) { return t.values[k].IntValue() } +// Map returns a map value at k +func (t Section) Map(k string) map[string]string { + return t.values[k].MapValue() +} + // Float64 returns a float value at k func (t Section) Float64(k string) (float64, bool) { return t.values[k].FloatValue() diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md index 31895589..99a54769 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md @@ -1,3 +1,16 @@ +# v1.10.2 (2023-11-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.1 (2023-11-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + # v1.9.37 (2023-10-12) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go index 1d73a0cd..66b8acd8 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go @@ -3,4 +3,4 @@ package presignedurl // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.9.37" +const goModuleVersion = "1.10.2" diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md index 0b270016..a4c1d645 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md @@ -1,3 +1,17 @@ +# v1.17.1 (2023-11-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.0 (2023-11-01) + +* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + # v1.15.2 (2023-10-12) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go index da4e470a..a2579227 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go @@ -295,6 +295,7 @@ func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { resolveAWSEndpointResolver(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) return New(opts, optFns...) } diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go index 6a2c7eb3..11538705 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go @@ -8,6 +8,7 @@ import ( "fmt" "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/awsrulesfn" internalendpoints "github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints" smithyendpoints "github.com/aws/smithy-go/endpoints" @@ -16,6 +17,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" "net/http" "net/url" + "os" "strings" ) @@ -194,6 +196,24 @@ func resolveEndpointResolverV2(options *Options) { } } +func resolveBaseEndpoint(cfg aws.Config, o *Options) { + if cfg.BaseEndpoint != nil { + o.BaseEndpoint = cfg.BaseEndpoint + } + + _, g := os.LookupEnv("AWS_ENDPOINT_URL") + _, s := os.LookupEnv("AWS_ENDPOINT_URL_SSO") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "SSO", cfg.ConfigSources) + if found && err == nil { + o.BaseEndpoint = &value + } +} + // 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) { diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sso/generated.json b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sso/generated.json index ab6af36e..8e618418 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sso/generated.json +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sso/generated.json @@ -16,6 +16,7 @@ "deserializers.go", "doc.go", "endpoints.go", + "endpoints_config_test.go", "endpoints_test.go", "generated.json", "internal/endpoints/endpoints.go", diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go index 0f216f4e..cd496510 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go @@ -3,4 +3,4 @@ package sso // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.15.2" +const goModuleVersion = "1.17.1" diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md index 53661972..b47827d7 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md @@ -1,3 +1,17 @@ +# v1.19.1 (2023-11-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.0 (2023-11-01) + +* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + # v1.17.3 (2023-10-12) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go index 24a69227..6a56093d 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go @@ -295,6 +295,7 @@ func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { resolveAWSEndpointResolver(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) return New(opts, optFns...) } diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go index e8d190e4..50b490cb 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go @@ -8,6 +8,7 @@ import ( "fmt" "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/awsrulesfn" internalendpoints "github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints" smithyendpoints "github.com/aws/smithy-go/endpoints" @@ -16,6 +17,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" "net/http" "net/url" + "os" "strings" ) @@ -194,6 +196,24 @@ func resolveEndpointResolverV2(options *Options) { } } +func resolveBaseEndpoint(cfg aws.Config, o *Options) { + if cfg.BaseEndpoint != nil { + o.BaseEndpoint = cfg.BaseEndpoint + } + + _, g := os.LookupEnv("AWS_ENDPOINT_URL") + _, s := os.LookupEnv("AWS_ENDPOINT_URL_SSO_OIDC") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "SSO OIDC", cfg.ConfigSources) + if found && err == nil { + o.BaseEndpoint = &value + } +} + // 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) { diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json index fe2d075a..403fac7c 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json @@ -15,6 +15,7 @@ "deserializers.go", "doc.go", "endpoints.go", + "endpoints_config_test.go", "endpoints_test.go", "generated.json", "internal/endpoints/endpoints.go", diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go index fab953b9..bcd16fde 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go @@ -3,4 +3,4 @@ package ssooidc // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.17.3" +const goModuleVersion = "1.19.1" diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md index d94dc1ab..eefcd873 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md @@ -1,3 +1,17 @@ +# v1.25.1 (2023-11-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.0 (2023-11-01) + +* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + # v1.23.2 (2023-10-12) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go index 22ac6904..c29d8cad 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go @@ -298,6 +298,7 @@ func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { resolveAWSEndpointResolver(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) return New(opts, optFns...) } diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go index ef1caae8..cb5d56fd 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go @@ -8,6 +8,7 @@ import ( "fmt" "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/awsrulesfn" internalendpoints "github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints" smithy "github.com/aws/smithy-go" @@ -17,6 +18,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" "net/http" "net/url" + "os" "strings" ) @@ -195,6 +197,24 @@ func resolveEndpointResolverV2(options *Options) { } } +func resolveBaseEndpoint(cfg aws.Config, o *Options) { + if cfg.BaseEndpoint != nil { + o.BaseEndpoint = cfg.BaseEndpoint + } + + _, g := os.LookupEnv("AWS_ENDPOINT_URL") + _, s := os.LookupEnv("AWS_ENDPOINT_URL_STS") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "STS", cfg.ConfigSources) + if found && err == nil { + o.BaseEndpoint = &value + } +} + // 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) { diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json index 2ae7a9b2..e44e7d14 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json @@ -21,6 +21,7 @@ "deserializers.go", "doc.go", "endpoints.go", + "endpoints_config_test.go", "endpoints_test.go", "generated.json", "internal/endpoints/endpoints.go", diff --git a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go index 90dc95f1..f934c18f 100644 --- a/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go +++ b/ecr-login/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go @@ -3,4 +3,4 @@ package sts // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.23.2" +const goModuleVersion = "1.25.1" diff --git a/ecr-login/vendor/modules.txt b/ecr-login/vendor/modules.txt index 5184d6d1..28b5b8c4 100644 --- a/ecr-login/vendor/modules.txt +++ b/ecr-login/vendor/modules.txt @@ -21,11 +21,11 @@ github.com/aws/aws-sdk-go-v2/internal/shareddefaults github.com/aws/aws-sdk-go-v2/internal/strings github.com/aws/aws-sdk-go-v2/internal/sync/singleflight github.com/aws/aws-sdk-go-v2/internal/timeconv -# github.com/aws/aws-sdk-go-v2/config v1.19.1 -## explicit; go 1.15 +# github.com/aws/aws-sdk-go-v2/config v1.23.0 +## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/config -# github.com/aws/aws-sdk-go-v2/credentials v1.13.43 -## explicit; go 1.15 +# github.com/aws/aws-sdk-go-v2/credentials v1.15.2 +## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/credentials github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds github.com/aws/aws-sdk-go-v2/credentials/endpointcreds @@ -33,8 +33,8 @@ github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client github.com/aws/aws-sdk-go-v2/credentials/processcreds github.com/aws/aws-sdk-go-v2/credentials/ssocreds github.com/aws/aws-sdk-go-v2/credentials/stscreds -# github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13 -## explicit; go 1.15 +# github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.3 +## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/feature/ec2/imds github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config # github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.2 @@ -43,8 +43,8 @@ github.com/aws/aws-sdk-go-v2/internal/configsources # github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.2 ## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 -# github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45 -## explicit; go 1.15 +# github.com/aws/aws-sdk-go-v2/internal/ini v1.6.0 +## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/internal/ini # github.com/aws/aws-sdk-go-v2/service/ecr v1.22.1 ## explicit; go 1.19 @@ -56,21 +56,21 @@ github.com/aws/aws-sdk-go-v2/service/ecr/types github.com/aws/aws-sdk-go-v2/service/ecrpublic github.com/aws/aws-sdk-go-v2/service/ecrpublic/internal/endpoints github.com/aws/aws-sdk-go-v2/service/ecrpublic/types -# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37 -## explicit; go 1.15 +# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.2 +## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/service/internal/presigned-url -# github.com/aws/aws-sdk-go-v2/service/sso v1.15.2 -## explicit; go 1.15 +# github.com/aws/aws-sdk-go-v2/service/sso v1.17.1 +## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/service/sso github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints github.com/aws/aws-sdk-go-v2/service/sso/types -# github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3 -## explicit; go 1.15 +# github.com/aws/aws-sdk-go-v2/service/ssooidc v1.19.1 +## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/service/ssooidc github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints github.com/aws/aws-sdk-go-v2/service/ssooidc/types -# github.com/aws/aws-sdk-go-v2/service/sts v1.23.2 -## explicit; go 1.15 +# github.com/aws/aws-sdk-go-v2/service/sts v1.25.1 +## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/service/sts github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints github.com/aws/aws-sdk-go-v2/service/sts/types