diff --git a/go.mod b/go.mod index 800941f8..16e19fb1 100644 --- a/go.mod +++ b/go.mod @@ -11,10 +11,10 @@ require ( github.com/DopplerHQ/cli v0.0.0-20210309042056-414bede8a50e github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38 github.com/alecthomas/kong v0.2.15 - github.com/aws/aws-sdk-go-v2 v1.2.0 - github.com/aws/aws-sdk-go-v2/config v1.1.1 - github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.1.1 - github.com/aws/aws-sdk-go-v2/service/ssm v1.1.1 + github.com/aws/aws-sdk-go-v2 v1.24.1 + github.com/aws/aws-sdk-go-v2/config v1.26.5 + github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.26.2 + github.com/aws/aws-sdk-go-v2/service/ssm v1.44.7 github.com/cloudflare/cloudflare-go v0.25.0 github.com/cyberark/conjur-api-go v0.7.1 github.com/dghubble/sling v1.3.0 @@ -33,6 +33,7 @@ require ( github.com/mitchellh/go-homedir v1.1.0 github.com/samber/lo v1.11.0 github.com/sirupsen/logrus v1.7.0 + github.com/sosedoff/ansible-vault-go v0.2.0 github.com/stretchr/testify v1.8.1 github.com/testcontainers/testcontainers-go v0.10.1-0.20210331130832-54854fb15ccb github.com/tobischo/gokeepasslib/v3 v3.2.5 @@ -47,6 +48,8 @@ require ( gopkg.in/yaml.v3 v3.0.1 ) +require github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 // indirect + require ( filippo.io/age v1.1.1 // indirect filippo.io/edwards25519 v1.0.0 // indirect @@ -69,12 +72,16 @@ require ( github.com/alessio/shellescape v1.4.1 // indirect github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da // indirect github.com/atotto/clipboard v0.1.4 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.1.1 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.1.1 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.1.1 // indirect - github.com/aws/smithy-go v1.1.0 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.16.16 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.10 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.10 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.18.7 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.7 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.26.7 // indirect + github.com/aws/smithy-go v1.19.0 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/blang/semver/v4 v4.0.0 // indirect github.com/caspr-io/yamlpath v0.0.0-20200722075116-502e8d113a9b // indirect @@ -141,7 +148,6 @@ require ( github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/ryanuber/go-glob v1.0.0 // indirect github.com/sergi/go-diff v1.1.0 // indirect - github.com/sosedoff/ansible-vault-go v0.2.0 github.com/spf13/cobra v0.0.5 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/twpayne/go-pinentry v0.2.0 // indirect diff --git a/go.sum b/go.sum index ae386b46..d4bc7073 100644 --- a/go.sum +++ b/go.sum @@ -141,26 +141,36 @@ github.com/atotto/clipboard v0.1.2/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= -github.com/aws/aws-sdk-go-v2 v1.2.0 h1:BS+UYpbsElC82gB+2E2jiCBg36i8HlubTB/dO/moQ9c= -github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= -github.com/aws/aws-sdk-go-v2/config v1.1.1 h1:ZAoq32boMzcaTW9bcUacBswAmHTbvlvDJICgHFZuECo= -github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= -github.com/aws/aws-sdk-go-v2/credentials v1.1.1 h1:NbvWIM1Mx6sNPTxowHgS2ewXCRp+NGTzUYb/96FZJbY= -github.com/aws/aws-sdk-go-v2/credentials v1.1.1/go.mod h1:mM2iIjwl7LULWtS6JCACyInboHirisUUdkBPoTHMOUo= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2 h1:EtEU7WRaWliitZh2nmuxEXrN0Cb8EgPUFGIoTMeqbzI= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2/go.mod h1:3hGg3PpiEjHnrkrlasTfxFqUsZ2GCk/fMUn4CbKgSkM= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2 h1:4AH9fFjUlVktQMznF+YN33aWNXaR4VgDXyP28qokJC0= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2/go.mod h1:45MfaXZ0cNbeuT0KQ1XJylq8A6+OpVV2E5kvY/Kq+u8= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.1.1 h1:tOZVE/wpwnCH6zMCvDi8WsuXLV1p5PG/WOhHu8LWphE= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.1.1/go.mod h1:ytf+Mop8BTUFmWJSCI/U33FawS9A8UWwybOdNOXU6zE= -github.com/aws/aws-sdk-go-v2/service/ssm v1.1.1 h1:7KkZoTdApfXlU7boQG3/DpdfsbYJiJKIpglGitlGL0o= -github.com/aws/aws-sdk-go-v2/service/ssm v1.1.1/go.mod h1:351FC4X3HnrPJ8/RwHuFRr6uLq1LrXFfh8V5vBhT6/Q= -github.com/aws/aws-sdk-go-v2/service/sso v1.1.1 h1:37QubsarExl5ZuCBlnRP+7l1tNwZPBSTqpTBrPH98RU= -github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0= -github.com/aws/aws-sdk-go-v2/service/sts v1.1.1 h1:TJoIfnIFubCX0ACVeJ0w46HEH5MwjwYN4iFhuYIhfIY= -github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= -github.com/aws/smithy-go v1.1.0 h1:D6CSsM3gdxaGaqXnPgOBCeL6Mophqzu7KJOu7zW78sU= -github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= +github.com/aws/aws-sdk-go-v2 v1.24.1 h1:xAojnj+ktS95YZlDf0zxWBkbFtymPeDP+rvUQIH3uAU= +github.com/aws/aws-sdk-go-v2 v1.24.1/go.mod h1:LNh45Br1YAkEKaAqvmE1m8FUx6a5b/V0oAKV7of29b4= +github.com/aws/aws-sdk-go-v2/config v1.26.5 h1:lodGSevz7d+kkFJodfauThRxK9mdJbyutUxGq1NNhvw= +github.com/aws/aws-sdk-go-v2/config v1.26.5/go.mod h1:DxHrz6diQJOc9EwDslVRh84VjjrE17g+pVZXUeSxaDU= +github.com/aws/aws-sdk-go-v2/credentials v1.16.16 h1:8q6Rliyv0aUFAVtzaldUEcS+T5gbadPbWdV1WcAddK8= +github.com/aws/aws-sdk-go-v2/credentials v1.16.16/go.mod h1:UHVZrdUsv63hPXFo1H7c5fEneoVo9UXiz36QG1GEPi0= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11 h1:c5I5iH+DZcH3xOIMlz3/tCKJDaHFwYEmxvlh2fAcFo8= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11/go.mod h1:cRrYDYAMUohBJUtUnOhydaMHtiK/1NZ0Otc9lIb6O0Y= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.10 h1:vF+Zgd9s+H4vOXd5BMaPWykta2a6Ih0AKLq/X6NYKn4= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.10/go.mod h1:6BkRjejp/GR4411UGqkX8+wFMbFbqsUIimfK4XjOKR4= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.10 h1:nYPe006ktcqUji8S2mqXf9c/7NdiKriOwMvWQHgYztw= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.10/go.mod h1:6UV4SZkVvmODfXKql4LCbaZUpF7HO2BX38FgBf9ZOLw= +github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2 h1:GrSw8s0Gs/5zZ0SX+gX4zQjRnRsMJDJ2sLur1gRBhEM= +github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2/go.mod h1:6fQQgfuGmw8Al/3M2IgIllycxV7ZW7WCdVSqfBeUiCY= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 h1:/b31bi3YVNlkzkBrm9LfpaKoaYZUxIAj4sHfOTmLfqw= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4/go.mod h1:2aGXHFmbInwgP9ZfpmdIfOELL79zhdNYNmReK8qDfdQ= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10 h1:DBYTXwIGQSGs9w4jKm60F5dmCQ3EEruxdc0MFh+3EY4= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10/go.mod h1:wohMUQiFdzo0NtxbBg0mSRGZ4vL3n0dKjLTINdcIino= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.26.2 h1:A5sGOT/mukuU+4At1vkSIWAN8tPwPCoYZBp7aruR540= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.26.2/go.mod h1:qutL00aW8GSo2D0I6UEOqMvRS3ZyuBrOC1BLe5D2jPc= +github.com/aws/aws-sdk-go-v2/service/ssm v1.44.7 h1:a8HvP/+ew3tKwSXqL3BCSjiuicr+XTU2eFYeogV9GJE= +github.com/aws/aws-sdk-go-v2/service/ssm v1.44.7/go.mod h1:Q7XIWsMo0JcMpI/6TGD6XXcXcV1DbTj6e9BKNntIMIM= +github.com/aws/aws-sdk-go-v2/service/sso v1.18.7 h1:eajuO3nykDPdYicLlP3AGgOyVN3MOlFmZv7WGTuJPow= +github.com/aws/aws-sdk-go-v2/service/sso v1.18.7/go.mod h1:+mJNDdF+qiUlNKNC3fxn74WWNN+sOiGOEImje+3ScPM= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.7 h1:QPMJf+Jw8E1l7zqhZmMlFw6w1NmfkfiSK8mS4zOx3BA= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.7/go.mod h1:ykf3COxYI0UJmxcfcxcVuz7b6uADi1FkiUz6Eb7AgM8= +github.com/aws/aws-sdk-go-v2/service/sts v1.26.7 h1:NzO4Vrau795RkUdSHKEwiR01FaGzGOH1EETJ+5QHnm0= +github.com/aws/aws-sdk-go-v2/service/sts v1.26.7/go.mod h1:6h2YuIoxaMSCFf5fi1EgZAwdfkGMgDY+DVfa61uLe4U= +github.com/aws/smithy-go v1.19.0 h1:KWFKQV80DpP3vJrrA9sVAHQ5gc2z8i4EzrLhLlWXcBM= +github.com/aws/smithy-go v1.19.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE= github.com/axw/gocov v1.0.0/go.mod h1:LvQpEYiwwIb2nYkXY2fDWhg9/AsYqkhmrCshjlUJECE= github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= diff --git a/main.go b/main.go index 7993aca7..e5d72cd9 100644 --- a/main.go +++ b/main.go @@ -100,7 +100,7 @@ var ( defaultLogLevel = "error" ) -// nolint +//nolint func main() { ctx := kong.Parse(&CLI) diff --git a/pkg/porcelain.go b/pkg/porcelain.go index 44b44272..40a935a5 100644 --- a/pkg/porcelain.go +++ b/pkg/porcelain.go @@ -110,7 +110,7 @@ func (p *Porcelain) PrintEntries(entries []core.EnvEntry) { for i := range entries { v := entries[i] - ep := ellipsis.Shorten(v.ResolvedPath, 30) // nolint: gomnd + ep := ellipsis.Shorten(v.ResolvedPath, 30) //nolint: gomnd if !v.IsFound { fmt.Fprintf(&buf, "[%s %s %s] %s\n", yellow(v.ProviderName), gray(ep), red("missing"), green(v.Key)) } else { @@ -123,7 +123,7 @@ func (p *Porcelain) PrintEntries(entries []core.EnvEntry) { fmt.Fprint(p.Out, out) } func maskedValue(v string) string { - return fmt.Sprintf("%s*****", v[:int(math.Min(float64(len(v)), 2))]) // nolint: gomnd + return fmt.Sprintf("%s*****", v[:int(math.Min(float64(len(v)), 2))]) //nolint: gomnd } func (p *Porcelain) PrintMatches(matches []core.Match) { diff --git a/pkg/providers/aws_secretsmanager.go b/pkg/providers/aws_secretsmanager.go index 9370aa76..a93ae51c 100644 --- a/pkg/providers/aws_secretsmanager.go +++ b/pkg/providers/aws_secretsmanager.go @@ -34,7 +34,8 @@ type AWSSecretsManager struct { deletionRecoveryWindowInDays int64 } -const defaultDeletionRecoveryWindowInDays = 7 +var defaultDeletionRecoveryWindowInDays int64 = 7 + const versionSplit = "," //nolint @@ -200,8 +201,8 @@ func (a *AWSSecretsManager) DeleteMapping(kp core.KeyPath) error { a.logger.WithField("path", kp.Path).Debug("delete secret") _, err = a.client.DeleteSecret(ctx, &secretsmanager.DeleteSecretInput{ SecretId: &kp.Path, - RecoveryWindowInDays: a.deletionRecoveryWindowInDays, - ForceDeleteWithoutRecovery: a.deletionDisableRecoveryWindow, + RecoveryWindowInDays: &a.deletionRecoveryWindowInDays, + ForceDeleteWithoutRecovery: &a.deletionDisableRecoveryWindow, }) return err diff --git a/pkg/providers/aws_ssm.go b/pkg/providers/aws_ssm.go index fa1d3cf1..2a793fce 100644 --- a/pkg/providers/aws_ssm.go +++ b/pkg/providers/aws_ssm.go @@ -25,7 +25,7 @@ type AWSSSM struct { const awsssmName = "aws_ssm" -// nolint +//nolint func init() { metaInfo := core.MetaInfo{ Description: "AWS SSM (aka paramstore)", @@ -70,10 +70,11 @@ func NewAWSSSM(logger logging.Logger) (core.Provider, error) { } func (a *AWSSSM) Put(kp core.KeyPath, val string) error { + _, err := a.client.PutParameter(context.TODO(), &ssm.PutParameterInput{ Name: &kp.Path, Value: &val, - Overwrite: true, + Overwrite: aws.Bool(true), Type: types.ParameterTypeString, }) if err != nil { @@ -126,7 +127,7 @@ func (a *AWSSSM) Get(p core.KeyPath) (*core.EnvEntry, error) { func (a *AWSSSM) getSecret(kp core.KeyPath) (*string, error) { a.logger.WithField("path", kp.Path).Debug("get entry") - res, err := a.client.GetParameter(context.TODO(), &ssm.GetParameterInput{Name: &kp.Path, WithDecryption: kp.Decrypt}) + res, err := a.client.GetParameter(context.TODO(), &ssm.GetParameterInput{Name: &kp.Path, WithDecryption: &kp.Decrypt}) if err != nil { return nil, err } diff --git a/pkg/providers/aws_ssm_test.go b/pkg/providers/aws_ssm_test.go index fa602be8..bcb1d2bd 100644 --- a/pkg/providers/aws_ssm_test.go +++ b/pkg/providers/aws_ssm_test.go @@ -4,6 +4,8 @@ import ( "errors" "testing" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/alecthomas/assert" "github.com/aws/aws-sdk-go-v2/service/ssm" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -20,7 +22,8 @@ func TestAWSSSM(t *testing.T) { client := mock_providers.NewMockAWSSSMClient(ctrl) path := "settings/prod/billing-svc" val := "shazam" - in := ssm.GetParameterInput{Name: &path, WithDecryption: true} + + in := ssm.GetParameterInput{Name: &path, WithDecryption: aws.Bool(true)} out := ssm.GetParameterOutput{ Parameter: &types.Parameter{ Value: &val, diff --git a/pkg/providers/google_secretmanager.go b/pkg/providers/google_secretmanager.go index 1bd077f6..352a8ab4 100644 --- a/pkg/providers/google_secretmanager.go +++ b/pkg/providers/google_secretmanager.go @@ -30,7 +30,7 @@ type GoogleSecretManager struct { const GoogleSecretManagerName = "google_secretmanager" -// nolint +//nolint func init() { metaInfo := core.MetaInfo{ Description: "Google Secret Manager", diff --git a/pkg/providers/heroku.go b/pkg/providers/heroku.go index c27d7c9b..a6dc8dc8 100644 --- a/pkg/providers/heroku.go +++ b/pkg/providers/heroku.go @@ -90,7 +90,7 @@ func (h *Heroku) GetMapping(p core.KeyPath) ([]core.EnvEntry, error) { return entries, nil } -func (h *Heroku) Get(p core.KeyPath) (*core.EnvEntry, error) { // nolint:dupl +func (h *Heroku) Get(p core.KeyPath) (*core.EnvEntry, error) { //nolint:dupl secret, err := h.getSecret(p) if err != nil { return nil, err diff --git a/pkg/providers/keypass.go b/pkg/providers/keypass.go index e8a8a766..d82e5b12 100644 --- a/pkg/providers/keypass.go +++ b/pkg/providers/keypass.go @@ -24,7 +24,7 @@ type KeyPass struct { const KeyPassName = "KeyPass" -// nolint +//nolint func init() { metaInfo := core.MetaInfo{ Description: "Keypass", diff --git a/pkg/providers/lastpass.go b/pkg/providers/lastpass.go index 53608a94..63afafde 100644 --- a/pkg/providers/lastpass.go +++ b/pkg/providers/lastpass.go @@ -148,7 +148,7 @@ func (l *LastPass) notesToMap(notes string) map[string]string { results := map[string]string{} scanner := bufio.NewScanner(strings.NewReader(notes)) for scanner.Scan() { - findings := strings.SplitN(scanner.Text(), ":", 2) // nolint: gomnd + findings := strings.SplitN(scanner.Text(), ":", 2) //nolint: gomnd if len(findings) == findingNoteCount { results[strings.TrimSpace(findings[0])] = strings.TrimSpace(findings[1]) } @@ -161,7 +161,7 @@ func (l *LastPass) getNodeByKeyName(key, notes string) (string, error) { scanner := bufio.NewScanner(strings.NewReader(notes)) for scanner.Scan() { - findings := strings.SplitN(scanner.Text(), ":", 2) // nolint: gomnd + findings := strings.SplitN(scanner.Text(), ":", 2) //nolint: gomnd if len(findings) == findingNoteCount && findings[0] == key { return strings.TrimSpace(findings[1]), nil } diff --git a/pkg/providers/process_env.go b/pkg/providers/process_env.go index d0e26ed9..66a57475 100644 --- a/pkg/providers/process_env.go +++ b/pkg/providers/process_env.go @@ -52,7 +52,7 @@ func (a *ProcessEnv) GetMapping(p core.KeyPath) ([]core.EnvEntry, error) { kvs := make(map[string]string) for _, envs := range os.Environ() { - pair := strings.SplitN(envs, "=", 2) // nolint: gomnd + pair := strings.SplitN(envs, "=", 2) //nolint: gomnd kvs[pair[0]] = pair[1] } var entries []core.EnvEntry diff --git a/pkg/providers/vercel.go b/pkg/providers/vercel.go index 22da7346..80b80291 100644 --- a/pkg/providers/vercel.go +++ b/pkg/providers/vercel.go @@ -119,7 +119,7 @@ func (ve *Vercel) GetMapping(p core.KeyPath) ([]core.EnvEntry, error) { return entries, nil } -func (ve *Vercel) Get(p core.KeyPath) (*core.EnvEntry, error) { // nolint:dupl +func (ve *Vercel) Get(p core.KeyPath) (*core.EnvEntry, error) { //nolint:dupl secret, err := ve.getSecret(p) if err != nil { return nil, err diff --git a/pkg/teller_test.go b/pkg/teller_test.go index 668da37f..33073e4f 100644 --- a/pkg/teller_test.go +++ b/pkg/teller_test.go @@ -75,7 +75,7 @@ func (im *InMemProvider) Meta() core.MetaInfo { return core.MetaInfo{} } -// nolint +//nolint func init() { inmemProviderMeta := core.MetaInfo{ Name: "inmem-provider", diff --git a/vendor/github.com/aws/aws-sdk-go-v2/NOTICE.txt b/vendor/github.com/aws/aws-sdk-go-v2/NOTICE.txt index 5f14d116..899129ec 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/NOTICE.txt +++ b/vendor/github.com/aws/aws-sdk-go-v2/NOTICE.txt @@ -1,3 +1,3 @@ AWS SDK for Go -Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. +Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. Copyright 2014-2015 Stripe, Inc. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/config.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/config.go index 481aa156..2264200c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/config.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/config.go @@ -3,13 +3,14 @@ package aws import ( "net/http" + smithybearer "github.com/aws/smithy-go/auth/bearer" "github.com/aws/smithy-go/logging" "github.com/aws/smithy-go/middleware" ) // HTTPClient provides the interface to provide custom HTTPClients. Generally // *http.Client is sufficient for most use cases. The HTTPClient should not -// follow redirects. +// follow 301 or 302 redirects. type HTTPClient interface { Do(*http.Request) (*http.Response, error) } @@ -25,11 +26,23 @@ type Config struct { // information on AWS regions. Region string - // The credentials object to use when signing requests. Defaults to a - // chain of credential providers to search for credentials in environment - // variables, shared credential file, and EC2 Instance Roles. + // The credentials object to use when signing requests. + // Use the LoadDefaultConfig to load configuration from all the SDK's supported + // sources, and resolve credentials using the SDK's default credential chain. Credentials CredentialsProvider + // The Bearer Authentication token provider to use for authenticating API + // operation calls with a Bearer Authentication token. The API clients and + // operation must support Bearer Authentication scheme in order for the + // token provider to be used. API clients created with NewFromConfig will + // automatically be configured with this option, if the API client support + // Bearer Authentication. + // + // The SDK's config.LoadDefaultConfig can automatically populate this + // option for external configuration options such as SSO session. + // https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html + BearerAuthTokenProvider smithybearer.TokenProvider + // The HTTP Client the SDK's API clients will use to invoke HTTP requests. // The SDK defaults to a BuildableClient allowing API clients to create // copies of the HTTP Client for service specific customizations. @@ -38,18 +51,58 @@ type Config struct { // will prevent the SDK from modifying the HTTP client. HTTPClient HTTPClient - // An endpoint resolver that can be used to provide or override an endpoint for the given - // service and region Please see the `aws.EndpointResolver` documentation on usage. + // An endpoint resolver that can be used to provide or override an endpoint + // for the given service and region. + // + // See the `aws.EndpointResolver` documentation for additional usage + // information. + // + // Deprecated: See Config.EndpointResolverWithOptions EndpointResolver EndpointResolver - // Retryer is a function that provides a Retryer implementation. A Retryer guides how HTTP requests should be - // retried in case of recoverable failures. When nil the API client will use a default - // retryer. + // An endpoint resolver that can be used to provide or override an endpoint + // for the given service and region. + // + // When EndpointResolverWithOptions is specified, it will be used by a + // service client rather than using EndpointResolver if also specified. + // + // See the `aws.EndpointResolverWithOptions` documentation for additional + // usage information. + // + // Deprecated: with the release of endpoint resolution v2 in API clients, + // EndpointResolver and EndpointResolverWithOptions are deprecated. + // Providing a value for this field will likely prevent you from using + // newer endpoint-related service features. See API client options + // EndpointResolverV2 and BaseEndpoint. + EndpointResolverWithOptions EndpointResolverWithOptions + + // RetryMaxAttempts specifies the maximum number attempts an API client + // will call an operation that fails with a retryable error. + // + // API Clients will only use this value to construct a retryer if the + // Config.Retryer member is not nil. This value will be ignored if + // Retryer is not nil. + RetryMaxAttempts int + + // RetryMode specifies the retry model the API client will be created with. + // + // API Clients will only use this value to construct a retryer if the + // Config.Retryer member is not nil. This value will be ignored if + // Retryer is not nil. + RetryMode RetryMode + + // Retryer is a function that provides a Retryer implementation. A Retryer + // guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. + // + // In general, the provider function should return a new instance of a + // Retryer if you are attempting to provide a consistent Retryer + // configuration across all clients. This will ensure that each client will + // be provided a new instance of the Retryer implementation, and will avoid + // issues such as sharing the same retry token bucket across services. // - // In general, the provider function should return a new instance of a Retyer if you are attempting - // to provide a consistent Retryer configuration across all clients. This will ensure that each client will be - // provided a new instance of the Retryer implementation, and will avoid issues such as sharing the same retry token - // bucket across services. + // If not nil, RetryMaxAttempts, and RetryMode will be ignored by API + // clients. Retryer func() Retryer // ConfigSources are the sources that were used to construct the Config. @@ -65,13 +118,50 @@ type Config struct { // standard error. Logger logging.Logger - // Configures the events that will be sent to the configured logger. - // This can be used to configure the logging of signing, retries, request, and responses - // of the SDK clients. + // Configures the events that will be sent to the configured logger. This + // can be used to configure the logging of signing, retries, request, and + // responses of the SDK clients. // - // See the ClientLogMode type documentation for the complete set of logging modes and available - // configuration. + // See the ClientLogMode type documentation for the complete set of logging + // modes and available configuration. ClientLogMode ClientLogMode + + // The configured DefaultsMode. If not specified, service clients will + // default to legacy. + // + // Supported modes are: auto, cross-region, in-region, legacy, mobile, + // standard + DefaultsMode DefaultsMode + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode + // is set to DefaultsModeAuto and is initialized by + // `config.LoadDefaultConfig`. You should not populate this structure + // programmatically, or rely on the values here within your applications. + RuntimeEnvironment RuntimeEnvironment + + // AppId is an optional application specific identifier that can be set. + // When set it will be appended to the User-Agent header of every request + // in the form of App/{AppId}. This variable is sourced from environment + // variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id. + // See https://docs.aws.amazon.com/sdkref/latest/guide/settings-reference.html for + // more information on environment variables and shared config settings. + AppID string + + // BaseEndpoint is an intermediary transfer location to a service specific + // BaseEndpoint on a service's Options. + BaseEndpoint *string + + // DisableRequestCompression toggles if an operation request could be + // compressed or not. Will be set to false by default. This variable is sourced from + // environment variable AWS_DISABLE_REQUEST_COMPRESSION or the shared config profile attribute + // disable_request_compression + DisableRequestCompression bool + + // RequestMinCompressSizeBytes sets the inclusive min bytes of a request body that could be + // compressed. Will be set to 10240 by default and must be within 0 and 10485760 bytes inclusively. + // This variable is sourced from environment variable AWS_REQUEST_MIN_COMPRESSION_SIZE_BYTES or + // the shared config profile attribute request_min_compression_size_bytes + RequestMinCompressSizeBytes int64 } // NewConfig returns a new Config pointer that can be chained with builder @@ -80,9 +170,39 @@ func NewConfig() *Config { return &Config{} } -// Copy will return a shallow copy of the Config object. If any additional -// configurations are provided they will be merged into the new config returned. +// Copy will return a shallow copy of the Config object. func (c Config) Copy() Config { cp := c return cp } + +// EndpointDiscoveryEnableState indicates if endpoint discovery is +// enabled, disabled, auto or unset state. +// +// Default behavior (Auto or Unset) indicates operations that require endpoint +// discovery will use Endpoint Discovery by default. Operations that +// optionally use Endpoint Discovery will not use Endpoint Discovery +// unless EndpointDiscovery is explicitly enabled. +type EndpointDiscoveryEnableState uint + +// Enumeration values for EndpointDiscoveryEnableState +const ( + // EndpointDiscoveryUnset represents EndpointDiscoveryEnableState is unset. + // Users do not need to use this value explicitly. The behavior for unset + // is the same as for EndpointDiscoveryAuto. + EndpointDiscoveryUnset EndpointDiscoveryEnableState = iota + + // EndpointDiscoveryAuto represents an AUTO state that allows endpoint + // discovery only when required by the api. This is the default + // configuration resolved by the client if endpoint discovery is neither + // enabled or disabled. + EndpointDiscoveryAuto // default state + + // EndpointDiscoveryDisabled indicates client MUST not perform endpoint + // discovery even when required. + EndpointDiscoveryDisabled + + // EndpointDiscoveryEnabled indicates client MUST always perform endpoint + // discovery if supported for the operation. + EndpointDiscoveryEnabled +) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/credential_cache.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/credential_cache.go index 1411a5c3..781ac0ae 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/credential_cache.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/credential_cache.go @@ -2,6 +2,7 @@ package aws import ( "context" + "fmt" "sync/atomic" "time" @@ -24,11 +25,13 @@ type CredentialsCacheOptions struct { // If ExpiryWindow is 0 or less it will be ignored. ExpiryWindow time.Duration - // ExpiryWindowJitterFrac provides a mechanism for randomizing the expiration of credentials - // within the configured ExpiryWindow by a random percentage. Valid values are between 0.0 and 1.0. + // ExpiryWindowJitterFrac provides a mechanism for randomizing the + // expiration of credentials within the configured ExpiryWindow by a random + // percentage. Valid values are between 0.0 and 1.0. // - // As an example if ExpiryWindow is 60 seconds and ExpiryWindowJitterFrac is 0.5 then credentials will be set to - // expire between 30 to 60 seconds prior to their actual expiration time. + // As an example if ExpiryWindow is 60 seconds and ExpiryWindowJitterFrac + // is 0.5 then credentials will be set to expire between 30 to 60 seconds + // prior to their actual expiration time. // // If ExpiryWindow is 0 or less then ExpiryWindowJitterFrac is ignored. // If ExpiryWindowJitterFrac is 0 then no randomization will be applied to the window. @@ -39,8 +42,19 @@ type CredentialsCacheOptions struct { // CredentialsCache provides caching and concurrency safe credentials retrieval // via the provider's retrieve method. +// +// CredentialsCache will look for optional interfaces on the Provider to adjust +// how the credential cache handles credentials caching. +// +// - HandleFailRefreshCredentialsCacheStrategy - Allows provider to handle +// credential refresh failures. This could return an updated Credentials +// value, or attempt another means of retrieving credentials. +// +// - AdjustExpiresByCredentialsCacheStrategy - Allows provider to adjust how +// credentials Expires is modified. This could modify how the Credentials +// Expires is adjusted based on the CredentialsCache ExpiryWindow option. +// Such as providing a floor not to reduce the Expires below. type CredentialsCache struct { - // provider is the CredentialProvider implementation to be wrapped by the CredentialCache. provider CredentialsProvider options CredentialsCacheOptions @@ -48,8 +62,9 @@ type CredentialsCache struct { sf singleflight.Group } -// NewCredentialsCache returns a CredentialsCache that wraps provider. Provider is expected to not be nil. A variadic -// list of one or more functions can be provided to modify the CredentialsCache configuration. This allows for +// NewCredentialsCache returns a CredentialsCache that wraps provider. Provider +// is expected to not be nil. A variadic list of one or more functions can be +// provided to modify the CredentialsCache configuration. This allows for // configuration of credential expiry window and jitter. func NewCredentialsCache(provider CredentialsProvider, optFns ...func(options *CredentialsCacheOptions)) *CredentialsCache { options := CredentialsCacheOptions{} @@ -81,8 +96,8 @@ func NewCredentialsCache(provider CredentialsProvider, optFns ...func(options *C // // Returns and error if the provider's retrieve method returns an error. func (p *CredentialsCache) Retrieve(ctx context.Context) (Credentials, error) { - if creds := p.getCreds(); creds != nil { - return *creds, nil + if creds, ok := p.getCreds(); ok && !creds.Expired() { + return creds, nil } resCh := p.sf.DoChan("", func() (interface{}, error) { @@ -97,39 +112,64 @@ func (p *CredentialsCache) Retrieve(ctx context.Context) (Credentials, error) { } func (p *CredentialsCache) singleRetrieve(ctx context.Context) (interface{}, error) { - if creds := p.getCreds(); creds != nil { - return *creds, nil + currCreds, ok := p.getCreds() + if ok && !currCreds.Expired() { + return currCreds, nil + } + + newCreds, err := p.provider.Retrieve(ctx) + if err != nil { + handleFailToRefresh := defaultHandleFailToRefresh + if cs, ok := p.provider.(HandleFailRefreshCredentialsCacheStrategy); ok { + handleFailToRefresh = cs.HandleFailToRefresh + } + newCreds, err = handleFailToRefresh(ctx, currCreds, err) + if err != nil { + return Credentials{}, fmt.Errorf("failed to refresh cached credentials, %w", err) + } } - creds, err := p.provider.Retrieve(ctx) - if err == nil { - if creds.CanExpire { - randFloat64, err := sdkrand.CryptoRandFloat64() - if err != nil { - return Credentials{}, err - } - jitter := time.Duration(randFloat64 * p.options.ExpiryWindowJitterFrac * float64(p.options.ExpiryWindow)) - creds.Expires = creds.Expires.Add(-(p.options.ExpiryWindow - jitter)) + if newCreds.CanExpire && p.options.ExpiryWindow > 0 { + adjustExpiresBy := defaultAdjustExpiresBy + if cs, ok := p.provider.(AdjustExpiresByCredentialsCacheStrategy); ok { + adjustExpiresBy = cs.AdjustExpiresBy } - p.creds.Store(&creds) + randFloat64, err := sdkrand.CryptoRandFloat64() + if err != nil { + return Credentials{}, fmt.Errorf("failed to get random provider, %w", err) + } + + var jitter time.Duration + if p.options.ExpiryWindowJitterFrac > 0 { + jitter = time.Duration(randFloat64 * + p.options.ExpiryWindowJitterFrac * float64(p.options.ExpiryWindow)) + } + + newCreds, err = adjustExpiresBy(newCreds, -(p.options.ExpiryWindow - jitter)) + if err != nil { + return Credentials{}, fmt.Errorf("failed to adjust credentials expires, %w", err) + } } - return creds, err + p.creds.Store(&newCreds) + return newCreds, nil } -func (p *CredentialsCache) getCreds() *Credentials { +// getCreds returns the currently stored credentials and true. Returning false +// if no credentials were stored. +func (p *CredentialsCache) getCreds() (Credentials, bool) { v := p.creds.Load() if v == nil { - return nil + return Credentials{}, false } c := v.(*Credentials) - if c != nil && c.HasKeys() && !c.Expired() { - return c + if c == nil || !c.HasKeys() { + return Credentials{}, false } - return nil + return *c, true } // Invalidate will invalidate the cached credentials. The next call to Retrieve @@ -137,3 +177,48 @@ func (p *CredentialsCache) getCreds() *Credentials { func (p *CredentialsCache) Invalidate() { p.creds.Store((*Credentials)(nil)) } + +// IsCredentialsProvider returns whether credential provider wrapped by CredentialsCache +// matches the target provider type. +func (p *CredentialsCache) IsCredentialsProvider(target CredentialsProvider) bool { + return IsCredentialsProvider(p.provider, target) +} + +// HandleFailRefreshCredentialsCacheStrategy is an interface for +// CredentialsCache to allow CredentialsProvider how failed to refresh +// credentials is handled. +type HandleFailRefreshCredentialsCacheStrategy interface { + // Given the previously cached Credentials, if any, and refresh error, may + // returns new or modified set of Credentials, or error. + // + // Credential caches may use default implementation if nil. + HandleFailToRefresh(context.Context, Credentials, error) (Credentials, error) +} + +// defaultHandleFailToRefresh returns the passed in error. +func defaultHandleFailToRefresh(ctx context.Context, _ Credentials, err error) (Credentials, error) { + return Credentials{}, err +} + +// AdjustExpiresByCredentialsCacheStrategy is an interface for CredentialCache +// to allow CredentialsProvider to intercept adjustments to Credentials expiry +// based on expectations and use cases of CredentialsProvider. +// +// Credential caches may use default implementation if nil. +type AdjustExpiresByCredentialsCacheStrategy interface { + // Given a Credentials as input, applying any mutations and + // returning the potentially updated Credentials, or error. + AdjustExpiresBy(Credentials, time.Duration) (Credentials, error) +} + +// defaultAdjustExpiresBy adds the duration to the passed in credentials Expires, +// and returns the updated credentials value. If Credentials value's CanExpire +// is false, the passed in credentials are returned unchanged. +func defaultAdjustExpiresBy(creds Credentials, dur time.Duration) (Credentials, error) { + if !creds.CanExpire { + return creds, nil + } + + creds.Expires = creds.Expires.Add(dur) + return creds, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/credentials.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/credentials.go index ce3868a9..714d4ad8 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/credentials.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/credentials.go @@ -3,6 +3,7 @@ package aws import ( "context" "fmt" + "reflect" "time" "github.com/aws/aws-sdk-go-v2/internal/sdk" @@ -23,41 +24,41 @@ import ( // The following example demonstrates using the AnonymousCredentials to prevent // SDK's external config loading attempt to resolve credentials. // -// cfg, err := config.LoadDefaultConfig(context.TODO(), -// config.WithCredentialsProvider(aws.AnonymousCredentials{}), -// ) -// if err != nil { -// log.Fatalf("failed to load config, %v", err) -// } +// cfg, err := config.LoadDefaultConfig(context.TODO(), +// config.WithCredentialsProvider(aws.AnonymousCredentials{}), +// ) +// if err != nil { +// log.Fatalf("failed to load config, %v", err) +// } // -// client := s3.NewFromConfig(cfg) +// client := s3.NewFromConfig(cfg) // // Alternatively you can leave the API client Option's `Credential` member to // nil. If using the `NewFromConfig` constructor you'll need to explicitly set // the `Credentials` member to nil, if the external config resolved a // credential provider. // -// client := s3.New(s3.Options{ -// // Credentials defaults to a nil value. -// }) +// client := s3.New(s3.Options{ +// // Credentials defaults to a nil value. +// }) // // This can also be configured for specific operations calls too. // -// cfg, err := config.LoadDefaultConfig(context.TODO()) -// if err != nil { -// log.Fatalf("failed to load config, %v", err) -// } +// cfg, err := config.LoadDefaultConfig(context.TODO()) +// if err != nil { +// log.Fatalf("failed to load config, %v", err) +// } // -// client := s3.NewFromConfig(config) +// client := s3.NewFromConfig(config) // -// result, err := client.GetObject(context.TODO(), s3.GetObject{ -// Bucket: aws.String("example-bucket"), -// Key: aws.String("example-key"), -// }, func(o *s3.Options) { -// o.Credentials = nil -// // Or -// o.Credentials = aws.AnonymousCredentials{} -// }) +// result, err := client.GetObject(context.TODO(), s3.GetObject{ +// Bucket: aws.String("example-bucket"), +// Key: aws.String("example-key"), +// }, func(o *s3.Options) { +// o.Credentials = nil +// // Or +// o.Credentials = aws.AnonymousCredentials{} +// }) type AnonymousCredentials struct{} // Retrieve implements the CredentialsProvider interface, but will always @@ -83,16 +84,20 @@ type Credentials struct { // Source of the credentials Source string - // Time the credentials will expire. + // States if the credentials can expire or not. CanExpire bool - Expires time.Time + + // The time the credentials will expire at. Should be ignored if CanExpire + // is false. + Expires time.Time } // Expired returns if the credentials have expired. func (v Credentials) Expired() bool { if v.CanExpire { - // Calling Round(0) on the current time will truncate the monotonic reading only. Ensures credential expiry - // time is always based on reported wall-clock time. + // Calling Round(0) on the current time will truncate the monotonic + // reading only. Ensures credential expiry time is always based on + // reported wall-clock time. return !v.Expires.After(sdk.NowTime().Round(0)) } @@ -125,3 +130,41 @@ type CredentialsProviderFunc func(context.Context) (Credentials, error) func (fn CredentialsProviderFunc) Retrieve(ctx context.Context) (Credentials, error) { return fn(ctx) } + +type isCredentialsProvider interface { + IsCredentialsProvider(CredentialsProvider) bool +} + +// IsCredentialsProvider returns whether the target CredentialProvider is the same type as provider when comparing the +// implementation type. +// +// If provider has a method IsCredentialsProvider(CredentialsProvider) bool it will be responsible for validating +// whether target matches the credential provider type. +// +// When comparing the CredentialProvider implementations provider and target for equality, the following rules are used: +// +// If provider is of type T and target is of type V, true if type *T is the same as type *V, otherwise false +// If provider is of type *T and target is of type V, true if type *T is the same as type *V, otherwise false +// If provider is of type T and target is of type *V, true if type *T is the same as type *V, otherwise false +// If provider is of type *T and target is of type *V,true if type *T is the same as type *V, otherwise false +func IsCredentialsProvider(provider, target CredentialsProvider) bool { + if target == nil || provider == nil { + return provider == target + } + + if x, ok := provider.(isCredentialsProvider); ok { + return x.IsCredentialsProvider(target) + } + + targetType := reflect.TypeOf(target) + if targetType.Kind() != reflect.Ptr { + targetType = reflect.PtrTo(targetType) + } + + providerType := reflect.TypeOf(provider) + if providerType.Kind() != reflect.Ptr { + providerType = reflect.PtrTo(providerType) + } + + return targetType.AssignableTo(providerType) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/auto.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/auto.go new file mode 100644 index 00000000..fd408e51 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/auto.go @@ -0,0 +1,38 @@ +package defaults + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + "runtime" + "strings" +) + +var getGOOS = func() string { + return runtime.GOOS +} + +// ResolveDefaultsModeAuto is used to determine the effective aws.DefaultsMode when the mode +// is set to aws.DefaultsModeAuto. +func ResolveDefaultsModeAuto(region string, environment aws.RuntimeEnvironment) aws.DefaultsMode { + goos := getGOOS() + if goos == "android" || goos == "ios" { + return aws.DefaultsModeMobile + } + + var currentRegion string + if len(environment.EnvironmentIdentifier) > 0 { + currentRegion = environment.Region + } + + if len(currentRegion) == 0 && len(environment.EC2InstanceMetadataRegion) > 0 { + currentRegion = environment.EC2InstanceMetadataRegion + } + + if len(region) > 0 && len(currentRegion) > 0 { + if strings.EqualFold(region, currentRegion) { + return aws.DefaultsModeInRegion + } + return aws.DefaultsModeCrossRegion + } + + return aws.DefaultsModeStandard +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/configuration.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/configuration.go new file mode 100644 index 00000000..8b7e01fa --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/configuration.go @@ -0,0 +1,43 @@ +package defaults + +import ( + "time" + + "github.com/aws/aws-sdk-go-v2/aws" +) + +// Configuration is the set of SDK configuration options that are determined based +// on the configured DefaultsMode. +type Configuration struct { + // RetryMode is the configuration's default retry mode API clients should + // use for constructing a Retryer. + RetryMode aws.RetryMode + + // ConnectTimeout is the maximum amount of time a dial will wait for + // a connect to complete. + // + // See https://pkg.go.dev/net#Dialer.Timeout + ConnectTimeout *time.Duration + + // TLSNegotiationTimeout specifies the maximum amount of time waiting to + // wait for a TLS handshake. + // + // See https://pkg.go.dev/net/http#Transport.TLSHandshakeTimeout + TLSNegotiationTimeout *time.Duration +} + +// GetConnectTimeout returns the ConnectTimeout value, returns false if the value is not set. +func (c *Configuration) GetConnectTimeout() (time.Duration, bool) { + if c.ConnectTimeout == nil { + return 0, false + } + return *c.ConnectTimeout, true +} + +// GetTLSNegotiationTimeout returns the TLSNegotiationTimeout value, returns false if the value is not set. +func (c *Configuration) GetTLSNegotiationTimeout() (time.Duration, bool) { + if c.TLSNegotiationTimeout == nil { + return 0, false + } + return *c.TLSNegotiationTimeout, true +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/defaults.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/defaults.go new file mode 100644 index 00000000..dbaa873d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/defaults.go @@ -0,0 +1,50 @@ +// Code generated by github.com/aws/aws-sdk-go-v2/internal/codegen/cmd/defaultsconfig. DO NOT EDIT. + +package defaults + +import ( + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + "time" +) + +// GetModeConfiguration returns the default Configuration descriptor for the given mode. +// +// Supports the following modes: cross-region, in-region, mobile, standard +func GetModeConfiguration(mode aws.DefaultsMode) (Configuration, error) { + var mv aws.DefaultsMode + mv.SetFromString(string(mode)) + + switch mv { + case aws.DefaultsModeCrossRegion: + settings := Configuration{ + ConnectTimeout: aws.Duration(3100 * time.Millisecond), + RetryMode: aws.RetryMode("standard"), + TLSNegotiationTimeout: aws.Duration(3100 * time.Millisecond), + } + return settings, nil + case aws.DefaultsModeInRegion: + settings := Configuration{ + ConnectTimeout: aws.Duration(1100 * time.Millisecond), + RetryMode: aws.RetryMode("standard"), + TLSNegotiationTimeout: aws.Duration(1100 * time.Millisecond), + } + return settings, nil + case aws.DefaultsModeMobile: + settings := Configuration{ + ConnectTimeout: aws.Duration(30000 * time.Millisecond), + RetryMode: aws.RetryMode("standard"), + TLSNegotiationTimeout: aws.Duration(30000 * time.Millisecond), + } + return settings, nil + case aws.DefaultsModeStandard: + settings := Configuration{ + ConnectTimeout: aws.Duration(3100 * time.Millisecond), + RetryMode: aws.RetryMode("standard"), + TLSNegotiationTimeout: aws.Duration(3100 * time.Millisecond), + } + return settings, nil + default: + return Configuration{}, fmt.Errorf("unsupported defaults mode: %v", mode) + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/doc.go new file mode 100644 index 00000000..2d90011b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/doc.go @@ -0,0 +1,2 @@ +// Package defaults provides recommended configuration values for AWS SDKs and CLIs. +package defaults diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/defaultsmode.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/defaultsmode.go new file mode 100644 index 00000000..fcf9387c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/defaultsmode.go @@ -0,0 +1,95 @@ +// Code generated by github.com/aws/aws-sdk-go-v2/internal/codegen/cmd/defaultsmode. DO NOT EDIT. + +package aws + +import ( + "strings" +) + +// DefaultsMode is the SDK defaults mode setting. +type DefaultsMode string + +// The DefaultsMode constants. +const ( + // DefaultsModeAuto is an experimental mode that builds on the standard mode. + // The SDK will attempt to discover the execution environment to determine the + // appropriate settings automatically. + // + // Note that the auto detection is heuristics-based and does not guarantee 100% + // accuracy. STANDARD mode will be used if the execution environment cannot + // be determined. The auto detection might query EC2 Instance Metadata service + // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html), + // which might introduce latency. Therefore we recommend choosing an explicit + // defaults_mode instead if startup latency is critical to your application + DefaultsModeAuto DefaultsMode = "auto" + + // DefaultsModeCrossRegion builds on the standard mode and includes optimization + // tailored for applications which call AWS services in a different region + // + // Note that the default values vended from this mode might change as best practices + // may evolve. As a result, it is encouraged to perform tests when upgrading + // the SDK + DefaultsModeCrossRegion DefaultsMode = "cross-region" + + // DefaultsModeInRegion builds on the standard mode and includes optimization + // tailored for applications which call AWS services from within the same AWS + // region + // + // Note that the default values vended from this mode might change as best practices + // may evolve. As a result, it is encouraged to perform tests when upgrading + // the SDK + DefaultsModeInRegion DefaultsMode = "in-region" + + // DefaultsModeLegacy provides default settings that vary per SDK and were used + // prior to establishment of defaults_mode + DefaultsModeLegacy DefaultsMode = "legacy" + + // DefaultsModeMobile builds on the standard mode and includes optimization + // tailored for mobile applications + // + // Note that the default values vended from this mode might change as best practices + // may evolve. As a result, it is encouraged to perform tests when upgrading + // the SDK + DefaultsModeMobile DefaultsMode = "mobile" + + // DefaultsModeStandard provides the latest recommended default values that + // should be safe to run in most scenarios + // + // Note that the default values vended from this mode might change as best practices + // may evolve. As a result, it is encouraged to perform tests when upgrading + // the SDK + DefaultsModeStandard DefaultsMode = "standard" +) + +// SetFromString sets the DefaultsMode value to one of the pre-defined constants that matches +// the provided string when compared using EqualFold. If the value does not match a known +// constant it will be set to as-is and the function will return false. As a special case, if the +// provided value is a zero-length string, the mode will be set to LegacyDefaultsMode. +func (d *DefaultsMode) SetFromString(v string) (ok bool) { + switch { + case strings.EqualFold(v, string(DefaultsModeAuto)): + *d = DefaultsModeAuto + ok = true + case strings.EqualFold(v, string(DefaultsModeCrossRegion)): + *d = DefaultsModeCrossRegion + ok = true + case strings.EqualFold(v, string(DefaultsModeInRegion)): + *d = DefaultsModeInRegion + ok = true + case strings.EqualFold(v, string(DefaultsModeLegacy)): + *d = DefaultsModeLegacy + ok = true + case strings.EqualFold(v, string(DefaultsModeMobile)): + *d = DefaultsModeMobile + ok = true + case strings.EqualFold(v, string(DefaultsModeStandard)): + *d = DefaultsModeStandard + ok = true + case len(v) == 0: + *d = DefaultsModeLegacy + ok = true + default: + *d = DefaultsMode(v) + } + return ok +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/doc.go index befc3bee..d8b6e09e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/doc.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/doc.go @@ -1,7 +1,7 @@ // Package aws provides the core SDK's utilities and shared types. Use this package's // utilities to simplify setting and reading API operations parameters. // -// Value and Pointer Conversion Utilities +// # Value and Pointer Conversion Utilities // // This package includes a helper conversion utility for each scalar type the SDK's // API use. These utilities make getting a pointer of the scalar, and dereferencing @@ -16,33 +16,33 @@ // to get pointer of a literal string value, because getting the address of a // literal requires assigning the value to a variable first. // -// var strPtr *string +// var strPtr *string // -// // Without the SDK's conversion functions -// str := "my string" -// strPtr = &str +// // Without the SDK's conversion functions +// str := "my string" +// strPtr = &str // -// // With the SDK's conversion functions -// strPtr = aws.String("my string") +// // With the SDK's conversion functions +// strPtr = aws.String("my string") // -// // Convert *string to string value -// str = aws.ToString(strPtr) +// // Convert *string to string value +// str = aws.ToString(strPtr) // // In addition to scalars the aws package also includes conversion utilities for // map and slice for commonly types used in API parameters. The map and slice // conversion functions use similar naming pattern as the scalar conversion // functions. // -// var strPtrs []*string -// var strs []string = []string{"Go", "Gophers", "Go"} +// var strPtrs []*string +// var strs []string = []string{"Go", "Gophers", "Go"} // -// // Convert []string to []*string -// strPtrs = aws.StringSlice(strs) +// // Convert []string to []*string +// strPtrs = aws.StringSlice(strs) // -// // Convert []*string to []string -// strs = aws.ToStringSlice(strPtrs) +// // Convert []*string to []string +// strs = aws.ToStringSlice(strPtrs) // -// SDK Default HTTP Client +// # SDK Default HTTP Client // // The SDK will use the http.DefaultClient if a HTTP client is not provided to // the SDK's Session, or service client constructor. This means that if the diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/endpoints.go index dadb2b40..aa10a9b4 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/endpoints.go @@ -4,6 +4,66 @@ import ( "fmt" ) +// DualStackEndpointState is a constant to describe the dual-stack endpoint resolution behavior. +type DualStackEndpointState uint + +const ( + // DualStackEndpointStateUnset is the default value behavior for dual-stack endpoint resolution. + DualStackEndpointStateUnset DualStackEndpointState = iota + + // DualStackEndpointStateEnabled enables dual-stack endpoint resolution for service endpoints. + DualStackEndpointStateEnabled + + // DualStackEndpointStateDisabled disables dual-stack endpoint resolution for endpoints. + DualStackEndpointStateDisabled +) + +// GetUseDualStackEndpoint takes a service's EndpointResolverOptions and returns the UseDualStackEndpoint value. +// Returns boolean false if the provided options does not have a method to retrieve the DualStackEndpointState. +func GetUseDualStackEndpoint(options ...interface{}) (value DualStackEndpointState, found bool) { + type iface interface { + GetUseDualStackEndpoint() DualStackEndpointState + } + for _, option := range options { + if i, ok := option.(iface); ok { + value = i.GetUseDualStackEndpoint() + found = true + break + } + } + return value, found +} + +// FIPSEndpointState is a constant to describe the FIPS endpoint resolution behavior. +type FIPSEndpointState uint + +const ( + // FIPSEndpointStateUnset is the default value behavior for FIPS endpoint resolution. + FIPSEndpointStateUnset FIPSEndpointState = iota + + // FIPSEndpointStateEnabled enables FIPS endpoint resolution for service endpoints. + FIPSEndpointStateEnabled + + // FIPSEndpointStateDisabled disables FIPS endpoint resolution for endpoints. + FIPSEndpointStateDisabled +) + +// GetUseFIPSEndpoint takes a service's EndpointResolverOptions and returns the UseDualStackEndpoint value. +// Returns boolean false if the provided options does not have a method to retrieve the DualStackEndpointState. +func GetUseFIPSEndpoint(options ...interface{}) (value FIPSEndpointState, found bool) { + type iface interface { + GetUseFIPSEndpoint() FIPSEndpointState + } + for _, option := range options { + if i, ok := option.(iface); ok { + value = i.GetUseFIPSEndpoint() + found = true + break + } + } + return value, found +} + // Endpoint represents the endpoint a service client should make API operation // calls to. // @@ -100,14 +160,70 @@ func (e *EndpointNotFoundError) Unwrap() error { // available. If the EndpointResolver returns an EndpointNotFoundError error, // API clients will fallback to attempting to resolve the endpoint using its // internal default endpoint resolver. +// +// Deprecated: See EndpointResolverWithOptions type EndpointResolver interface { ResolveEndpoint(service, region string) (Endpoint, error) } // EndpointResolverFunc wraps a function to satisfy the EndpointResolver interface. +// +// Deprecated: See EndpointResolverWithOptionsFunc type EndpointResolverFunc func(service, region string) (Endpoint, error) // ResolveEndpoint calls the wrapped function and returns the results. +// +// Deprecated: See EndpointResolverWithOptions.ResolveEndpoint func (e EndpointResolverFunc) ResolveEndpoint(service, region string) (Endpoint, error) { return e(service, region) } + +// EndpointResolverWithOptions is an endpoint resolver that can be used to provide or +// override an endpoint for the given service, region, and the service client's EndpointOptions. API clients will +// attempt to use the EndpointResolverWithOptions first to resolve an endpoint if +// available. If the EndpointResolverWithOptions returns an EndpointNotFoundError error, +// API clients will fallback to attempting to resolve the endpoint using its +// internal default endpoint resolver. +type EndpointResolverWithOptions interface { + ResolveEndpoint(service, region string, options ...interface{}) (Endpoint, error) +} + +// EndpointResolverWithOptionsFunc wraps a function to satisfy the EndpointResolverWithOptions interface. +type EndpointResolverWithOptionsFunc func(service, region string, options ...interface{}) (Endpoint, error) + +// ResolveEndpoint calls the wrapped function and returns the results. +func (e EndpointResolverWithOptionsFunc) ResolveEndpoint(service, region string, options ...interface{}) (Endpoint, error) { + return e(service, region, options...) +} + +// GetDisableHTTPS takes a service's EndpointResolverOptions and returns the DisableHTTPS value. +// Returns boolean false if the provided options does not have a method to retrieve the DisableHTTPS. +func GetDisableHTTPS(options ...interface{}) (value bool, found bool) { + type iface interface { + GetDisableHTTPS() bool + } + for _, option := range options { + if i, ok := option.(iface); ok { + value = i.GetDisableHTTPS() + found = true + break + } + } + return value, found +} + +// GetResolvedRegion takes a service's EndpointResolverOptions and returns the ResolvedRegion value. +// Returns boolean false if the provided options does not have a method to retrieve the ResolvedRegion. +func GetResolvedRegion(options ...interface{}) (value string, found bool) { + type iface interface { + GetResolvedRegion() string + } + for _, option := range options { + if i, ok := option.(iface); ok { + value = i.GetResolvedRegion() + found = true + break + } + } + return value, found +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/from_ptr.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/from_ptr.go index 72e29c35..2394418e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/from_ptr.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/from_ptr.go @@ -342,3 +342,24 @@ func ToTimeSlice(vs []*time.Time) []time.Time { func ToTimeMap(vs map[string]*time.Time) map[string]time.Time { return ptr.ToTimeMap(vs) } + +// ToDuration returns time.Duration value dereferenced if the passed +// in pointer was not nil. Returns a time.Duration zero value if the +// pointer was nil. +func ToDuration(p *time.Duration) (v time.Duration) { + return ptr.ToDuration(p) +} + +// ToDurationSlice returns a slice of time.Duration values, that are +// dereferenced if the passed in pointer was not nil. Returns a time.Duration +// zero value if the pointer was nil. +func ToDurationSlice(vs []*time.Duration) []time.Duration { + return ptr.ToDurationSlice(vs) +} + +// ToDurationMap returns a map of time.Duration values, that are +// dereferenced if the passed in pointer was not nil. The time.Duration +// zero value is used if the pointer was nil. +func ToDurationMap(vs map[string]*time.Duration) map[string]time.Duration { + return ptr.ToDurationMap(vs) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go new file mode 100644 index 00000000..66d09630 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package aws + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "1.24.1" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/logging.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/logging.go index f6abb0a6..91c94d98 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/logging.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/logging.go @@ -7,10 +7,12 @@ package aws // The entire 64-bit group is reserved for later expansion by the SDK. // // Example: Setting ClientLogMode to enable logging of retries and requests -// clientLogMode := aws.LogRetries | aws.LogRequest +// +// clientLogMode := aws.LogRetries | aws.LogRequest // // Example: Adding an additional log mode to an existing ClientLogMode value -// clientLogMode |= aws.LogResponse +// +// clientLogMode |= aws.LogResponse type ClientLogMode uint64 // Supported ClientLogMode bits that can be configured to toggle logging of specific SDK events. @@ -21,6 +23,9 @@ const ( LogRequestWithBody LogResponse LogResponseWithBody + LogDeprecatedUsage + LogRequestEventMessage + LogResponseEventMessage ) // IsSigning returns whether the Signing logging mode bit is set @@ -53,6 +58,21 @@ func (m ClientLogMode) IsResponseWithBody() bool { return m&LogResponseWithBody != 0 } +// IsDeprecatedUsage returns whether the DeprecatedUsage logging mode bit is set +func (m ClientLogMode) IsDeprecatedUsage() bool { + return m&LogDeprecatedUsage != 0 +} + +// IsRequestEventMessage returns whether the RequestEventMessage logging mode bit is set +func (m ClientLogMode) IsRequestEventMessage() bool { + return m&LogRequestEventMessage != 0 +} + +// IsResponseEventMessage returns whether the ResponseEventMessage logging mode bit is set +func (m ClientLogMode) IsResponseEventMessage() bool { + return m&LogResponseEventMessage != 0 +} + // ClearSigning clears the Signing logging mode bit func (m *ClientLogMode) ClearSigning() { *m &^= LogSigning @@ -82,3 +102,18 @@ func (m *ClientLogMode) ClearResponse() { func (m *ClientLogMode) ClearResponseWithBody() { *m &^= LogResponseWithBody } + +// ClearDeprecatedUsage clears the DeprecatedUsage logging mode bit +func (m *ClientLogMode) ClearDeprecatedUsage() { + *m &^= LogDeprecatedUsage +} + +// ClearRequestEventMessage clears the RequestEventMessage logging mode bit +func (m *ClientLogMode) ClearRequestEventMessage() { + *m &^= LogRequestEventMessage +} + +// ClearResponseEventMessage clears the ResponseEventMessage logging mode bit +func (m *ClientLogMode) ClearResponseEventMessage() { + *m &^= LogResponseEventMessage +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/logging_generate.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/logging_generate.go index 522bbade..6ecc2231 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/logging_generate.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/logging_generate.go @@ -1,10 +1,13 @@ +//go:build clientlogmode // +build clientlogmode package main import ( + "fmt" "log" "os" + "strings" "text/template" ) @@ -19,13 +22,21 @@ var config = struct { "RequestWithBody", "Response", "ResponseWithBody", + "DeprecatedUsage", + "RequestEventMessage", + "ResponseEventMessage", }, } +func bitName(name string) string { + return strings.ToUpper(name[:1]) + name[1:] +} + var tmpl = template.Must(template.New("ClientLogMode").Funcs(map[string]interface{}{ "symbolName": func(name string) string { - return "Log" + name + return "Log" + bitName(name) }, + "bitName": bitName, }).Parse(`// Code generated by aws/logging_generate.go DO NOT EDIT. package aws @@ -47,23 +58,30 @@ const ( {{ (symbolName $field) }}{{- if (eq 0 $index) }} ClientLogMode = 1 << (64 - 1 - iota){{- end }} {{- end }} ) - {{ range $_, $field := .ModeBits }} -// Is{{- $field }} returns whether the {{ $field }} logging mode bit is set -func (m ClientLogMode) Is{{- $field }}() bool { +// Is{{- bitName $field }} returns whether the {{ bitName $field }} logging mode bit is set +func (m ClientLogMode) Is{{- bitName $field }}() bool { return m&{{- (symbolName $field) }} != 0 } {{ end }} - -{{ range $_, $field := .ModeBits }} -// Clear{{- $field }} clears the {{ $field }} logging mode bit -func (m *ClientLogMode) Clear{{- $field }}() { - *m &^= {{- (symbolName $field) }} +{{- range $_, $field := .ModeBits }} +// Clear{{- bitName $field }} clears the {{ bitName $field }} logging mode bit +func (m *ClientLogMode) Clear{{- bitName $field }}() { + *m &^= {{ (symbolName $field) }} } -{{ end }} +{{ end -}} `)) func main() { + uniqueBitFields := make(map[string]struct{}) + + for _, bitName := range config.ModeBits { + if _, ok := uniqueBitFields[strings.ToLower(bitName)]; ok { + panic(fmt.Sprintf("duplicate bit field: %s", bitName)) + } + uniqueBitFields[bitName] = struct{}{} + } + file, err := os.Create("logging.go") if err != nil { log.Fatal(err) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/metadata.go index 28201217..d66f0960 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/metadata.go @@ -2,6 +2,7 @@ package middleware import ( "context" + "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/smithy-go/middleware" @@ -42,12 +43,13 @@ func (s RegisterServiceMetadata) HandleInitialize( // service metadata keys for storing and lookup of runtime stack information. type ( - serviceIDKey struct{} - signingNameKey struct{} - signingRegionKey struct{} - regionKey struct{} - operationNameKey struct{} - partitionIDKey struct{} + serviceIDKey struct{} + signingNameKey struct{} + signingRegionKey struct{} + regionKey struct{} + operationNameKey struct{} + partitionIDKey struct{} + requiresLegacyEndpointsKey struct{} ) // GetServiceID retrieves the service id from the context. @@ -63,6 +65,9 @@ func GetServiceID(ctx context.Context) (v string) { // // Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues // to clear all stack values. +// +// Deprecated: This value is unstable. The resolved signing name is available +// in the signer properties object passed to the signer. func GetSigningName(ctx context.Context) (v string) { v, _ = middleware.GetStackValue(ctx, signingNameKey{}).(string) return v @@ -72,6 +77,9 @@ func GetSigningName(ctx context.Context) (v string) { // // Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues // to clear all stack values. +// +// Deprecated: This value is unstable. The resolved signing region is available +// in the signer properties object passed to the signer. func GetSigningRegion(ctx context.Context) (v string) { v, _ = middleware.GetStackValue(ctx, signingRegionKey{}).(string) return v @@ -104,10 +112,32 @@ func GetPartitionID(ctx context.Context) string { return v } -// SetSigningName set or modifies the signing name on the context. +// GetRequiresLegacyEndpoints the flag used to indicate if legacy endpoint +// customizations need to be executed. +// +// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues +// to clear all stack values. +func GetRequiresLegacyEndpoints(ctx context.Context) bool { + v, _ := middleware.GetStackValue(ctx, requiresLegacyEndpointsKey{}).(bool) + return v +} + +// SetRequiresLegacyEndpoints set or modifies the flag indicated that +// legacy endpoint customizations are needed. +// +// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues +// to clear all stack values. +func SetRequiresLegacyEndpoints(ctx context.Context, value bool) context.Context { + return middleware.WithStackValue(ctx, requiresLegacyEndpointsKey{}, value) +} + +// SetSigningName set or modifies the sigv4 or sigv4a signing name on the context. // // Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues // to clear all stack values. +// +// Deprecated: This value is unstable. Use WithSigV4SigningName client option +// funcs instead. func SetSigningName(ctx context.Context, value string) context.Context { return middleware.WithStackValue(ctx, signingNameKey{}, value) } @@ -116,6 +146,9 @@ func SetSigningName(ctx context.Context, value string) context.Context { // // Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues // to clear all stack values. +// +// Deprecated: This value is unstable. Use WithSigV4SigningRegion client option +// funcs instead. func SetSigningRegion(ctx context.Context, value string) context.Context { return middleware.WithStackValue(ctx, signingRegionKey{}, value) } @@ -165,3 +198,16 @@ func GetEndpointSource(ctx context.Context) (v aws.EndpointSource) { func SetEndpointSource(ctx context.Context, value aws.EndpointSource) context.Context { return middleware.WithStackValue(ctx, endpointSourceKey{}, value) } + +type signingCredentialsKey struct{} + +// GetSigningCredentials returns the credentials that were used for signing if set on context. +func GetSigningCredentials(ctx context.Context) (v aws.Credentials) { + v, _ = middleware.GetStackValue(ctx, signingCredentialsKey{}).(aws.Credentials) + return v +} + +// SetSigningCredentials sets the credentails used for signing on the context. +func SetSigningCredentials(ctx context.Context, value aws.Credentials) context.Context { + return middleware.WithStackValue(ctx, signingCredentialsKey{}, value) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/osname.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/osname.go new file mode 100644 index 00000000..ba262dad --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/osname.go @@ -0,0 +1,24 @@ +//go:build go1.16 +// +build go1.16 + +package middleware + +import "runtime" + +func getNormalizedOSName() (os string) { + switch runtime.GOOS { + case "android": + os = "android" + case "linux": + os = "linux" + case "windows": + os = "windows" + case "darwin": + os = "macos" + case "ios": + os = "ios" + default: + os = "other" + } + return os +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/osname_go115.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/osname_go115.go new file mode 100644 index 00000000..e14a1e4e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/osname_go115.go @@ -0,0 +1,24 @@ +//go:build !go1.16 +// +build !go1.16 + +package middleware + +import "runtime" + +func getNormalizedOSName() (os string) { + switch runtime.GOOS { + case "android": + os = "android" + case "linux": + os = "linux" + case "windows": + os = "windows" + case "darwin": + // Due to Apple M1 we can't distinguish between macOS and iOS when GOOS/GOARCH is darwin/amd64 + // For now declare this as "other" until we have a better detection mechanism. + fallthrough + default: + os = "other" + } + return os +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/private/metrics/metrics.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/private/metrics/metrics.go new file mode 100644 index 00000000..b0133f4c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/private/metrics/metrics.go @@ -0,0 +1,319 @@ +// Package metrics implements metrics gathering for SDK development purposes. +// +// This package is designated as private and is intended for use only by the +// AWS client runtime. The exported API therein is not considered stable and +// is subject to breaking changes without notice. +package metrics + +import ( + "context" + "encoding/json" + "fmt" + "sync" + "time" + + "github.com/aws/smithy-go/middleware" +) + +const ( + // ServiceIDKey is the key for the service ID metric. + ServiceIDKey = "ServiceId" + // OperationNameKey is the key for the operation name metric. + OperationNameKey = "OperationName" + // ClientRequestIDKey is the key for the client request ID metric. + ClientRequestIDKey = "ClientRequestId" + // APICallDurationKey is the key for the API call duration metric. + APICallDurationKey = "ApiCallDuration" + // APICallSuccessfulKey is the key for the API call successful metric. + APICallSuccessfulKey = "ApiCallSuccessful" + // MarshallingDurationKey is the key for the marshalling duration metric. + MarshallingDurationKey = "MarshallingDuration" + // InThroughputKey is the key for the input throughput metric. + InThroughputKey = "InThroughput" + // OutThroughputKey is the key for the output throughput metric. + OutThroughputKey = "OutThroughput" + // RetryCountKey is the key for the retry count metric. + RetryCountKey = "RetryCount" + // HTTPStatusCodeKey is the key for the HTTP status code metric. + HTTPStatusCodeKey = "HttpStatusCode" + // AWSExtendedRequestIDKey is the key for the AWS extended request ID metric. + AWSExtendedRequestIDKey = "AwsExtendedRequestId" + // AWSRequestIDKey is the key for the AWS request ID metric. + AWSRequestIDKey = "AwsRequestId" + // BackoffDelayDurationKey is the key for the backoff delay duration metric. + BackoffDelayDurationKey = "BackoffDelayDuration" + // StreamThroughputKey is the key for the stream throughput metric. + StreamThroughputKey = "Throughput" + // ConcurrencyAcquireDurationKey is the key for the concurrency acquire duration metric. + ConcurrencyAcquireDurationKey = "ConcurrencyAcquireDuration" + // PendingConcurrencyAcquiresKey is the key for the pending concurrency acquires metric. + PendingConcurrencyAcquiresKey = "PendingConcurrencyAcquires" + // SigningDurationKey is the key for the signing duration metric. + SigningDurationKey = "SigningDuration" + // UnmarshallingDurationKey is the key for the unmarshalling duration metric. + UnmarshallingDurationKey = "UnmarshallingDuration" + // TimeToFirstByteKey is the key for the time to first byte metric. + TimeToFirstByteKey = "TimeToFirstByte" + // ServiceCallDurationKey is the key for the service call duration metric. + ServiceCallDurationKey = "ServiceCallDuration" + // EndpointResolutionDurationKey is the key for the endpoint resolution duration metric. + EndpointResolutionDurationKey = "EndpointResolutionDuration" + // AttemptNumberKey is the key for the attempt number metric. + AttemptNumberKey = "AttemptNumber" + // MaxConcurrencyKey is the key for the max concurrency metric. + MaxConcurrencyKey = "MaxConcurrency" + // AvailableConcurrencyKey is the key for the available concurrency metric. + AvailableConcurrencyKey = "AvailableConcurrency" +) + +// MetricPublisher provides the interface to provide custom MetricPublishers. +// PostRequestMetrics will be invoked by the MetricCollection middleware to post request. +// PostStreamMetrics will be invoked by ReadCloserWithMetrics to post stream metrics. +type MetricPublisher interface { + PostRequestMetrics(*MetricData) error + PostStreamMetrics(*MetricData) error +} + +// Serializer provides the interface to provide custom Serializers. +// Serialize will transform any input object in its corresponding string representation. +type Serializer interface { + Serialize(obj interface{}) (string, error) +} + +// DefaultSerializer is an implementation of the Serializer interface. +type DefaultSerializer struct{} + +// Serialize uses the default JSON serializer to obtain the string representation of an object. +func (DefaultSerializer) Serialize(obj interface{}) (string, error) { + bytes, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(bytes), nil +} + +type metricContextKey struct{} + +// MetricContext contains fields to store metric-related information. +type MetricContext struct { + connectionCounter *SharedConnectionCounter + publisher MetricPublisher + data *MetricData +} + +// MetricData stores the collected metric data. +type MetricData struct { + RequestStartTime time.Time + RequestEndTime time.Time + APICallDuration time.Duration + SerializeStartTime time.Time + SerializeEndTime time.Time + MarshallingDuration time.Duration + ResolveEndpointStartTime time.Time + ResolveEndpointEndTime time.Time + EndpointResolutionDuration time.Duration + InThroughput float64 + OutThroughput float64 + RetryCount int + Success uint8 + StatusCode int + ClientRequestID string + ServiceID string + OperationName string + PartitionID string + Region string + RequestContentLength int64 + Stream StreamMetrics + Attempts []AttemptMetrics +} + +// StreamMetrics stores metrics related to streaming data. +type StreamMetrics struct { + ReadDuration time.Duration + ReadBytes int64 + Throughput float64 +} + +// AttemptMetrics stores metrics related to individual attempts. +type AttemptMetrics struct { + ServiceCallStart time.Time + ServiceCallEnd time.Time + ServiceCallDuration time.Duration + FirstByteTime time.Time + TimeToFirstByte time.Duration + ConnRequestedTime time.Time + ConnObtainedTime time.Time + ConcurrencyAcquireDuration time.Duration + CredentialFetchStartTime time.Time + CredentialFetchEndTime time.Time + SignStartTime time.Time + SignEndTime time.Time + SigningDuration time.Duration + DeserializeStartTime time.Time + DeserializeEndTime time.Time + UnMarshallingDuration time.Duration + RetryDelay time.Duration + ResponseContentLength int64 + StatusCode int + RequestID string + ExtendedRequestID string + HTTPClient string + MaxConcurrency int + PendingConnectionAcquires int + AvailableConcurrency int + ActiveRequests int + ReusedConnection bool +} + +// Data returns the MetricData associated with the MetricContext. +func (mc *MetricContext) Data() *MetricData { + return mc.data +} + +// ConnectionCounter returns the SharedConnectionCounter associated with the MetricContext. +func (mc *MetricContext) ConnectionCounter() *SharedConnectionCounter { + return mc.connectionCounter +} + +// Publisher returns the MetricPublisher associated with the MetricContext. +func (mc *MetricContext) Publisher() MetricPublisher { + return mc.publisher +} + +// ComputeRequestMetrics calculates and populates derived metrics based on the collected data. +func (md *MetricData) ComputeRequestMetrics() { + + for idx := range md.Attempts { + attempt := &md.Attempts[idx] + attempt.ConcurrencyAcquireDuration = attempt.ConnObtainedTime.Sub(attempt.ConnRequestedTime) + attempt.SigningDuration = attempt.SignEndTime.Sub(attempt.SignStartTime) + attempt.UnMarshallingDuration = attempt.DeserializeEndTime.Sub(attempt.DeserializeStartTime) + attempt.TimeToFirstByte = attempt.FirstByteTime.Sub(attempt.ServiceCallStart) + attempt.ServiceCallDuration = attempt.ServiceCallEnd.Sub(attempt.ServiceCallStart) + } + + md.APICallDuration = md.RequestEndTime.Sub(md.RequestStartTime) + md.MarshallingDuration = md.SerializeEndTime.Sub(md.SerializeStartTime) + md.EndpointResolutionDuration = md.ResolveEndpointEndTime.Sub(md.ResolveEndpointStartTime) + + md.RetryCount = len(md.Attempts) - 1 + + latestAttempt, err := md.LatestAttempt() + + if err != nil { + fmt.Printf("error retrieving attempts data due to: %s. Skipping Throughput metrics", err.Error()) + } else { + + md.StatusCode = latestAttempt.StatusCode + + if md.Success == 1 { + if latestAttempt.ResponseContentLength > 0 && latestAttempt.ServiceCallDuration > 0 { + md.InThroughput = float64(latestAttempt.ResponseContentLength) / latestAttempt.ServiceCallDuration.Seconds() + } + if md.RequestContentLength > 0 && latestAttempt.ServiceCallDuration > 0 { + md.OutThroughput = float64(md.RequestContentLength) / latestAttempt.ServiceCallDuration.Seconds() + } + } + } +} + +// LatestAttempt returns the latest attempt metrics. +// It returns an error if no attempts are initialized. +func (md *MetricData) LatestAttempt() (*AttemptMetrics, error) { + if md.Attempts == nil || len(md.Attempts) == 0 { + return nil, fmt.Errorf("no attempts initialized. NewAttempt() should be called first") + } + return &md.Attempts[len(md.Attempts)-1], nil +} + +// NewAttempt initializes new attempt metrics. +func (md *MetricData) NewAttempt() { + if md.Attempts == nil { + md.Attempts = []AttemptMetrics{} + } + md.Attempts = append(md.Attempts, AttemptMetrics{}) +} + +// SharedConnectionCounter is a counter shared across API calls. +type SharedConnectionCounter struct { + mu sync.Mutex + + activeRequests int + pendingConnectionAcquire int +} + +// ActiveRequests returns the count of active requests. +func (cc *SharedConnectionCounter) ActiveRequests() int { + cc.mu.Lock() + defer cc.mu.Unlock() + + return cc.activeRequests +} + +// PendingConnectionAcquire returns the count of pending connection acquires. +func (cc *SharedConnectionCounter) PendingConnectionAcquire() int { + cc.mu.Lock() + defer cc.mu.Unlock() + + return cc.pendingConnectionAcquire +} + +// AddActiveRequest increments the count of active requests. +func (cc *SharedConnectionCounter) AddActiveRequest() { + cc.mu.Lock() + defer cc.mu.Unlock() + + cc.activeRequests++ +} + +// RemoveActiveRequest decrements the count of active requests. +func (cc *SharedConnectionCounter) RemoveActiveRequest() { + cc.mu.Lock() + defer cc.mu.Unlock() + + cc.activeRequests-- +} + +// AddPendingConnectionAcquire increments the count of pending connection acquires. +func (cc *SharedConnectionCounter) AddPendingConnectionAcquire() { + cc.mu.Lock() + defer cc.mu.Unlock() + + cc.pendingConnectionAcquire++ +} + +// RemovePendingConnectionAcquire decrements the count of pending connection acquires. +func (cc *SharedConnectionCounter) RemovePendingConnectionAcquire() { + cc.mu.Lock() + defer cc.mu.Unlock() + + cc.pendingConnectionAcquire-- +} + +// InitMetricContext initializes the metric context with the provided counter and publisher. +// It returns the updated context. +func InitMetricContext( + ctx context.Context, counter *SharedConnectionCounter, publisher MetricPublisher, +) context.Context { + if middleware.GetStackValue(ctx, metricContextKey{}) == nil { + ctx = middleware.WithStackValue(ctx, metricContextKey{}, &MetricContext{ + connectionCounter: counter, + publisher: publisher, + data: &MetricData{ + Attempts: []AttemptMetrics{}, + Stream: StreamMetrics{}, + }, + }) + } + return ctx +} + +// Context returns the metric context from the given context. +// It returns nil if the metric context is not found. +func Context(ctx context.Context) *MetricContext { + mctx := middleware.GetStackValue(ctx, metricContextKey{}) + if mctx == nil { + return nil + } + return mctx.(*MetricContext) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/recursion_detection.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/recursion_detection.go new file mode 100644 index 00000000..3f6aaf23 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/recursion_detection.go @@ -0,0 +1,94 @@ +package middleware + +import ( + "context" + "fmt" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "os" +) + +const envAwsLambdaFunctionName = "AWS_LAMBDA_FUNCTION_NAME" +const envAmznTraceID = "_X_AMZN_TRACE_ID" +const amznTraceIDHeader = "X-Amzn-Trace-Id" + +// AddRecursionDetection adds recursionDetection to the middleware stack +func AddRecursionDetection(stack *middleware.Stack) error { + return stack.Build.Add(&RecursionDetection{}, middleware.After) +} + +// RecursionDetection detects Lambda environment and sets its X-Ray trace ID to request header if absent +// to avoid recursion invocation in Lambda +type RecursionDetection struct{} + +// ID returns the middleware identifier +func (m *RecursionDetection) ID() string { + return "RecursionDetection" +} + +// HandleBuild detects Lambda environment and adds its trace ID to request header if absent +func (m *RecursionDetection) HandleBuild( + ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, +) ( + out middleware.BuildOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown request type %T", req) + } + + _, hasLambdaEnv := os.LookupEnv(envAwsLambdaFunctionName) + xAmznTraceID, hasTraceID := os.LookupEnv(envAmznTraceID) + value := req.Header.Get(amznTraceIDHeader) + // only set the X-Amzn-Trace-Id header when it is not set initially, the + // current environment is Lambda and the _X_AMZN_TRACE_ID env variable exists + if value != "" || !hasLambdaEnv || !hasTraceID { + return next.HandleBuild(ctx, in) + } + + req.Header.Set(amznTraceIDHeader, percentEncode(xAmznTraceID)) + return next.HandleBuild(ctx, in) +} + +func percentEncode(s string) string { + upperhex := "0123456789ABCDEF" + hexCount := 0 + for i := 0; i < len(s); i++ { + c := s[i] + if shouldEncode(c) { + hexCount++ + } + } + + if hexCount == 0 { + return s + } + + required := len(s) + 2*hexCount + t := make([]byte, required) + j := 0 + for i := 0; i < len(s); i++ { + if c := s[i]; shouldEncode(c) { + t[j] = '%' + t[j+1] = upperhex[c>>4] + t[j+2] = upperhex[c&15] + j += 3 + } else { + t[j] = c + j++ + } + } + return string(t) +} + +func shouldEncode(c byte) bool { + if 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || '0' <= c && c <= '9' { + return false + } + switch c { + case '-', '=', ';', ':', '+', '&', '[', ']', '{', '}', '"', '\'', ',': + return false + default: + return true + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/user_agent.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/user_agent.go index 80418d72..af3447dd 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/user_agent.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/user_agent.go @@ -59,6 +59,11 @@ func (k SDKAgentKeyType) string() string { const execEnvVar = `AWS_EXECUTION_ENV` +var validChars = map[rune]bool{ + '!': true, '#': true, '$': true, '%': true, '&': true, '\'': true, '*': true, '+': true, + '-': true, '.': true, '^': true, '_': true, '`': true, '|': true, '~': true, +} + // requestUserAgent is a build middleware that set the User-Agent for the request. type requestUserAgent struct { sdkAgent, userAgent *smithyhttp.UserAgentBuilder @@ -68,10 +73,12 @@ type requestUserAgent struct { // request. // // User-Agent example: -// aws-sdk-go-v2/1.2.3 +// +// aws-sdk-go-v2/1.2.3 // // X-Amz-User-Agent example: -// aws-sdk-go-v2/1.2.3 md/GOOS/linux md/GOARCH/amd64 lang/go/1.15 +// +// aws-sdk-go-v2/1.2.3 md/GOOS/linux md/GOARCH/amd64 lang/go/1.15 func newRequestUserAgent() *requestUserAgent { userAgent, sdkAgent := smithyhttp.NewUserAgentBuilder(), smithyhttp.NewUserAgentBuilder() addProductName(userAgent) @@ -87,24 +94,6 @@ func newRequestUserAgent() *requestUserAgent { return r } -func getNormalizedOSName() (os string) { - switch runtime.GOOS { - case "android": - os = "android" - case "linux": - os = "linux" - case "windows": - os = "windows" - case "darwin": - // Due to Apple M1 we can't distinguish between macOS and iOS when GOOS/GOARCH is darwin/amd64 - // For now declare this as "other" until we have a better detection mechanism. - fallthrough - default: - os = "other" - } - return os -} - func addSDKMetadata(r *requestUserAgent) { r.AddSDKAgentKey(OperatingSystemMetadata, getNormalizedOSName()) r.AddSDKAgentKeyValue(LanguageMetadata, "go", languageVersion) @@ -194,22 +183,24 @@ func getOrAddRequestUserAgent(stack *middleware.Stack) (*requestUserAgent, error // AddUserAgentKey adds the component identified by name to the User-Agent string. func (u *requestUserAgent) AddUserAgentKey(key string) { - u.userAgent.AddKey(key) + u.userAgent.AddKey(strings.Map(rules, key)) } // AddUserAgentKeyValue adds the key identified by the given name and value to the User-Agent string. func (u *requestUserAgent) AddUserAgentKeyValue(key, value string) { - u.userAgent.AddKeyValue(key, value) + u.userAgent.AddKeyValue(strings.Map(rules, key), strings.Map(rules, value)) } // AddUserAgentKey adds the component identified by name to the User-Agent string. func (u *requestUserAgent) AddSDKAgentKey(keyType SDKAgentKeyType, key string) { - u.sdkAgent.AddKey(keyType.string() + "/" + key) + // TODO: should target sdkAgent + u.userAgent.AddKey(keyType.string() + "/" + strings.Map(rules, key)) } // AddUserAgentKeyValue adds the key identified by the given name and value to the User-Agent string. func (u *requestUserAgent) AddSDKAgentKeyValue(keyType SDKAgentKeyType, key, value string) { - u.sdkAgent.AddKeyValue(keyType.string()+"/"+key, value) + // TODO: should target sdkAgent + u.userAgent.AddKeyValue(keyType.string(), strings.Map(rules, key)+"#"+strings.Map(rules, value)) } // ID the name of the middleware. @@ -224,7 +215,8 @@ func (u *requestUserAgent) HandleBuild(ctx context.Context, in middleware.BuildI switch req := in.Request.(type) { case *smithyhttp.Request: u.addHTTPUserAgent(req) - u.addHTTPSDKAgent(req) + // TODO: To be re-enabled + // u.addHTTPSDKAgent(req) default: return out, metadata, fmt.Errorf("unknown transport type %T", in) } @@ -254,3 +246,16 @@ func updateHTTPHeader(request *smithyhttp.Request, header string, value string) } request.Header[header] = append(request.Header[header][:0], current) } + +func rules(r rune) rune { + switch { + case r >= '0' && r <= '9': + return r + case r >= 'A' && r <= 'Z' || r >= 'a' && r <= 'z': + return r + case validChars[r]: + return r + default: + return '-' + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/array.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/array.go index 77dd4d8d..47ebc0f5 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/array.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/array.go @@ -9,9 +9,9 @@ import ( // representation of a list of values of a fixed type. A serialized array might // look like the following: // -// ListName.member.1=foo -// &ListName.member.2=bar -// &Listname.member.3=baz +// ListName.member.1=foo +// &ListName.member.2=bar +// &Listname.member.3=baz type Array struct { // The query values to add the array to. values url.Values @@ -36,20 +36,31 @@ type Array struct { memberName string // Elements are stored in values, so we keep track of the list size here. size int32 + // Empty lists are encoded as "=", if we add a value later we will + // remove this encoding + emptyValue Value } func newArray(values url.Values, prefix string, flat bool, memberName string) *Array { + emptyValue := newValue(values, prefix, flat) + emptyValue.String("") + return &Array{ values: values, prefix: prefix, flat: flat, memberName: memberName, + emptyValue: emptyValue, } } // Value adds a new element to the Query Array. Returns a Value type used to // encode the array element. func (a *Array) Value() Value { + if a.size == 0 { + delete(a.values, a.emptyValue.key) + } + // Query lists start a 1, so adjust the size first a.size++ prefix := a.prefix diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/map.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/map.go index ab91e357..dea242b8 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/map.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/map.go @@ -11,10 +11,10 @@ import ( // the values must all be of the same type, and that map entries are ordered. // A serialized map might look like the following: // -// MapName.entry.1.key=Foo -// &MapName.entry.1.value=spam -// &MapName.entry.2.key=Bar -// &MapName.entry.2.value=eggs +// MapName.entry.1.key=Foo +// &MapName.entry.1.value=spam +// &MapName.entry.2.key=Bar +// &MapName.entry.2.value=eggs type Map struct { // The query values to add the map to. values url.Values diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/object.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/object.go index debb413d..455b9251 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/object.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/object.go @@ -10,8 +10,8 @@ import ( // values where there is a fixed set of keys whose values each have their // own known type. A serialized object might look like the following: // -// ObjectName.Foo=value -// &ObjectName.Bar=5 +// ObjectName.Foo=value +// &ObjectName.Bar=5 type Object struct { // The query values to add the object to. values url.Values @@ -41,6 +41,12 @@ func (o *Object) Key(name string) Value { return o.key(name, false) } +// KeyWithValues adds the given named key to the Query object. +// Returns a Value encoder that should be used to encode a Query list of values. +func (o *Object) KeyWithValues(name string) Value { + return o.keyWithValues(name, false) +} + // FlatKey adds the given named key to the Query object. // Returns a Value encoder that should be used to encode a Query value type. The // value will be flattened if it is a map or array. @@ -54,3 +60,10 @@ func (o *Object) key(name string, flatValue bool) Value { } return newValue(o.values, name, flatValue) } + +func (o *Object) keyWithValues(name string, flatValue bool) Value { + if o.prefix != "" { + return newAppendValue(o.values, fmt.Sprintf("%s.%s", o.prefix, name), flatValue) + } + return newAppendValue(o.values, name, flatValue) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/value.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/value.go index 302525ab..a9251521 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/value.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/value.go @@ -27,6 +27,15 @@ func newValue(values url.Values, key string, flat bool) Value { } } +func newAppendValue(values url.Values, key string, flat bool) Value { + return Value{ + values: values, + key: key, + flat: flat, + queryValue: httpbinding.NewQueryValue(values, key, true), + } +} + func newBaseValue(values url.Values) Value { return Value{ values: values, diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/xml/error_utils.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/xml/error_utils.go index c228f7d8..6975ce65 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/xml/error_utils.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/xml/error_utils.go @@ -21,26 +21,18 @@ func GetErrorResponseComponents(r io.Reader, noErrorWrapping bool) (ErrorCompone if err := xml.NewDecoder(r).Decode(&errResponse); err != nil && err != io.EOF { return ErrorComponents{}, fmt.Errorf("error while deserializing xml error response: %w", err) } - return ErrorComponents{ - Code: errResponse.Code, - Message: errResponse.Message, - RequestID: errResponse.RequestID, - }, nil + return ErrorComponents(errResponse), nil } var errResponse wrappedErrorResponse if err := xml.NewDecoder(r).Decode(&errResponse); err != nil && err != io.EOF { return ErrorComponents{}, fmt.Errorf("error while deserializing xml error response: %w", err) } - return ErrorComponents{ - Code: errResponse.Code, - Message: errResponse.Message, - RequestID: errResponse.RequestID, - }, nil + return ErrorComponents(errResponse), nil } // noWrappedErrorResponse represents the error response body with -// no internal ... +// wrapped within Error type wrappedErrorResponse struct { Code string `xml:"Error>Code"` Message string `xml:"Error>Message"` diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/token_bucket.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/token_bucket.go index f337803f..974ef594 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/token_bucket.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/token_bucket.go @@ -7,17 +7,19 @@ import ( // TokenBucket provides a concurrency safe utility for adding and removing // tokens from the available token bucket. type TokenBucket struct { - capacity uint - maxCapacity uint - mu sync.Mutex + remainingTokens uint + maxCapacity uint + minCapacity uint + mu sync.Mutex } // NewTokenBucket returns an initialized TokenBucket with the capacity // specified. func NewTokenBucket(i uint) *TokenBucket { return &TokenBucket{ - capacity: i, - maxCapacity: i, + remainingTokens: i, + maxCapacity: i, + minCapacity: 1, } } @@ -25,17 +27,18 @@ func NewTokenBucket(i uint) *TokenBucket { // there are tokens available true will be returned along with the number of // available tokens remaining. If amount requested is larger than the available // capacity, false will be returned along with the available capacity. If the -// amount is less than the available capacity +// amount is less than the available capacity, the capacity will be reduced by +// that amount, and the remaining capacity and true will be returned. func (t *TokenBucket) Retrieve(amount uint) (available uint, retrieved bool) { t.mu.Lock() defer t.mu.Unlock() - if amount > t.capacity { - return t.capacity, false + if amount > t.remainingTokens { + return t.remainingTokens, false } - t.capacity -= amount - return t.capacity, true + t.remainingTokens -= amount + return t.remainingTokens, true } // Refund returns the amount of tokens back to the available token bucket, up @@ -44,8 +47,50 @@ func (t *TokenBucket) Refund(amount uint) { t.mu.Lock() defer t.mu.Unlock() - t.capacity += amount - if t.capacity > t.maxCapacity { - t.capacity = t.maxCapacity + // Capacity cannot exceed max capacity. + t.remainingTokens = uintMin(t.remainingTokens+amount, t.maxCapacity) +} + +// Capacity returns the maximum capacity of tokens that the bucket could +// contain. +func (t *TokenBucket) Capacity() uint { + t.mu.Lock() + defer t.mu.Unlock() + + return t.maxCapacity +} + +// Remaining returns the number of tokens that remaining in the bucket. +func (t *TokenBucket) Remaining() uint { + t.mu.Lock() + defer t.mu.Unlock() + + return t.remainingTokens +} + +// Resize adjusts the size of the token bucket. Returns the capacity remaining. +func (t *TokenBucket) Resize(size uint) uint { + t.mu.Lock() + defer t.mu.Unlock() + + t.maxCapacity = uintMax(size, t.minCapacity) + + // Capacity needs to be capped at max capacity, if max size reduced. + t.remainingTokens = uintMin(t.remainingTokens, t.maxCapacity) + + return t.remainingTokens +} + +func uintMin(a, b uint) uint { + if a < b { + return a + } + return b +} + +func uintMax(a, b uint) uint { + if a > b { + return a } + return b } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/token_rate_limit.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/token_rate_limit.go index d7997f42..d89090ad 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/token_rate_limit.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/token_rate_limit.go @@ -30,10 +30,6 @@ func NewTokenRateLimit(tokens uint) *TokenRateLimit { } } -func isTimeoutError(error) bool { - return false -} - type canceledError struct { Err error } @@ -69,6 +65,11 @@ func (l *TokenRateLimit) AddTokens(v uint) error { return nil } +// Remaining returns the number of remaining tokens in the bucket. +func (l *TokenRateLimit) Remaining() uint { + return l.bucket.Remaining() +} + // QuotaExceededError provides the SDK error when the retries for a given // token bucket have been exhausted. type QuotaExceededError struct { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive.go new file mode 100644 index 00000000..4dfde857 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive.go @@ -0,0 +1,156 @@ +package retry + +import ( + "context" + "fmt" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/sdk" +) + +const ( + // DefaultRequestCost is the cost of a single request from the adaptive + // rate limited token bucket. + DefaultRequestCost uint = 1 +) + +// DefaultThrottles provides the set of errors considered throttle errors that +// are checked by default. +var DefaultThrottles = []IsErrorThrottle{ + ThrottleErrorCode{ + Codes: DefaultThrottleErrorCodes, + }, +} + +// AdaptiveModeOptions provides the functional options for configuring the +// adaptive retry mode, and delay behavior. +type AdaptiveModeOptions struct { + // If the adaptive token bucket is empty, when an attempt will be made + // AdaptiveMode will sleep until a token is available. This can occur when + // attempts fail with throttle errors. Use this option to disable the sleep + // until token is available, and return error immediately. + FailOnNoAttemptTokens bool + + // The cost of an attempt from the AdaptiveMode's adaptive token bucket. + RequestCost uint + + // Set of strategies to determine if the attempt failed due to a throttle + // error. + // + // It is safe to append to this list in NewAdaptiveMode's functional options. + Throttles []IsErrorThrottle + + // Set of options for standard retry mode that AdaptiveMode is built on top + // of. AdaptiveMode may apply its own defaults to Standard retry mode that + // are different than the defaults of NewStandard. Use these options to + // override the default options. + StandardOptions []func(*StandardOptions) +} + +// AdaptiveMode provides an experimental retry strategy that expands on the +// Standard retry strategy, adding client attempt rate limits. The attempt rate +// limit is initially unrestricted, but becomes restricted when the attempt +// fails with for a throttle error. When restricted AdaptiveMode may need to +// sleep before an attempt is made, if too many throttles have been received. +// AdaptiveMode's sleep can be canceled with context cancel. Set +// AdaptiveModeOptions FailOnNoAttemptTokens to change the behavior from sleep, +// to fail fast. +// +// Eventually unrestricted attempt rate limit will be restored once attempts no +// longer are failing due to throttle errors. +type AdaptiveMode struct { + options AdaptiveModeOptions + throttles IsErrorThrottles + + retryer aws.RetryerV2 + rateLimit *adaptiveRateLimit +} + +// NewAdaptiveMode returns an initialized AdaptiveMode retry strategy. +func NewAdaptiveMode(optFns ...func(*AdaptiveModeOptions)) *AdaptiveMode { + o := AdaptiveModeOptions{ + RequestCost: DefaultRequestCost, + Throttles: append([]IsErrorThrottle{}, DefaultThrottles...), + } + for _, fn := range optFns { + fn(&o) + } + + return &AdaptiveMode{ + options: o, + throttles: IsErrorThrottles(o.Throttles), + retryer: NewStandard(o.StandardOptions...), + rateLimit: newAdaptiveRateLimit(), + } +} + +// IsErrorRetryable returns if the failed attempt is retryable. This check +// should determine if the error can be retried, or if the error is +// terminal. +func (a *AdaptiveMode) IsErrorRetryable(err error) bool { + return a.retryer.IsErrorRetryable(err) +} + +// MaxAttempts returns the maximum number of attempts that can be made for +// an attempt before failing. A value of 0 implies that the attempt should +// be retried until it succeeds if the errors are retryable. +func (a *AdaptiveMode) MaxAttempts() int { + return a.retryer.MaxAttempts() +} + +// RetryDelay returns the delay that should be used before retrying the +// attempt. Will return error if the if the delay could not be determined. +func (a *AdaptiveMode) RetryDelay(attempt int, opErr error) ( + time.Duration, error, +) { + return a.retryer.RetryDelay(attempt, opErr) +} + +// GetRetryToken attempts to deduct the retry cost from the retry token pool. +// Returning the token release function, or error. +func (a *AdaptiveMode) GetRetryToken(ctx context.Context, opErr error) ( + releaseToken func(error) error, err error, +) { + return a.retryer.GetRetryToken(ctx, opErr) +} + +// GetInitialToken returns the initial attempt token that can increment the +// retry token pool if the attempt is successful. +// +// Deprecated: This method does not provide a way to block using Context, +// nor can it return an error. Use RetryerV2, and GetAttemptToken instead. Only +// present to implement Retryer interface. +func (a *AdaptiveMode) GetInitialToken() (releaseToken func(error) error) { + return nopRelease +} + +// GetAttemptToken returns the attempt token that can be used to rate limit +// attempt calls. Will be used by the SDK's retry package's Attempt +// middleware to get an attempt token prior to calling the temp and releasing +// the attempt token after the attempt has been made. +func (a *AdaptiveMode) GetAttemptToken(ctx context.Context) (func(error) error, error) { + for { + acquiredToken, waitTryAgain := a.rateLimit.AcquireToken(a.options.RequestCost) + if acquiredToken { + break + } + if a.options.FailOnNoAttemptTokens { + return nil, fmt.Errorf( + "unable to get attempt token, and FailOnNoAttemptTokens enables") + } + + if err := sdk.SleepWithContext(ctx, waitTryAgain); err != nil { + return nil, fmt.Errorf("failed to wait for token to be available, %w", err) + } + } + + return a.handleResponse, nil +} + +func (a *AdaptiveMode) handleResponse(opErr error) error { + throttled := a.throttles.IsErrorThrottle(opErr).Bool() + + a.rateLimit.Update(throttled) + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive_ratelimit.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive_ratelimit.go new file mode 100644 index 00000000..ad96d9b8 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive_ratelimit.go @@ -0,0 +1,158 @@ +package retry + +import ( + "math" + "sync" + "time" + + "github.com/aws/aws-sdk-go-v2/internal/sdk" +) + +type adaptiveRateLimit struct { + tokenBucketEnabled bool + + smooth float64 + beta float64 + scaleConstant float64 + minFillRate float64 + + fillRate float64 + calculatedRate float64 + lastRefilled time.Time + measuredTxRate float64 + lastTxRateBucket float64 + requestCount int64 + lastMaxRate float64 + lastThrottleTime time.Time + timeWindow float64 + + tokenBucket *adaptiveTokenBucket + + mu sync.Mutex +} + +func newAdaptiveRateLimit() *adaptiveRateLimit { + now := sdk.NowTime() + return &adaptiveRateLimit{ + smooth: 0.8, + beta: 0.7, + scaleConstant: 0.4, + + minFillRate: 0.5, + + lastTxRateBucket: math.Floor(timeFloat64Seconds(now)), + lastThrottleTime: now, + + tokenBucket: newAdaptiveTokenBucket(0), + } +} + +func (a *adaptiveRateLimit) Enable(v bool) { + a.mu.Lock() + defer a.mu.Unlock() + + a.tokenBucketEnabled = v +} + +func (a *adaptiveRateLimit) AcquireToken(amount uint) ( + tokenAcquired bool, waitTryAgain time.Duration, +) { + a.mu.Lock() + defer a.mu.Unlock() + + if !a.tokenBucketEnabled { + return true, 0 + } + + a.tokenBucketRefill() + + available, ok := a.tokenBucket.Retrieve(float64(amount)) + if !ok { + waitDur := float64Seconds((float64(amount) - available) / a.fillRate) + return false, waitDur + } + + return true, 0 +} + +func (a *adaptiveRateLimit) Update(throttled bool) { + a.mu.Lock() + defer a.mu.Unlock() + + a.updateMeasuredRate() + + if throttled { + rateToUse := a.measuredTxRate + if a.tokenBucketEnabled { + rateToUse = math.Min(a.measuredTxRate, a.fillRate) + } + + a.lastMaxRate = rateToUse + a.calculateTimeWindow() + a.lastThrottleTime = sdk.NowTime() + a.calculatedRate = a.cubicThrottle(rateToUse) + a.tokenBucketEnabled = true + } else { + a.calculateTimeWindow() + a.calculatedRate = a.cubicSuccess(sdk.NowTime()) + } + + newRate := math.Min(a.calculatedRate, 2*a.measuredTxRate) + a.tokenBucketUpdateRate(newRate) +} + +func (a *adaptiveRateLimit) cubicSuccess(t time.Time) float64 { + dt := secondsFloat64(t.Sub(a.lastThrottleTime)) + return (a.scaleConstant * math.Pow(dt-a.timeWindow, 3)) + a.lastMaxRate +} + +func (a *adaptiveRateLimit) cubicThrottle(rateToUse float64) float64 { + return rateToUse * a.beta +} + +func (a *adaptiveRateLimit) calculateTimeWindow() { + a.timeWindow = math.Pow((a.lastMaxRate*(1.-a.beta))/a.scaleConstant, 1./3.) +} + +func (a *adaptiveRateLimit) tokenBucketUpdateRate(newRPS float64) { + a.tokenBucketRefill() + a.fillRate = math.Max(newRPS, a.minFillRate) + a.tokenBucket.Resize(newRPS) +} + +func (a *adaptiveRateLimit) updateMeasuredRate() { + now := sdk.NowTime() + timeBucket := math.Floor(timeFloat64Seconds(now)*2.) / 2. + a.requestCount++ + + if timeBucket > a.lastTxRateBucket { + currentRate := float64(a.requestCount) / (timeBucket - a.lastTxRateBucket) + a.measuredTxRate = (currentRate * a.smooth) + (a.measuredTxRate * (1. - a.smooth)) + a.requestCount = 0 + a.lastTxRateBucket = timeBucket + } +} + +func (a *adaptiveRateLimit) tokenBucketRefill() { + now := sdk.NowTime() + if a.lastRefilled.IsZero() { + a.lastRefilled = now + return + } + + fillAmount := secondsFloat64(now.Sub(a.lastRefilled)) * a.fillRate + a.tokenBucket.Refund(fillAmount) + a.lastRefilled = now +} + +func float64Seconds(v float64) time.Duration { + return time.Duration(v * float64(time.Second)) +} + +func secondsFloat64(v time.Duration) float64 { + return float64(v) / float64(time.Second) +} + +func timeFloat64Seconds(v time.Time) float64 { + return float64(v.UnixNano()) / float64(time.Second) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive_token_bucket.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive_token_bucket.go new file mode 100644 index 00000000..052723e8 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive_token_bucket.go @@ -0,0 +1,83 @@ +package retry + +import ( + "math" + "sync" +) + +// adaptiveTokenBucket provides a concurrency safe utility for adding and +// removing tokens from the available token bucket. +type adaptiveTokenBucket struct { + remainingTokens float64 + maxCapacity float64 + minCapacity float64 + mu sync.Mutex +} + +// newAdaptiveTokenBucket returns an initialized adaptiveTokenBucket with the +// capacity specified. +func newAdaptiveTokenBucket(i float64) *adaptiveTokenBucket { + return &adaptiveTokenBucket{ + remainingTokens: i, + maxCapacity: i, + minCapacity: 1, + } +} + +// Retrieve attempts to reduce the available tokens by the amount requested. If +// there are tokens available true will be returned along with the number of +// available tokens remaining. If amount requested is larger than the available +// capacity, false will be returned along with the available capacity. If the +// amount is less than the available capacity, the capacity will be reduced by +// that amount, and the remaining capacity and true will be returned. +func (t *adaptiveTokenBucket) Retrieve(amount float64) (available float64, retrieved bool) { + t.mu.Lock() + defer t.mu.Unlock() + + if amount > t.remainingTokens { + return t.remainingTokens, false + } + + t.remainingTokens -= amount + return t.remainingTokens, true +} + +// Refund returns the amount of tokens back to the available token bucket, up +// to the initial capacity. +func (t *adaptiveTokenBucket) Refund(amount float64) { + t.mu.Lock() + defer t.mu.Unlock() + + // Capacity cannot exceed max capacity. + t.remainingTokens = math.Min(t.remainingTokens+amount, t.maxCapacity) +} + +// Capacity returns the maximum capacity of tokens that the bucket could +// contain. +func (t *adaptiveTokenBucket) Capacity() float64 { + t.mu.Lock() + defer t.mu.Unlock() + + return t.maxCapacity +} + +// Remaining returns the number of tokens that remaining in the bucket. +func (t *adaptiveTokenBucket) Remaining() float64 { + t.mu.Lock() + defer t.mu.Unlock() + + return t.remainingTokens +} + +// Resize adjusts the size of the token bucket. Returns the capacity remaining. +func (t *adaptiveTokenBucket) Resize(size float64) float64 { + t.mu.Lock() + defer t.mu.Unlock() + + t.maxCapacity = math.Max(size, t.minCapacity) + + // Capacity needs to be capped at max capacity, if max size reduced. + t.remainingTokens = math.Min(t.remainingTokens, t.maxCapacity) + + return t.remainingTokens +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/doc.go index 42ced06e..3a08ebe0 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/doc.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/doc.go @@ -1,12 +1,12 @@ // Package retry provides interfaces and implementations for SDK request retry behavior. // -// Retryer Interface and Implementations +// # Retryer Interface and Implementations // -// This packages defines Retryer interface that is used to either implement custom retry behavior -// or to extend the existing retry implementations provided by the SDK. This packages provides a single -// retry implementations: Standard. +// This package defines Retryer interface that is used to either implement custom retry behavior +// or to extend the existing retry implementations provided by the SDK. This package provides a single +// retry implementation: Standard. // -// Standard +// # Standard // // Standard is the default retryer implementation used by service clients. The standard retryer is a rate limited // retryer that has a configurable max attempts to limit the number of retry attempts when a retryable error occurs. @@ -15,66 +15,66 @@ // // By default the standard retryer uses the DefaultRetryables slice of IsErrorRetryable types to determine whether // a given error is retryable. By default this list of retryables includes the following: -// - Retrying errors that implement the RetryableError method, and return true. -// - Connection Errors -// - Errors that implement a ConnectionError, Temporary, or Timeout method that return true. -// - Connection Reset Errors. -// - net.OpErr types that are dialing errors or are temporary. -// - HTTP Status Codes: 500, 502, 503, and 504. -// - API Error Codes -// - RequestTimeout, RequestTimeoutException -// - Throttling, ThrottlingException, ThrottledException, RequestThrottledException, TooManyRequestsException, -// RequestThrottled, SlowDown, EC2ThrottledException -// - ProvisionedThroughputExceededException, RequestLimitExceeded, BandwidthLimitExceeded, LimitExceededException -// - TransactionInProgressException, PriorRequestNotComplete +// - Retrying errors that implement the RetryableError method, and return true. +// - Connection Errors +// - Errors that implement a ConnectionError, Temporary, or Timeout method that return true. +// - Connection Reset Errors. +// - net.OpErr types that are dialing errors or are temporary. +// - HTTP Status Codes: 500, 502, 503, and 504. +// - API Error Codes +// - RequestTimeout, RequestTimeoutException +// - Throttling, ThrottlingException, ThrottledException, RequestThrottledException, TooManyRequestsException, +// RequestThrottled, SlowDown, EC2ThrottledException +// - ProvisionedThroughputExceededException, RequestLimitExceeded, BandwidthLimitExceeded, LimitExceededException +// - TransactionInProgressException, PriorRequestNotComplete // // The standard retryer will not retry a request in the event if the context associated with the request // has been cancelled. Applications must handle this case explicitly if they wish to retry with a different context // value. // // You can configure the standard retryer implementation to fit your applications by constructing a standard retryer -// using the NewStandard function, and providing one more functional arguments that mutate the StandardOptions +// using the NewStandard function, and providing one more functional argument that mutate the StandardOptions // structure. StandardOptions provides the ability to modify the token bucket rate limiter, retryable error conditions, // and the retry delay policy. // // For example to modify the default retry attempts for the standard retryer: // -// // configure the custom retryer -// customRetry := retry.NewStandard(func(o *retry.StandardOptions) { -// o.MaxAttempts = 5 -// }) +// // configure the custom retryer +// customRetry := retry.NewStandard(func(o *retry.StandardOptions) { +// o.MaxAttempts = 5 +// }) // -// // create a service client with the retryer -// s3.NewFromConfig(cfg, func(o *s3.Options) { -// o.Retryer = customRetry -// }) +// // create a service client with the retryer +// s3.NewFromConfig(cfg, func(o *s3.Options) { +// o.Retryer = customRetry +// }) // -// Utilities +// # Utilities // // A number of package functions have been provided to easily wrap retryer implementations in an implementation agnostic // way. These are: // -// AddWithErrorCodes - Provides the ability to add additional API error codes that should be considered retryable -// in addition to those considered retryable by the provided retryer. +// AddWithErrorCodes - Provides the ability to add additional API error codes that should be considered retryable +// in addition to those considered retryable by the provided retryer. // -// AddWithMaxAttempts - Provides the ability to set the max number of attempts for retrying a request by wrapping -// a retryer implementation. +// AddWithMaxAttempts - Provides the ability to set the max number of attempts for retrying a request by wrapping +// a retryer implementation. // -// AddWithMaxBackoffDelay - Provides the ability to set the max back off delay that can occur before retrying a -// request by wrapping a retryer implementation. +// AddWithMaxBackoffDelay - Provides the ability to set the max back off delay that can occur before retrying a +// request by wrapping a retryer implementation. // // The following package functions have been provided to easily satisfy different retry interfaces to further customize // a given retryer's behavior: // -// BackoffDelayerFunc - Can be used to wrap a function to satisfy the BackoffDelayer interface. For example, -// you can use this method to easily create custom back off policies to be used with the -// standard retryer. +// BackoffDelayerFunc - Can be used to wrap a function to satisfy the BackoffDelayer interface. For example, +// you can use this method to easily create custom back off policies to be used with the +// standard retryer. // -// IsErrorRetryableFunc - Can be used to wrap a function to satisfy the IsErrorRetryable interface. For example, -// this can be used to extend the standard retryer to add additional logic ot determine if a -// error should be retried. +// IsErrorRetryableFunc - Can be used to wrap a function to satisfy the IsErrorRetryable interface. For example, +// this can be used to extend the standard retryer to add additional logic to determine if an +// error should be retried. // -// IsErrorTimeoutFunc - Can be used to wrap a function to satisfy IsErrorTimeout interface. For example, -// this can be used to extend the standard retryer to add additional logic to determine if an -// error should be considered a timeout. +// IsErrorTimeoutFunc - Can be used to wrap a function to satisfy IsErrorTimeout interface. For example, +// this can be used to extend the standard retryer to add additional logic to determine if an +// error should be considered a timeout. package retry diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/middleware.go index 8d703ed2..dc703d48 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/middleware.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/middleware.go @@ -3,6 +3,7 @@ package retry import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/aws/middleware/private/metrics" "strconv" "strings" "time" @@ -11,13 +12,12 @@ import ( awsmiddle "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/internal/sdk" "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/middleware" smithymiddle "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/transport/http" ) -// RequestCloner is a function that can take an input request type and clone the request -// for use in a subsequent retry attempt +// RequestCloner is a function that can take an input request type and clone +// the request for use in a subsequent retry attempt. type RequestCloner func(interface{}) interface{} type retryMetadata struct { @@ -27,20 +27,24 @@ type retryMetadata struct { AttemptClockSkew time.Duration } -// Attempt is a Smithy FinalizeMiddleware that handles retry attempts using the provided -// Retryer implementation +// Attempt is a Smithy Finalize middleware that handles retry attempts using +// the provided Retryer implementation. type Attempt struct { - // Enable the logging of retry attempts performed by the SDK. - // This will include logging retry attempts, unretryable errors, and when max attempts are reached. + // Enable the logging of retry attempts performed by the SDK. This will + // include logging retry attempts, unretryable errors, and when max + // attempts are reached. LogAttempts bool - retryer aws.Retryer + retryer aws.RetryerV2 requestCloner RequestCloner } // NewAttemptMiddleware returns a new Attempt retry middleware. func NewAttemptMiddleware(retryer aws.Retryer, requestCloner RequestCloner, optFns ...func(*Attempt)) *Attempt { - m := &Attempt{retryer: retryer, requestCloner: requestCloner} + m := &Attempt{ + retryer: wrapAsRetryerV2(retryer), + requestCloner: requestCloner, + } for _, fn := range optFns { fn(m) } @@ -48,9 +52,7 @@ func NewAttemptMiddleware(retryer aws.Retryer, requestCloner RequestCloner, optF } // ID returns the middleware identifier -func (r *Attempt) ID() string { - return "Retry" -} +func (r *Attempt) ID() string { return "Retry" } func (r Attempt) logf(logger logging.Logger, classification logging.Classification, format string, v ...interface{}) { if !r.LogAttempts { @@ -59,8 +61,9 @@ func (r Attempt) logf(logger logging.Logger, classification logging.Classificati logger.Logf(classification, format, v...) } -// HandleFinalize utilizes the provider Retryer implementation to attempt retries over the next handler -func (r Attempt) HandleFinalize(ctx context.Context, in smithymiddle.FinalizeInput, next smithymiddle.FinalizeHandler) ( +// HandleFinalize utilizes the provider Retryer implementation to attempt +// retries over the next handler +func (r *Attempt) HandleFinalize(ctx context.Context, in smithymiddle.FinalizeInput, next smithymiddle.FinalizeHandler) ( out smithymiddle.FinalizeOutput, metadata smithymiddle.Metadata, err error, ) { var attemptNum int @@ -68,12 +71,14 @@ func (r Attempt) HandleFinalize(ctx context.Context, in smithymiddle.FinalizeInp var attemptResults AttemptResults maxAttempts := r.retryer.MaxAttempts() + releaseRetryToken := nopRelease for { attemptNum++ attemptInput := in attemptInput.Request = r.requestCloner(attemptInput.Request) + // Record the metadata for the for attempt being started. attemptCtx := setRetryMetadata(ctx, retryMetadata{ AttemptNum: attemptNum, AttemptTime: sdk.NowTime().UTC(), @@ -82,21 +87,22 @@ func (r Attempt) HandleFinalize(ctx context.Context, in smithymiddle.FinalizeInp }) var attemptResult AttemptResult + out, attemptResult, releaseRetryToken, err = r.handleAttempt(attemptCtx, attemptInput, releaseRetryToken, next) + attemptClockSkew, _ = awsmiddle.GetAttemptSkew(attemptResult.ResponseMetadata) - out, attemptResult, err = r.handleAttempt(attemptCtx, attemptInput, next) - - var ok bool - attemptClockSkew, ok = awsmiddle.GetAttemptSkew(attemptResult.ResponseMetadata) - if !ok { - attemptClockSkew = 0 - } - + // AttemptResult Retried states that the attempt was not successful, and + // should be retried. shouldRetry := attemptResult.Retried - // add attempt metadata to list of all attempt metadata + // Add attempt metadata to list of all attempt metadata attemptResults.Results = append(attemptResults.Results, attemptResult) if !shouldRetry { + // Ensure the last response's metadata is used as the bases for result + // metadata returned by the stack. The Slice of attempt results + // will be added to this cloned metadata. + metadata = attemptResult.ResponseMetadata.Clone() + break } } @@ -106,81 +112,139 @@ func (r Attempt) HandleFinalize(ctx context.Context, in smithymiddle.FinalizeInp } // handleAttempt handles an individual request attempt. -func (r Attempt) handleAttempt(ctx context.Context, in smithymiddle.FinalizeInput, next smithymiddle.FinalizeHandler) ( - out smithymiddle.FinalizeOutput, attemptResult AttemptResult, err error, +func (r *Attempt) handleAttempt( + ctx context.Context, in smithymiddle.FinalizeInput, releaseRetryToken func(error) error, next smithymiddle.FinalizeHandler, +) ( + out smithymiddle.FinalizeOutput, attemptResult AttemptResult, _ func(error) error, err error, ) { defer func() { attemptResult.Err = err }() - relRetryToken := r.retryer.GetInitialToken() + // Short circuit if this attempt never can succeed because the context is + // canceled. This reduces the chance of token pools being modified for + // attempts that will not be made + select { + case <-ctx.Done(): + return out, attemptResult, nopRelease, ctx.Err() + default: + } + + //------------------------------ + // Get Attempt Token + //------------------------------ + releaseAttemptToken, err := r.retryer.GetAttemptToken(ctx) + if err != nil { + return out, attemptResult, nopRelease, fmt.Errorf( + "failed to get retry Send token, %w", err) + } + + //------------------------------ + // Send Attempt + //------------------------------ logger := smithymiddle.GetLogger(ctx) service, operation := awsmiddle.GetServiceID(ctx), awsmiddle.GetOperationName(ctx) - retryMetadata, _ := getRetryMetadata(ctx) attemptNum := retryMetadata.AttemptNum maxAttempts := retryMetadata.MaxAttempts + // Following attempts must ensure the request payload stream starts in a + // rewound state. if attemptNum > 1 { if rewindable, ok := in.Request.(interface{ RewindStream() error }); ok { if rewindErr := rewindable.RewindStream(); rewindErr != nil { - err = fmt.Errorf("failed to rewind transport stream for retry, %w", rewindErr) - return out, attemptResult, err + return out, attemptResult, nopRelease, fmt.Errorf( + "failed to rewind transport stream for retry, %w", rewindErr) } } - r.logf(logger, logging.Debug, "retrying request %s/%s, attempt %d", service, operation, attemptNum) + r.logf(logger, logging.Debug, "retrying request %s/%s, attempt %d", + service, operation, attemptNum) } var metadata smithymiddle.Metadata out, metadata, err = next.HandleFinalize(ctx, in) attemptResult.ResponseMetadata = metadata - if releaseError := relRetryToken(err); releaseError != nil && err != nil { - err = fmt.Errorf("failed to release token after request error, %w", err) - return out, attemptResult, err + //------------------------------ + // Bookkeeping + //------------------------------ + // Release the retry token based on the state of the attempt's error (if any). + if releaseError := releaseRetryToken(err); releaseError != nil && err != nil { + return out, attemptResult, nopRelease, fmt.Errorf( + "failed to release retry token after request error, %w", err) } - + // Release the attempt token based on the state of the attempt's error (if any). + if releaseError := releaseAttemptToken(err); releaseError != nil && err != nil { + return out, attemptResult, nopRelease, fmt.Errorf( + "failed to release initial token after request error, %w", err) + } + // If there was no error making the attempt, nothing further to do. There + // will be nothing to retry. if err == nil { - return out, attemptResult, err + return out, attemptResult, nopRelease, err } + //------------------------------ + // Is Retryable and Should Retry + //------------------------------ + // If the attempt failed with an unretryable error, nothing further to do + // but return, and inform the caller about the terminal failure. retryable := r.retryer.IsErrorRetryable(err) if !retryable { r.logf(logger, logging.Debug, "request failed with unretryable error %v", err) - return out, attemptResult, err + return out, attemptResult, nopRelease, err } // set retryable to true attemptResult.Retryable = true + // Once the maximum number of attempts have been exhausted there is nothing + // further to do other than inform the caller about the terminal failure. if maxAttempts > 0 && attemptNum >= maxAttempts { r.logf(logger, logging.Debug, "max retry attempts exhausted, max %d", maxAttempts) err = &MaxAttemptsError{ Attempt: attemptNum, Err: err, } - return out, attemptResult, err + return out, attemptResult, nopRelease, err } - relRetryToken, reqErr := r.retryer.GetRetryToken(ctx, err) - if reqErr != nil { - return out, attemptResult, reqErr + //------------------------------ + // Get Retry (aka Retry Quota) Token + //------------------------------ + // Get a retry token that will be released after the + releaseRetryToken, retryTokenErr := r.retryer.GetRetryToken(ctx, err) + if retryTokenErr != nil { + return out, attemptResult, nopRelease, retryTokenErr } + //------------------------------ + // Retry Delay and Sleep + //------------------------------ + // Get the retry delay before another attempt can be made, and sleep for + // that time. Potentially early exist if the sleep is canceled via the + // context. retryDelay, reqErr := r.retryer.RetryDelay(attemptNum, err) + mctx := metrics.Context(ctx) + if mctx != nil { + attempt, err := mctx.Data().LatestAttempt() + if err != nil { + attempt.RetryDelay = retryDelay + } + } if reqErr != nil { - return out, attemptResult, reqErr + return out, attemptResult, releaseRetryToken, reqErr } - if reqErr = sdk.SleepWithContext(ctx, retryDelay); reqErr != nil { err = &aws.RequestCanceledError{Err: reqErr} - return out, attemptResult, err + return out, attemptResult, releaseRetryToken, err } + // The request should be re-attempted. attemptResult.Retried = true - return out, attemptResult, err + return out, attemptResult, releaseRetryToken, err } // MetricsHeader attaches SDK request metric header for retries to the transport @@ -191,7 +255,7 @@ func (r *MetricsHeader) ID() string { return "RetryMetricsHeader" } -// HandleFinalize attaches the sdk request metric header to the transport layer +// HandleFinalize attaches the SDK request metric header to the transport layer func (r MetricsHeader) HandleFinalize(ctx context.Context, in smithymiddle.FinalizeInput, next smithymiddle.FinalizeHandler) ( out smithymiddle.FinalizeOutput, metadata smithymiddle.Metadata, err error, ) { @@ -235,7 +299,7 @@ type retryMetadataKey struct{} // Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues // to clear all stack values. func getRetryMetadata(ctx context.Context) (metadata retryMetadata, ok bool) { - metadata, ok = middleware.GetStackValue(ctx, retryMetadataKey{}).(retryMetadata) + metadata, ok = smithymiddle.GetStackValue(ctx, retryMetadataKey{}).(retryMetadata) return metadata, ok } @@ -244,16 +308,17 @@ func getRetryMetadata(ctx context.Context) (metadata retryMetadata, ok bool) { // Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues // to clear all stack values. func setRetryMetadata(ctx context.Context, metadata retryMetadata) context.Context { - return middleware.WithStackValue(ctx, retryMetadataKey{}, metadata) + return smithymiddle.WithStackValue(ctx, retryMetadataKey{}, metadata) } -// AddRetryMiddlewaresOptions is the set of options that can be passed to AddRetryMiddlewares for configuring retry -// associated middleware. +// AddRetryMiddlewaresOptions is the set of options that can be passed to +// AddRetryMiddlewares for configuring retry associated middleware. type AddRetryMiddlewaresOptions struct { Retryer aws.Retryer - // Enable the logging of retry attempts performed by the SDK. - // This will include logging retry attempts, unretryable errors, and when max attempts are reached. + // Enable the logging of retry attempts performed by the SDK. This will + // include logging retry attempts, unretryable errors, and when max + // attempts are reached. LogRetryAttempts bool } @@ -263,10 +328,12 @@ func AddRetryMiddlewares(stack *smithymiddle.Stack, options AddRetryMiddlewaresO middleware.LogAttempts = options.LogRetryAttempts }) - if err := stack.Finalize.Add(attempt, smithymiddle.After); err != nil { + // index retry to before signing, if signing exists + if err := stack.Finalize.Insert(attempt, "Signing", smithymiddle.Before); err != nil { return err } - if err := stack.Finalize.Add(&MetricsHeader{}, smithymiddle.After); err != nil { + + if err := stack.Finalize.Insert(&MetricsHeader{}, attempt.ID(), smithymiddle.After); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retry.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retry.go index ad81b8c9..af81635b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retry.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retry.go @@ -1,6 +1,7 @@ package retry import ( + "context" "time" "github.com/aws/aws-sdk-go-v2/aws" @@ -17,13 +18,13 @@ func AddWithErrorCodes(r aws.Retryer, codes ...string) aws.Retryer { } return &withIsErrorRetryable{ - Retryer: r, + RetryerV2: wrapAsRetryerV2(r), Retryable: retryable, } } type withIsErrorRetryable struct { - aws.Retryer + aws.RetryerV2 Retryable IsErrorRetryable } @@ -31,20 +32,20 @@ func (r *withIsErrorRetryable) IsErrorRetryable(err error) bool { if v := r.Retryable.IsErrorRetryable(err); v != aws.UnknownTernary { return v.Bool() } - return r.Retryer.IsErrorRetryable(err) + return r.RetryerV2.IsErrorRetryable(err) } // AddWithMaxAttempts returns a Retryer with MaxAttempts set to the value // specified. func AddWithMaxAttempts(r aws.Retryer, max int) aws.Retryer { return &withMaxAttempts{ - Retryer: r, - Max: max, + RetryerV2: wrapAsRetryerV2(r), + Max: max, } } type withMaxAttempts struct { - aws.Retryer + aws.RetryerV2 Max int } @@ -57,16 +58,33 @@ func (w *withMaxAttempts) MaxAttempts() int { // delay. func AddWithMaxBackoffDelay(r aws.Retryer, delay time.Duration) aws.Retryer { return &withMaxBackoffDelay{ - Retryer: r, - backoff: NewExponentialJitterBackoff(delay), + RetryerV2: wrapAsRetryerV2(r), + backoff: NewExponentialJitterBackoff(delay), } } type withMaxBackoffDelay struct { - aws.Retryer + aws.RetryerV2 backoff *ExponentialJitterBackoff } func (r *withMaxBackoffDelay) RetryDelay(attempt int, err error) (time.Duration, error) { return r.backoff.BackoffDelay(attempt, err) } + +type wrappedAsRetryerV2 struct { + aws.Retryer +} + +func wrapAsRetryerV2(r aws.Retryer) aws.RetryerV2 { + v, ok := r.(aws.RetryerV2) + if !ok { + v = wrappedAsRetryerV2{Retryer: r} + } + + return v +} + +func (w wrappedAsRetryerV2) GetAttemptToken(context.Context) (func(error) error, error) { + return w.Retryer.GetInitialToken(), nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retryable_error.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retryable_error.go index c695e6fe..987affdd 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retryable_error.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retryable_error.go @@ -95,6 +95,21 @@ func (r RetryableConnectionError) IsErrorRetryable(err error) aws.Ternary { var timeoutErr interface{ Timeout() bool } var urlErr *url.Error var netOpErr *net.OpError + var dnsError *net.DNSError + + if errors.As(err, &dnsError) { + // NXDOMAIN errors should not be retried + if dnsError.IsNotFound { + return aws.BoolTernary(false) + } + + // if !dnsError.Temporary(), error may or may not be temporary, + // (i.e. !Temporary() =/=> !retryable) so we should fall through to + // remaining checks + if dnsError.Temporary() { + return aws.BoolTernary(true) + } + } switch { case errors.As(err, &conErr) && conErr.ConnectionError(): diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/standard.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/standard.go index be2f8146..25abffc8 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/standard.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/standard.go @@ -2,6 +2,7 @@ package retry import ( "context" + "fmt" "time" "github.com/aws/aws-sdk-go-v2/aws/ratelimit" @@ -52,8 +53,11 @@ var DefaultRetryableHTTPStatusCodes = map[int]struct{}{ var DefaultRetryableErrorCodes = map[string]struct{}{ "RequestTimeout": {}, "RequestTimeoutException": {}, +} - // Throttled status codes +// DefaultThrottleErrorCodes provides the set of API error codes that are +// considered throttle errors. +var DefaultThrottleErrorCodes = map[string]struct{}{ "Throttling": {}, "ThrottlingException": {}, "ThrottledException": {}, @@ -82,35 +86,66 @@ var DefaultRetryables = []IsErrorRetryable{ RetryableErrorCode{ Codes: DefaultRetryableErrorCodes, }, + RetryableErrorCode{ + Codes: DefaultThrottleErrorCodes, + }, +} + +// DefaultTimeouts provides the set of timeout checks that are used by default. +var DefaultTimeouts = []IsErrorTimeout{ + TimeouterError{}, } // StandardOptions provides the functional options for configuring the standard // retryable, and delay behavior. type StandardOptions struct { + // Maximum number of attempts that should be made. MaxAttempts int - MaxBackoff time.Duration - Backoff BackoffDelayer + // MaxBackoff duration between retried attempts. + MaxBackoff time.Duration + + // Provides the backoff strategy the retryer will use to determine the + // delay between retry attempts. + Backoff BackoffDelayer + + // Set of strategies to determine if the attempt should be retried based on + // the error response received. + // + // It is safe to append to this list in NewStandard's functional options. Retryables []IsErrorRetryable - Timeouts []IsErrorTimeout - RateLimiter RateLimiter - RetryCost uint + // Set of strategies to determine if the attempt failed due to a timeout + // error. + // + // It is safe to append to this list in NewStandard's functional options. + Timeouts []IsErrorTimeout + + // Provides the rate limiting strategy for rate limiting attempt retries + // across all attempts the retryer is being used with. + RateLimiter RateLimiter + + // The cost to deduct from the RateLimiter's token bucket per retry. + RetryCost uint + + // The cost to deduct from the RateLimiter's token bucket per retry caused + // by timeout error. RetryTimeoutCost uint + + // The cost to payback to the RateLimiter's token bucket for successful + // attempts. NoRetryIncrement uint } -// RateLimiter provides the interface for limiting the rate of request retries -// allowed by the retrier. +// RateLimiter provides the interface for limiting the rate of attempt retries +// allowed by the retryer. type RateLimiter interface { GetToken(ctx context.Context, cost uint) (releaseToken func() error, err error) AddTokens(uint) error } -func nopTokenRelease(error) error { return nil } - // Standard is the standard retry pattern for the SDK. It uses a set of -// retryable checks to determine of the failed request should be retried, and +// retryable checks to determine of the failed attempt should be retried, and // what retry delay should be used. type Standard struct { options StandardOptions @@ -126,7 +161,8 @@ func NewStandard(fnOpts ...func(*StandardOptions)) *Standard { o := StandardOptions{ MaxAttempts: DefaultMaxAttempts, MaxBackoff: DefaultMaxBackoff, - Retryables: DefaultRetryables, + Retryables: append([]IsErrorRetryable{}, DefaultRetryables...), + Timeouts: append([]IsErrorTimeout{}, DefaultTimeouts...), RateLimiter: ratelimit.NewTokenRateLimit(DefaultRetryRateTokens), RetryCost: DefaultRetryCost, @@ -136,23 +172,20 @@ func NewStandard(fnOpts ...func(*StandardOptions)) *Standard { for _, fn := range fnOpts { fn(&o) } + if o.MaxAttempts <= 0 { + o.MaxAttempts = DefaultMaxAttempts + } backoff := o.Backoff if backoff == nil { backoff = NewExponentialJitterBackoff(o.MaxBackoff) } - rs := make([]IsErrorRetryable, len(o.Retryables)) - copy(rs, o.Retryables) - - ts := make([]IsErrorTimeout, len(o.Timeouts)) - copy(ts, o.Timeouts) - return &Standard{ options: o, backoff: backoff, - retryable: IsErrorRetryables(rs), - timeout: IsErrorTimeouts(ts), + retryable: IsErrorRetryables(o.Retryables), + timeout: IsErrorTimeouts(o.Timeouts), } } @@ -173,32 +206,47 @@ func (s *Standard) RetryDelay(attempt int, err error) (time.Duration, error) { return s.backoff.BackoffDelay(attempt, err) } -// GetInitialToken returns the initial request token that can increment the -// retry token pool if the request is successful. +// GetAttemptToken returns the token to be released after then attempt completes. +// The release token will add NoRetryIncrement to the RateLimiter token pool if +// the attempt was successful. If the attempt failed, nothing will be done. +func (s *Standard) GetAttemptToken(context.Context) (func(error) error, error) { + return s.GetInitialToken(), nil +} + +// GetInitialToken returns a token for adding the NoRetryIncrement to the +// RateLimiter token if the attempt completed successfully without error. +// +// InitialToken applies to result of the each attempt, including the first. +// Whereas the RetryToken applies to the result of subsequent attempts. +// +// Deprecated: use GetAttemptToken instead. func (s *Standard) GetInitialToken() func(error) error { - return releaseToken(s.incrementTokens).release + return releaseToken(s.noRetryIncrement).release } -func (s *Standard) incrementTokens() error { +func (s *Standard) noRetryIncrement() error { return s.options.RateLimiter.AddTokens(s.options.NoRetryIncrement) } // GetRetryToken attempts to deduct the retry cost from the retry token pool. // Returning the token release function, or error. -func (s *Standard) GetRetryToken(ctx context.Context, err error) (func(error) error, error) { +func (s *Standard) GetRetryToken(ctx context.Context, opErr error) (func(error) error, error) { cost := s.options.RetryCost - if s.timeout.IsErrorTimeout(err).Bool() { + + if s.timeout.IsErrorTimeout(opErr).Bool() { cost = s.options.RetryTimeoutCost } fn, err := s.options.RateLimiter.GetToken(ctx, cost) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to get rate limit token, %w", err) } return releaseToken(fn).release, nil } +func nopRelease(error) error { return nil } + type releaseToken func() error func (f releaseToken) release(err error) error { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/throttle_error.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/throttle_error.go new file mode 100644 index 00000000..c4b844d1 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/throttle_error.go @@ -0,0 +1,60 @@ +package retry + +import ( + "errors" + + "github.com/aws/aws-sdk-go-v2/aws" +) + +// IsErrorThrottle provides the interface of an implementation to determine if +// a error response from an operation is a throttling error. +type IsErrorThrottle interface { + IsErrorThrottle(error) aws.Ternary +} + +// IsErrorThrottles is a collection of checks to determine of the error a +// throttle error. Iterates through the checks and returns the state of +// throttle if any check returns something other than unknown. +type IsErrorThrottles []IsErrorThrottle + +// IsErrorThrottle returns if the error is a throttle error if any of the +// checks in the list return a value other than unknown. +func (r IsErrorThrottles) IsErrorThrottle(err error) aws.Ternary { + for _, re := range r { + if v := re.IsErrorThrottle(err); v != aws.UnknownTernary { + return v + } + } + return aws.UnknownTernary +} + +// IsErrorThrottleFunc wraps a function with the IsErrorThrottle interface. +type IsErrorThrottleFunc func(error) aws.Ternary + +// IsErrorThrottle returns if the error is a throttle error. +func (fn IsErrorThrottleFunc) IsErrorThrottle(err error) aws.Ternary { + return fn(err) +} + +// ThrottleErrorCode determines if an attempt should be retried based on the +// API error code. +type ThrottleErrorCode struct { + Codes map[string]struct{} +} + +// IsErrorThrottle return if the error is a throttle error based on the error +// codes. Returns unknown if the error doesn't have a code or it is unknown. +func (r ThrottleErrorCode) IsErrorThrottle(err error) aws.Ternary { + var v interface{ ErrorCode() string } + + if !errors.As(err, &v) { + return aws.UnknownTernary + } + + _, ok := r.Codes[v.ErrorCode()] + if !ok { + return aws.UnknownTernary + } + + return aws.TrueTernary +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retryer.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retryer.go index 0489508e..b0ba4cb2 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/retryer.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/retryer.go @@ -6,34 +6,94 @@ import ( "time" ) +// RetryMode provides the mode the API client will use to create a retryer +// based on. +type RetryMode string + +const ( + // RetryModeStandard model provides rate limited retry attempts with + // exponential backoff delay. + RetryModeStandard RetryMode = "standard" + + // RetryModeAdaptive model provides attempt send rate limiting on throttle + // responses in addition to standard mode's retry rate limiting. + // + // Adaptive retry mode is experimental and is subject to change in the + // future. + RetryModeAdaptive RetryMode = "adaptive" +) + +// ParseRetryMode attempts to parse a RetryMode from the given string. +// Returning error if the value is not a known RetryMode. +func ParseRetryMode(v string) (mode RetryMode, err error) { + switch v { + case "standard": + return RetryModeStandard, nil + case "adaptive": + return RetryModeAdaptive, nil + default: + return mode, fmt.Errorf("unknown RetryMode, %v", v) + } +} + +func (m RetryMode) String() string { return string(m) } + // Retryer is an interface to determine if a given error from a -// request should be retried, and if so what backoff delay to apply. The +// attempt should be retried, and if so what backoff delay to apply. The // default implementation used by most services is the retry package's Standard // type. Which contains basic retry logic using exponential backoff. type Retryer interface { - // IsErrorRetryable returns if the failed request is retryable. This check + // IsErrorRetryable returns if the failed attempt is retryable. This check // should determine if the error can be retried, or if the error is // terminal. IsErrorRetryable(error) bool // MaxAttempts returns the maximum number of attempts that can be made for - // a request before failing. A value of 0 implies that the request should + // an attempt before failing. A value of 0 implies that the attempt should // be retried until it succeeds if the errors are retryable. MaxAttempts() int // RetryDelay returns the delay that should be used before retrying the - // request. Will return error if the if the delay could not be determined. + // attempt. Will return error if the delay could not be determined. RetryDelay(attempt int, opErr error) (time.Duration, error) // GetRetryToken attempts to deduct the retry cost from the retry token pool. // Returning the token release function, or error. GetRetryToken(ctx context.Context, opErr error) (releaseToken func(error) error, err error) - // GetInitalToken returns the initial request token that can increment the - // retry token pool if the request is successful. + // GetInitialToken returns the initial attempt token that can increment the + // retry token pool if the attempt is successful. GetInitialToken() (releaseToken func(error) error) } +// RetryerV2 is an interface to determine if a given error from an attempt +// should be retried, and if so what backoff delay to apply. The default +// implementation used by most services is the retry package's Standard type. +// Which contains basic retry logic using exponential backoff. +// +// RetryerV2 replaces the Retryer interface, deprecating the GetInitialToken +// method in favor of GetAttemptToken which takes a context, and can return an error. +// +// The SDK's retry package's Attempt middleware, and utilities will always +// wrap a Retryer as a RetryerV2. Delegating to GetInitialToken, only if +// GetAttemptToken is not implemented. +type RetryerV2 interface { + Retryer + + // GetInitialToken returns the initial attempt token that can increment the + // retry token pool if the attempt is successful. + // + // Deprecated: This method does not provide a way to block using Context, + // nor can it return an error. Use RetryerV2, and GetAttemptToken instead. + GetInitialToken() (releaseToken func(error) error) + + // GetAttemptToken returns the send token that can be used to rate limit + // attempt calls. Will be used by the SDK's retry package's Attempt + // middleware to get a send token prior to calling the temp and releasing + // the send token after the attempt has been made. + GetAttemptToken(context.Context) (func(error) error, error) +} + // NopRetryer provides a RequestRetryDecider implementation that will flag // all attempt errors as not retryable, with a max attempts of 1. type NopRetryer struct{} @@ -41,12 +101,12 @@ type NopRetryer struct{} // IsErrorRetryable returns false for all error values. func (NopRetryer) IsErrorRetryable(error) bool { return false } -// MaxAttempts always returns 1 for the original request attempt. +// MaxAttempts always returns 1 for the original attempt. func (NopRetryer) MaxAttempts() int { return 1 } // RetryDelay is not valid for the NopRetryer. Will always return error. func (NopRetryer) RetryDelay(int, error) (time.Duration, error) { - return 0, fmt.Errorf("not retrying any request errors") + return 0, fmt.Errorf("not retrying any attempt errors") } // GetRetryToken returns a stub function that does nothing. @@ -59,4 +119,9 @@ func (NopRetryer) GetInitialToken() func(error) error { return nopReleaseToken } +// GetAttemptToken returns a stub function that does nothing. +func (NopRetryer) GetAttemptToken(context.Context) (func(error) error, error) { + return nopReleaseToken, nil +} + func nopReleaseToken(error) error { return nil } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/runtime.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/runtime.go new file mode 100644 index 00000000..3af9b2b3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/runtime.go @@ -0,0 +1,14 @@ +package aws + +// ExecutionEnvironmentID is the AWS execution environment runtime identifier. +type ExecutionEnvironmentID string + +// RuntimeEnvironment is a collection of values that are determined at runtime +// based on the environment that the SDK is executing in. Some of these values +// may or may not be present based on the executing environment and certain SDK +// configuration properties that drive whether these values are populated.. +type RuntimeEnvironment struct { + EnvironmentIdentifier ExecutionEnvironmentID + Region string + EC2InstanceMetadataRegion string +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/const.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/const.go index 89a76e2e..a23cb003 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/const.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/const.go @@ -1,5 +1,6 @@ package v4 +// Signature Version 4 (SigV4) Constants const ( // EmptyStringSHA256 is the hex encoded sha256 value of an empty string EmptyStringSHA256 = `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855` @@ -33,4 +34,7 @@ const ( // ContentSHAKey is the SHA256 of request body ContentSHAKey = "X-Amz-Content-Sha256" + + // StreamingEventsPayload indicates that the request payload body is a signed event stream. + StreamingEventsPayload = "STREAMING-AWS4-HMAC-SHA256-EVENTS" ) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/header_rules.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/header_rules.go index 5e5953c7..c61955ad 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/header_rules.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/header_rules.go @@ -34,23 +34,23 @@ func (m MapRule) IsValid(value string) bool { return ok } -// Whitelist is a generic Rule for whitelisting -type Whitelist struct { +// AllowList is a generic Rule for include listing +type AllowList struct { Rule } -// IsValid for Whitelist checks if the value is within the Whitelist -func (w Whitelist) IsValid(value string) bool { +// IsValid for AllowList checks if the value is within the AllowList +func (w AllowList) IsValid(value string) bool { return w.Rule.IsValid(value) } -// Blacklist is a generic Rule for blacklisting -type Blacklist struct { +// ExcludeList is a generic Rule for exclude listing +type ExcludeList struct { Rule } -// IsValid for Whitelist checks if the value is within the Whitelist -func (b Blacklist) IsValid(value string) bool { +// IsValid for AllowList checks if the value is within the AllowList +func (b ExcludeList) IsValid(value string) bool { return !b.Rule.IsValid(value) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/headers.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/headers.go index b62d985c..ca738f23 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/headers.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/headers.go @@ -2,18 +2,19 @@ package v4 // IgnoredHeaders is a list of headers that are ignored during signing var IgnoredHeaders = Rules{ - Blacklist{ + ExcludeList{ MapRule{ "Authorization": struct{}{}, "User-Agent": struct{}{}, "X-Amzn-Trace-Id": struct{}{}, + "Expect": struct{}{}, }, }, } -// RequiredSignedHeaders is a whitelist for Build canonical headers. +// RequiredSignedHeaders is a allow list for Build canonical headers. var RequiredSignedHeaders = Rules{ - Whitelist{ + AllowList{ MapRule{ "Cache-Control": struct{}{}, "Content-Disposition": struct{}{}, @@ -37,6 +38,7 @@ var RequiredSignedHeaders = Rules{ "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Algorithm": struct{}{}, "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key": struct{}{}, "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key-Md5": struct{}{}, + "X-Amz-Expected-Bucket-Owner": struct{}{}, "X-Amz-Grant-Full-control": struct{}{}, "X-Amz-Grant-Read": struct{}{}, "X-Amz-Grant-Read-Acp": struct{}{}, @@ -47,6 +49,7 @@ var RequiredSignedHeaders = Rules{ "X-Amz-Request-Payer": struct{}{}, "X-Amz-Server-Side-Encryption": struct{}{}, "X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id": struct{}{}, + "X-Amz-Server-Side-Encryption-Context": struct{}{}, "X-Amz-Server-Side-Encryption-Customer-Algorithm": struct{}{}, "X-Amz-Server-Side-Encryption-Customer-Key": struct{}{}, "X-Amz-Server-Side-Encryption-Customer-Key-Md5": struct{}{}, @@ -56,12 +59,13 @@ var RequiredSignedHeaders = Rules{ "X-Amz-Tagging": struct{}{}, }, }, + Patterns{"X-Amz-Object-Lock-"}, Patterns{"X-Amz-Meta-"}, } -// AllowedQueryHoisting is a whitelist for Build query headers. The boolean value +// AllowedQueryHoisting is a allowed list for Build query headers. The boolean value // represents whether or not it is a pattern. var AllowedQueryHoisting = InclusiveRules{ - Blacklist{RequiredSignedHeaders}, + ExcludeList{RequiredSignedHeaders}, Patterns{"X-Amz-"}, } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/scope.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/scope.go new file mode 100644 index 00000000..fc788790 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/scope.go @@ -0,0 +1,13 @@ +package v4 + +import "strings" + +// BuildCredentialScope builds the Signature Version 4 (SigV4) signing scope +func BuildCredentialScope(signingTime SigningTime, region, service string) string { + return strings.Join([]string{ + signingTime.ShortTimeFormat(), + region, + service, + "aws4_request", + }, "/") +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/util.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/util.go index 741019b5..d025dbaa 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/util.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/util.go @@ -8,7 +8,7 @@ import ( const doubleSpace = " " // StripExcessSpaces will rewrite the passed in slice's string values to not -// contain muliple side-by-side spaces. +// contain multiple side-by-side spaces. func StripExcessSpaces(str string) string { var j, k, l, m, spaces int // Trim trailing spaces @@ -46,19 +46,35 @@ func StripExcessSpaces(str string) string { return string(buf[:m]) } -// GetURIPath returns the escaped URI component from the provided URL +// GetURIPath returns the escaped URI component from the provided URL. func GetURIPath(u *url.URL) string { - var uri string + var uriPath string if len(u.Opaque) > 0 { - uri = "/" + strings.Join(strings.Split(u.Opaque, "/")[3:], "/") + const schemeSep, pathSep, queryStart = "//", "/", "?" + + opaque := u.Opaque + // Cut off the query string if present. + if idx := strings.Index(opaque, queryStart); idx >= 0 { + opaque = opaque[:idx] + } + + // Cutout the scheme separator if present. + if strings.Index(opaque, schemeSep) == 0 { + opaque = opaque[len(schemeSep):] + } + + // capture URI path starting with first path separator. + if idx := strings.Index(opaque, pathSep); idx >= 0 { + uriPath = opaque[idx:] + } } else { - uri = u.EscapedPath() + uriPath = u.EscapedPath() } - if len(uri) == 0 { - uri = "/" + if len(uriPath) == 0 { + uriPath = "/" } - return uri + return uriPath } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/middleware.go index ffa29766..f39a369a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/middleware.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/middleware.go @@ -6,13 +6,17 @@ import ( "encoding/hex" "fmt" "io" + "net/http" + "strings" "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/middleware/private/metrics" v4Internal "github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" "github.com/aws/aws-sdk-go-v2/internal/sdk" "github.com/aws/smithy-go/middleware" - smithyHTTP "github.com/aws/smithy-go/transport/http" + smithyhttp "github.com/aws/smithy-go/transport/http" ) const computePayloadHashMiddlewareID = "ComputePayloadHash" @@ -46,6 +50,46 @@ func (e *SigningError) Unwrap() error { return e.Err } +// UseDynamicPayloadSigningMiddleware swaps the compute payload sha256 middleware with a resolver middleware that +// switches between unsigned and signed payload based on TLS state for request. +// This middleware should not be used for AWS APIs that do not support unsigned payload signing auth. +// By default, SDK uses this middleware for known AWS APIs that support such TLS based auth selection . +// +// Usage example - +// S3 PutObject API allows unsigned payload signing auth usage when TLS is enabled, and uses this middleware to +// dynamically switch between unsigned and signed payload based on TLS state for request. +func UseDynamicPayloadSigningMiddleware(stack *middleware.Stack) error { + _, err := stack.Finalize.Swap(computePayloadHashMiddlewareID, &dynamicPayloadSigningMiddleware{}) + return err +} + +// dynamicPayloadSigningMiddleware dynamically resolves the middleware that computes and set payload sha256 middleware. +type dynamicPayloadSigningMiddleware struct { +} + +// ID returns the resolver identifier +func (m *dynamicPayloadSigningMiddleware) ID() string { + return computePayloadHashMiddlewareID +} + +// HandleFinalize delegates SHA256 computation according to whether the request +// is TLS-enabled. +func (m *dynamicPayloadSigningMiddleware) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, +) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if req.IsHTTPS() { + return (&unsignedPayload{}).HandleFinalize(ctx, in, next) + } + return (&computePayloadSHA256{}).HandleFinalize(ctx, in, next) +} + // unsignedPayload sets the SigV4 request payload hash to unsigned. // // Will not set the Unsigned Payload magic SHA value, if a SHA has already been @@ -59,7 +103,7 @@ type unsignedPayload struct{} // AddUnsignedPayloadMiddleware adds unsignedPayload to the operation // middleware stack func AddUnsignedPayloadMiddleware(stack *middleware.Stack) error { - return stack.Build.Add(&unsignedPayload{}, middleware.After) + return stack.Finalize.Insert(&unsignedPayload{}, "ResolveEndpointV2", middleware.After) } // ID returns the unsignedPayload identifier @@ -67,23 +111,16 @@ func (m *unsignedPayload) ID() string { return computePayloadHashMiddlewareID } -// HandleBuild sets the payload hash to be an unsigned payload -func (m *unsignedPayload) HandleBuild( - ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, +// HandleFinalize sets the payload hash magic value to the unsigned sentinel. +func (m *unsignedPayload) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, ) ( - out middleware.BuildOutput, metadata middleware.Metadata, err error, + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, ) { - // This should not compute the content SHA256 if the value is already - // known. (e.g. application pre-computed SHA256 before making API call). - // Does not have any tight coupling to the X-Amz-Content-Sha256 header, if - // that header is provided a middleware must translate it into the context. - contentSHA := GetPayloadHash(ctx) - if len(contentSHA) == 0 { - contentSHA = v4Internal.UnsignedPayload + if GetPayloadHash(ctx) == "" { + ctx = SetPayloadHash(ctx, v4Internal.UnsignedPayload) } - - ctx = SetPayloadHash(ctx, contentSHA) - return next.HandleBuild(ctx, in) + return next.HandleFinalize(ctx, in) } // computePayloadSHA256 computes SHA256 payload hash to sign. @@ -99,13 +136,13 @@ type computePayloadSHA256 struct{} // AddComputePayloadSHA256Middleware adds computePayloadSHA256 to the // operation middleware stack func AddComputePayloadSHA256Middleware(stack *middleware.Stack) error { - return stack.Build.Add(&computePayloadSHA256{}, middleware.After) + return stack.Finalize.Insert(&computePayloadSHA256{}, "ResolveEndpointV2", middleware.After) } // RemoveComputePayloadSHA256Middleware removes computePayloadSHA256 from the // operation middleware stack func RemoveComputePayloadSHA256Middleware(stack *middleware.Stack) error { - _, err := stack.Build.Remove(computePayloadHashMiddlewareID) + _, err := stack.Finalize.Remove(computePayloadHashMiddlewareID) return err } @@ -114,27 +151,24 @@ func (m *computePayloadSHA256) ID() string { return computePayloadHashMiddlewareID } -// HandleBuild compute the payload hash for the request payload -func (m *computePayloadSHA256) HandleBuild( - ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, +// HandleFinalize computes the payload hash for the request, storing it to the +// context. This is a no-op if a caller has previously set that value. +func (m *computePayloadSHA256) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, ) ( - out middleware.BuildOutput, metadata middleware.Metadata, err error, + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, ) { - req, ok := in.Request.(*smithyHTTP.Request) + if GetPayloadHash(ctx) != "" { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &HashComputationError{ Err: fmt.Errorf("unexpected request middleware type %T", in.Request), } } - // This should not compute the content SHA256 if the value is already - // known. (e.g. application pre-computed SHA256 before making API call) - // Does not have any tight coupling to the X-Amz-Content-Sha256 header, if - // that header is provided a middleware must translate it into the context. - if contentSHA := GetPayloadHash(ctx); len(contentSHA) != 0 { - return next.HandleBuild(ctx, in) - } - hash := sha256.New() if stream := req.GetStream(); stream != nil { _, err = io.Copy(hash, stream) @@ -153,7 +187,17 @@ func (m *computePayloadSHA256) HandleBuild( ctx = SetPayloadHash(ctx, hex.EncodeToString(hash.Sum(nil))) - return next.HandleBuild(ctx, in) + return next.HandleFinalize(ctx, in) +} + +// SwapComputePayloadSHA256ForUnsignedPayloadMiddleware replaces the +// ComputePayloadSHA256 middleware with the UnsignedPayload middleware. +// +// Use this to disable computing the Payload SHA256 checksum and instead use +// UNSIGNED-PAYLOAD for the SHA256 value. +func SwapComputePayloadSHA256ForUnsignedPayloadMiddleware(stack *middleware.Stack) error { + _, err := stack.Finalize.Swap(computePayloadHashMiddlewareID, &unsignedPayload{}) + return err } // contentSHA256Header sets the X-Amz-Content-Sha256 header value to @@ -163,13 +207,13 @@ type contentSHA256Header struct{} // AddContentSHA256HeaderMiddleware adds ContentSHA256Header to the // operation middleware stack func AddContentSHA256HeaderMiddleware(stack *middleware.Stack) error { - return stack.Build.Insert(&contentSHA256Header{}, computePayloadHashMiddlewareID, middleware.After) + return stack.Finalize.Insert(&contentSHA256Header{}, computePayloadHashMiddlewareID, middleware.After) } // RemoveContentSHA256HeaderMiddleware removes contentSHA256Header middleware // from the operation middleware stack func RemoveContentSHA256HeaderMiddleware(stack *middleware.Stack) error { - _, err := stack.Build.Remove((*contentSHA256Header)(nil).ID()) + _, err := stack.Finalize.Remove((*contentSHA256Header)(nil).ID()) return err } @@ -178,38 +222,48 @@ func (m *contentSHA256Header) ID() string { return "SigV4ContentSHA256Header" } -// HandleBuild sets the X-Amz-Content-Sha256 header value to the Payload hash +// HandleFinalize sets the X-Amz-Content-Sha256 header value to the Payload hash // stored in the context. -func (m *contentSHA256Header) HandleBuild( - ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, +func (m *contentSHA256Header) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, ) ( - out middleware.BuildOutput, metadata middleware.Metadata, err error, + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, ) { - req, ok := in.Request.(*smithyHTTP.Request) + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &HashComputationError{Err: fmt.Errorf("unexpected request middleware type %T", in.Request)} } req.Header.Set(v4Internal.ContentSHAKey, GetPayloadHash(ctx)) - - return next.HandleBuild(ctx, in) + return next.HandleFinalize(ctx, in) } -// SignHTTPRequestMiddlewareOptions is the configuration options for the SignHTTPRequestMiddleware middleware. +// SignHTTPRequestMiddlewareOptions is the configuration options for +// [SignHTTPRequestMiddleware]. +// +// Deprecated: [SignHTTPRequestMiddleware] is deprecated. type SignHTTPRequestMiddlewareOptions struct { CredentialsProvider aws.CredentialsProvider Signer HTTPSigner LogSigning bool } -// SignHTTPRequestMiddleware is a `FinalizeMiddleware` implementation for SigV4 HTTP Signing +// SignHTTPRequestMiddleware is a `FinalizeMiddleware` implementation for SigV4 +// HTTP Signing. +// +// Deprecated: AWS service clients no longer use this middleware. Signing as an +// SDK operation is now performed through an internal per-service middleware +// which opaquely selects and uses the signer from the resolved auth scheme. type SignHTTPRequestMiddleware struct { credentialsProvider aws.CredentialsProvider signer HTTPSigner logSigning bool } -// NewSignHTTPRequestMiddleware constructs a SignHTTPRequestMiddleware using the given Signer for signing requests +// NewSignHTTPRequestMiddleware constructs a [SignHTTPRequestMiddleware] using +// the given [Signer] for signing requests. +// +// Deprecated: SignHTTPRequestMiddleware is deprecated. func NewSignHTTPRequestMiddleware(options SignHTTPRequestMiddlewareOptions) *SignHTTPRequestMiddleware { return &SignHTTPRequestMiddleware{ credentialsProvider: options.CredentialsProvider, @@ -218,12 +272,17 @@ func NewSignHTTPRequestMiddleware(options SignHTTPRequestMiddlewareOptions) *Sig } } -// ID is the SignHTTPRequestMiddleware identifier +// ID is the SignHTTPRequestMiddleware identifier. +// +// Deprecated: SignHTTPRequestMiddleware is deprecated. func (s *SignHTTPRequestMiddleware) ID() string { return "Signing" } -// HandleFinalize will take the provided input and sign the request using the SigV4 authentication scheme +// HandleFinalize will take the provided input and sign the request using the +// SigV4 authentication scheme. +// +// Deprecated: SignHTTPRequestMiddleware is deprecated. func (s *SignHTTPRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( out middleware.FinalizeOutput, metadata middleware.Metadata, err error, ) { @@ -231,7 +290,7 @@ func (s *SignHTTPRequestMiddleware) HandleFinalize(ctx context.Context, in middl return next.HandleFinalize(ctx, in) } - req, ok := in.Request.(*smithyHTTP.Request) + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &SigningError{Err: fmt.Errorf("unexpected request middleware type %T", in.Request)} } @@ -242,34 +301,123 @@ func (s *SignHTTPRequestMiddleware) HandleFinalize(ctx context.Context, in middl return out, metadata, &SigningError{Err: fmt.Errorf("computed payload hash missing from context")} } + mctx := metrics.Context(ctx) + + if mctx != nil { + if attempt, err := mctx.Data().LatestAttempt(); err == nil { + attempt.CredentialFetchStartTime = sdk.NowTime() + } + } + credentials, err := s.credentialsProvider.Retrieve(ctx) + + if mctx != nil { + if attempt, err := mctx.Data().LatestAttempt(); err == nil { + attempt.CredentialFetchEndTime = sdk.NowTime() + } + } + if err != nil { return out, metadata, &SigningError{Err: fmt.Errorf("failed to retrieve credentials: %w", err)} } - err = s.signer.SignHTTP(ctx, credentials, req.Request, payloadHash, signingName, signingRegion, sdk.NowTime(), + signerOptions := []func(o *SignerOptions){ func(o *SignerOptions) { o.Logger = middleware.GetLogger(ctx) o.LogSigning = s.logSigning + }, + } + + // existing DisableURIPathEscaping is equivalent in purpose + // to authentication scheme property DisableDoubleEncoding + disableDoubleEncoding, overridden := internalauth.GetDisableDoubleEncoding(ctx) + if overridden { + signerOptions = append(signerOptions, func(o *SignerOptions) { + o.DisableURIPathEscaping = disableDoubleEncoding }) + } + + if mctx != nil { + if attempt, err := mctx.Data().LatestAttempt(); err == nil { + attempt.SignStartTime = sdk.NowTime() + } + } + + err = s.signer.SignHTTP(ctx, credentials, req.Request, payloadHash, signingName, signingRegion, sdk.NowTime(), signerOptions...) + + if mctx != nil { + if attempt, err := mctx.Data().LatestAttempt(); err == nil { + attempt.SignEndTime = sdk.NowTime() + } + } + if err != nil { return out, metadata, &SigningError{Err: fmt.Errorf("failed to sign http request, %w", err)} } + ctx = awsmiddleware.SetSigningCredentials(ctx, credentials) + return next.HandleFinalize(ctx, in) } +type streamingEventsPayload struct{} + +// AddStreamingEventsPayload adds the streamingEventsPayload middleware to the stack. +func AddStreamingEventsPayload(stack *middleware.Stack) error { + return stack.Finalize.Add(&streamingEventsPayload{}, middleware.Before) +} + +func (s *streamingEventsPayload) ID() string { + return computePayloadHashMiddlewareID +} + +func (s *streamingEventsPayload) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, +) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + contentSHA := GetPayloadHash(ctx) + if len(contentSHA) == 0 { + contentSHA = v4Internal.StreamingEventsPayload + } + + ctx = SetPayloadHash(ctx, contentSHA) + + return next.HandleFinalize(ctx, in) +} + +// GetSignedRequestSignature attempts to extract the signature of the request. +// Returning an error if the request is unsigned, or unable to extract the +// signature. +func GetSignedRequestSignature(r *http.Request) ([]byte, error) { + const authHeaderSignatureElem = "Signature=" + + if auth := r.Header.Get(authorizationHeader); len(auth) != 0 { + ps := strings.Split(auth, ", ") + for _, p := range ps { + if idx := strings.Index(p, authHeaderSignatureElem); idx >= 0 { + sig := p[len(authHeaderSignatureElem):] + if len(sig) == 0 { + return nil, fmt.Errorf("invalid request signature authorization header") + } + return hex.DecodeString(sig) + } + } + } + + if sig := r.URL.Query().Get("X-Amz-Signature"); len(sig) != 0 { + return hex.DecodeString(sig) + } + + return nil, fmt.Errorf("request not signed") +} + func haveCredentialProvider(p aws.CredentialsProvider) bool { if p == nil { return false } - switch p.(type) { - case aws.AnonymousCredentials, - *aws.AnonymousCredentials: - return false - } - return true + return !aws.IsCredentialsProvider(p, (*aws.AnonymousCredentials)(nil)) } type payloadHashKey struct{} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/stream.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/stream.go new file mode 100644 index 00000000..66aa2bd6 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/stream.go @@ -0,0 +1,86 @@ +package v4 + +import ( + "context" + "crypto/sha256" + "encoding/hex" + "github.com/aws/aws-sdk-go-v2/aws" + v4Internal "github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4" + "strings" + "time" +) + +// EventStreamSigner is an AWS EventStream protocol signer. +type EventStreamSigner interface { + GetSignature(ctx context.Context, headers, payload []byte, signingTime time.Time, optFns ...func(*StreamSignerOptions)) ([]byte, error) +} + +// StreamSignerOptions is the configuration options for StreamSigner. +type StreamSignerOptions struct{} + +// StreamSigner implements Signature Version 4 (SigV4) signing of event stream encoded payloads. +type StreamSigner struct { + options StreamSignerOptions + + credentials aws.Credentials + service string + region string + + prevSignature []byte + + signingKeyDeriver *v4Internal.SigningKeyDeriver +} + +// NewStreamSigner returns a new AWS EventStream protocol signer. +func NewStreamSigner(credentials aws.Credentials, service, region string, seedSignature []byte, optFns ...func(*StreamSignerOptions)) *StreamSigner { + o := StreamSignerOptions{} + + for _, fn := range optFns { + fn(&o) + } + + return &StreamSigner{ + options: o, + credentials: credentials, + service: service, + region: region, + signingKeyDeriver: v4Internal.NewSigningKeyDeriver(), + prevSignature: seedSignature, + } +} + +// GetSignature signs the provided header and payload bytes. +func (s *StreamSigner) GetSignature(ctx context.Context, headers, payload []byte, signingTime time.Time, optFns ...func(*StreamSignerOptions)) ([]byte, error) { + options := s.options + + for _, fn := range optFns { + fn(&options) + } + + prevSignature := s.prevSignature + + st := v4Internal.NewSigningTime(signingTime) + + sigKey := s.signingKeyDeriver.DeriveKey(s.credentials, s.service, s.region, st) + + scope := v4Internal.BuildCredentialScope(st, s.region, s.service) + + stringToSign := s.buildEventStreamStringToSign(headers, payload, prevSignature, scope, &st) + + signature := v4Internal.HMACSHA256(sigKey, []byte(stringToSign)) + s.prevSignature = signature + + return signature, nil +} + +func (s *StreamSigner) buildEventStreamStringToSign(headers, payload, previousSignature []byte, credentialScope string, signingTime *v4Internal.SigningTime) string { + hash := sha256.New() + return strings.Join([]string{ + "AWS4-HMAC-SHA256-PAYLOAD", + signingTime.TimeFormat(), + credentialScope, + hex.EncodeToString(previousSignature), + hex.EncodeToString(makeHash(hash, headers)), + hex.EncodeToString(makeHash(hash, payload)), + }, "\n") +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/v4.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/v4.go index b77558c8..bb61904e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/v4.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/v4.go @@ -3,20 +3,22 @@ // Provides request signing for request that need to be signed with // AWS V4 Signatures. // -// Standalone Signer +// # Standalone Signer // // Generally using the signer outside of the SDK should not require any additional -// The signer does this by taking advantage of the URL.EscapedPath method. If your request URI requires +// +// The signer does this by taking advantage of the URL.EscapedPath method. If your request URI requires +// // additional escaping you many need to use the URL.Opaque to define what the raw URI should be sent // to the service as. // // The signer will first check the URL.Opaque field, and use its value if set. // The signer does require the URL.Opaque field to be set in the form of: // -// "///" +// "///" // -// // e.g. -// "//example.com/some/path" +// // e.g. +// "//example.com/some/path" // // The leading "//" and hostname are required or the URL.Opaque escaping will // not work correctly. @@ -66,6 +68,9 @@ import ( const ( signingAlgorithm = "AWS4-HMAC-SHA256" authorizationHeader = "Authorization" + + // Version of signing v4 + Version = "SigV4" ) // HTTPSigner is an interface to a SigV4 signer that can sign HTTP requests @@ -101,6 +106,11 @@ type SignerOptions struct { // This will enable logging of the canonical request, the string to sign, and for presigning the subsequent // presigned URL. LogSigning bool + + // Disables setting the session token on the request as part of signing + // through X-Amz-Security-Token. This is needed for variations of v4 that + // present the token elsewhere. + DisableSessionToken bool } // Signer applies AWS v4 signing to given request. Use this to sign requests @@ -130,13 +140,11 @@ type httpSigner struct { KeyDerivator keyDerivator IsPreSign bool - // PayloadHash is the hex encoded SHA-256 hash of the request payload - // If len(PayloadHash) == 0 the signer will attempt to send the request - // as an unsigned payload. Note: Unsigned payloads only work for a subset of services. PayloadHash string DisableHeaderHoisting bool DisableURIPathEscaping bool + DisableSessionToken bool } func (s *httpSigner) Build() (signedRequest, error) { @@ -250,6 +258,19 @@ func buildAuthorizationHeader(credentialStr, signedHeadersStr, signingSignature // you to specify that a request is signed for the future, and cannot be // used until then. // +// The payloadHash is the hex encoded SHA-256 hash of the request payload, and +// must be provided. Even if the request has no payload (aka body). If the +// request has no payload you should use the hex encoded SHA-256 of an empty +// string as the payloadHash value. +// +// "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" +// +// Some services such as Amazon S3 accept alternative values for the payload +// hash, such as "UNSIGNED-PAYLOAD" for requests where the body will not be +// included in the request signature. +// +// https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html +// // Sign differs from Presign in that it will sign the request using HTTP // header values. This type of signing is intended for http.Request values that // will not be shared, or are shared in a way the header values on the request @@ -272,6 +293,7 @@ func (s Signer) SignHTTP(ctx context.Context, credentials aws.Credentials, r *ht Time: v4Internal.NewSigningTime(signingTime.UTC()), DisableHeaderHoisting: options.DisableHeaderHoisting, DisableURIPathEscaping: options.DisableURIPathEscaping, + DisableSessionToken: options.DisableSessionToken, KeyDerivator: s.keyDerivator, } @@ -296,6 +318,19 @@ func (s Signer) SignHTTP(ctx context.Context, credentials aws.Credentials, r *ht // is made. This is helpful to know what header values need to be shared with // the party the presigned request will be distributed to. // +// The payloadHash is the hex encoded SHA-256 hash of the request payload, and +// must be provided. Even if the request has no payload (aka body). If the +// request has no payload you should use the hex encoded SHA-256 of an empty +// string as the payloadHash value. +// +// "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" +// +// Some services such as Amazon S3 accept alternative values for the payload +// hash, such as "UNSIGNED-PAYLOAD" for requests where the body will not be +// included in the request signature. +// +// https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html +// // PresignHTTP differs from SignHTTP in that it will sign the request using // query string instead of header values. This allows you to share the // Presigned Request's URL with third parties, or distribute it throughout your @@ -308,10 +343,10 @@ func (s Signer) SignHTTP(ctx context.Context, credentials aws.Credentials, r *ht // parameter is not used by all AWS services, and is most notable used by // Amazon S3 APIs. // -// expires := 20 * time.Minute -// query := req.URL.Query() -// query.Set("X-Amz-Expires", strconv.FormatInt(int64(expires/time.Second), 10) -// req.URL.RawQuery = query.Encode() +// expires := 20 * time.Minute +// query := req.URL.Query() +// query.Set("X-Amz-Expires", strconv.FormatInt(int64(expires/time.Second), 10)) +// req.URL.RawQuery = query.Encode() // // This method does not modify the provided request. func (s *Signer) PresignHTTP( @@ -335,6 +370,7 @@ func (s *Signer) PresignHTTP( IsPreSign: true, DisableHeaderHoisting: options.DisableHeaderHoisting, DisableURIPathEscaping: options.DisableURIPathEscaping, + DisableSessionToken: options.DisableSessionToken, KeyDerivator: s.keyDerivator, } @@ -359,12 +395,7 @@ func (s *Signer) PresignHTTP( } func (s *httpSigner) buildCredentialScope() string { - return strings.Join([]string{ - s.Time.ShortTimeFormat(), - s.Region, - s.ServiceName, - "aws4_request", - }, "/") + return v4Internal.BuildCredentialScope(s.Time, s.Region, s.ServiceName) } func buildQuery(r v4Internal.Rule, header http.Header) (url.Values, http.Header) { @@ -389,8 +420,8 @@ func (s *httpSigner) buildCanonicalHeaders(host string, rule v4Internal.Rule, he headers = append(headers, hostHeader) signed[hostHeader] = append(signed[hostHeader], host) + const contentLengthHeader = "content-length" if length > 0 { - const contentLengthHeader = "content-length" headers = append(headers, contentLengthHeader) signed[contentLengthHeader] = append(signed[contentLengthHeader], strconv.FormatInt(length, 10)) } @@ -399,6 +430,10 @@ func (s *httpSigner) buildCanonicalHeaders(host string, rule v4Internal.Rule, he if !rule.IsValid(k) { continue // ignored header } + if strings.EqualFold(k, contentLengthHeader) { + // prevent signing already handled content-length header. + continue + } lowerCaseKey := strings.ToLower(k) if _, ok := signed[lowerCaseKey]; ok { @@ -425,7 +460,15 @@ func (s *httpSigner) buildCanonicalHeaders(host string, rule v4Internal.Rule, he } else { canonicalHeaders.WriteString(headers[i]) canonicalHeaders.WriteRune(colon) - canonicalHeaders.WriteString(strings.Join(signed[headers[i]], ",")) + // Trim out leading, trailing, and dedup inner spaces from signed header values. + values := signed[headers[i]] + for j, v := range values { + cleanedValue := strings.TrimSpace(v4Internal.StripExcessSpaces(v)) + canonicalHeaders.WriteString(cleanedValue) + if j < len(values)-1 { + canonicalHeaders.WriteRune(',') + } + } } canonicalHeaders.WriteRune('\n') } @@ -470,7 +513,8 @@ func (s *httpSigner) setRequiredSigningFields(headers http.Header, query url.Val if s.IsPreSign { query.Set(v4Internal.AmzAlgorithmKey, signingAlgorithm) - if sessionToken := s.Credentials.SessionToken; len(sessionToken) > 0 { + sessionToken := s.Credentials.SessionToken + if !s.DisableSessionToken && len(sessionToken) > 0 { query.Set("X-Amz-Security-Token", sessionToken) } @@ -480,7 +524,7 @@ func (s *httpSigner) setRequiredSigningFields(headers http.Header, query url.Val headers[v4Internal.AmzDateKey] = append(headers[v4Internal.AmzDateKey][:0], amzDate) - if len(s.Credentials.SessionToken) > 0 { + if !s.DisableSessionToken && len(s.Credentials.SessionToken) > 0 { headers[v4Internal.AmzSecurityTokenKey] = append(headers[v4Internal.AmzSecurityTokenKey][:0], s.Credentials.SessionToken) } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/to_ptr.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/to_ptr.go index 28a193b8..f3fc4d61 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/to_ptr.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/to_ptr.go @@ -278,3 +278,20 @@ func TimeSlice(vs []time.Time) []*time.Time { func TimeMap(vs map[string]time.Time) map[string]*time.Time { return ptr.TimeMap(vs) } + +// Duration returns a pointer value for the time.Duration value passed in. +func Duration(v time.Duration) *time.Duration { + return ptr.Duration(v) +} + +// DurationSlice returns a slice of time.Duration pointers from the values +// passed in. +func DurationSlice(vs []time.Duration) []*time.Duration { + return ptr.DurationSlice(vs) +} + +// DurationMap returns a map of time.Duration pointers from the values +// passed in. +func DurationMap(vs map[string]time.Duration) map[string]*time.Duration { + return ptr.DurationMap(vs) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/client.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/client.go index b207a565..26d90719 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/client.go @@ -2,6 +2,7 @@ package http import ( "crypto/tls" + "github.com/aws/aws-sdk-go-v2/aws" "net" "net/http" "reflect" @@ -68,6 +69,14 @@ func (b *BuildableClient) Do(req *http.Request) (*http.Response, error) { return b.client.Do(req) } +// Freeze returns a frozen aws.HTTPClient implementation that is no longer a BuildableClient. +// Use this to prevent the SDK from applying DefaultMode configuration values to a buildable client. +func (b *BuildableClient) Freeze() aws.HTTPClient { + cpy := b.clone() + cpy.build() + return cpy.client +} + func (b *BuildableClient) build() { b.client = wrapWithLimitedRedirect(&http.Client{ Timeout: b.clientTimeout, diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/version.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/version.go index 1c585e60..5f729d45 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/version.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/version.go @@ -5,4 +5,4 @@ package aws const SDKName = "aws-sdk-go-v2" // SDKVersion is the version of this SDK -const SDKVersion = "1.2.0" +const SDKVersion = goModuleVersion diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md new file mode 100644 index 00000000..52437367 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md @@ -0,0 +1,558 @@ +# v1.26.5 (2024-01-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.4 (2024-01-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.3 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.2 (2023-12-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.1 (2023-12-08) + +* **Bug Fix**: Correct loading of [services *] sections into shared config. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.0 (2023-12-07) + +* **Feature**: Support modeled request compression. The only algorithm supported at this time is `gzip`. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.12 (2023-12-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.11 (2023-12-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.10 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.9 (2023-11-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.8 (2023-11-28.3) + +* **Bug Fix**: Correct resolution of S3Express auth disable toggle. + +# v1.25.7 (2023-11-28.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.6 (2023-11-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.5 (2023-11-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.4 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.3 (2023-11-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.2 (2023-11-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.1 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.0 (2023-11-14) + +* **Feature**: Add support for dynamic auth token from file and EKS container host in absolute/relative URIs in the HTTP credential provider. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.0 (2023-11-13) + +* **Feature**: Replace the legacy config parser with a modern, less-strict implementation. Parsing failures within a section will now simply ignore the invalid line rather than silently drop the entire section. +* **Dependency Update**: Updated to the latest SDK module versions + +# 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. + +# v1.19.0 (2023-10-16) + +* **Feature**: Modify logic of retrieving user agent appID from env config + +# v1.18.45 (2023-10-12) + +* **Bug Fix**: Fail to load config if an explicitly provided profile doesn't exist. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.44 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.43 (2023-10-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.42 (2023-09-22) + +* **Bug Fix**: Fixed a bug where merging `max_attempts` or `duration_seconds` fields across shared config files with invalid values would silently default them to 0. +* **Bug Fix**: Move type assertion of config values out of the parsing stage, which resolves an issue where the contents of a profile would silently be dropped with certain numeric formats. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.41 (2023-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.40 (2023-09-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.39 (2023-09-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.38 (2023-08-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.37 (2023-08-23) + +* No change notes available for this release. + +# v1.18.36 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.35 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.34 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.33 (2023-08-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.32 (2023-08-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.31 (2023-07-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.30 (2023-07-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.29 (2023-07-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.28 (2023-07-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.27 (2023-06-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.26 (2023-06-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.25 (2023-05-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.24 (2023-05-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.23 (2023-05-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.22 (2023-04-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.21 (2023-04-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.20 (2023-04-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.19 (2023-03-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.18 (2023-03-16) + +* **Bug Fix**: Allow RoleARN to be set as functional option on STS WebIdentityRoleOptions. Fixes aws/aws-sdk-go-v2#2015. + +# v1.18.17 (2023-03-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.16 (2023-03-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.15 (2023-02-22) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.14 (2023-02-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.13 (2023-02-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.12 (2023-02-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.11 (2023-02-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.10 (2023-01-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.9 (2023-01-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.8 (2023-01-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.7 (2022-12-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.6 (2022-12-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.5 (2022-12-15) + +* **Bug Fix**: Unify logic between shared config and in finding home directory +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.4 (2022-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.3 (2022-11-22) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.2 (2022-11-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.1 (2022-11-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.0 (2022-11-11) + +* **Announcement**: When using the SSOTokenProvider, a previous implementation incorrectly compensated for invalid SSOTokenProvider configurations in the shared profile. This has been fixed via PR #1903 and tracked in issue #1846 +* **Feature**: Adds token refresh support (via SSOTokenProvider) when using the SSOCredentialProvider +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.11 (2022-11-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.10 (2022-10-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.9 (2022-10-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.8 (2022-09-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.7 (2022-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.6 (2022-09-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.5 (2022-09-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.4 (2022-08-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.3 (2022-08-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.2 (2022-08-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.1 (2022-08-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.0 (2022-08-14) + +* **Feature**: Add alternative mechanism for determning the users `$HOME` or `%USERPROFILE%` location when the environment variables are not present. + +# v1.16.1 (2022-08-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.0 (2022-08-10) + +* **Feature**: Adds support for the following settings in the `~/.aws/credentials` file: `sso_account_id`, `sso_region`, `sso_role_name`, `sso_start_url`, and `ca_bundle`. + +# v1.15.17 (2022-08-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.16 (2022-08-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.15 (2022-08-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.14 (2022-07-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.13 (2022-07-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.12 (2022-06-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.11 (2022-06-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.10 (2022-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.9 (2022-05-26) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.8 (2022-05-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.7 (2022-05-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.6 (2022-05-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.5 (2022-05-09) + +* **Bug Fix**: Fixes a bug in LoadDefaultConfig to correctly assign ConfigSources so all config resolvers have access to the config sources. This fixes the feature/ec2/imds client not having configuration applied via config.LoadOptions such as EC2IMDSClientEnableState. PR [#1682](https://github.com/aws/aws-sdk-go-v2/pull/1682) + +# v1.15.4 (2022-04-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.3 (2022-03-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.2 (2022-03-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.1 (2022-03-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.0 (2022-03-08) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.0 (2022-02-24) + +* **Feature**: Adds support for loading RetryMaxAttempts and RetryMod from the environment and shared configuration files. These parameters drive how the SDK's API client will initialize its default retryer, if custome retryer has not been specified. See [config](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/config) module and [aws.Config](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws#Config) for more information about and how to use these new options. +* **Feature**: Adds support for the `ca_bundle` parameter in shared config and credentials files. The usage of the file is the same as environment variable, `AWS_CA_BUNDLE`, but sourced from shared config. Fixes [#1589](https://github.com/aws/aws-sdk-go-v2/issues/1589) +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.1 (2022-01-28) + +* **Bug Fix**: Fixes LoadDefaultConfig handling of errors returned by passed in functional options. Previously errors returned from the LoadOptions passed into LoadDefaultConfig were incorrectly ignored. [#1562](https://github.com/aws/aws-sdk-go-v2/pull/1562). Thanks to [Pinglei Guo](https://github.com/pingleig) for submitting this PR. +* **Bug Fix**: Fixes the SDK's handling of `duration_sections` in the shared credentials file or specified in multiple shared config and shared credentials files under the same profile. [#1568](https://github.com/aws/aws-sdk-go-v2/pull/1568). Thanks to [Amir Szekely](https://github.com/kichik) for help reproduce this bug. +* **Bug Fix**: Updates `config` module to use os.UserHomeDir instead of hard coded environment variable for OS. [#1563](https://github.com/aws/aws-sdk-go-v2/pull/1563) +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.0 (2022-01-14) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.0 (2022-01-07) + +* **Feature**: Add load option for CredentialCache. Adds a new member to the LoadOptions struct, CredentialsCacheOptions. This member allows specifying a function that will be used to configure the CredentialsCache. The CredentialsCacheOptions will only be used if the configuration loader will wrap the underlying credential provider in the CredentialsCache. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.1 (2021-12-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.0 (2021-12-02) + +* **Feature**: Add support for specifying `EndpointResolverWithOptions` on `LoadOptions`, and associated `WithEndpointResolverWithOptions`. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.3 (2021-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.2 (2021-11-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.1 (2021-11-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.0 (2021-11-06) + +* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.0 (2021-10-21) + +* **Feature**: Updated to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.3 (2021-10-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.2 (2021-09-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.1 (2021-09-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.0 (2021-09-02) + +* **Feature**: Add support for S3 Multi-Region Access Point ARNs. + +# v1.7.0 (2021-08-27) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.1 (2021-08-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.0 (2021-08-04) + +* **Feature**: adds error handling for defered close calls +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.0 (2021-07-15) + +* **Feature**: Support has been added for EC2 IPv6-enabled Instance Metadata Service Endpoints. +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.1 (2021-07-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.0 (2021-06-25) + +* **Feature**: Adds configuration setting for enabling endpoint discovery. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.0 (2021-05-20) + +* **Feature**: SSO credentials can now be defined alongside other credential providers within the same configuration profile. +* **Bug Fix**: Profile names were incorrectly normalized to lower-case, which could result in unexpected profile configurations. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.0 (2021-05-14) + +* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. +* **Dependency Update**: Updated to the latest SDK module versions + diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/config.go b/vendor/github.com/aws/aws-sdk-go-v2/config/config.go index fa2df2c8..50582d89 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/config.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/config.go @@ -2,17 +2,11 @@ package config import ( "context" + "os" + "github.com/aws/aws-sdk-go-v2/aws" ) -// defaultLoaders are a slice of functions that will read external configuration -// sources for configuration values. These values are read by the AWSConfigResolvers -// using interfaces to extract specific information from the external configuration. -var defaultLoaders = []loader{ - loadEnvConfig, - loadSharedConfigIgnoreNotExist, -} - // defaultAWSConfigResolvers are a slice of functions that will resolve external // configuration values into AWS configuration values. // @@ -34,8 +28,11 @@ var defaultAWSConfigResolvers = []awsConfigResolver{ // Sets the endpoint resolving behavior the API Clients will use for making // requests to. Clients default to their own clients this allows overrides - // to be specified. + // to be specified. The resolveEndpointResolver option is deprecated, but + // we still need to set it for backwards compatibility on config + // construction. resolveEndpointResolver, + resolveEndpointResolverWithOptions, // Sets the retry behavior API clients will use within their retry attempt // middleware. Defaults to unset, allowing API clients to define their own @@ -51,6 +48,15 @@ var defaultAWSConfigResolvers = []awsConfigResolver{ // API client request pipeline middleware. resolveAPIOptions, + // Resolves the DefaultsMode that should be used by SDK clients. If this + // mode is set to DefaultsModeAuto. + // + // Comes after HTTPClient and CustomCABundle to ensure the HTTP client is + // configured if provided before invoking IMDS if mode is auto. Comes + // before resolving credentials so that those subsequent clients use the + // configured auto mode. + resolveDefaultsModeOptions, + // Sets the resolved credentials the API clients will use for // authentication. Provides the SDK's default credential chain. // @@ -59,6 +65,21 @@ var defaultAWSConfigResolvers = []awsConfigResolver{ // implementations depend on or can be configured with earlier resolved // configuration options. resolveCredentials, + + // Sets the resolved bearer authentication token API clients will use for + // httpBearerAuth authentication scheme. + resolveBearerAuthToken, + + // Sets the sdk app ID if present in env var or shared config profile + resolveAppID, + + resolveBaseEndpoint, + + // Sets the DisableRequestCompression if present in env var or shared config profile + resolveDisableRequestCompression, + + // Sets the RequestMinCompressSizeBytes if present in env var or shared config profile + resolveRequestMinCompressSizeBytes, } // A Config represents a generic configuration value or set of values. This type @@ -124,17 +145,10 @@ func (cs configs) ResolveAWSConfig(ctx context.Context, resolvers []awsConfigRes for _, fn := range resolvers { if err := fn(ctx, &cfg, cs); err != nil { - // TODO provide better error? return aws.Config{}, err } } - var sources []interface{} - for _, s := range cs { - sources = append(sources, s) - } - cfg.ConfigSources = sources - return cfg, nil } @@ -156,13 +170,12 @@ func (cs configs) ResolveConfig(f func(configs []interface{}) error) error { // The custom configurations must satisfy the respective providers for their data // or the custom data will be ignored by the resolvers and config loaders. // -// cfg, err := config.LoadDefaultConfig( context.TODO(), -// WithSharedConfigProfile("test-profile"), -// ) -// if err != nil { -// panic(fmt.Sprintf("failed loading config, %v", err)) -// } -// +// cfg, err := config.LoadDefaultConfig( context.TODO(), +// config.WithSharedConfigProfile("test-profile"), +// ) +// if err != nil { +// panic(fmt.Sprintf("failed loading config, %v", err)) +// } // // The default configuration sources are: // * Environment Variables @@ -170,13 +183,15 @@ func (cs configs) ResolveConfig(f func(configs []interface{}) error) error { func LoadDefaultConfig(ctx context.Context, optFns ...func(*LoadOptions) error) (cfg aws.Config, err error) { var options LoadOptions for _, optFn := range optFns { - optFn(&options) + if err := optFn(&options); err != nil { + return aws.Config{}, err + } } // assign Load Options to configs var cfgCpy = configs{options} - cfgCpy, err = cfgCpy.AppendFromLoaders(ctx, defaultLoaders) + cfgCpy, err = cfgCpy.AppendFromLoaders(ctx, resolveConfigLoaders(&options)) if err != nil { return aws.Config{}, err } @@ -188,3 +203,17 @@ func LoadDefaultConfig(ctx context.Context, optFns ...func(*LoadOptions) error) return cfg, nil } + +func resolveConfigLoaders(options *LoadOptions) []loader { + loaders := make([]loader, 2) + loaders[0] = loadEnvConfig + + // specification of a profile should cause a load failure if it doesn't exist + if os.Getenv(awsProfileEnvVar) != "" || options.SharedConfigProfile != "" { + loaders[1] = loadSharedConfig + } else { + loaders[1] = loadSharedConfigIgnoreNotExist + } + + return loaders +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/defaultsmode.go b/vendor/github.com/aws/aws-sdk-go-v2/config/defaultsmode.go new file mode 100644 index 00000000..20b66367 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/defaultsmode.go @@ -0,0 +1,47 @@ +package config + +import ( + "context" + "os" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" +) + +const execEnvVar = "AWS_EXECUTION_ENV" + +// DefaultsModeOptions is the set of options that are used to configure +type DefaultsModeOptions struct { + // The SDK configuration defaults mode. Defaults to legacy if not specified. + // + // Supported modes are: auto, cross-region, in-region, legacy, mobile, standard + Mode aws.DefaultsMode + + // The EC2 Instance Metadata Client that should be used when performing environment + // discovery when aws.DefaultsModeAuto is set. + // + // If not specified the SDK will construct a client if the instance metadata service has not been disabled by + // the AWS_EC2_METADATA_DISABLED environment variable. + IMDSClient *imds.Client +} + +func resolveDefaultsModeRuntimeEnvironment(ctx context.Context, envConfig *EnvConfig, client *imds.Client) (aws.RuntimeEnvironment, error) { + getRegionOutput, err := client.GetRegion(ctx, &imds.GetRegionInput{}) + // honor context timeouts, but if we couldn't talk to IMDS don't fail runtime environment introspection. + select { + case <-ctx.Done(): + return aws.RuntimeEnvironment{}, err + default: + } + + var imdsRegion string + if err == nil { + imdsRegion = getRegionOutput.Region + } + + return aws.RuntimeEnvironment{ + EnvironmentIdentifier: aws.ExecutionEnvironmentID(os.Getenv(execEnvVar)), + Region: envConfig.Region, + EC2InstanceMetadataRegion: imdsRegion, + }, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/config/doc.go index 31648ffb..aab7164e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/doc.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/doc.go @@ -15,6 +15,6 @@ // take precedence over the default environment and shared config sources used by the SDK. If one or more Config sources // implement the same provider interface, priority will be handled by the order in which the sources were passed in. // -// A number of helpers (prefixed by ``With``) are provided in this package that implement their respective provider +// A number of helpers (prefixed by “With“) are provided in this package that implement their respective provider // interface. These helpers should be used for overriding configuration programmatically at runtime. package config diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/env_config.go b/vendor/github.com/aws/aws-sdk-go-v2/config/env_config.go index 85040b45..88550198 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/env_config.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/env_config.go @@ -7,9 +7,12 @@ import ( "io" "io/ioutil" "os" + "strconv" "strings" "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" + smithyrequestcompression "github.com/aws/smithy-go/private/requestcompression" ) // CredentialsSourceName provides a name of the provider when config is @@ -42,14 +45,41 @@ const ( awsCustomCABundleEnvVar = "AWS_CA_BUNDLE" - awsWebIdentityTokenFilePathEnvKey = "AWS_WEB_IDENTITY_TOKEN_FILE" + awsWebIdentityTokenFilePathEnvVar = "AWS_WEB_IDENTITY_TOKEN_FILE" - awsRoleARNEnvKey = "AWS_ROLE_ARN" - awsRoleSessionNameEnvKey = "AWS_ROLE_SESSION_NAME" + awsRoleARNEnvVar = "AWS_ROLE_ARN" + awsRoleSessionNameEnvVar = "AWS_ROLE_SESSION_NAME" - awsEnableEndpointDiscoveryEnvKey = "AWS_ENABLE_ENDPOINT_DISCOVERY" + awsEnableEndpointDiscoveryEnvVar = "AWS_ENABLE_ENDPOINT_DISCOVERY" awsS3UseARNRegionEnvVar = "AWS_S3_USE_ARN_REGION" + + awsEc2MetadataServiceEndpointModeEnvVar = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE" + + awsEc2MetadataServiceEndpointEnvVar = "AWS_EC2_METADATA_SERVICE_ENDPOINT" + + awsEc2MetadataDisabled = "AWS_EC2_METADATA_DISABLED" + awsEc2MetadataV1DisabledEnvVar = "AWS_EC2_METADATA_V1_DISABLED" + + awsS3DisableMultiRegionAccessPointEnvVar = "AWS_S3_DISABLE_MULTIREGION_ACCESS_POINTS" + + awsUseDualStackEndpoint = "AWS_USE_DUALSTACK_ENDPOINT" + + awsUseFIPSEndpoint = "AWS_USE_FIPS_ENDPOINT" + + awsDefaultMode = "AWS_DEFAULTS_MODE" + + awsRetryMaxAttempts = "AWS_MAX_ATTEMPTS" + awsRetryMode = "AWS_RETRY_MODE" + awsSdkAppID = "AWS_SDK_UA_APP_ID" + + awsIgnoreConfiguredEndpoints = "AWS_IGNORE_CONFIGURED_ENDPOINT_URLS" + awsEndpointURL = "AWS_ENDPOINT_URL" + + awsDisableRequestCompression = "AWS_DISABLE_REQUEST_COMPRESSION" + awsRequestMinCompressionSizeBytes = "AWS_REQUEST_MIN_COMPRESSION_SIZE_BYTES" + + awsS3DisableExpressSessionAuthEnv = "AWS_S3_DISABLE_EXPRESS_SESSION_AUTH" ) var ( @@ -157,7 +187,7 @@ type EnvConfig struct { // Enables endpoint discovery via environment variables. // // AWS_ENABLE_ENDPOINT_DISCOVERY=true - EnableEndpointDiscovery *bool + EnableEndpointDiscovery aws.EndpointDiscoveryEnableState // Specifies the WebIdentity token the SDK should use to assume a role // with. @@ -180,6 +210,86 @@ type EnvConfig struct { // // AWS_S3_USE_ARN_REGION=true S3UseARNRegion *bool + + // Specifies if the EC2 IMDS service client is enabled. + // + // 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 + EC2IMDSEndpointMode imds.EndpointModeState + + // Specifies the EC2 Instance Metadata Service endpoint to use. If specified it overrides EC2IMDSEndpointMode. + // + // AWS_EC2_METADATA_SERVICE_ENDPOINT=http://fd00:ec2::254 + EC2IMDSEndpoint string + + // Specifies if the S3 service should disable multi-region access points + // support. + // + // AWS_S3_DISABLE_MULTIREGION_ACCESS_POINTS=true + S3DisableMultiRegionAccessPoints *bool + + // Specifies that SDK clients must resolve a dual-stack endpoint for + // services. + // + // AWS_USE_DUALSTACK_ENDPOINT=true + UseDualStackEndpoint aws.DualStackEndpointState + + // Specifies that SDK clients must resolve a FIPS endpoint for + // services. + // + // AWS_USE_FIPS_ENDPOINT=true + UseFIPSEndpoint aws.FIPSEndpointState + + // Specifies the SDK Defaults Mode used by services. + // + // AWS_DEFAULTS_MODE=standard + DefaultsMode aws.DefaultsMode + + // Specifies the maximum number attempts an API client will call an + // operation that fails with a retryable error. + // + // AWS_MAX_ATTEMPTS=3 + RetryMaxAttempts int + + // Specifies the retry model the API client will be created with. + // + // aws_retry_mode=standard + RetryMode aws.RetryMode + + // 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 + + // determine if request compression is allowed, default to false + // retrieved from env var AWS_DISABLE_REQUEST_COMPRESSION + DisableRequestCompression *bool + + // inclusive threshold request body size to trigger compression, + // default to 10240 and must be within 0 and 10485760 bytes inclusive + // retrieved from env var AWS_REQUEST_MIN_COMPRESSION_SIZE_BYTES + RequestMinCompressSizeBytes *int64 + + // Whether S3Express auth is disabled. + // + // This will NOT prevent requests from being made to S3Express buckets, it + // will only bypass the modified endpoint routing and signing behaviors + // associated with the feature. + S3DisableExpressAuth *bool } // loadEnvConfig reads configuration values from the OS's environment variables. @@ -215,12 +325,21 @@ func NewEnvConfig() (EnvConfig, error) { cfg.CustomCABundle = os.Getenv(awsCustomCABundleEnvVar) - cfg.WebIdentityTokenFilePath = os.Getenv(awsWebIdentityTokenFilePathEnvKey) + cfg.WebIdentityTokenFilePath = os.Getenv(awsWebIdentityTokenFilePathEnvVar) + + cfg.RoleARN = os.Getenv(awsRoleARNEnvVar) + cfg.RoleSessionName = os.Getenv(awsRoleSessionNameEnvVar) + + cfg.AppID = os.Getenv(awsSdkAppID) - cfg.RoleARN = os.Getenv(awsRoleARNEnvKey) - cfg.RoleSessionName = os.Getenv(awsRoleSessionNameEnvKey) + if err := setBoolPtrFromEnvVal(&cfg.DisableRequestCompression, []string{awsDisableRequestCompression}); err != nil { + return cfg, err + } + if err := setInt64PtrFromEnvVal(&cfg.RequestMinCompressSizeBytes, []string{awsRequestMinCompressionSizeBytes}, smithyrequestcompression.MaxRequestMinCompressSizeBytes); err != nil { + return cfg, err + } - if err := setBoolPtrFromEnvVal(&cfg.EnableEndpointDiscovery, []string{awsEnableEndpointDiscoveryEnvKey}); err != nil { + if err := setEndpointDiscoveryTypeFromEnvVal(&cfg.EnableEndpointDiscovery, []string{awsEnableEndpointDiscoveryEnvVar}); err != nil { return cfg, err } @@ -228,9 +347,150 @@ func NewEnvConfig() (EnvConfig, error) { return cfg, err } + setEC2IMDSClientEnableState(&cfg.EC2IMDSClientEnableState, []string{awsEc2MetadataDisabled}) + if err := setEC2IMDSEndpointMode(&cfg.EC2IMDSEndpointMode, []string{awsEc2MetadataServiceEndpointModeEnvVar}); err != nil { + 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 + } + + if err := setUseDualStackEndpointFromEnvVal(&cfg.UseDualStackEndpoint, []string{awsUseDualStackEndpoint}); err != nil { + return cfg, err + } + + if err := setUseFIPSEndpointFromEnvVal(&cfg.UseFIPSEndpoint, []string{awsUseFIPSEndpoint}); err != nil { + return cfg, err + } + + if err := setDefaultsModeFromEnvVal(&cfg.DefaultsMode, []string{awsDefaultMode}); err != nil { + return cfg, err + } + + if err := setIntFromEnvVal(&cfg.RetryMaxAttempts, []string{awsRetryMaxAttempts}); err != nil { + return cfg, err + } + if err := setRetryModeFromEnvVal(&cfg.RetryMode, []string{awsRetryMode}); err != nil { + return cfg, err + } + + setStringFromEnvVal(&cfg.BaseEndpoint, []string{awsEndpointURL}) + + if err := setBoolPtrFromEnvVal(&cfg.IgnoreConfiguredEndpoints, []string{awsIgnoreConfiguredEndpoints}); err != nil { + return cfg, err + } + + if err := setBoolPtrFromEnvVal(&cfg.S3DisableExpressAuth, []string{awsS3DisableExpressSessionAuthEnv}); err != nil { + return cfg, err + } + return cfg, nil } +func (c EnvConfig) getDefaultsMode(ctx context.Context) (aws.DefaultsMode, bool, error) { + if len(c.DefaultsMode) == 0 { + return "", false, nil + } + return c.DefaultsMode, true, nil +} + +func (c EnvConfig) getAppID(context.Context) (string, bool, error) { + return c.AppID, len(c.AppID) > 0, nil +} + +func (c EnvConfig) getDisableRequestCompression(context.Context) (bool, bool, error) { + if c.DisableRequestCompression == nil { + return false, false, nil + } + return *c.DisableRequestCompression, true, nil +} + +func (c EnvConfig) getRequestMinCompressSizeBytes(context.Context) (int64, bool, error) { + if c.RequestMinCompressSizeBytes == nil { + return 0, false, nil + } + return *c.RequestMinCompressSizeBytes, true, nil +} + +// GetRetryMaxAttempts returns the value of AWS_MAX_ATTEMPTS if was specified, +// and not 0. +func (c EnvConfig) GetRetryMaxAttempts(ctx context.Context) (int, bool, error) { + if c.RetryMaxAttempts == 0 { + return 0, false, nil + } + return c.RetryMaxAttempts, true, nil +} + +// GetRetryMode returns the RetryMode of AWS_RETRY_MODE if was specified, and a +// valid value. +func (c EnvConfig) GetRetryMode(ctx context.Context) (aws.RetryMode, bool, error) { + if len(c.RetryMode) == 0 { + return "", false, nil + } + return c.RetryMode, true, nil +} + +func setEC2IMDSClientEnableState(state *imds.ClientEnableState, keys []string) { + for _, k := range keys { + value := os.Getenv(k) + if len(value) == 0 { + continue + } + switch { + case strings.EqualFold(value, "true"): + *state = imds.ClientDisabled + case strings.EqualFold(value, "false"): + *state = imds.ClientEnabled + default: + continue + } + break + } +} + +func setDefaultsModeFromEnvVal(mode *aws.DefaultsMode, keys []string) error { + for _, k := range keys { + if value := os.Getenv(k); len(value) > 0 { + if ok := mode.SetFromString(value); !ok { + return fmt.Errorf("invalid %s value: %s", k, value) + } + break + } + } + return nil +} + +func setRetryModeFromEnvVal(mode *aws.RetryMode, keys []string) (err error) { + for _, k := range keys { + if value := os.Getenv(k); len(value) > 0 { + *mode, err = aws.ParseRetryMode(value) + if err != nil { + return fmt.Errorf("invalid %s value, %w", k, err) + } + break + } + } + return nil +} + +func setEC2IMDSEndpointMode(mode *imds.EndpointModeState, keys []string) error { + for _, k := range keys { + value := os.Getenv(k) + if len(value) == 0 { + continue + } + if err := mode.SetFromString(value); err != nil { + return fmt.Errorf("invalid value for environment variable, %s=%s, %v", k, value, err) + } + } + return nil +} + // GetRegion returns the AWS Region if set in the environment. Returns an empty // string if not set. func (c EnvConfig) getRegion(ctx context.Context) (string, bool, error) { @@ -294,6 +554,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) { @@ -304,6 +592,36 @@ func (c EnvConfig) GetS3UseARNRegion(ctx context.Context) (value, ok bool, err e return *c.S3UseARNRegion, true, nil } +// GetS3DisableMultiRegionAccessPoints returns whether to disable multi-region access point +// support for the S3 client. +func (c EnvConfig) GetS3DisableMultiRegionAccessPoints(ctx context.Context) (value, ok bool, err error) { + if c.S3DisableMultiRegionAccessPoints == nil { + return false, false, nil + } + + return *c.S3DisableMultiRegionAccessPoints, true, nil +} + +// GetUseDualStackEndpoint returns whether the service's dual-stack endpoint should be +// used for requests. +func (c EnvConfig) GetUseDualStackEndpoint(ctx context.Context) (value aws.DualStackEndpointState, found bool, err error) { + if c.UseDualStackEndpoint == aws.DualStackEndpointStateUnset { + return aws.DualStackEndpointStateUnset, false, nil + } + + return c.UseDualStackEndpoint, true, nil +} + +// GetUseFIPSEndpoint returns whether the service's FIPS endpoint should be +// used for requests. +func (c EnvConfig) GetUseFIPSEndpoint(ctx context.Context) (value aws.FIPSEndpointState, found bool, err error) { + if c.UseFIPSEndpoint == aws.FIPSEndpointStateUnset { + return aws.FIPSEndpointStateUnset, false, nil + } + + return c.UseFIPSEndpoint, true, nil +} + func setStringFromEnvVal(dst *string, keys []string) { for _, k := range keys { if v := os.Getenv(k); len(v) > 0 { @@ -313,6 +631,21 @@ func setStringFromEnvVal(dst *string, keys []string) { } } +func setIntFromEnvVal(dst *int, keys []string) error { + for _, k := range keys { + if v := os.Getenv(k); len(v) > 0 { + i, err := strconv.ParseInt(v, 10, 64) + if err != nil { + return fmt.Errorf("invalid value %s=%s, %w", k, v, err) + } + *dst = int(i) + break + } + } + + return nil +} + func setBoolPtrFromEnvVal(dst **bool, keys []string) error { for _, k := range keys { value := os.Getenv(k) @@ -339,3 +672,148 @@ func setBoolPtrFromEnvVal(dst **bool, keys []string) error { return nil } + +func setInt64PtrFromEnvVal(dst **int64, keys []string, max int64) error { + for _, k := range keys { + value := os.Getenv(k) + if len(value) == 0 { + continue + } + + v, err := strconv.ParseInt(value, 10, 64) + if err != nil { + return fmt.Errorf("invalid value for env var, %s=%s, need int64", k, value) + } else if v < 0 || v > max { + return fmt.Errorf("invalid range for env var min request compression size bytes %q, must be within 0 and 10485760 inclusively", v) + } + if *dst == nil { + *dst = new(int64) + } + + **dst = v + break + } + + return nil +} + +func setEndpointDiscoveryTypeFromEnvVal(dst *aws.EndpointDiscoveryEnableState, keys []string) error { + for _, k := range keys { + value := os.Getenv(k) + if len(value) == 0 { + continue // skip if empty + } + + switch { + case strings.EqualFold(value, endpointDiscoveryDisabled): + *dst = aws.EndpointDiscoveryDisabled + case strings.EqualFold(value, endpointDiscoveryEnabled): + *dst = aws.EndpointDiscoveryEnabled + case strings.EqualFold(value, endpointDiscoveryAuto): + *dst = aws.EndpointDiscoveryAuto + default: + return fmt.Errorf( + "invalid value for environment variable, %s=%s, need true, false or auto", + k, value) + } + } + return nil +} + +func setUseDualStackEndpointFromEnvVal(dst *aws.DualStackEndpointState, keys []string) error { + for _, k := range keys { + value := os.Getenv(k) + if len(value) == 0 { + continue // skip if empty + } + + switch { + case strings.EqualFold(value, "true"): + *dst = aws.DualStackEndpointStateEnabled + case strings.EqualFold(value, "false"): + *dst = aws.DualStackEndpointStateDisabled + default: + return fmt.Errorf( + "invalid value for environment variable, %s=%s, need true, false", + k, value) + } + } + return nil +} + +func setUseFIPSEndpointFromEnvVal(dst *aws.FIPSEndpointState, keys []string) error { + for _, k := range keys { + value := os.Getenv(k) + if len(value) == 0 { + continue // skip if empty + } + + switch { + case strings.EqualFold(value, "true"): + *dst = aws.FIPSEndpointStateEnabled + case strings.EqualFold(value, "false"): + *dst = aws.FIPSEndpointStateDisabled + default: + return fmt.Errorf( + "invalid value for environment variable, %s=%s, need true, false", + k, value) + } + } + return nil +} + +// GetEnableEndpointDiscovery returns resolved value for EnableEndpointDiscovery env variable setting. +func (c EnvConfig) GetEnableEndpointDiscovery(ctx context.Context) (value aws.EndpointDiscoveryEnableState, found bool, err error) { + if c.EnableEndpointDiscovery == aws.EndpointDiscoveryUnset { + return aws.EndpointDiscoveryUnset, false, nil + } + + return c.EnableEndpointDiscovery, true, nil +} + +// GetEC2IMDSClientEnableState implements a EC2IMDSClientEnableState options resolver interface. +func (c EnvConfig) GetEC2IMDSClientEnableState() (imds.ClientEnableState, bool, error) { + if c.EC2IMDSClientEnableState == imds.ClientDefaultEnableState { + return imds.ClientDefaultEnableState, false, nil + } + + return c.EC2IMDSClientEnableState, true, nil +} + +// GetEC2IMDSEndpointMode implements a EC2IMDSEndpointMode option resolver interface. +func (c EnvConfig) GetEC2IMDSEndpointMode() (imds.EndpointModeState, bool, error) { + if c.EC2IMDSEndpointMode == imds.EndpointModeStateUnset { + return imds.EndpointModeStateUnset, false, nil + } + + return c.EC2IMDSEndpointMode, true, nil +} + +// GetEC2IMDSEndpoint implements a EC2IMDSEndpoint option resolver interface. +func (c EnvConfig) GetEC2IMDSEndpoint() (string, bool, error) { + if len(c.EC2IMDSEndpoint) == 0 { + return "", false, nil + } + + 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 +} + +// GetS3DisableExpressAuth returns the configured value for +// [EnvConfig.S3DisableExpressAuth]. +func (c EnvConfig) GetS3DisableExpressAuth() (value, ok bool) { + if c.S3DisableExpressAuth == nil { + return false, false + } + + return *c.S3DisableExpressAuth, true +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go new file mode 100644 index 00000000..6fc8acb0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package config + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "1.26.5" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/load_options.go b/vendor/github.com/aws/aws-sdk-go-v2/config/load_options.go index 901c7fd8..06596c1b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/load_options.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/load_options.go @@ -11,6 +11,7 @@ import ( "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" + smithybearer "github.com/aws/smithy-go/auth/bearer" "github.com/aws/smithy-go/logging" "github.com/aws/smithy-go/middleware" ) @@ -18,7 +19,8 @@ import ( // LoadOptionsFunc is a type alias for LoadOptions functional option type LoadOptionsFunc func(*LoadOptions) error -// LoadOptions are discrete set of options that are valid for loading the configuration +// LoadOptions are discrete set of options that are valid for loading the +// configuration type LoadOptions struct { // Region is the region to send requests to. @@ -27,15 +29,42 @@ type LoadOptions struct { // Credentials object to use when signing requests. Credentials aws.CredentialsProvider + // Token provider for authentication operations with bearer authentication. + BearerAuthTokenProvider smithybearer.TokenProvider + // HTTPClient the SDK's API clients will use to invoke HTTP requests. HTTPClient HTTPClient - // EndpointResolver that can be used to provide or override an endpoint for the given - // service and region Please see the `aws.EndpointResolver` documentation on usage. + // EndpointResolver that can be used to provide or override an endpoint for + // the given service and region. + // + // See the `aws.EndpointResolver` documentation on usage. + // + // Deprecated: See EndpointResolverWithOptions EndpointResolver aws.EndpointResolver - // Retryer is a function that provides a Retryer implementation. A Retryer guides how HTTP requests should be - // retried in case of recoverable failures. + // EndpointResolverWithOptions that can be used to provide or override an + // endpoint for the given service and region. + // + // See the `aws.EndpointResolverWithOptions` documentation on usage. + EndpointResolverWithOptions aws.EndpointResolverWithOptions + + // RetryMaxAttempts specifies the maximum number attempts an API client + // will call an operation that fails with a retryable error. + // + // This value will only be used if Retryer option is nil. + RetryMaxAttempts int + + // RetryMode specifies the retry model the API client will be created with. + // + // This value will only be used if Retryer option is nil. + RetryMode aws.RetryMode + + // Retryer is a function that provides a Retryer implementation. A Retryer + // guides how HTTP requests should be retried in case of recoverable + // failures. + // + // If not nil, RetryMaxAttempts, and RetryMode will be ignored. Retryer func() aws.Retryer // APIOptions provides the set of middleware mutations modify how the API @@ -46,51 +75,71 @@ type LoadOptions struct { // Logger writer interface to write logging messages to. Logger logging.Logger - // ClientLogMode is used to configure the events that will be sent to the configured logger. - // This can be used to configure the logging of signing, retries, request, and responses - // of the SDK clients. + // ClientLogMode is used to configure the events that will be sent to the + // configured logger. This can be used to configure the logging of signing, + // retries, request, and responses of the SDK clients. // - // See the ClientLogMode type documentation for the complete set of logging modes and available - // configuration. + // See the ClientLogMode type documentation for the complete set of logging + // modes and available configuration. ClientLogMode *aws.ClientLogMode // SharedConfigProfile is the profile to be used when loading the SharedConfig SharedConfigProfile string - // SharedConfigFiles is the slice of custom shared config files to use when loading the SharedConfig. - // A non-default profile used within config file must have name defined with prefix 'profile '. - // eg [profile xyz] indicates a profile with name 'xyz'. - // To read more on the format of the config file, please refer the documentation at + // SharedConfigFiles is the slice of custom shared config files to use when + // loading the SharedConfig. A non-default profile used within config file + // must have name defined with prefix 'profile '. eg [profile xyz] + // indicates a profile with name 'xyz'. To read more on the format of the + // config file, please refer the documentation at // https://docs.aws.amazon.com/credref/latest/refdocs/file-format.html#file-format-config // - // If duplicate profiles are provided within the same, or across multiple shared config files, the next parsed - // profile will override only the properties that conflict with the previously defined profile. - // Note that if duplicate profiles are provided within the SharedCredentialsFiles and SharedConfigFiles, - // the properties defined in shared credentials file take precedence. + // If duplicate profiles are provided within the same, or across multiple + // shared config files, the next parsed profile will override only the + // properties that conflict with the previously defined profile. Note that + // if duplicate profiles are provided within the SharedCredentialsFiles and + // SharedConfigFiles, the properties defined in shared credentials file + // take precedence. SharedConfigFiles []string - // SharedCredentialsFile is the slice of custom shared credentials files to use when loading the SharedConfig. - // The profile name used within credentials file must not prefix 'profile '. - // eg [xyz] indicates a profile with name 'xyz'. Profile declared as [profile xyz] will be ignored. - // To read more on the format of the credentials file, please refer the documentation at + // SharedCredentialsFile is the slice of custom shared credentials files to + // use when loading the SharedConfig. The profile name used within + // credentials file must not prefix 'profile '. eg [xyz] indicates a + // profile with name 'xyz'. Profile declared as [profile xyz] will be + // ignored. To read more on the format of the credentials file, please + // refer the documentation at // https://docs.aws.amazon.com/credref/latest/refdocs/file-format.html#file-format-creds // - // If duplicate profiles are provided with a same, or across multiple shared credentials files, the next parsed - // profile will override only properties that conflict with the previously defined profile. - // Note that if duplicate profiles are provided within the SharedCredentialsFiles and SharedConfigFiles, - // the properties defined in shared credentials file take precedence. + // If duplicate profiles are provided with a same, or across multiple + // shared credentials files, the next parsed profile will override only + // properties that conflict with the previously defined profile. Note that + // if duplicate profiles are provided within the SharedCredentialsFiles and + // SharedConfigFiles, the properties defined in shared credentials file + // take precedence. SharedCredentialsFiles []string // CustomCABundle is CA bundle PEM bytes reader CustomCABundle io.Reader - // DefaultRegion is the fall back region, used if a region was not resolved from other sources + // DefaultRegion is the fall back region, used if a region was not resolved + // from other sources DefaultRegion string // UseEC2IMDSRegion indicates if SDK should retrieve the region // from the EC2 Metadata service UseEC2IMDSRegion *UseEC2IMDSRegion + // CredentialsCacheOptions is a function for setting the + // aws.CredentialsCacheOptions + CredentialsCacheOptions func(*aws.CredentialsCacheOptions) + + // BearerAuthTokenCacheOptions is a function for setting the smithy-go + // auth/bearer#TokenCacheOptions + BearerAuthTokenCacheOptions func(*smithybearer.TokenCacheOptions) + + // SSOTokenProviderOptions is a function for setting the + // credentials/ssocreds.SSOTokenProviderOptions + SSOTokenProviderOptions func(*ssocreds.SSOTokenProviderOptions) + // ProcessCredentialOptions is a function for setting // the processcreds.Options ProcessCredentialOptions func(*processcreds.Options) @@ -122,6 +171,81 @@ type LoadOptions struct { // S3UseARNRegion specifies if the S3 service should allow ARNs to direct // the region, the client's requests are sent to. S3UseARNRegion *bool + + // S3DisableMultiRegionAccessPoints specifies if the S3 service should disable + // the S3 Multi-Region access points feature. + S3DisableMultiRegionAccessPoints *bool + + // EnableEndpointDiscovery specifies if endpoint discovery is enable for + // the client. + EnableEndpointDiscovery aws.EndpointDiscoveryEnableState + + // Specifies if the EC2 IMDS service client is enabled. + // + // AWS_EC2_METADATA_DISABLED=true + EC2IMDSClientEnableState imds.ClientEnableState + + // Specifies the EC2 Instance Metadata Service default endpoint selection + // mode (IPv4 or IPv6) + EC2IMDSEndpointMode imds.EndpointModeState + + // Specifies the EC2 Instance Metadata Service endpoint to use. If + // specified it overrides EC2IMDSEndpointMode. + EC2IMDSEndpoint string + + // Specifies that SDK clients must resolve a dual-stack endpoint for + // services. + UseDualStackEndpoint aws.DualStackEndpointState + + // Specifies that SDK clients must resolve a FIPS endpoint for + // services. + UseFIPSEndpoint aws.FIPSEndpointState + + // Specifies the SDK configuration mode for defaults. + DefaultsModeOptions DefaultsModeOptions + + // The sdk app ID retrieved from env var or shared config to be added to request user agent header + AppID string + + // Specifies whether an operation request could be compressed + DisableRequestCompression *bool + + // The inclusive min bytes of a request body that could be compressed + RequestMinCompressSizeBytes *int64 + + // Whether S3 Express auth is disabled. + S3DisableExpressAuth *bool +} + +func (o LoadOptions) getDefaultsMode(ctx context.Context) (aws.DefaultsMode, bool, error) { + if len(o.DefaultsModeOptions.Mode) == 0 { + return "", false, nil + } + return o.DefaultsModeOptions.Mode, true, nil +} + +// GetRetryMaxAttempts returns the RetryMaxAttempts if specified in the +// LoadOptions and not 0. +func (o LoadOptions) GetRetryMaxAttempts(ctx context.Context) (int, bool, error) { + if o.RetryMaxAttempts == 0 { + return 0, false, nil + } + return o.RetryMaxAttempts, true, nil +} + +// GetRetryMode returns the RetryMode specified in the LoadOptions. +func (o LoadOptions) GetRetryMode(ctx context.Context) (aws.RetryMode, bool, error) { + if len(o.RetryMode) == 0 { + return "", false, nil + } + return o.RetryMode, true, nil +} + +func (o LoadOptions) getDefaultsModeIMDSClient(ctx context.Context) (*imds.Client, bool, error) { + if o.DefaultsModeOptions.IMDSClient == nil { + return nil, false, nil + } + return o.DefaultsModeOptions.IMDSClient, true, nil } // getRegion returns Region from config's LoadOptions @@ -133,6 +257,27 @@ func (o LoadOptions) getRegion(ctx context.Context) (string, bool, error) { return o.Region, true, nil } +// getAppID returns AppID from config's LoadOptions +func (o LoadOptions) getAppID(ctx context.Context) (string, bool, error) { + return o.AppID, len(o.AppID) > 0, nil +} + +// getDisableRequestCompression returns DisableRequestCompression from config's LoadOptions +func (o LoadOptions) getDisableRequestCompression(ctx context.Context) (bool, bool, error) { + if o.DisableRequestCompression == nil { + return false, false, nil + } + return *o.DisableRequestCompression, true, nil +} + +// getRequestMinCompressSizeBytes returns RequestMinCompressSizeBytes from config's LoadOptions +func (o LoadOptions) getRequestMinCompressSizeBytes(ctx context.Context) (int64, bool, error) { + if o.RequestMinCompressSizeBytes == nil { + return 0, false, nil + } + return *o.RequestMinCompressSizeBytes, true, nil +} + // WithRegion is a helper function to construct functional options // that sets Region on config's LoadOptions. Setting the region to // an empty string, will result in the region value being ignored. @@ -145,6 +290,39 @@ func WithRegion(v string) LoadOptionsFunc { } } +// WithAppID is a helper function to construct functional options +// that sets AppID on config's LoadOptions. +func WithAppID(ID string) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.AppID = ID + return nil + } +} + +// WithDisableRequestCompression is a helper function to construct functional options +// that sets DisableRequestCompression on config's LoadOptions. +func WithDisableRequestCompression(DisableRequestCompression *bool) LoadOptionsFunc { + return func(o *LoadOptions) error { + if DisableRequestCompression == nil { + return nil + } + o.DisableRequestCompression = DisableRequestCompression + return nil + } +} + +// WithRequestMinCompressSizeBytes is a helper function to construct functional options +// that sets RequestMinCompressSizeBytes on config's LoadOptions. +func WithRequestMinCompressSizeBytes(RequestMinCompressSizeBytes *int64) LoadOptionsFunc { + return func(o *LoadOptions) error { + if RequestMinCompressSizeBytes == nil { + return nil + } + o.RequestMinCompressSizeBytes = RequestMinCompressSizeBytes + return nil + } +} + // getDefaultRegion returns DefaultRegion from config's LoadOptions func (o LoadOptions) getDefaultRegion(ctx context.Context) (string, bool, error) { if len(o.DefaultRegion) == 0 { @@ -273,7 +451,7 @@ func (p *UseEC2IMDSRegion) getRegion(ctx context.Context) (string, bool, error) client = imds.New(imds.Options{}) } - result, err := p.Client.GetRegion(ctx, nil) + result, err := client.GetRegion(ctx, nil) if err != nil { return "", false, err } @@ -332,6 +510,96 @@ func WithCredentialsProvider(v aws.CredentialsProvider) LoadOptionsFunc { } } +// getCredentialsCacheOptionsProvider returns the wrapped function to set aws.CredentialsCacheOptions +func (o LoadOptions) getCredentialsCacheOptions(ctx context.Context) (func(*aws.CredentialsCacheOptions), bool, error) { + if o.CredentialsCacheOptions == nil { + return nil, false, nil + } + + return o.CredentialsCacheOptions, true, nil +} + +// WithCredentialsCacheOptions is a helper function to construct functional +// options that sets a function to modify the aws.CredentialsCacheOptions the +// aws.CredentialsCache will be configured with, if the CredentialsCache is used +// by the configuration loader. +// +// If multiple WithCredentialsCacheOptions calls are made, the last call +// overrides the previous call values. +func WithCredentialsCacheOptions(v func(*aws.CredentialsCacheOptions)) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.CredentialsCacheOptions = v + return nil + } +} + +// getBearerAuthTokenProvider returns the credentials value +func (o LoadOptions) getBearerAuthTokenProvider(ctx context.Context) (smithybearer.TokenProvider, bool, error) { + if o.BearerAuthTokenProvider == nil { + return nil, false, nil + } + + return o.BearerAuthTokenProvider, true, nil +} + +// WithBearerAuthTokenProvider is a helper function to construct functional options +// that sets Credential provider value on config's LoadOptions. If credentials +// provider is set to nil, the credentials provider value will be ignored. +// If multiple WithBearerAuthTokenProvider calls are made, the last call overrides +// the previous call values. +func WithBearerAuthTokenProvider(v smithybearer.TokenProvider) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.BearerAuthTokenProvider = v + return nil + } +} + +// getBearerAuthTokenCacheOptionsProvider returns the wrapped function to set smithybearer.TokenCacheOptions +func (o LoadOptions) getBearerAuthTokenCacheOptions(ctx context.Context) (func(*smithybearer.TokenCacheOptions), bool, error) { + if o.BearerAuthTokenCacheOptions == nil { + return nil, false, nil + } + + return o.BearerAuthTokenCacheOptions, true, nil +} + +// WithBearerAuthTokenCacheOptions is a helper function to construct functional options +// that sets a function to modify the TokenCacheOptions the smithy-go +// auth/bearer#TokenCache will be configured with, if the TokenCache is used by +// the configuration loader. +// +// If multiple WithBearerAuthTokenCacheOptions calls are made, the last call overrides +// the previous call values. +func WithBearerAuthTokenCacheOptions(v func(*smithybearer.TokenCacheOptions)) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.BearerAuthTokenCacheOptions = v + return nil + } +} + +// getSSOTokenProviderOptionsProvider returns the wrapped function to set smithybearer.TokenCacheOptions +func (o LoadOptions) getSSOTokenProviderOptions(ctx context.Context) (func(*ssocreds.SSOTokenProviderOptions), bool, error) { + if o.SSOTokenProviderOptions == nil { + return nil, false, nil + } + + return o.SSOTokenProviderOptions, true, nil +} + +// WithSSOTokenProviderOptions is a helper function to construct functional +// options that sets a function to modify the SSOtokenProviderOptions the SDK's +// credentials/ssocreds#SSOProvider will be configured with, if the +// SSOTokenProvider is used by the configuration loader. +// +// If multiple WithSSOTokenProviderOptions calls are made, the last call overrides +// the previous call values. +func WithSSOTokenProviderOptions(v func(*ssocreds.SSOTokenProviderOptions)) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.SSOTokenProviderOptions = v + return nil + } +} + // getProcessCredentialOptions returns the wrapped function to set processcreds.Options func (o LoadOptions) getProcessCredentialOptions(ctx context.Context) (func(*processcreds.Options), bool, error) { if o.ProcessCredentialOptions == nil { @@ -482,6 +750,48 @@ func WithAPIOptions(v []func(*middleware.Stack) error) LoadOptionsFunc { } } +func (o LoadOptions) getRetryMaxAttempts(ctx context.Context) (int, bool, error) { + if o.RetryMaxAttempts == 0 { + return 0, false, nil + } + + return o.RetryMaxAttempts, true, nil +} + +// WithRetryMaxAttempts is a helper function to construct functional options that sets +// RetryMaxAttempts on LoadOptions. If RetryMaxAttempts is unset, the RetryMaxAttempts value is +// ignored. If multiple WithRetryMaxAttempts calls are made, the last call overrides +// the previous call values. +// +// Will be ignored of LoadOptions.Retryer or WithRetryer are used. +func WithRetryMaxAttempts(v int) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.RetryMaxAttempts = v + return nil + } +} + +func (o LoadOptions) getRetryMode(ctx context.Context) (aws.RetryMode, bool, error) { + if o.RetryMode == "" { + return "", false, nil + } + + return o.RetryMode, true, nil +} + +// WithRetryMode is a helper function to construct functional options that sets +// RetryMode on LoadOptions. If RetryMode is unset, the RetryMode value is +// ignored. If multiple WithRetryMode calls are made, the last call overrides +// the previous call values. +// +// Will be ignored of LoadOptions.Retryer or WithRetryer are used. +func WithRetryMode(v aws.RetryMode) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.RetryMode = v + return nil + } +} + func (o LoadOptions) getRetryer(ctx context.Context) (func() aws.Retryer, bool, error) { if o.Retryer == nil { return nil, false, nil @@ -510,9 +820,11 @@ func (o LoadOptions) getEndpointResolver(ctx context.Context) (aws.EndpointResol } // WithEndpointResolver is a helper function to construct functional options -// that sets endpoint resolver on LoadOptions. The EndpointResolver is set to nil, +// that sets the EndpointResolver on LoadOptions. If the EndpointResolver is set to nil, // the EndpointResolver value is ignored. If multiple WithEndpointResolver calls // are made, the last call overrides the previous call values. +// +// Deprecated: See WithEndpointResolverWithOptions func WithEndpointResolver(v aws.EndpointResolver) LoadOptionsFunc { return func(o *LoadOptions) error { o.EndpointResolver = v @@ -520,6 +832,25 @@ func WithEndpointResolver(v aws.EndpointResolver) LoadOptionsFunc { } } +func (o LoadOptions) getEndpointResolverWithOptions(ctx context.Context) (aws.EndpointResolverWithOptions, bool, error) { + if o.EndpointResolverWithOptions == nil { + return nil, false, nil + } + + return o.EndpointResolverWithOptions, true, nil +} + +// WithEndpointResolverWithOptions is a helper function to construct functional options +// that sets the EndpointResolverWithOptions on LoadOptions. If the EndpointResolverWithOptions is set to nil, +// the EndpointResolver value is ignored. If multiple WithEndpointResolver calls +// are made, the last call overrides the previous call values. +func WithEndpointResolverWithOptions(v aws.EndpointResolverWithOptions) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.EndpointResolverWithOptions = v + return nil + } +} + func (o LoadOptions) getLogger(ctx context.Context) (logging.Logger, bool, error) { if o.Logger == nil { return nil, false, nil @@ -598,6 +929,45 @@ func WithS3UseARNRegion(v bool) LoadOptionsFunc { } } +// GetS3DisableMultiRegionAccessPoints returns whether to disable +// the S3 multi-region access points feature. +func (o LoadOptions) GetS3DisableMultiRegionAccessPoints(ctx context.Context) (v bool, found bool, err error) { + if o.S3DisableMultiRegionAccessPoints == nil { + return false, false, nil + } + return *o.S3DisableMultiRegionAccessPoints, true, nil +} + +// WithS3DisableMultiRegionAccessPoints is a helper function to construct functional options +// that can be used to set S3DisableMultiRegionAccessPoints on LoadOptions. +// If multiple WithS3DisableMultiRegionAccessPoints calls are made, the last call overrides +// the previous call values. +func WithS3DisableMultiRegionAccessPoints(v bool) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.S3DisableMultiRegionAccessPoints = &v + return nil + } +} + +// GetEnableEndpointDiscovery returns if the EnableEndpointDiscovery flag is set. +func (o LoadOptions) GetEnableEndpointDiscovery(ctx context.Context) (value aws.EndpointDiscoveryEnableState, ok bool, err error) { + if o.EnableEndpointDiscovery == aws.EndpointDiscoveryUnset { + return aws.EndpointDiscoveryUnset, false, nil + } + return o.EnableEndpointDiscovery, true, nil +} + +// WithEndpointDiscovery is a helper function to construct functional options +// that can be used to enable endpoint discovery on LoadOptions for supported clients. +// If multiple WithEndpointDiscovery calls are made, the last call overrides +// the previous call values. +func WithEndpointDiscovery(v aws.EndpointDiscoveryEnableState) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.EnableEndpointDiscovery = v + return nil + } +} + // getSSOProviderOptions returns AssumeRoleCredentialOptions from LoadOptions func (o LoadOptions) getSSOProviderOptions(context.Context) (func(options *ssocreds.Options), bool, error) { if o.SSOProviderOptions == nil { @@ -619,3 +989,126 @@ func WithSSOProviderOptions(v func(*ssocreds.Options)) LoadOptionsFunc { return nil } } + +// GetEC2IMDSClientEnableState implements a EC2IMDSClientEnableState options resolver interface. +func (o LoadOptions) GetEC2IMDSClientEnableState() (imds.ClientEnableState, bool, error) { + if o.EC2IMDSClientEnableState == imds.ClientDefaultEnableState { + return imds.ClientDefaultEnableState, false, nil + } + + return o.EC2IMDSClientEnableState, true, nil +} + +// GetEC2IMDSEndpointMode implements a EC2IMDSEndpointMode option resolver interface. +func (o LoadOptions) GetEC2IMDSEndpointMode() (imds.EndpointModeState, bool, error) { + if o.EC2IMDSEndpointMode == imds.EndpointModeStateUnset { + return imds.EndpointModeStateUnset, false, nil + } + + return o.EC2IMDSEndpointMode, true, nil +} + +// GetEC2IMDSEndpoint implements a EC2IMDSEndpoint option resolver interface. +func (o LoadOptions) GetEC2IMDSEndpoint() (string, bool, error) { + if len(o.EC2IMDSEndpoint) == 0 { + return "", false, nil + } + + return o.EC2IMDSEndpoint, true, nil +} + +// WithEC2IMDSClientEnableState is a helper function to construct functional options that sets the EC2IMDSClientEnableState. +func WithEC2IMDSClientEnableState(v imds.ClientEnableState) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.EC2IMDSClientEnableState = v + return nil + } +} + +// WithEC2IMDSEndpointMode is a helper function to construct functional options that sets the EC2IMDSEndpointMode. +func WithEC2IMDSEndpointMode(v imds.EndpointModeState) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.EC2IMDSEndpointMode = v + return nil + } +} + +// WithEC2IMDSEndpoint is a helper function to construct functional options that sets the EC2IMDSEndpoint. +func WithEC2IMDSEndpoint(v string) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.EC2IMDSEndpoint = v + return nil + } +} + +// WithUseDualStackEndpoint is a helper function to construct +// functional options that can be used to set UseDualStackEndpoint on LoadOptions. +func WithUseDualStackEndpoint(v aws.DualStackEndpointState) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.UseDualStackEndpoint = v + return nil + } +} + +// GetUseDualStackEndpoint returns whether the service's dual-stack endpoint should be +// used for requests. +func (o LoadOptions) GetUseDualStackEndpoint(ctx context.Context) (value aws.DualStackEndpointState, found bool, err error) { + if o.UseDualStackEndpoint == aws.DualStackEndpointStateUnset { + return aws.DualStackEndpointStateUnset, false, nil + } + return o.UseDualStackEndpoint, true, nil +} + +// WithUseFIPSEndpoint is a helper function to construct +// functional options that can be used to set UseFIPSEndpoint on LoadOptions. +func WithUseFIPSEndpoint(v aws.FIPSEndpointState) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.UseFIPSEndpoint = v + return nil + } +} + +// GetUseFIPSEndpoint returns whether the service's FIPS endpoint should be +// used for requests. +func (o LoadOptions) GetUseFIPSEndpoint(ctx context.Context) (value aws.FIPSEndpointState, found bool, err error) { + if o.UseFIPSEndpoint == aws.FIPSEndpointStateUnset { + return aws.FIPSEndpointStateUnset, false, nil + } + return o.UseFIPSEndpoint, true, nil +} + +// WithDefaultsMode sets the SDK defaults configuration mode to the value provided. +// +// Zero or more functional options can be provided to provide configuration options for performing +// environment discovery when using aws.DefaultsModeAuto. +func WithDefaultsMode(mode aws.DefaultsMode, optFns ...func(options *DefaultsModeOptions)) LoadOptionsFunc { + do := DefaultsModeOptions{ + Mode: mode, + } + for _, fn := range optFns { + fn(&do) + } + return func(options *LoadOptions) error { + options.DefaultsModeOptions = do + return nil + } +} + +// GetS3DisableExpressAuth returns the configured value for +// [EnvConfig.S3DisableExpressAuth]. +func (o LoadOptions) GetS3DisableExpressAuth() (value, ok bool) { + if o.S3DisableExpressAuth == nil { + return false, false + } + + return *o.S3DisableExpressAuth, true +} + +// WithS3DisableExpressAuth sets [LoadOptions.S3DisableExpressAuth] +// to the value provided. +func WithS3DisableExpressAuth(v bool) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.S3DisableExpressAuth = &v + return nil + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/provider.go b/vendor/github.com/aws/aws-sdk-go-v2/config/provider.go index a4308368..13745fc9 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/provider.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/provider.go @@ -11,6 +11,8 @@ import ( "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" + smithybearer "github.com/aws/smithy-go/auth/bearer" "github.com/aws/smithy-go/logging" "github.com/aws/smithy-go/middleware" ) @@ -120,6 +122,109 @@ func getRegion(ctx context.Context, configs configs) (value string, found bool, return } +// IgnoreConfiguredEndpointsProvider is needed to search for all providers +// that provide a flag to disable configured endpoints. +type IgnoreConfiguredEndpointsProvider interface { + GetIgnoreConfiguredEndpoints(ctx context.Context) (bool, bool, error) +} + +// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured +// endpoints feature. +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) + if err != nil || found { + break + } + } + } + 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) +} + +func getAppID(ctx context.Context, configs configs) (value string, found bool, err error) { + for _, cfg := range configs { + if p, ok := cfg.(appIDProvider); ok { + value, found, err = p.getAppID(ctx) + if err != nil || found { + break + } + } + } + return +} + +// disableRequestCompressionProvider provides access to the DisableRequestCompression +type disableRequestCompressionProvider interface { + getDisableRequestCompression(context.Context) (bool, bool, error) +} + +func getDisableRequestCompression(ctx context.Context, configs configs) (value bool, found bool, err error) { + for _, cfg := range configs { + if p, ok := cfg.(disableRequestCompressionProvider); ok { + value, found, err = p.getDisableRequestCompression(ctx) + if err != nil || found { + break + } + } + } + return +} + +// requestMinCompressSizeBytesProvider provides access to the MinCompressSizeBytes +type requestMinCompressSizeBytesProvider interface { + getRequestMinCompressSizeBytes(context.Context) (int64, bool, error) +} + +func getRequestMinCompressSizeBytes(ctx context.Context, configs configs) (value int64, found bool, err error) { + for _, cfg := range configs { + if p, ok := cfg.(requestMinCompressSizeBytesProvider); ok { + value, found, err = p.getRequestMinCompressSizeBytes(ctx) + if err != nil || found { + break + } + } + } + return +} + // ec2IMDSRegionProvider provides access to the ec2 imds region // configuration value type ec2IMDSRegionProvider interface { @@ -162,6 +267,95 @@ func getCredentialsProvider(ctx context.Context, configs configs) (p aws.Credent return } +// credentialsCacheOptionsProvider is an interface for retrieving a function for setting +// the aws.CredentialsCacheOptions. +type credentialsCacheOptionsProvider interface { + getCredentialsCacheOptions(ctx context.Context) (func(*aws.CredentialsCacheOptions), bool, error) +} + +// getCredentialsCacheOptionsProvider is an interface for retrieving a function for setting +// the aws.CredentialsCacheOptions. +func getCredentialsCacheOptionsProvider(ctx context.Context, configs configs) ( + f func(*aws.CredentialsCacheOptions), found bool, err error, +) { + for _, config := range configs { + if p, ok := config.(credentialsCacheOptionsProvider); ok { + f, found, err = p.getCredentialsCacheOptions(ctx) + if err != nil || found { + break + } + } + } + return +} + +// bearerAuthTokenProviderProvider provides access to the bearer authentication +// token external configuration value. +type bearerAuthTokenProviderProvider interface { + getBearerAuthTokenProvider(context.Context) (smithybearer.TokenProvider, bool, error) +} + +// getBearerAuthTokenProvider searches the config sources for a +// bearerAuthTokenProviderProvider and returns the value if found. Returns an +// error if a provider fails before a value is found. +func getBearerAuthTokenProvider(ctx context.Context, configs configs) (p smithybearer.TokenProvider, found bool, err error) { + for _, cfg := range configs { + if provider, ok := cfg.(bearerAuthTokenProviderProvider); ok { + p, found, err = provider.getBearerAuthTokenProvider(ctx) + if err != nil || found { + break + } + } + } + return +} + +// bearerAuthTokenCacheOptionsProvider is an interface for retrieving a function for +// setting the smithy-go auth/bearer#TokenCacheOptions. +type bearerAuthTokenCacheOptionsProvider interface { + getBearerAuthTokenCacheOptions(context.Context) (func(*smithybearer.TokenCacheOptions), bool, error) +} + +// getBearerAuthTokenCacheOptionsProvider is an interface for retrieving a function for +// setting the smithy-go auth/bearer#TokenCacheOptions. +func getBearerAuthTokenCacheOptions(ctx context.Context, configs configs) ( + f func(*smithybearer.TokenCacheOptions), found bool, err error, +) { + for _, config := range configs { + if p, ok := config.(bearerAuthTokenCacheOptionsProvider); ok { + f, found, err = p.getBearerAuthTokenCacheOptions(ctx) + if err != nil || found { + break + } + } + } + return +} + +// ssoTokenProviderOptionsProvider is an interface for retrieving a function for +// setting the SDK's credentials/ssocreds#SSOTokenProviderOptions. +type ssoTokenProviderOptionsProvider interface { + getSSOTokenProviderOptions(context.Context) (func(*ssocreds.SSOTokenProviderOptions), bool, error) +} + +// getSSOTokenProviderOptions is an interface for retrieving a function for +// setting the SDK's credentials/ssocreds#SSOTokenProviderOptions. +func getSSOTokenProviderOptions(ctx context.Context, configs configs) ( + f func(*ssocreds.SSOTokenProviderOptions), found bool, err error, +) { + for _, config := range configs { + if p, ok := config.(ssoTokenProviderOptionsProvider); ok { + f, found, err = p.getSSOTokenProviderOptions(ctx) + if err != nil || found { + break + } + } + } + return +} + +// ssoTokenProviderOptionsProvider + // processCredentialOptions is an interface for retrieving a function for setting // the processcreds.Options. type processCredentialOptions interface { @@ -336,6 +530,25 @@ func getEndpointResolver(ctx context.Context, configs configs) (f aws.EndpointRe return } +// endpointResolverWithOptionsProvider is an interface for retrieving an aws.EndpointResolverWithOptions from a configuration source +type endpointResolverWithOptionsProvider interface { + getEndpointResolverWithOptions(ctx context.Context) (aws.EndpointResolverWithOptions, bool, error) +} + +// getEndpointResolver searches the provided config sources for a EndpointResolverFunc that can be used +// to configure the aws.Config.EndpointResolver value. +func getEndpointResolverWithOptions(ctx context.Context, configs configs) (f aws.EndpointResolverWithOptions, found bool, err error) { + for _, c := range configs { + if p, ok := c.(endpointResolverWithOptionsProvider); ok { + f, found, err = p.getEndpointResolverWithOptions(ctx) + if err != nil || found { + break + } + } + } + return +} + // loggerProvider is an interface for retrieving a logging.Logger from a configuration source. type loggerProvider interface { getLogger(ctx context.Context) (logging.Logger, bool, error) @@ -423,5 +636,69 @@ func getSSOProviderOptions(ctx context.Context, configs configs) (v func(options } } } - return + return v, found, err +} + +type defaultsModeIMDSClientProvider interface { + getDefaultsModeIMDSClient(context.Context) (*imds.Client, bool, error) +} + +func getDefaultsModeIMDSClient(ctx context.Context, configs configs) (v *imds.Client, found bool, err error) { + for _, c := range configs { + if p, ok := c.(defaultsModeIMDSClientProvider); ok { + v, found, err = p.getDefaultsModeIMDSClient(ctx) + if err != nil || found { + break + } + } + } + return v, found, err +} + +type defaultsModeProvider interface { + getDefaultsMode(context.Context) (aws.DefaultsMode, bool, error) +} + +func getDefaultsMode(ctx context.Context, configs configs) (v aws.DefaultsMode, found bool, err error) { + for _, c := range configs { + if p, ok := c.(defaultsModeProvider); ok { + v, found, err = p.getDefaultsMode(ctx) + if err != nil || found { + break + } + } + } + return v, found, err +} + +type retryMaxAttemptsProvider interface { + GetRetryMaxAttempts(context.Context) (int, bool, error) +} + +func getRetryMaxAttempts(ctx context.Context, configs configs) (v int, found bool, err error) { + for _, c := range configs { + if p, ok := c.(retryMaxAttemptsProvider); ok { + v, found, err = p.GetRetryMaxAttempts(ctx) + if err != nil || found { + break + } + } + } + return v, found, err +} + +type retryModeProvider interface { + GetRetryMode(context.Context) (aws.RetryMode, bool, error) +} + +func getRetryMode(ctx context.Context, configs configs) (v aws.RetryMode, found bool, err error) { + for _, c := range configs { + if p, ok := c.(retryModeProvider); ok { + v, found, err = p.GetRetryMode(ctx) + if err != nil || found { + break + } + } + } + return v, found, err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/resolve.go b/vendor/github.com/aws/aws-sdk-go-v2/config/resolve.go index 550ca4e7..fde2e398 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/resolve.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/resolve.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" "github.com/aws/smithy-go/logging" ) @@ -20,9 +21,14 @@ import ( // This should be used as the first resolver in the slice of resolvers when // resolving external configuration. func resolveDefaultAWSConfig(ctx context.Context, cfg *aws.Config, cfgs configs) error { + var sources []interface{} + for _, s := range cfgs { + sources = append(sources, s) + } + *cfg = aws.Config{ - Credentials: aws.AnonymousCredentials{}, - Logger: logging.NewStandardLogger(os.Stderr), + Logger: logging.NewStandardLogger(os.Stderr), + ConfigSources: sources, } return nil } @@ -99,6 +105,67 @@ 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) + if err != nil { + return err + } + + cfg.AppID = ID + return nil +} + +// resolveDisableRequestCompression extracts the DisableRequestCompression from the configs slice's +// SharedConfig or EnvConfig +func resolveDisableRequestCompression(ctx context.Context, cfg *aws.Config, configs configs) error { + disable, _, err := getDisableRequestCompression(ctx, configs) + if err != nil { + return err + } + + cfg.DisableRequestCompression = disable + return nil +} + +// resolveRequestMinCompressSizeBytes extracts the RequestMinCompressSizeBytes from the configs slice's +// SharedConfig or EnvConfig +func resolveRequestMinCompressSizeBytes(ctx context.Context, cfg *aws.Config, configs configs) error { + minBytes, found, err := getRequestMinCompressSizeBytes(ctx, configs) + if err != nil { + return err + } + // must set a default min size 10240 if not configured + if !found { + minBytes = 10240 + } + cfg.RequestMinCompressSizeBytes = minBytes + return nil +} + // resolveDefaultRegion extracts the first instance of a default region and sets `aws.Config.Region` to the default // region if region had not been resolved from other sources. func resolveDefaultRegion(ctx context.Context, cfg *aws.Config, configs configs) error { @@ -166,6 +233,22 @@ func resolveEndpointResolver(ctx context.Context, cfg *aws.Config, configs confi return nil } +// resolveEndpointResolver extracts the first instance of a EndpointResolverFunc from the config slice +// and sets the functions result on the aws.Config.EndpointResolver +func resolveEndpointResolverWithOptions(ctx context.Context, cfg *aws.Config, configs configs) error { + endpointResolver, found, err := getEndpointResolverWithOptions(ctx, configs) + if err != nil { + return err + } + if !found { + return nil + } + + cfg.EndpointResolverWithOptions = endpointResolver + + return nil +} + func resolveLogger(ctx context.Context, cfg *aws.Config, configs configs) error { logger, found, err := getLogger(ctx, configs) if err != nil { @@ -199,13 +282,17 @@ func resolveRetryer(ctx context.Context, cfg *aws.Config, configs configs) error if err != nil { return err } - if !found { + + if found { + cfg.Retryer = retryer return nil } - cfg.Retryer = retryer - - return nil + // Only load the retry options if a custom retryer has not be specified. + if err = resolveRetryMaxAttempts(ctx, cfg, configs); err != nil { + return err + } + return resolveRetryMode(ctx, cfg, configs) } func resolveEC2IMDSRegion(ctx context.Context, cfg *aws.Config, configs configs) error { @@ -225,3 +312,56 @@ func resolveEC2IMDSRegion(ctx context.Context, cfg *aws.Config, configs configs) return nil } + +func resolveDefaultsModeOptions(ctx context.Context, cfg *aws.Config, configs configs) error { + defaultsMode, found, err := getDefaultsMode(ctx, configs) + if err != nil { + return err + } + if !found { + defaultsMode = aws.DefaultsModeLegacy + } + + var environment aws.RuntimeEnvironment + if defaultsMode == aws.DefaultsModeAuto { + envConfig, _, _ := getAWSConfigSources(configs) + + client, found, err := getDefaultsModeIMDSClient(ctx, configs) + if err != nil { + return err + } + if !found { + client = imds.NewFromConfig(*cfg) + } + + environment, err = resolveDefaultsModeRuntimeEnvironment(ctx, envConfig, client) + if err != nil { + return err + } + } + + cfg.DefaultsMode = defaultsMode + cfg.RuntimeEnvironment = environment + + return nil +} + +func resolveRetryMaxAttempts(ctx context.Context, cfg *aws.Config, configs configs) error { + maxAttempts, found, err := getRetryMaxAttempts(ctx, configs) + if err != nil || !found { + return err + } + cfg.RetryMaxAttempts = maxAttempts + + return nil +} + +func resolveRetryMode(ctx context.Context, cfg *aws.Config, configs configs) error { + retryMode, found, err := getRetryMode(ctx, configs) + if err != nil || !found { + return err + } + cfg.RetryMode = retryMode + + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/resolve_bearer_token.go b/vendor/github.com/aws/aws-sdk-go-v2/config/resolve_bearer_token.go new file mode 100644 index 00000000..a8ebb3c0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/resolve_bearer_token.go @@ -0,0 +1,122 @@ +package config + +import ( + "context" + "fmt" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/credentials/ssocreds" + "github.com/aws/aws-sdk-go-v2/service/ssooidc" + smithybearer "github.com/aws/smithy-go/auth/bearer" +) + +// resolveBearerAuthToken extracts a token provider from the config sources. +// +// If an explicit bearer authentication token provider is not found the +// resolver will fallback to resolving token provider via other config sources +// such as SharedConfig. +func resolveBearerAuthToken(ctx context.Context, cfg *aws.Config, configs configs) error { + found, err := resolveBearerAuthTokenProvider(ctx, cfg, configs) + if found || err != nil { + return err + } + + return resolveBearerAuthTokenProviderChain(ctx, cfg, configs) +} + +// resolveBearerAuthTokenProvider extracts the first instance of +// BearerAuthTokenProvider from the config sources. +// +// The resolved BearerAuthTokenProvider will be wrapped in a cache to ensure +// the Token is only refreshed when needed. This also protects the +// TokenProvider so it can be used concurrently. +// +// Config providers used: +// * bearerAuthTokenProviderProvider +func resolveBearerAuthTokenProvider(ctx context.Context, cfg *aws.Config, configs configs) (bool, error) { + tokenProvider, found, err := getBearerAuthTokenProvider(ctx, configs) + if !found || err != nil { + return false, err + } + + cfg.BearerAuthTokenProvider, err = wrapWithBearerAuthTokenCache( + ctx, configs, tokenProvider) + if err != nil { + return false, err + } + + return true, nil +} + +func resolveBearerAuthTokenProviderChain(ctx context.Context, cfg *aws.Config, configs configs) (err error) { + _, sharedConfig, _ := getAWSConfigSources(configs) + + var provider smithybearer.TokenProvider + + if sharedConfig.SSOSession != nil { + provider, err = resolveBearerAuthSSOTokenProvider( + ctx, cfg, sharedConfig.SSOSession, configs) + } + + if err == nil && provider != nil { + cfg.BearerAuthTokenProvider, err = wrapWithBearerAuthTokenCache( + ctx, configs, provider) + } + + return err +} + +func resolveBearerAuthSSOTokenProvider(ctx context.Context, cfg *aws.Config, session *SSOSession, configs configs) (*ssocreds.SSOTokenProvider, error) { + ssoTokenProviderOptionsFn, found, err := getSSOTokenProviderOptions(ctx, configs) + if err != nil { + return nil, fmt.Errorf("failed to get SSOTokenProviderOptions from config sources, %w", err) + } + + var optFns []func(*ssocreds.SSOTokenProviderOptions) + if found { + optFns = append(optFns, ssoTokenProviderOptionsFn) + } + + cachePath, err := ssocreds.StandardCachedTokenFilepath(session.Name) + if err != nil { + return nil, fmt.Errorf("failed to get SSOTokenProvider's cache path, %w", err) + } + + client := ssooidc.NewFromConfig(*cfg) + provider := ssocreds.NewSSOTokenProvider(client, cachePath, optFns...) + + return provider, nil +} + +// wrapWithBearerAuthTokenCache will wrap provider with an smithy-go +// bearer/auth#TokenCache with the provided options if the provider is not +// already a TokenCache. +func wrapWithBearerAuthTokenCache( + ctx context.Context, + cfgs configs, + provider smithybearer.TokenProvider, + optFns ...func(*smithybearer.TokenCacheOptions), +) (smithybearer.TokenProvider, error) { + _, ok := provider.(*smithybearer.TokenCache) + if ok { + return provider, nil + } + + tokenCacheConfigOptions, optionsFound, err := getBearerAuthTokenCacheOptions(ctx, cfgs) + if err != nil { + return nil, err + } + + opts := make([]func(*smithybearer.TokenCacheOptions), 0, 2+len(optFns)) + opts = append(opts, func(o *smithybearer.TokenCacheOptions) { + o.RefreshBeforeExpires = 5 * time.Minute + o.RetrieveBearerTokenTimeout = 30 * time.Second + }) + opts = append(opts, optFns...) + if optionsFound { + opts = append(opts, tokenCacheConfigOptions) + } + + return smithybearer.NewTokenCache(provider, opts...), nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/resolve_credentials.go b/vendor/github.com/aws/aws-sdk-go-v2/config/resolve_credentials.go index 449fc393..89368520 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/resolve_credentials.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/resolve_credentials.go @@ -3,7 +3,10 @@ package config import ( "context" "fmt" + "io/ioutil" + "net" "net/url" + "os" "time" "github.com/aws/aws-sdk-go-v2/aws" @@ -15,39 +18,56 @@ import ( "github.com/aws/aws-sdk-go-v2/credentials/stscreds" "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" "github.com/aws/aws-sdk-go-v2/service/sso" + "github.com/aws/aws-sdk-go-v2/service/ssooidc" "github.com/aws/aws-sdk-go-v2/service/sts" ) const ( // valid credential source values - credSourceEc2Metadata = "Ec2InstanceMetadata" - credSourceEnvironment = "Environment" - credSourceECSContainer = "EcsContainer" + credSourceEc2Metadata = "Ec2InstanceMetadata" + credSourceEnvironment = "Environment" + credSourceECSContainer = "EcsContainer" + httpProviderAuthFileEnvVar = "AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE" ) +// direct representation of the IPv4 address for the ECS container +// "169.254.170.2" +var ecsContainerIPv4 net.IP = []byte{ + 169, 254, 170, 2, +} + +// direct representation of the IPv4 address for the EKS container +// "169.254.170.23" +var eksContainerIPv4 net.IP = []byte{ + 169, 254, 170, 23, +} + +// direct representation of the IPv6 address for the EKS container +// "fd00:ec2::23" +var eksContainerIPv6 net.IP = []byte{ + 0xFD, 0, 0xE, 0xC2, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0x23, +} + var ( ecsContainerEndpoint = "http://169.254.170.2" // not constant to allow for swapping during unit-testing ) -// resolveCredentials extracts a credential provider from slice of config sources. +// resolveCredentials extracts a credential provider from slice of config +// sources. // -// If an explict credential provider is not found the resolver will fallback to resolving -// credentials by extracting a credential provider from EnvConfig and SharedConfig. +// If an explicit credential provider is not found the resolver will fallback +// to resolving credentials by extracting a credential provider from EnvConfig +// and SharedConfig. func resolveCredentials(ctx context.Context, cfg *aws.Config, configs configs) error { found, err := resolveCredentialProvider(ctx, cfg, configs) - if err != nil { + if found || err != nil { return err } - if found { - return nil - } - err = resolveCredentialChain(ctx, cfg, configs) - if err != nil { - return err - } - - return nil + return resolveCredentialChain(ctx, cfg, configs) } // resolveCredentialProvider extracts the first instance of Credentials from the @@ -59,16 +79,16 @@ func resolveCredentials(ctx context.Context, cfg *aws.Config, configs configs) e // // Config providers used: // * credentialsProviderProvider -func resolveCredentialProvider(ctx context.Context, cfg *aws.Config, cfgs configs) (bool, error) { - credProvider, found, err := getCredentialsProvider(ctx, cfgs) - if err != nil { +func resolveCredentialProvider(ctx context.Context, cfg *aws.Config, configs configs) (bool, error) { + credProvider, found, err := getCredentialsProvider(ctx, configs) + if !found || err != nil { return false, err } - if !found { - return false, nil - } - cfg.Credentials = wrapWithCredentialsCache(credProvider) + cfg.Credentials, err = wrapWithCredentialsCache(ctx, configs, credProvider) + if err != nil { + return false, err + } return true, nil } @@ -105,7 +125,10 @@ func resolveCredentialChain(ctx context.Context, cfg *aws.Config, configs config } // Wrap the resolved provider in a cache so the SDK will cache credentials. - cfg.Credentials = wrapWithCredentialsCache(cfg.Credentials) + cfg.Credentials, err = wrapWithCredentialsCache(ctx, configs, cfg.Credentials) + if err != nil { + return err + } return nil } @@ -123,13 +146,6 @@ func resolveCredsFromProfile(ctx context.Context, cfg *aws.Config, envConfig *En Value: sharedConfig.Credentials, } - case sharedConfig.hasSSOConfiguration(): - err = resolveSSOCredentials(ctx, cfg, sharedConfig, configs) - - case len(sharedConfig.CredentialProcess) != 0: - // Get credentials from CredentialProcess - err = processCredentials(ctx, cfg, sharedConfig, configs) - case len(sharedConfig.CredentialSource) != 0: err = resolveCredsFromSource(ctx, cfg, envConfig, sharedConfig, configs) @@ -137,7 +153,14 @@ func resolveCredsFromProfile(ctx context.Context, cfg *aws.Config, envConfig *En // Credentials from Assume Web Identity token require an IAM Role, and // that roll will be assumed. May be wrapped with another assume role // via SourceProfile. - err = assumeWebIdentity(ctx, cfg, sharedConfig.WebIdentityTokenFile, sharedConfig.RoleARN, sharedConfig.RoleSessionName, configs) + return assumeWebIdentity(ctx, cfg, sharedConfig.WebIdentityTokenFile, sharedConfig.RoleARN, sharedConfig.RoleSessionName, configs) + + case sharedConfig.hasSSOConfiguration(): + err = resolveSSOCredentials(ctx, cfg, sharedConfig, configs) + + case len(sharedConfig.CredentialProcess) != 0: + // Get credentials from CredentialProcess + err = processCredentials(ctx, cfg, sharedConfig, configs) case len(envConfig.ContainerCredentialsEndpoint) != 0: err = resolveLocalHTTPCredProvider(ctx, cfg, envConfig.ContainerCredentialsEndpoint, envConfig.ContainerAuthorizationToken, configs) @@ -174,7 +197,30 @@ func resolveSSOCredentials(ctx context.Context, cfg *aws.Config, sharedConfig *S } cfgCopy := cfg.Copy() - cfgCopy.Region = sharedConfig.SSORegion + + if sharedConfig.SSOSession != nil { + ssoTokenProviderOptionsFn, found, err := getSSOTokenProviderOptions(ctx, configs) + if err != nil { + return fmt.Errorf("failed to get SSOTokenProviderOptions from config sources, %w", err) + } + var optFns []func(*ssocreds.SSOTokenProviderOptions) + if found { + optFns = append(optFns, ssoTokenProviderOptionsFn) + } + cfgCopy.Region = sharedConfig.SSOSession.SSORegion + cachedPath, err := ssocreds.StandardCachedTokenFilepath(sharedConfig.SSOSession.Name) + if err != nil { + return err + } + oidcClient := ssooidc.NewFromConfig(cfgCopy) + tokenProvider := ssocreds.NewSSOTokenProvider(oidcClient, cachedPath, optFns...) + options = append(options, func(o *ssocreds.Options) { + o.SSOTokenProvider = tokenProvider + o.CachedTokenFilepath = cachedPath + }) + } else { + cfgCopy.Region = sharedConfig.SSORegion + } cfg.Credentials = ssocreds.New(sso.NewFromConfig(cfgCopy), sharedConfig.SSOAccountID, sharedConfig.SSORoleName, sharedConfig.SSOStartURL, options...) @@ -201,6 +247,36 @@ func processCredentials(ctx context.Context, cfg *aws.Config, sharedConfig *Shar return nil } +// isAllowedHost allows host to be loopback or known ECS/EKS container IPs +// +// host can either be an IP address OR an unresolved hostname - resolution will +// be automatically performed in the latter case +func isAllowedHost(host string) (bool, error) { + if ip := net.ParseIP(host); ip != nil { + return isIPAllowed(ip), nil + } + + addrs, err := lookupHostFn(host) + if err != nil { + return false, err + } + + for _, addr := range addrs { + if ip := net.ParseIP(addr); ip == nil || !isIPAllowed(ip) { + return false, nil + } + } + + return true, nil +} + +func isIPAllowed(ip net.IP) bool { + return ip.IsLoopback() || + ip.Equal(ecsContainerIPv4) || + ip.Equal(eksContainerIPv4) || + ip.Equal(eksContainerIPv6) +} + func resolveLocalHTTPCredProvider(ctx context.Context, cfg *aws.Config, endpointURL, authToken string, configs configs) error { var resolveErr error @@ -211,10 +287,12 @@ func resolveLocalHTTPCredProvider(ctx context.Context, cfg *aws.Config, endpoint host := parsed.Hostname() if len(host) == 0 { resolveErr = fmt.Errorf("unable to parse host from local HTTP cred provider URL") - } else if isLoopback, loopbackErr := isLoopbackHost(host); loopbackErr != nil { - resolveErr = fmt.Errorf("failed to resolve host %q, %v", host, loopbackErr) - } else if !isLoopback { - resolveErr = fmt.Errorf("invalid endpoint host, %q, only loopback hosts are allowed", host) + } else if parsed.Scheme == "http" { + if isAllowedHost, allowHostErr := isAllowedHost(host); allowHostErr != nil { + resolveErr = fmt.Errorf("failed to resolve host %q, %v", host, allowHostErr) + } else if !isAllowedHost { + resolveErr = fmt.Errorf("invalid endpoint host, %q, only loopback/ecs/eks hosts are allowed", host) + } } } @@ -231,6 +309,16 @@ func resolveHTTPCredProvider(ctx context.Context, cfg *aws.Config, url, authToke if len(authToken) != 0 { options.AuthorizationToken = authToken } + if authFilePath := os.Getenv(httpProviderAuthFileEnvVar); authFilePath != "" { + options.AuthorizationTokenProvider = endpointcreds.TokenProviderFunc(func() (string, error) { + var contents []byte + var err error + if contents, err = ioutil.ReadFile(authFilePath); err != nil { + return "", fmt.Errorf("failed to read authorization token from %v: %v", authFilePath, err) + } + return string(contents), nil + }) + } options.APIOptions = cfg.APIOptions if cfg.Retryer != nil { options.Retryer = cfg.Retryer() @@ -248,9 +336,12 @@ func resolveHTTPCredProvider(ctx context.Context, cfg *aws.Config, url, authToke provider := endpointcreds.New(url, optFns...) - cfg.Credentials = wrapWithCredentialsCache(provider, func(options *aws.CredentialsCacheOptions) { + cfg.Credentials, err = wrapWithCredentialsCache(ctx, configs, provider, func(options *aws.CredentialsCacheOptions) { options.ExpiryWindow = 5 * time.Minute }) + if err != nil { + return err + } return nil } @@ -289,22 +380,17 @@ func resolveEC2RoleCredentials(ctx context.Context, cfg *aws.Config, configs con optFns = append(optFns, func(o *ec2rolecreds.Options) { // Only define a client from config if not already defined. - if o.Client != nil { - options := imds.Options{ - HTTPClient: cfg.HTTPClient, - } - if cfg.Retryer != nil { - options.Retryer = cfg.Retryer() - } - o.Client = imds.New(options) + if o.Client == nil { + o.Client = imds.NewFromConfig(*cfg) } }) provider := ec2rolecreds.New(optFns...) - cfg.Credentials = wrapWithCredentialsCache(provider, func(options *aws.CredentialsCacheOptions) { - options.ExpiryWindow = 5 * time.Minute - }) + cfg.Credentials, err = wrapWithCredentialsCache(ctx, configs, provider) + if err != nil { + return err + } return nil } @@ -365,10 +451,6 @@ func assumeWebIdentity(ctx context.Context, cfg *aws.Config, filepath string, ro return fmt.Errorf("token file path is not set") } - if len(roleARN) == 0 { - return fmt.Errorf("role ARN is not set") - } - optFns := []func(*stscreds.WebIdentityRoleOptions){ func(options *stscreds.WebIdentityRoleOptions) { options.RoleSessionName = sessionName @@ -379,11 +461,29 @@ func assumeWebIdentity(ctx context.Context, cfg *aws.Config, filepath string, ro if err != nil { return err } + if found { optFns = append(optFns, optFn) } - provider := stscreds.NewWebIdentityRoleProvider(sts.NewFromConfig(*cfg), roleARN, stscreds.IdentityTokenFile(filepath), optFns...) + opts := stscreds.WebIdentityRoleOptions{ + RoleARN: roleARN, + } + + for _, fn := range optFns { + fn(&opts) + } + + if len(opts.RoleARN) == 0 { + return fmt.Errorf("role ARN is not set") + } + + client := opts.Client + if client == nil { + client = sts.NewFromConfig(*cfg) + } + + provider := stscreds.NewWebIdentityRoleProvider(client, roleARN, stscreds.IdentityTokenFile(filepath), optFns...) cfg.Credentials = provider @@ -436,12 +536,31 @@ func credsFromAssumeRole(ctx context.Context, cfg *aws.Config, sharedCfg *Shared return nil } -// wrapWithCredentialsCache will wrap provider with an aws.CredentialsCache with the provided options if the provider is not already a aws.CredentialsCache. -func wrapWithCredentialsCache(provider aws.CredentialsProvider, optFns ...func(options *aws.CredentialsCacheOptions)) aws.CredentialsProvider { +// wrapWithCredentialsCache will wrap provider with an aws.CredentialsCache +// with the provided options if the provider is not already a +// aws.CredentialsCache. +func wrapWithCredentialsCache( + ctx context.Context, + cfgs configs, + provider aws.CredentialsProvider, + optFns ...func(options *aws.CredentialsCacheOptions), +) (aws.CredentialsProvider, error) { _, ok := provider.(*aws.CredentialsCache) if ok { - return provider + return provider, nil + } + + credCacheOptions, optionsFound, err := getCredentialsCacheOptionsProvider(ctx, cfgs) + if err != nil { + return nil, err + } + + // force allocation of a new slice if the additional options are + // needed, to prevent overwriting the passed in slice of options. + optFns = optFns[:len(optFns):len(optFns)] + if optionsFound { + optFns = append(optFns, credCacheOptions) } - return aws.NewCredentialsCache(provider, optFns...) + return aws.NewCredentialsCache(provider, optFns...), nil } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go b/vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go index 8c34a61b..c546cb7d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go @@ -1,24 +1,43 @@ package config import ( + "bytes" "context" "errors" "fmt" + "io" + "io/ioutil" "os" "path/filepath" - "runtime" "strings" "time" "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" "github.com/aws/aws-sdk-go-v2/internal/ini" + "github.com/aws/aws-sdk-go-v2/internal/shareddefaults" "github.com/aws/smithy-go/logging" + smithyrequestcompression "github.com/aws/smithy-go/private/requestcompression" ) const ( - // Prefix to use for filtering profiles + // Prefix to use for filtering profiles. The profile prefix should only + // exist in the shared config file, not the credentials file. profilePrefix = `profile ` + // Prefix to be used for SSO sections. These are supposed to only exist in + // 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` + endpointDiscoveryAuto = `auto` + // Static Credentials group accessKeyIDKey = `aws_access_key_id` // group required secretAccessKey = `aws_secret_access_key` // group required @@ -34,10 +53,13 @@ const ( roleDurationSecondsKey = "duration_seconds" // optional // AWS Single Sign-On (AWS SSO) group + ssoSessionNameKey = "sso_session" + + ssoRegionKey = "sso_region" + ssoStartURLKey = "sso_start_url" + ssoAccountIDKey = "sso_account_id" - ssoRegionKey = "sso_region" ssoRoleNameKey = "sso_role_name" - ssoStartURL = "sso_start_url" // Additional Config fields regionKey = `region` @@ -54,10 +76,45 @@ const ( // S3 ARN Region Usage s3UseARNRegionKey = "s3_use_arn_region" + ec2MetadataServiceEndpointModeKey = "ec2_metadata_service_endpoint_mode" + + ec2MetadataServiceEndpointKey = "ec2_metadata_service_endpoint" + + ec2MetadataV1DisabledKey = "ec2_metadata_v1_disabled" + + // Use DualStack Endpoint Resolution + useDualStackEndpoint = "use_dualstack_endpoint" + // DefaultSharedConfigProfile is the default profile to be used when // loading configuration from the config files if another profile name // is not provided. DefaultSharedConfigProfile = `default` + + // S3 Disable Multi-Region AccessPoints + s3DisableMultiRegionAccessPointsKey = `s3_disable_multiregion_access_points` + + useFIPSEndpointKey = "use_fips_endpoint" + + defaultsModeKey = "defaults_mode" + + // Retry options + retryMaxAttemptsKey = "max_attempts" + retryModeKey = "retry_mode" + + caBundleKey = "ca_bundle" + + sdkAppID = "sdk_ua_app_id" + + ignoreConfiguredEndpoints = "ignore_configured_endpoint_urls" + + endpointURL = "endpoint_url" + + servicesSectionKey = "services" + + disableRequestCompression = "disable_request_compression" + requestMinCompressionSizeBytes = "request_min_compression_size_bytes" + + s3DisableExpressSessionAuthKey = "s3_disable_express_session_auth" ) // defaultSharedConfigProfile allows for swapping the default profile for testing @@ -71,7 +128,7 @@ var defaultSharedConfigProfile = DefaultSharedConfigProfile // - Linux/Unix: $HOME/.aws/credentials // - Windows: %USERPROFILE%\.aws\credentials func DefaultSharedCredentialsFilename() string { - return filepath.Join(userHomeDir(), ".aws", "credentials") + return filepath.Join(shareddefaults.UserHomeDir(), ".aws", "credentials") } // DefaultSharedConfigFilename returns the SDK's default file path for @@ -82,7 +139,7 @@ func DefaultSharedCredentialsFilename() string { // - Linux/Unix: $HOME/.aws/config // - Windows: %USERPROFILE%\.aws\config func DefaultSharedConfigFilename() string { - return filepath.Join(userHomeDir(), ".aws", "config") + return filepath.Join(shareddefaults.UserHomeDir(), ".aws", "config") } // DefaultSharedConfigFiles is a slice of the default shared config files that @@ -91,12 +148,44 @@ var DefaultSharedConfigFiles = []string{ DefaultSharedConfigFilename(), } -// DefaultSharedCredentialsFiles is a slice of the default shared credentials files that -// the will be used in order to load the SharedConfig. +// DefaultSharedCredentialsFiles is a slice of the default shared credentials +// files that the will be used in order to load the SharedConfig. var DefaultSharedCredentialsFiles = []string{ DefaultSharedCredentialsFilename(), } +// SSOSession provides the shared configuration parameters of the sso-session +// section. +type SSOSession struct { + Name string + SSORegion string + SSOStartURL string +} + +func (s *SSOSession) setFromIniSection(section ini.Section) { + updateString(&s.Name, section, ssoSessionNameKey) + updateString(&s.SSORegion, section, ssoRegionKey) + 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 @@ -116,10 +205,17 @@ type SharedConfig struct { CredentialProcess string WebIdentityTokenFile string + // SSO session options + SSOSessionName string + SSOSession *SSOSession + + // Legacy SSO session options + SSORegion string + SSOStartURL string + + // SSO fields not used SSOAccountID string - SSORegion string SSORoleName string - SSOStartURL string RoleARN string ExternalID string @@ -133,20 +229,145 @@ type SharedConfig struct { // Region is the region the SDK should use for looking up AWS service endpoints // and signing requests. // - // region + // region = us-west-2 Region string - // EnableEndpointDiscovery can be enabled in the shared config by setting - // endpoint_discovery_enabled to true + // EnableEndpointDiscovery can be enabled or disabled in the shared config + // by setting endpoint_discovery_enabled to true, or false respectively. // // endpoint_discovery_enabled = true - EnableEndpointDiscovery *bool + EnableEndpointDiscovery aws.EndpointDiscoveryEnableState // Specifies if the S3 service should allow ARNs to direct the region // the client's requests are sent to. // // s3_use_arn_region=true S3UseARNRegion *bool + + // Specifies the EC2 Instance Metadata Service default endpoint selection + // mode (IPv4 or IPv6) + // + // ec2_metadata_service_endpoint_mode=IPv6 + EC2IMDSEndpointMode imds.EndpointModeState + + // Specifies the EC2 Instance Metadata Service endpoint to use. If + // specified it overrides EC2IMDSEndpointMode. + // + // 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 + // + // s3_disable_multiregion_access_points=true + S3DisableMultiRegionAccessPoints *bool + + // Specifies that SDK clients must resolve a dual-stack endpoint for + // services. + // + // use_dualstack_endpoint=true + UseDualStackEndpoint aws.DualStackEndpointState + + // Specifies that SDK clients must resolve a FIPS endpoint for + // services. + // + // use_fips_endpoint=true + UseFIPSEndpoint aws.FIPSEndpointState + + // Specifies which defaults mode should be used by services. + // + // defaults_mode=standard + DefaultsMode aws.DefaultsMode + + // Specifies the maximum number attempts an API client will call an + // operation that fails with a retryable error. + // + // max_attempts=3 + RetryMaxAttempts int + + // Specifies the retry model the API client will be created with. + // + // retry_mode=standard + RetryMode aws.RetryMode + + // Sets the path to a custom Credentials Authority (CA) Bundle PEM file + // that the SDK will use instead of the system's root CA bundle. Only use + // this if you want to configure the SDK to use a custom set of CAs. + // + // Enabling this option will attempt to merge the Transport into the SDK's + // HTTP client. If the client's Transport is not a http.Transport an error + // will be returned. If the Transport's TLS config is set this option will + // cause the SDK to overwrite the Transport's TLS config's RootCAs value. + // + // Setting a custom HTTPClient in the aws.Config options will override this + // setting. To use this option and custom HTTP client, the HTTP client + // needs to be provided when creating the config. Not the service client. + // + // ca_bundle=$HOME/my_custom_ca_bundle + CustomCABundle string + + // 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 + + // Services section config. + ServicesSectionName string + Services Services + + // determine if request compression is allowed, default to false + // retrieved from config file's profile field disable_request_compression + DisableRequestCompression *bool + + // inclusive threshold request body size to trigger compression, + // default to 10240 and must be within 0 and 10485760 bytes inclusive + // retrieved from config file's profile field request_min_compression_size_bytes + RequestMinCompressSizeBytes *int64 + + // Whether S3Express auth is disabled. + // + // This will NOT prevent requests from being made to S3Express buckets, it + // will only bypass the modified endpoint routing and signing behaviors + // associated with the feature. + S3DisableExpressAuth *bool +} + +func (c SharedConfig) getDefaultsMode(ctx context.Context) (value aws.DefaultsMode, ok bool, err error) { + if len(c.DefaultsMode) == 0 { + return "", false, nil + } + + return c.DefaultsMode, true, nil +} + +// GetRetryMaxAttempts returns the maximum number of attempts an API client +// created Retryer should attempt an operation call before failing. +func (c SharedConfig) GetRetryMaxAttempts(ctx context.Context) (value int, ok bool, err error) { + if c.RetryMaxAttempts == 0 { + return 0, false, nil + } + + return c.RetryMaxAttempts, true, nil +} + +// GetRetryMode returns the model the API client should create its Retryer in. +func (c SharedConfig) GetRetryMode(ctx context.Context) (value aws.RetryMode, ok bool, err error) { + if len(c.RetryMode) == 0 { + return "", false, nil + } + + return c.RetryMode, true, nil } // GetS3UseARNRegion returns if the S3 service should allow ARNs to direct the region @@ -159,6 +380,25 @@ func (c SharedConfig) GetS3UseARNRegion(ctx context.Context) (value, ok bool, er return *c.S3UseARNRegion, true, nil } +// GetEnableEndpointDiscovery returns if the enable_endpoint_discovery is set. +func (c SharedConfig) GetEnableEndpointDiscovery(ctx context.Context) (value aws.EndpointDiscoveryEnableState, ok bool, err error) { + if c.EnableEndpointDiscovery == aws.EndpointDiscoveryUnset { + return aws.EndpointDiscoveryUnset, false, nil + } + + return c.EnableEndpointDiscovery, true, nil +} + +// GetS3DisableMultiRegionAccessPoints returns if the S3 service should disable support for Multi-Region +// access-points. +func (c SharedConfig) GetS3DisableMultiRegionAccessPoints(ctx context.Context) (value, ok bool, err error) { + if c.S3DisableMultiRegionAccessPoints == nil { + return false, false, nil + } + + return *c.S3DisableMultiRegionAccessPoints, true, nil +} + // GetRegion returns the region for the profile if a region is set. func (c SharedConfig) getRegion(ctx context.Context) (string, bool, error) { if len(c.Region) == 0 { @@ -172,6 +412,116 @@ func (c SharedConfig) getCredentialsProvider() (aws.Credentials, bool, error) { return c.Credentials, true, nil } +// GetEC2IMDSEndpointMode implements a EC2IMDSEndpointMode option resolver interface. +func (c SharedConfig) GetEC2IMDSEndpointMode() (imds.EndpointModeState, bool, error) { + if c.EC2IMDSEndpointMode == imds.EndpointModeStateUnset { + return imds.EndpointModeStateUnset, false, nil + } + + return c.EC2IMDSEndpointMode, true, nil +} + +// GetEC2IMDSEndpoint implements a EC2IMDSEndpoint option resolver interface. +func (c SharedConfig) GetEC2IMDSEndpoint() (string, bool, error) { + if len(c.EC2IMDSEndpoint) == 0 { + return "", false, nil + } + + 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) { + if c.UseDualStackEndpoint == aws.DualStackEndpointStateUnset { + return aws.DualStackEndpointStateUnset, false, nil + } + + return c.UseDualStackEndpoint, true, nil +} + +// GetUseFIPSEndpoint returns whether the service's FIPS endpoint should be +// used for requests. +func (c SharedConfig) GetUseFIPSEndpoint(ctx context.Context) (value aws.FIPSEndpointState, found bool, err error) { + if c.UseFIPSEndpoint == aws.FIPSEndpointStateUnset { + return aws.FIPSEndpointStateUnset, false, nil + } + + return c.UseFIPSEndpoint, true, nil +} + +// GetS3DisableExpressAuth returns the configured value for +// [SharedConfig.S3DisableExpressAuth]. +func (c SharedConfig) GetS3DisableExpressAuth() (value, ok bool) { + if c.S3DisableExpressAuth == nil { + return false, false + } + + return *c.S3DisableExpressAuth, true +} + +// GetCustomCABundle returns the custom CA bundle's PEM bytes if the file was +func (c SharedConfig) getCustomCABundle(context.Context) (io.Reader, bool, error) { + if len(c.CustomCABundle) == 0 { + return nil, false, nil + } + + b, err := ioutil.ReadFile(c.CustomCABundle) + if err != nil { + return nil, false, err + } + return bytes.NewReader(b), true, nil +} + +// getAppID returns the sdk app ID if set in shared config profile +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. @@ -276,7 +626,6 @@ type LoadSharedConfigOptions struct { // // You can read more about shared config and credentials file location at // https://docs.aws.amazon.com/credref/latest/refdocs/file-location.html#file-location -// func LoadSharedConfigProfile(ctx context.Context, profile string, optFns ...func(*LoadSharedConfigOptions)) (SharedConfig, error) { var option LoadSharedConfigOptions for _, fn := range optFns { @@ -298,7 +647,7 @@ func LoadSharedConfigProfile(ctx context.Context, profile string, optFns ...func } // check for profile prefix and drop duplicates or invalid profiles - err = processConfigSections(ctx, configSections, option.Logger) + err = processConfigSections(ctx, &configSections, option.Logger) if err != nil { return SharedConfig{}, err } @@ -310,21 +659,19 @@ func LoadSharedConfigProfile(ctx context.Context, profile string, optFns ...func } // check for profile prefix and drop duplicates or invalid profiles - err = processCredentialsSections(ctx, credentialsSections, option.Logger) + err = processCredentialsSections(ctx, &credentialsSections, option.Logger) if err != nil { return SharedConfig{}, err } - err = mergeSections(configSections, credentialsSections) + err = mergeSections(&configSections, credentialsSections) if err != nil { return SharedConfig{}, err } - // profile should be lower-cased to standardize - profile = strings.ToLower(profile) - cfg := SharedConfig{} profiles := map[string]struct{}{} + if err = cfg.setFromIniSections(profiles, profile, configSections, option.Logger); err != nil { return SharedConfig{}, err } @@ -332,53 +679,74 @@ func LoadSharedConfigProfile(ctx context.Context, profile string, optFns ...func return cfg, nil } -func processConfigSections(ctx context.Context, sections ini.Sections, logger logging.Logger) error { +func processConfigSections(ctx context.Context, sections *ini.Sections, logger logging.Logger) error { + skipSections := map[string]struct{}{} + for _, section := range sections.List() { - // drop profiles without prefix for config files - if !strings.HasPrefix(section, profilePrefix) && !strings.EqualFold(section, "default") { + if _, ok := skipSections[section]; ok { + continue + } + + // drop sections from config file that do not have expected prefixes. + switch { + case strings.HasPrefix(section, profilePrefix): + // Rename sections to remove "profile " prefixing to match with + // credentials file. If default is already present, it will be + // dropped. + newName, err := renameProfileSection(section, sections, logger) + if err != nil { + return fmt.Errorf("failed to rename profile section, %w", err) + } + 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 sections.DeleteSection(section) if logger != nil { - logger.Logf(logging.Debug, - "A profile defined with name `%v` is ignored. For use within a shared configuration file, "+ - "a non-default profile must have `profile ` prefixed to the profile name.\n", + logger.Logf(logging.Debug, "A profile defined with name `%v` is ignored. "+ + "For use within a shared configuration file, "+ + "a non-default profile must have `profile ` "+ + "prefixed to the profile name.", section, ) } } } + return nil +} - // rename sections to remove `profile ` prefixing to match with credentials file. - // if default is already present, it will be dropped. - for _, section := range sections.List() { - if strings.HasPrefix(section, profilePrefix) { - v, ok := sections.GetSection(section) - if !ok { - return fmt.Errorf("error processing profiles within the shared configuration files") - } +func renameProfileSection(section string, sections *ini.Sections, logger logging.Logger) (string, error) { + v, ok := sections.GetSection(section) + if !ok { + return "", fmt.Errorf("error processing profiles within the shared configuration files") + } - // delete section with profile as prefix - sections.DeleteSection(section) + // delete section with profile as prefix + sections.DeleteSection(section) + + // set the value to non-prefixed name in sections. + section = strings.TrimPrefix(section, profilePrefix) + if sections.HasSection(section) { + oldSection, _ := sections.GetSection(section) + v.Logs = append(v.Logs, + fmt.Sprintf("A non-default profile not prefixed with `profile ` found in %s, "+ + "overriding non-default profile from %s", + v.SourceFile, oldSection.SourceFile)) + sections.DeleteSection(section) + } - // set the value to non-prefixed name in sections. - section = strings.TrimPrefix(section, profilePrefix) - if sections.HasSection(section) { - oldSection, _ := sections.GetSection(section) - v.Logs = append(v.Logs, - fmt.Sprintf("A default profile prefixed with `profile ` found in %s, "+ - "overrided non-prefixed default profile from %s", v.SourceFile, oldSection.SourceFile)) - } + // assign non-prefixed name to section + v.Name = section + sections.SetSection(section, v) - // assign non-prefixed name to section - v.Name = section - sections.SetSection(section, v) - } - } - return nil + return section, nil } -func processCredentialsSections(ctx context.Context, sections ini.Sections, logger logging.Logger) error { +func processCredentialsSections(ctx context.Context, sections *ini.Sections, logger logging.Logger) error { for _, section := range sections.List() { // drop profiles with prefix for credential files if strings.HasPrefix(section, profilePrefix) { @@ -412,7 +780,7 @@ func loadIniFiles(filenames []string) (ini.Sections, error) { } // mergeSections into mergedSections - err = mergeSections(mergedSections, sections) + err = mergeSections(&mergedSections, sections) if err != nil { return ini.Sections{}, SharedConfigLoadError{Filename: filename, Err: err} } @@ -422,7 +790,7 @@ func loadIniFiles(filenames []string) (ini.Sections, error) { } // mergeSections merges source section properties into destination section properties -func mergeSections(dst, src ini.Sections) error { +func mergeSections(dst *ini.Sections, src ini.Sections) error { for _, sectionName := range src.List() { srcSection, _ := src.GetSection(sectionName) @@ -449,12 +817,8 @@ func mergeSections(dst, src ini.Sections) error { secretKey := srcSection.String(secretAccessKey) if dstSection.Has(accessKeyIDKey) { - dstSection.Logs = append(dstSection.Logs, - fmt.Sprintf("For profile: %v, overriding credentials value for aws access key id, "+ - "and aws secret access key, defined in %v, with values found in a duplicate profile "+ - "defined at file %v. \n", - sectionName, dstSection.SourceFile[accessKeyIDKey], - srcSection.SourceFile[accessKeyIDKey])) + dstSection.Logs = append(dstSection.Logs, newMergeKeyLogMessage(sectionName, accessKeyIDKey, + dstSection.SourceFile[accessKeyIDKey], srcSection.SourceFile[accessKeyIDKey])) } // update access key @@ -472,24 +836,8 @@ func mergeSections(dst, src ini.Sections) error { dstSection.UpdateValue(secretAccessKey, v) // update session token - if srcSection.Has(sessionTokenKey) { - sessionKey := srcSection.String(sessionTokenKey) - - val, e := ini.NewStringValue(sessionKey) - if e != nil { - return fmt.Errorf("error merging session key, %w", e) - } - - if dstSection.Has(sessionTokenKey) { - dstSection.Logs = append(dstSection.Logs, - fmt.Sprintf("For profile: %v, overriding %v value, defined in %v "+ - "with a %v value found in a duplicate profile defined at file %v. \n", - sectionName, sessionTokenKey, dstSection.SourceFile[sessionTokenKey], - sessionTokenKey, srcSection.SourceFile[sessionTokenKey])) - } - - dstSection.UpdateValue(sessionTokenKey, val) - dstSection.UpdateSourceFile(sessionTokenKey, srcSection.SourceFile[sessionTokenKey]) + if err = mergeStringKey(&srcSection, &dstSection, sectionName, sessionTokenKey); err != nil { + return err } // update source file to reflect where the static creds came from @@ -497,234 +845,74 @@ func mergeSections(dst, src ini.Sections) error { dstSection.UpdateSourceFile(secretAccessKey, srcSection.SourceFile[secretAccessKey]) } - if srcSection.Has(roleArnKey) { - key := srcSection.String(roleArnKey) - val, err := ini.NewStringValue(key) - if err != nil { - return fmt.Errorf("error merging roleArnKey, %w", err) - } - - if dstSection.Has(roleArnKey) { - dstSection.Logs = append(dstSection.Logs, - fmt.Sprintf("For profile: %v, overriding %v value, defined in %v "+ - "with a %v value found in a duplicate profile defined at file %v. \n", - sectionName, roleArnKey, dstSection.SourceFile[roleArnKey], - roleArnKey, srcSection.SourceFile[roleArnKey])) - } - - dstSection.UpdateValue(roleArnKey, val) - dstSection.UpdateSourceFile(roleArnKey, srcSection.SourceFile[roleArnKey]) - } - - if srcSection.Has(sourceProfileKey) { - key := srcSection.String(sourceProfileKey) - val, err := ini.NewStringValue(key) - if err != nil { - return fmt.Errorf("error merging sourceProfileKey, %w", err) - } - - if dstSection.Has(sourceProfileKey) { - dstSection.Logs = append(dstSection.Logs, - fmt.Sprintf("For profile: %v, overriding %v value, defined in %v "+ - "with a %v value found in a duplicate profile defined at file %v. \n", - sectionName, sourceProfileKey, dstSection.SourceFile[sourceProfileKey], - sourceProfileKey, srcSection.SourceFile[sourceProfileKey])) - } - - dstSection.UpdateValue(sourceProfileKey, val) - dstSection.UpdateSourceFile(sourceProfileKey, srcSection.SourceFile[sourceProfileKey]) - } - - if srcSection.Has(credentialSourceKey) { - key := srcSection.String(credentialSourceKey) - val, err := ini.NewStringValue(key) - if err != nil { - return fmt.Errorf("error merging credentialSourceKey, %w", err) - } - - if dstSection.Has(credentialSourceKey) { - dstSection.Logs = append(dstSection.Logs, - fmt.Sprintf("For profile: %v, overriding %v value, defined in %v "+ - "with a %v value found in a duplicate profile defined at file %v. \n", - sectionName, credentialSourceKey, dstSection.SourceFile[credentialSourceKey], - credentialSourceKey, srcSection.SourceFile[credentialSourceKey])) - } - - dstSection.UpdateValue(credentialSourceKey, val) - dstSection.UpdateSourceFile(credentialSourceKey, srcSection.SourceFile[credentialSourceKey]) - } - - if srcSection.Has(externalIDKey) { - key := srcSection.String(externalIDKey) - val, err := ini.NewStringValue(key) - if err != nil { - return fmt.Errorf("error merging externalIDKey, %w", err) - } - - if dstSection.Has(externalIDKey) { - dstSection.Logs = append(dstSection.Logs, - fmt.Sprintf("For profile: %v, overriding %v value, defined in %v "+ - "with a %v value found in a duplicate profile defined at file %v. \n", - sectionName, externalIDKey, dstSection.SourceFile[externalIDKey], - externalIDKey, srcSection.SourceFile[externalIDKey])) - } - - dstSection.UpdateValue(externalIDKey, val) - dstSection.UpdateSourceFile(externalIDKey, srcSection.SourceFile[externalIDKey]) - } - - if srcSection.Has(mfaSerialKey) { - key := srcSection.String(mfaSerialKey) - val, err := ini.NewStringValue(key) - if err != nil { - return fmt.Errorf("error merging mfaSerialKey, %w", err) - } - - if dstSection.Has(mfaSerialKey) { - dstSection.Logs = append(dstSection.Logs, - fmt.Sprintf("For profile: %v, overriding %v value, defined in %v "+ - "with a %v value found in a duplicate profile defined at file %v. \n", - sectionName, mfaSerialKey, dstSection.SourceFile[mfaSerialKey], - mfaSerialKey, srcSection.SourceFile[mfaSerialKey])) - } - - dstSection.UpdateValue(mfaSerialKey, val) - dstSection.UpdateSourceFile(mfaSerialKey, srcSection.SourceFile[mfaSerialKey]) - } - - if srcSection.Has(roleSessionNameKey) { - key := srcSection.String(roleSessionNameKey) - val, err := ini.NewStringValue(key) - if err != nil { - return fmt.Errorf("error merging roleSessionNameKey, %w", err) - } - - if dstSection.Has(roleSessionNameKey) { - dstSection.Logs = append(dstSection.Logs, - fmt.Sprintf("For profile: %v, overriding %v value, defined in %v "+ - "with a %v value found in a duplicate profile defined at file %v. \n", - sectionName, roleSessionNameKey, dstSection.SourceFile[roleSessionNameKey], - roleSessionNameKey, srcSection.SourceFile[roleSessionNameKey])) - } - - dstSection.UpdateValue(roleSessionNameKey, val) - dstSection.UpdateSourceFile(roleSessionNameKey, srcSection.SourceFile[roleSessionNameKey]) - } - - // role duration seconds key update - if srcSection.Has(roleDurationSecondsKey) { - roleDurationSeconds := srcSection.Int(roleDurationSecondsKey) - v, err := ini.NewIntValue(roleDurationSeconds) - if err != nil { - return fmt.Errorf("error merging role duration seconds key, %w", err) - } - dstSection.UpdateValue(roleDurationSecondsKey, v) - - dstSection.UpdateSourceFile(roleDurationSecondsKey, srcSection.SourceFile[roleDurationSecondsKey]) - } - - if srcSection.Has(regionKey) { - key := srcSection.String(regionKey) - val, err := ini.NewStringValue(key) - if err != nil { - return fmt.Errorf("error merging regionKey, %w", err) - } - - if dstSection.Has(regionKey) { - dstSection.Logs = append(dstSection.Logs, - fmt.Sprintf("For profile: %v, overriding %v value, defined in %v "+ - "with a %v value found in a duplicate profile defined at file %v. \n", - sectionName, regionKey, dstSection.SourceFile[regionKey], - regionKey, srcSection.SourceFile[regionKey])) - } - - dstSection.UpdateValue(regionKey, val) - dstSection.UpdateSourceFile(regionKey, srcSection.SourceFile[regionKey]) - } - - if srcSection.Has(enableEndpointDiscoveryKey) { - key := srcSection.String(enableEndpointDiscoveryKey) - val, err := ini.NewStringValue(key) - if err != nil { - return fmt.Errorf("error merging enableEndpointDiscoveryKey, %w", err) - } - - if dstSection.Has(enableEndpointDiscoveryKey) { - dstSection.Logs = append(dstSection.Logs, - fmt.Sprintf("For profile: %v, overriding %v value, defined in %v "+ - "with a %v value found in a duplicate profile defined at file %v. \n", - sectionName, enableEndpointDiscoveryKey, dstSection.SourceFile[enableEndpointDiscoveryKey], - enableEndpointDiscoveryKey, srcSection.SourceFile[enableEndpointDiscoveryKey])) - } - - dstSection.UpdateValue(enableEndpointDiscoveryKey, val) - dstSection.UpdateSourceFile(enableEndpointDiscoveryKey, srcSection.SourceFile[enableEndpointDiscoveryKey]) + stringKeys := []string{ + roleArnKey, + sourceProfileKey, + credentialSourceKey, + externalIDKey, + mfaSerialKey, + roleSessionNameKey, + regionKey, + enableEndpointDiscoveryKey, + credentialProcessKey, + webIdentityTokenFileKey, + s3UseARNRegionKey, + s3DisableMultiRegionAccessPointsKey, + ec2MetadataServiceEndpointModeKey, + ec2MetadataServiceEndpointKey, + ec2MetadataV1DisabledKey, + useDualStackEndpoint, + useFIPSEndpointKey, + defaultsModeKey, + retryModeKey, + caBundleKey, + roleDurationSecondsKey, + retryMaxAttemptsKey, + + ssoSessionNameKey, + ssoAccountIDKey, + ssoRegionKey, + ssoRoleNameKey, + ssoStartURLKey, } - - if srcSection.Has(credentialProcessKey) { - key := srcSection.String(credentialProcessKey) - val, err := ini.NewStringValue(key) - if err != nil { - return fmt.Errorf("error merging credentialProcessKey, %w", err) + for i := range stringKeys { + if err := mergeStringKey(&srcSection, &dstSection, sectionName, stringKeys[i]); err != nil { + return err } - - if dstSection.Has(credentialProcessKey) { - dstSection.Logs = append(dstSection.Logs, - fmt.Sprintf("For profile: %v, overriding %v value, defined in %v "+ - "with a %v value found in a duplicate profile defined at file %v. \n", - sectionName, credentialProcessKey, dstSection.SourceFile[credentialProcessKey], - credentialProcessKey, srcSection.SourceFile[credentialProcessKey])) - } - - dstSection.UpdateValue(credentialProcessKey, val) - dstSection.UpdateSourceFile(credentialProcessKey, srcSection.SourceFile[credentialProcessKey]) } - if srcSection.Has(webIdentityTokenFileKey) { - key := srcSection.String(webIdentityTokenFileKey) - val, err := ini.NewStringValue(key) - if err != nil { - return fmt.Errorf("error merging webIdentityTokenFileKey, %w", err) - } + // set srcSection on dst srcSection + *dst = dst.SetSection(sectionName, dstSection) + } - if dstSection.Has(webIdentityTokenFileKey) { - dstSection.Logs = append(dstSection.Logs, - fmt.Sprintf("For profile: %v, overriding %v value, defined in %v "+ - "with a %v value found in a duplicate profile defined at file %v. \n", - sectionName, webIdentityTokenFileKey, dstSection.SourceFile[webIdentityTokenFileKey], - webIdentityTokenFileKey, srcSection.SourceFile[webIdentityTokenFileKey])) - } + return nil +} - dstSection.UpdateValue(webIdentityTokenFileKey, val) - dstSection.UpdateSourceFile(webIdentityTokenFileKey, srcSection.SourceFile[webIdentityTokenFileKey]) +func mergeStringKey(srcSection *ini.Section, dstSection *ini.Section, sectionName, key string) error { + if srcSection.Has(key) { + srcValue := srcSection.String(key) + val, err := ini.NewStringValue(srcValue) + if err != nil { + return fmt.Errorf("error merging %s, %w", key, err) } - if srcSection.Has(s3UseARNRegionKey) { - key := srcSection.String(s3UseARNRegionKey) - val, err := ini.NewStringValue(key) - if err != nil { - return fmt.Errorf("error merging s3UseARNRegionKey, %w", err) - } - - if dstSection.Has(s3UseARNRegionKey) { - dstSection.Logs = append(dstSection.Logs, - fmt.Sprintf("For profile: %v, overriding %v value, defined in %v "+ - "with a %v value found in a duplicate profile defined at file %v. \n", - sectionName, s3UseARNRegionKey, dstSection.SourceFile[s3UseARNRegionKey], - s3UseARNRegionKey, srcSection.SourceFile[s3UseARNRegionKey])) - } - - dstSection.UpdateValue(s3UseARNRegionKey, val) - dstSection.UpdateSourceFile(s3UseARNRegionKey, srcSection.SourceFile[s3UseARNRegionKey]) + if dstSection.Has(key) { + dstSection.Logs = append(dstSection.Logs, newMergeKeyLogMessage(sectionName, key, + dstSection.SourceFile[key], srcSection.SourceFile[key])) } - // set srcSection on dst srcSection - dst = dst.SetSection(sectionName, dstSection) + dstSection.UpdateValue(key, val) + dstSection.UpdateSourceFile(key, srcSection.SourceFile[key]) } - return nil } +func newMergeKeyLogMessage(sectionName, key, dstSourceFile, srcSourceFile string) string { + return fmt.Sprintf("For profile: %v, overriding %v value, defined in %v "+ + "with a %v value found in a duplicate profile defined at file %v. \n", + sectionName, key, dstSourceFile, key, srcSourceFile) +} + // Returns an error if all of the files fail to load. If at least one file is // successfully loaded and contains the profile, no error will be returned. func (c *SharedConfig) setFromIniSections(profiles map[string]struct{}, profile string, @@ -745,7 +933,7 @@ func (c *SharedConfig) setFromIniSections(profiles map[string]struct{}, profile } } - // set config from the provided ini section + // set config from the provided INI section err := c.setFromIniSection(profile, section) if err != nil { return fmt.Errorf("error fetching config from profile, %v, %w", profile, err) @@ -758,9 +946,8 @@ func (c *SharedConfig) setFromIniSections(profiles map[string]struct{}, profile // profile only have credential provider options. c.clearAssumeRoleOptions() } else { - // First time a profile has been seen, It must either be a assume role - // credentials, or SSO. Assert if the credential type requires a role ARN, - // the ARN is also set, or validate that the SSO configuration is complete. + // First time a profile has been seen. Assert if the credential type + // requires a role ARN, the ARN is also set if err := c.validateCredentialsConfig(profile); err != nil { return err } @@ -808,11 +995,34 @@ func (c *SharedConfig) setFromIniSections(profiles map[string]struct{}, profile c.Source = srcCfg } + // If the profile contains an SSO session parameter, the session MUST exist + // as a section in the config file. Load the SSO session using the name + // provided. If the session section is not found or incomplete an error + // will be returned. + if c.hasSSOTokenProviderConfiguration() { + section, ok := sections.GetSection(ssoSectionPrefix + strings.TrimSpace(c.SSOSessionName)) + if !ok { + return fmt.Errorf("failed to find SSO session section, %v", c.SSOSessionName) + } + var ssoSession SSOSession + ssoSession.setFromIniSection(section) + ssoSession.Name = c.SSOSessionName + c.SSOSession = &ssoSession + } + + if len(c.ServicesSectionName) > 0 { + if section, ok := sections.GetSection(servicesPrefix + c.ServicesSectionName); ok { + var svcs Services + svcs.setFromIniSection(section) + c.Services = svcs + } + } + return nil } // setFromIniSection loads the configuration from the profile section defined in -// the provided ini file. A SharedConfig pointer type value is used so that +// the provided INI file. A SharedConfig pointer type value is used so that // multiple config file loadings can be chained. // // Only loads complete logically grouped values, and will not set fields in cfg @@ -847,21 +1057,72 @@ func (c *SharedConfig) setFromIniSection(profile string, section ini.Section) er updateString(&c.Region, section, regionKey) // AWS Single Sign-On (AWS SSO) - updateString(&c.SSOAccountID, section, ssoAccountIDKey) + // SSO session options + updateString(&c.SSOSessionName, section, ssoSessionNameKey) + + // Legacy SSO session options updateString(&c.SSORegion, section, ssoRegionKey) + updateString(&c.SSOStartURL, section, ssoStartURLKey) + + // SSO fields not used + updateString(&c.SSOAccountID, section, ssoAccountIDKey) updateString(&c.SSORoleName, section, ssoRoleNameKey) - updateString(&c.SSOStartURL, section, ssoStartURL) + // we're retaining a behavioral quirk with this field that existed before + // the removal of literal parsing for #2276: + // - if the key is missing, the config field will not be set + // - if the key is set to a non-numeric, the config field will be set to 0 if section.Has(roleDurationSecondsKey) { - d := time.Duration(section.Int(roleDurationSecondsKey)) * time.Second - c.RoleDurationSeconds = &d + if v, ok := section.Int(roleDurationSecondsKey); ok { + c.RoleDurationSeconds = aws.Duration(time.Duration(v) * time.Second) + } else { + c.RoleDurationSeconds = aws.Duration(time.Duration(0)) + } } updateString(&c.CredentialProcess, section, credentialProcessKey) updateString(&c.WebIdentityTokenFile, section, webIdentityTokenFileKey) - updateBoolPtr(&c.EnableEndpointDiscovery, section, enableEndpointDiscoveryKey) + updateEndpointDiscoveryType(&c.EnableEndpointDiscovery, section, enableEndpointDiscoveryKey) updateBoolPtr(&c.S3UseARNRegion, section, s3UseARNRegionKey) + updateBoolPtr(&c.S3DisableMultiRegionAccessPoints, section, s3DisableMultiRegionAccessPointsKey) + updateBoolPtr(&c.S3DisableExpressAuth, section, s3DisableExpressSessionAuthKey) + + if err := updateEC2MetadataServiceEndpointMode(&c.EC2IMDSEndpointMode, section, ec2MetadataServiceEndpointModeKey); err != nil { + 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) + + if err := updateDefaultsMode(&c.DefaultsMode, section, defaultsModeKey); err != nil { + return fmt.Errorf("failed to load %s from shared config, %w", defaultsModeKey, err) + } + + if err := updateInt(&c.RetryMaxAttempts, section, retryMaxAttemptsKey); err != nil { + return fmt.Errorf("failed to load %s from shared config, %w", retryMaxAttemptsKey, err) + } + if err := updateRetryMode(&c.RetryMode, section, retryModeKey); err != nil { + return fmt.Errorf("failed to load %s from shared config, %w", retryModeKey, err) + } + + updateString(&c.CustomCABundle, section, caBundleKey) + + // 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) + + if err := updateDisableRequestCompression(&c.DisableRequestCompression, section, disableRequestCompression); err != nil { + return fmt.Errorf("failed to load %s from shared config, %w", disableRequestCompression, err) + } + if err := updateRequestMinCompressSizeBytes(&c.RequestMinCompressSizeBytes, section, requestMinCompressionSizeBytes); err != nil { + return fmt.Errorf("failed to load %s from shared config, %w", requestMinCompressionSizeBytes, err) + } // Shared Credentials creds := aws.Credentials{ @@ -875,9 +1136,91 @@ func (c *SharedConfig) setFromIniSection(profile string, section ini.Section) er c.Credentials = creds } + updateString(&c.ServicesSectionName, section, servicesSectionKey) + + return nil +} + +func updateRequestMinCompressSizeBytes(bytes **int64, sec ini.Section, key string) error { + if !sec.Has(key) { + return nil + } + + v, ok := sec.Int(key) + if !ok { + return fmt.Errorf("invalid value for min request compression size bytes %s, need int64", sec.String(key)) + } + if v < 0 || v > smithyrequestcompression.MaxRequestMinCompressSizeBytes { + return fmt.Errorf("invalid range for min request compression size bytes %d, must be within 0 and 10485760 inclusively", v) + } + *bytes = new(int64) + **bytes = v + return nil +} + +func updateDisableRequestCompression(disable **bool, sec ini.Section, key string) error { + if !sec.Has(key) { + return nil + } + + v := sec.String(key) + switch { + case v == "true": + *disable = new(bool) + **disable = true + case v == "false": + *disable = new(bool) + **disable = false + default: + return fmt.Errorf("invalid value for shared config profile field, %s=%s, need true or false", key, v) + } + return nil +} + +func (c SharedConfig) getRequestMinCompressSizeBytes(ctx context.Context) (int64, bool, error) { + if c.RequestMinCompressSizeBytes == nil { + return 0, false, nil + } + return *c.RequestMinCompressSizeBytes, true, nil +} + +func (c SharedConfig) getDisableRequestCompression(ctx context.Context) (bool, bool, error) { + if c.DisableRequestCompression == nil { + return false, false, nil + } + return *c.DisableRequestCompression, true, nil +} + +func updateDefaultsMode(mode *aws.DefaultsMode, section ini.Section, key string) error { + if !section.Has(key) { + return nil + } + value := section.String(key) + if ok := mode.SetFromString(value); !ok { + return fmt.Errorf("invalid value: %s", value) + } return nil } +func updateRetryMode(mode *aws.RetryMode, section ini.Section, key string) (err error) { + if !section.Has(key) { + return nil + } + value := section.String(key) + if *mode, err = aws.ParseRetryMode(value); err != nil { + return err + } + return nil +} + +func updateEC2MetadataServiceEndpointMode(endpointMode *imds.EndpointModeState, section ini.Section, key string) error { + if !section.Has(key) { + return nil + } + value := section.String(key) + return endpointMode.SetFromString(value) +} + func (c *SharedConfig) validateCredentialsConfig(profile string) error { if err := c.validateCredentialsRequireARN(profile); err != nil { return err @@ -915,41 +1258,89 @@ func (c *SharedConfig) validateCredentialType() error { len(c.CredentialSource) != 0, len(c.CredentialProcess) != 0, len(c.WebIdentityTokenFile) != 0, - c.hasSSOConfiguration(), ) { - return fmt.Errorf("only one credential type may be specified per profile: source profile, credential source, credential process, web identity token, or sso") + return fmt.Errorf("only one credential type may be specified per profile: source profile, credential source, credential process, web identity token") } return nil } func (c *SharedConfig) validateSSOConfiguration() error { - if !c.hasSSOConfiguration() { + if c.hasSSOTokenProviderConfiguration() { + err := c.validateSSOTokenProviderConfiguration() + if err != nil { + return err + } return nil } + if c.hasLegacySSOConfiguration() { + err := c.validateLegacySSOConfiguration() + if err != nil { + return err + } + } + return nil +} + +func (c *SharedConfig) validateSSOTokenProviderConfiguration() error { var missing []string - if len(c.SSOAccountID) == 0 { - missing = append(missing, ssoAccountIDKey) + + if len(c.SSOSessionName) == 0 { + missing = append(missing, ssoSessionNameKey) + } + + if c.SSOSession == nil { + missing = append(missing, ssoSectionPrefix) + } else { + if len(c.SSOSession.SSORegion) == 0 { + missing = append(missing, ssoRegionKey) + } + + if len(c.SSOSession.SSOStartURL) == 0 { + missing = append(missing, ssoStartURLKey) + } + } + + if len(missing) > 0 { + return fmt.Errorf("profile %q is configured to use SSO but is missing required configuration: %s", + c.Profile, strings.Join(missing, ", ")) + } + + if len(c.SSORegion) > 0 && c.SSORegion != c.SSOSession.SSORegion { + return fmt.Errorf("%s in profile %q must match %s in %s", ssoRegionKey, c.Profile, ssoRegionKey, ssoSectionPrefix) } + if len(c.SSOStartURL) > 0 && c.SSOStartURL != c.SSOSession.SSOStartURL { + return fmt.Errorf("%s in profile %q must match %s in %s", ssoStartURLKey, c.Profile, ssoStartURLKey, ssoSectionPrefix) + } + + return nil +} + +func (c *SharedConfig) validateLegacySSOConfiguration() error { + var missing []string + if len(c.SSORegion) == 0 { missing = append(missing, ssoRegionKey) } - if len(c.SSORoleName) == 0 { - missing = append(missing, ssoRoleNameKey) + if len(c.SSOStartURL) == 0 { + missing = append(missing, ssoStartURLKey) } - if len(c.SSOStartURL) == 0 { - missing = append(missing, ssoStartURL) + if len(c.SSOAccountID) == 0 { + missing = append(missing, ssoAccountIDKey) + } + + if len(c.SSORoleName) == 0 { + missing = append(missing, ssoRoleNameKey) } if len(missing) > 0 { return fmt.Errorf("profile %q is configured to use SSO but is missing required configuration: %s", c.Profile, strings.Join(missing, ", ")) } - return nil } @@ -969,15 +1360,15 @@ func (c *SharedConfig) hasCredentials() bool { } func (c *SharedConfig) hasSSOConfiguration() bool { - switch { - case len(c.SSOAccountID) != 0: - case len(c.SSORegion) != 0: - case len(c.SSORoleName) != 0: - case len(c.SSOStartURL) != 0: - default: - return false - } - return true + return c.hasSSOTokenProviderConfiguration() || c.hasLegacySSOConfiguration() +} + +func (c *SharedConfig) hasSSOTokenProviderConfiguration() bool { + return len(c.SSOSessionName) > 0 +} + +func (c *SharedConfig) hasLegacySSOConfiguration() bool { + return len(c.SSORegion) > 0 || len(c.SSOAccountID) > 0 || len(c.SSOStartURL) > 0 || len(c.SSORoleName) > 0 } func (c *SharedConfig) clearAssumeRoleOptions() { @@ -993,6 +1384,10 @@ func (c *SharedConfig) clearCredentialOptions() { c.CredentialProcess = "" c.WebIdentityTokenFile = "" c.Credentials = aws.Credentials{} + c.SSOAccountID = "" + c.SSORegion = "" + c.SSORoleName = "" + c.SSOStartURL = "" } // SharedConfigLoadError is an error for the shared config file failed to load. @@ -1064,15 +1459,6 @@ func (e CredentialRequiresARNError) Error() string { ) } -func userHomeDir() string { - if runtime.GOOS == "windows" { // Windows - return os.Getenv("USERPROFILE") - } - - // *nix - return os.Getenv("HOME") -} - func oneOrNone(bs ...bool) bool { var count int @@ -1097,13 +1483,35 @@ func updateString(dst *string, section ini.Section, key string) { *dst = section.String(key) } +// updateInt will only update the dst with the value in the section key, key +// is present in the section. +// +// Down casts the INI integer value from a int64 to an int, which could be +// different bit size depending on platform. +func updateInt(dst *int, section ini.Section, key string) error { + if !section.Has(key) { + return nil + } + + v, ok := section.Int(key) + if !ok { + return fmt.Errorf("invalid value %s=%s, expect integer", key, section.String(key)) + } + + *dst = int(v) + return nil +} + // updateBool will only update the dst with the value in the section key, key // is present in the section. func updateBool(dst *bool, section ini.Section, key string) { if !section.Has(key) { return } - *dst = section.Bool(key) + + // retains pre-#2276 behavior where non-bool value would resolve to false + v, _ := section.Bool(key) + *dst = v } // updateBoolPtr will only update the dst with the value in the section key, @@ -1112,6 +1520,65 @@ func updateBoolPtr(dst **bool, section ini.Section, key string) { if !section.Has(key) { return } + + // retains pre-#2276 behavior where non-bool value would resolve to false + v, _ := section.Bool(key) *dst = new(bool) - **dst = section.Bool(key) + **dst = v +} + +// updateEndpointDiscoveryType will only update the dst with the value in the section, if +// a valid key and corresponding EndpointDiscoveryType is found. +func updateEndpointDiscoveryType(dst *aws.EndpointDiscoveryEnableState, section ini.Section, key string) { + if !section.Has(key) { + return + } + + value := section.String(key) + if len(value) == 0 { + return + } + + switch { + case strings.EqualFold(value, endpointDiscoveryDisabled): + *dst = aws.EndpointDiscoveryDisabled + case strings.EqualFold(value, endpointDiscoveryEnabled): + *dst = aws.EndpointDiscoveryEnabled + case strings.EqualFold(value, endpointDiscoveryAuto): + *dst = aws.EndpointDiscoveryAuto + } +} + +// updateEndpointDiscoveryType will only update the dst with the value in the section, if +// a valid key and corresponding EndpointDiscoveryType is found. +func updateUseDualStackEndpoint(dst *aws.DualStackEndpointState, section ini.Section, key string) { + if !section.Has(key) { + return + } + + // retains pre-#2276 behavior where non-bool value would resolve to false + if v, _ := section.Bool(key); v { + *dst = aws.DualStackEndpointStateEnabled + } else { + *dst = aws.DualStackEndpointStateDisabled + } + + return +} + +// updateEndpointDiscoveryType will only update the dst with the value in the section, if +// a valid key and corresponding EndpointDiscoveryType is found. +func updateUseFIPSEndpoint(dst *aws.FIPSEndpointState, section ini.Section, key string) { + if !section.Has(key) { + return + } + + // retains pre-#2276 behavior where non-bool value would resolve to false + if v, _ := section.Bool(key); v { + *dst = aws.FIPSEndpointStateEnabled + } else { + *dst = aws.FIPSEndpointStateDisabled + } + + return } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md new file mode 100644 index 00000000..989c4ea3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md @@ -0,0 +1,477 @@ +# v1.16.16 (2024-01-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.15 (2024-01-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.14 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.13 (2023-12-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.12 (2023-12-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.11 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.10 (2023-12-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.9 (2023-12-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.8 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.7 (2023-11-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.6 (2023-11-28.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.5 (2023-11-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.4 (2023-11-21) + +* **Bug Fix**: Don't expect error responses to have a JSON payload in the endpointcreds provider. + +# v1.16.3 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.2 (2023-11-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.1 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.0 (2023-11-14) + +* **Feature**: Add support for dynamic auth token from file and EKS container host in absolute/relative URIs in the HTTP credential provider. + +# 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 + +# v1.13.42 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.41 (2023-10-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.40 (2023-09-22) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.39 (2023-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.38 (2023-09-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.37 (2023-09-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.36 (2023-08-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.35 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.34 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.33 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.32 (2023-08-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.31 (2023-08-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.30 (2023-07-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.29 (2023-07-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.28 (2023-07-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.27 (2023-07-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.26 (2023-06-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.25 (2023-06-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.24 (2023-05-09) + +* No change notes available for this release. + +# v1.13.23 (2023-05-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.22 (2023-05-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.21 (2023-04-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.20 (2023-04-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.19 (2023-04-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.18 (2023-03-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.17 (2023-03-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.16 (2023-03-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.15 (2023-02-22) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.14 (2023-02-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.13 (2023-02-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.12 (2023-02-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.11 (2023-02-01) + +* No change notes available for this release. + +# v1.13.10 (2023-01-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.9 (2023-01-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.8 (2023-01-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.7 (2022-12-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.6 (2022-12-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.5 (2022-12-15) + +* **Bug Fix**: Unify logic between shared config and in finding home directory +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.4 (2022-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.3 (2022-11-22) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.2 (2022-11-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.1 (2022-11-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.0 (2022-11-11) + +* **Announcement**: When using the SSOTokenProvider, a previous implementation incorrectly compensated for invalid SSOTokenProvider configurations in the shared profile. This has been fixed via PR #1903 and tracked in issue #1846 +* **Feature**: Adds token refresh support (via SSOTokenProvider) when using the SSOCredentialProvider + +# v1.12.24 (2022-11-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.23 (2022-10-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.22 (2022-10-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.21 (2022-09-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.20 (2022-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.19 (2022-09-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.18 (2022-09-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.17 (2022-08-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.16 (2022-08-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.15 (2022-08-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.14 (2022-08-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.13 (2022-08-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.12 (2022-08-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.11 (2022-08-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.10 (2022-08-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.9 (2022-07-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.8 (2022-07-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.7 (2022-06-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.6 (2022-06-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.5 (2022-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.4 (2022-05-26) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.3 (2022-05-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.2 (2022-05-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.1 (2022-05-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.0 (2022-04-25) + +* **Feature**: Adds Duration and Policy options that can be used when creating stscreds.WebIdentityRoleProvider credentials provider. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.2 (2022-03-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.1 (2022-03-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.0 (2022-03-23) + +* **Feature**: Update `ec2rolecreds` package's `Provider` to implememnt support for CredentialsCache new optional caching strategy interfaces, HandleFailRefreshCredentialsCacheStrategy and AdjustExpiresByCredentialsCacheStrategy. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.0 (2022-03-08) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.0 (2022-02-24) + +* **Feature**: Adds support for `SourceIdentity` to `stscreds.AssumeRoleProvider` [#1588](https://github.com/aws/aws-sdk-go-v2/pull/1588). Fixes [#1575](https://github.com/aws/aws-sdk-go-v2/issues/1575) +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.0 (2022-01-14) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.7.0 (2022-01-07) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.5 (2021-12-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.4 (2021-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.3 (2021-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.2 (2021-11-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.1 (2021-11-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.0 (2021-11-06) + +* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.0 (2021-10-21) + +* **Feature**: Updated to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.3 (2021-10-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.2 (2021-09-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.1 (2021-09-10) + +* **Documentation**: Fixes the AssumeRoleProvider's documentation for using custom TokenProviders. + +# v1.4.0 (2021-08-27) + +* **Feature**: Adds support for Tags and TransitiveTagKeys to stscreds.AssumeRoleProvider. Closes https://github.com/aws/aws-sdk-go-v2/issues/723 +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.3 (2021-08-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.2 (2021-08-04) + +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.1 (2021-07-15) + +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.0 (2021-06-25) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Bug Fix**: Fixed example usages of aws.CredentialsCache ([#1275](https://github.com/aws/aws-sdk-go-v2/pull/1275)) +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.1 (2021-05-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.0 (2021-05-14) + +* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. +* **Dependency Update**: Updated to the latest SDK module versions + diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/doc.go index 0bec6526..6ed71b42 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/doc.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/doc.go @@ -1,27 +1,27 @@ // Package ec2rolecreds provides the credentials provider implementation for // retrieving AWS credentials from Amazon EC2 Instance Roles via Amazon EC2 IMDS. // -// Concurrency and caching +// # Concurrency and caching // // The Provider is not safe to be used concurrently, and does not provide any // caching of credentials retrieved. You should wrap the Provider with a // `aws.CredentialsCache` to provide concurrency safety, and caching of // credentials. // -// Loading credentials with the SDK's AWS Config +// # Loading credentials with the SDK's AWS Config // // The EC2 Instance role credentials provider will automatically be the resolved -// credential provider int he credential chain if no other credential provider is +// credential provider in the credential chain if no other credential provider is // resolved first. // // To explicitly instruct the SDK's credentials resolving to use the EC2 Instance // role for credentials, you specify a `credentials_source` property in the config // profile the SDK will load. // -// [default] -// credential_source = Ec2InstanceMetadata +// [default] +// credential_source = Ec2InstanceMetadata // -// Loading credentials with the Provider directly +// # Loading credentials with the Provider directly // // Another way to use the EC2 Instance role credentials provider is to create it // directly and assign it as the credentials provider for an API client. @@ -30,28 +30,28 @@ // it with the CredentialsCache before assigning the provider to the Amazon S3 API // client's Credentials option. // -// provider := imds.New(imds.Options{}) +// provider := imds.New(imds.Options{}) // -// // Create the service client value configured for credentials. -// svc := s3.New(s3.Options{ -// Credentials: &aws.CredentialsCache{Provider: provider}, -// }) +// // Create the service client value configured for credentials. +// svc := s3.New(s3.Options{ +// Credentials: aws.NewCredentialsCache(provider), +// }) // // If you need more control, you can set the configuration options on the // credentials provider using the imds.Options type to configure the EC2 IMDS // API Client and ExpiryWindow of the retrieved credentials. // -// provider := imds.New(imds.Options{ -// // See imds.Options type's documentation for more options available. -// Client: imds.New(Options{ -// HTTPClient: customHTTPClient, -// }), +// provider := imds.New(imds.Options{ +// // See imds.Options type's documentation for more options available. +// Client: imds.New(Options{ +// HTTPClient: customHTTPClient, +// }), // -// // Modify how soon credentials expire prior to their original expiry time. -// ExpiryWindow: 5 * time.Minute, -// }) +// // Modify how soon credentials expire prior to their original expiry time. +// ExpiryWindow: 5 * time.Minute, +// }) // -// EC2 IMDS API Client +// # EC2 IMDS API Client // // See the github.com/aws/aws-sdk-go-v2/feature/ec2/imds module for more details on // configuring the client, and options available. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/provider.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/provider.go index 901132a3..5c699f16 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/provider.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/provider.go @@ -5,13 +5,18 @@ import ( "context" "encoding/json" "fmt" + "math" "path" "strings" "time" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" + sdkrand "github.com/aws/aws-sdk-go-v2/internal/rand" + "github.com/aws/aws-sdk-go-v2/internal/sdk" "github.com/aws/smithy-go" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" ) // ProviderName provides a name of EC2Role provider @@ -26,15 +31,11 @@ type GetMetadataAPIClient interface { // A Provider retrieves credentials from the EC2 service, and keeps track if // those credentials are expired. // -// The New function must be used to create the Provider. +// The New function must be used to create the with a custom EC2 IMDS client. // -// p := &ec2rolecreds.New(ec2rolecreds.Options{ -// Client: imds.New(imds.Options{}), -// -// // Expire the credentials 10 minutes before IAM states they should. -// // Proactively refreshing the credentials. -// ExpiryWindow: 10 * time.Minute -// }) +// p := &ec2rolecreds.New(func(o *ec2rolecreds.Options{ +// o.Client = imds.New(imds.Options{/* custom options */}) +// }) type Provider struct { options Options } @@ -66,9 +67,8 @@ func New(optFns ...func(*Options)) *Provider { } } -// Retrieve retrieves credentials from the EC2 service. -// Error will be returned if the request fails, or unable to extract -// the desired credentials. +// Retrieve retrieves credentials from the EC2 service. Error will be returned +// if the request fails, or unable to extract the desired credentials. func (p *Provider) Retrieve(ctx context.Context) (aws.Credentials, error) { credsList, err := requestCredList(ctx, p.options.Client) if err != nil { @@ -96,10 +96,65 @@ func (p *Provider) Retrieve(ctx context.Context) (aws.Credentials, error) { Expires: roleCreds.Expiration, } + // Cap role credentials Expires to 1 hour so they can be refreshed more + // often. Jitter will be applied credentials cache if being used. + if anHour := sdk.NowTime().Add(1 * time.Hour); creds.Expires.After(anHour) { + creds.Expires = anHour + } + + return creds, nil +} + +// HandleFailToRefresh will extend the credentials Expires time if it it is +// expired. If the credentials will not expire within the minimum time, they +// will be returned. +// +// If the credentials cannot expire, the original error will be returned. +func (p *Provider) HandleFailToRefresh(ctx context.Context, prevCreds aws.Credentials, err error) ( + aws.Credentials, error, +) { + if !prevCreds.CanExpire { + return aws.Credentials{}, err + } + + if prevCreds.Expires.After(sdk.NowTime().Add(5 * time.Minute)) { + return prevCreds, nil + } + + newCreds := prevCreds + randFloat64, err := sdkrand.CryptoRandFloat64() + if err != nil { + return aws.Credentials{}, fmt.Errorf("failed to get random float, %w", err) + } + + // Random distribution of [5,15) minutes. + expireOffset := time.Duration(randFloat64*float64(10*time.Minute)) + 5*time.Minute + newCreds.Expires = sdk.NowTime().Add(expireOffset) + + logger := middleware.GetLogger(ctx) + logger.Logf(logging.Warn, "Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted again in %v minutes.", math.Floor(expireOffset.Minutes())) + + return newCreds, nil +} + +// AdjustExpiresBy will adds the passed in duration to the passed in +// credential's Expires time, unless the time until Expires is less than 15 +// minutes. Returns the credentials, even if not updated. +func (p *Provider) AdjustExpiresBy(creds aws.Credentials, dur time.Duration) ( + aws.Credentials, error, +) { + if !creds.CanExpire { + return creds, nil + } + if creds.Expires.Before(sdk.NowTime().Add(15 * time.Minute)) { + return creds, nil + } + + creds.Expires = creds.Expires.Add(dur) return creds, nil } -// A ec2RoleCredRespBody provides the shape for unmarshaling credential +// ec2RoleCredRespBody provides the shape for unmarshaling credential // request responses. type ec2RoleCredRespBody struct { // Success State diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/auth.go new file mode 100644 index 00000000..c3f5dadc --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/auth.go @@ -0,0 +1,48 @@ +package client + +import ( + "context" + "github.com/aws/smithy-go/middleware" +) + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + return next.HandleFinalize(ctx, in) +} + +type signRequestMiddleware struct { +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + return next.HandleFinalize(ctx, in) +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/client.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/client.go index 60b8298f..9a869f89 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/client.go @@ -62,7 +62,16 @@ func New(options Options, optFns ...func(*Options)) *Client { } if options.Retryer == nil { - options.Retryer = retry.NewStandard() + // Amazon-owned implementations of this endpoint are known to sometimes + // return plaintext responses (i.e. no Code) like normal, add a few + // additional status codes + options.Retryer = retry.NewStandard(func(o *retry.StandardOptions) { + o.Retryables = append(o.Retryables, retry.RetryableHTTPStatusCode{ + Codes: map[int]struct{}{ + http.StatusTooManyRequests: {}, + }, + }) + }) } for _, fn := range optFns { @@ -92,6 +101,7 @@ func (c *Client) GetCredentials(ctx context.Context, params *GetCredentialsInput stack.Serialize.Add(&serializeOpGetCredential{}, smithymiddleware.After) stack.Build.Add(&buildEndpoint{Endpoint: options.Endpoint}, smithymiddleware.After) stack.Deserialize.Add(&deserializeOpGetCredential{}, smithymiddleware.After) + addProtocolFinalizerMiddlewares(stack, options, "GetCredentials") retry.AddRetryMiddlewares(stack, retry.AddRetryMiddlewaresOptions{Retryer: options.Retryer}) middleware.AddSDKAgentKey(middleware.FeatureMetadata, ServiceID) smithyhttp.AddErrorCloseResponseBodyMiddleware(stack) @@ -122,9 +132,10 @@ type GetCredentialsOutput struct { // EndpointError is an error returned from the endpoint service type EndpointError struct { - Code string `json:"code"` - Message string `json:"message"` - Fault smithy.ErrorFault `json:"-"` + Code string `json:"code"` + Message string `json:"message"` + Fault smithy.ErrorFault `json:"-"` + statusCode int `json:"-"` } // Error is the error mesage string @@ -146,3 +157,8 @@ func (e *EndpointError) ErrorMessage() string { func (e *EndpointError) ErrorFault() smithy.ErrorFault { return e.Fault } + +// HTTPStatusCode implements retry.HTTPStatusCode. +func (e *EndpointError) HTTPStatusCode() int { + return e.statusCode +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/endpoints.go new file mode 100644 index 00000000..748ee672 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/endpoints.go @@ -0,0 +1,20 @@ +package client + +import ( + "context" + "github.com/aws/smithy-go/middleware" +) + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/middleware.go index 050f0997..f2820d20 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/middleware.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/middleware.go @@ -4,11 +4,12 @@ import ( "context" "encoding/json" "fmt" + "io" "net/url" + "github.com/aws/smithy-go" smithymiddleware "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" - "github.com/aws/smithy-go" ) type buildEndpoint struct { @@ -104,17 +105,60 @@ func (d *deserializeOpGetCredential) HandleDeserialize(ctx context.Context, in s } func deserializeError(response *smithyhttp.Response) error { - var errShape *EndpointError - err := json.NewDecoder(response.Body).Decode(&errShape) + // we could be talking to anything, json isn't guaranteed + // see https://github.com/aws/aws-sdk-go-v2/issues/2316 + if response.Header.Get("Content-Type") == "application/json" { + return deserializeJSONError(response) + } + + msg, err := io.ReadAll(response.Body) if err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode error message, %w", err)} + return &smithy.DeserializationError{ + Err: fmt.Errorf("read response, %w", err), + } } - if response.StatusCode >= 500 { - errShape.Fault = smithy.FaultServer - } else { - errShape.Fault = smithy.FaultClient + return &EndpointError{ + // no sensible value for Code + Message: string(msg), + Fault: stof(response.StatusCode), + statusCode: response.StatusCode, + } +} + +func deserializeJSONError(response *smithyhttp.Response) error { + var errShape *EndpointError + if err := json.NewDecoder(response.Body).Decode(&errShape); err != nil { + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode error message, %w", err), + } } + errShape.Fault = stof(response.StatusCode) + errShape.statusCode = response.StatusCode return errShape } + +// maps HTTP status code to smithy ErrorFault +func stof(code int) smithy.ErrorFault { + if code >= 500 { + return smithy.FaultServer + } + return smithy.FaultClient +} + +func addProtocolFinalizerMiddlewares(stack *smithymiddleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, smithymiddleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %w", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", smithymiddleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %w", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", smithymiddleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %w", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{}, "ResolveEndpointV2", smithymiddleware.After); err != nil { + return fmt.Errorf("add Signing: %w", err) + } + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/provider.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/provider.go index 40cd7add..0c3c4d68 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/provider.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/provider.go @@ -7,32 +7,36 @@ // // Static credentials will never expire once they have been retrieved. The format // of the static credentials response: -// { -// "AccessKeyId" : "MUA...", -// "SecretAccessKey" : "/7PC5om....", -// } +// +// { +// "AccessKeyId" : "MUA...", +// "SecretAccessKey" : "/7PC5om....", +// } // // Refreshable credentials will expire within the "ExpiryWindow" of the Expiration // value in the response. The format of the refreshable credentials response: -// { -// "AccessKeyId" : "MUA...", -// "SecretAccessKey" : "/7PC5om....", -// "Token" : "AQoDY....=", -// "Expiration" : "2016-02-25T06:03:31Z" -// } +// +// { +// "AccessKeyId" : "MUA...", +// "SecretAccessKey" : "/7PC5om....", +// "Token" : "AQoDY....=", +// "Expiration" : "2016-02-25T06:03:31Z" +// } // // Errors should be returned in the following format and only returned with 400 // or 500 HTTP status codes. -// { -// "code": "ErrorCode", -// "message": "Helpful error message." -// } +// +// { +// "code": "ErrorCode", +// "message": "Helpful error message." +// } package endpointcreds import ( "context" "fmt" "net/http" + "strings" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client" @@ -78,7 +82,37 @@ type Options struct { // Optional authorization token value if set will be used as the value of // the Authorization header of the endpoint credential request. + // + // When constructed from environment, the provider will use the value of + // AWS_CONTAINER_AUTHORIZATION_TOKEN environment variable as the token + // + // Will be overridden if AuthorizationTokenProvider is configured AuthorizationToken string + + // Optional auth provider func to dynamically load the auth token from a file + // everytime a credential is retrieved + // + // When constructed from environment, the provider will read and use the content + // of the file pointed to by AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE environment variable + // as the auth token everytime credentials are retrieved + // + // Will override AuthorizationToken if configured + AuthorizationTokenProvider AuthTokenProvider +} + +// AuthTokenProvider defines an interface to dynamically load a value to be passed +// for the Authorization header of a credentials request. +type AuthTokenProvider interface { + GetToken() (string, error) +} + +// TokenProviderFunc is a func type implementing AuthTokenProvider interface +// and enables customizing token provider behavior +type TokenProviderFunc func() (string, error) + +// GetToken func retrieves auth token according to TokenProviderFunc implementation +func (p TokenProviderFunc) GetToken() (string, error) { + return p() } // New returns a credentials Provider for retrieving AWS credentials @@ -129,5 +163,30 @@ func (p *Provider) Retrieve(ctx context.Context) (aws.Credentials, error) { } func (p *Provider) getCredentials(ctx context.Context) (*client.GetCredentialsOutput, error) { - return p.client.GetCredentials(ctx, &client.GetCredentialsInput{AuthorizationToken: p.options.AuthorizationToken}) + authToken, err := p.resolveAuthToken() + if err != nil { + return nil, fmt.Errorf("resolve auth token: %v", err) + } + + return p.client.GetCredentials(ctx, &client.GetCredentialsInput{ + AuthorizationToken: authToken, + }) +} + +func (p *Provider) resolveAuthToken() (string, error) { + authToken := p.options.AuthorizationToken + + var err error + if p.options.AuthorizationTokenProvider != nil { + authToken, err = p.options.AuthorizationTokenProvider.GetToken() + if err != nil { + return "", err + } + } + + if strings.ContainsAny(authToken, "\r\n") { + return "", fmt.Errorf("authorization token contains invalid newline sequence") + } + + return authToken, nil } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go new file mode 100644 index 00000000..fe92184d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package credentials + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "1.16.16" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/doc.go index b028bea4..a3137b8f 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/doc.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/doc.go @@ -7,14 +7,14 @@ // option, you should make sure that the config file is as locked down as possible // using security best practices for your operating system. // -// Concurrency and caching +// # Concurrency and caching // // The Provider is not safe to be used concurrently, and does not provide any // caching of credentials retrieved. You should wrap the Provider with a // `aws.CredentialsCache` to provide concurrency safety, and caching of // credentials. // -// Loading credentials with the SDKs AWS Config +// # Loading credentials with the SDKs AWS Config // // You can use credentials from a AWS shared config `credential_process` in a // variety of ways. @@ -24,20 +24,20 @@ // called. You also need to set the AWS_SDK_LOAD_CONFIG environment variable // (e.g., `export AWS_SDK_LOAD_CONFIG=1`) to use the shared config file. // -// [default] -// credential_process = /command/to/call +// [default] +// credential_process = /command/to/call // // Loading configuration using external will use the credential process to // retrieve credentials. NOTE: If there are credentials in the profile you are // using, the credential process will not be used. // -// // Initialize a session to load credentials. -// cfg, _ := config.LoadDefaultConfig(context.TODO()) +// // Initialize a session to load credentials. +// cfg, _ := config.LoadDefaultConfig(context.TODO()) // -// // Create S3 service client to use the credentials. -// svc := s3.NewFromConfig(cfg) +// // Create S3 service client to use the credentials. +// svc := s3.NewFromConfig(cfg) // -// Loading credentials with the Provider directly +// # Loading credentials with the Provider directly // // Another way to use the credentials process provider is by using the // `NewProvider` constructor to create the provider and providing a it with a @@ -47,46 +47,46 @@ // it with the CredentialsCache before assigning the provider to the Amazon S3 API // client's Credentials option. // -// // Create credentials using the Provider. -// provider := processcreds.NewProvider("/path/to/command") +// // Create credentials using the Provider. +// provider := processcreds.NewProvider("/path/to/command") // -// // Create the service client value configured for credentials. -// svc := s3.New(s3.Options{ -// Credentials: &aws.CredentialsCache{Provider: provider}, -// }) +// // Create the service client value configured for credentials. +// svc := s3.New(s3.Options{ +// Credentials: aws.NewCredentialsCache(provider), +// }) // // If you need more control, you can set any configurable options in the // credentials using one or more option functions. // -// provider := processcreds.NewProvider("/path/to/command", -// func(o *processcreds.Options) { -// // Override the provider's default timeout -// o.Timeout = 2 * time.Minute -// }) +// provider := processcreds.NewProvider("/path/to/command", +// func(o *processcreds.Options) { +// // Override the provider's default timeout +// o.Timeout = 2 * time.Minute +// }) // // You can also use your own `exec.Cmd` value by satisfying a value that satisfies // the `NewCommandBuilder` interface and use the `NewProviderCommand` constructor. // -// // Create an exec.Cmd -// cmdBuilder := processcreds.NewCommandBuilderFunc( -// func(ctx context.Context) (*exec.Cmd, error) { -// cmd := exec.CommandContext(ctx, -// "customCLICommand", -// "-a", "argument", -// ) -// cmd.Env = []string{ -// "ENV_VAR_FOO=value", -// "ENV_VAR_BAR=other_value", -// } -// -// return cmd, nil -// }, -// ) -// -// // Create credentials using your exec.Cmd and custom timeout -// provider := processcreds.NewProviderCommand(cmdBuilder, -// func(opt *processcreds.Provider) { -// // optionally override the provider's default timeout -// opt.Timeout = 1 * time.Second -// }) +// // Create an exec.Cmd +// cmdBuilder := processcreds.NewCommandBuilderFunc( +// func(ctx context.Context) (*exec.Cmd, error) { +// cmd := exec.CommandContext(ctx, +// "customCLICommand", +// "-a", "argument", +// ) +// cmd.Env = []string{ +// "ENV_VAR_FOO=value", +// "ENV_VAR_BAR=other_value", +// } +// +// return cmd, nil +// }, +// ) +// +// // Create credentials using your exec.Cmd and custom timeout +// provider := processcreds.NewProviderCommand(cmdBuilder, +// func(opt *processcreds.Provider) { +// // optionally override the provider's default timeout +// opt.Timeout = 1 * time.Second +// }) package processcreds diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/provider.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/provider.go index 3921da34..fe9345e2 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/provider.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/provider.go @@ -149,12 +149,24 @@ func NewProviderCommand(builder NewCommandBuilder, options ...func(*Options)) *P return p } -type credentialProcessResponse struct { - Version int - AccessKeyID string `json:"AccessKeyId"` +// A CredentialProcessResponse is the AWS credentials format that must be +// returned when executing an external credential_process. +type CredentialProcessResponse struct { + // As of this writing, the Version key must be set to 1. This might + // increment over time as the structure evolves. + Version int + + // The access key ID that identifies the temporary security credentials. + AccessKeyID string `json:"AccessKeyId"` + + // The secret access key that can be used to sign requests. SecretAccessKey string - SessionToken string - Expiration *time.Time + + // The token that users must pass to the service API to use the temporary credentials. + SessionToken string + + // The date on which the current credentials expire. + Expiration *time.Time } // Retrieve executes the credential process command and returns the @@ -166,7 +178,7 @@ func (p *Provider) Retrieve(ctx context.Context) (aws.Credentials, error) { } // Serialize and validate response - resp := &credentialProcessResponse{} + resp := &CredentialProcessResponse{} if err = json.Unmarshal(out, resp); err != nil { return aws.Credentials{Source: ProviderName}, &ProviderError{ Err: fmt.Errorf("parse failed of process output: %s, error: %w", out, err), diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/doc.go index 2f396c0a..ece1e65f 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/doc.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/doc.go @@ -1,63 +1,81 @@ -// Package ssocreds provides a credential provider for retrieving temporary AWS credentials using an SSO access token. +// Package ssocreds provides a credential provider for retrieving temporary AWS +// credentials using an SSO access token. // -// IMPORTANT: The provider in this package does not initiate or perform the AWS SSO login flow. The SDK provider -// expects that you have already performed the SSO login flow using AWS CLI using the "aws sso login" command, or by -// some other mechanism. The provider must find a valid non-expired access token for the AWS SSO user portal URL in -// ~/.aws/sso/cache. If a cached token is not found, it is expired, or the file is malformed an error will be returned. +// IMPORTANT: The provider in this package does not initiate or perform the AWS +// SSO login flow. The SDK provider expects that you have already performed the +// SSO login flow using AWS CLI using the "aws sso login" command, or by some +// other mechanism. The provider must find a valid non-expired access token for +// the AWS SSO user portal URL in ~/.aws/sso/cache. If a cached token is not +// found, it is expired, or the file is malformed an error will be returned. // -// Loading AWS SSO credentials with the AWS shared configuration file +// # Loading AWS SSO credentials with the AWS shared configuration file // // You can use configure AWS SSO credentials from the AWS shared configuration file by -// providing the specifying the required keys in the profile: +// specifying the required keys in the profile and referencing an sso-session: // -// sso_account_id -// sso_region -// sso_role_name -// sso_start_url +// sso_session +// sso_account_id +// sso_role_name // -// For example, the following defines a profile "devsso" and specifies the AWS SSO parameters that defines the target -// account, role, sign-on portal, and the region where the user portal is located. Note: all SSO arguments must be +// For example, the following defines a profile "devsso" and specifies the AWS +// SSO parameters that defines the target account, role, sign-on portal, and +// the region where the user portal is located. Note: all SSO arguments must be // provided, or an error will be returned. // -// [profile devsso] -// sso_start_url = https://my-sso-portal.awsapps.com/start -// sso_role_name = SSOReadOnlyRole -// sso_region = us-east-1 -// sso_account_id = 123456789012 -// -// Using the config module, you can load the AWS SDK shared configuration, and specify that this profile be used to -// retrieve credentials. For example: -// -// config, err := config.LoadDefaultConfig(context.TODO(), config.WithSharedConfigProfile("devsso")) -// if err != nil { -// return err -// } -// -// Programmatically loading AWS SSO credentials directly -// -// You can programmatically construct the AWS SSO Provider in your application, and provide the necessary information -// to load and retrieve temporary credentials using an access token from ~/.aws/sso/cache. -// -// client := sso.NewFromConfig(cfg) -// -// var provider aws.CredentialsProvider -// provider = ssocreds.New(client, "123456789012", "SSOReadOnlyRole", "us-east-1", "https://my-sso-portal.awsapps.com/start") -// -// // Wrap the provider with aws.CredentialsCache to cache the credentials until their expire time -// provider = aws.NewCredentialsCache(provider) -// -// credentials, err := provider.Retrieve(context.TODO()) -// if err != nil { -// return err -// } -// -// It is important that you wrap the Provider with aws.CredentialsCache if you are programmatically constructing the -// provider directly. This prevents your application from accessing the cached access token and requesting new +// [profile devsso] +// sso_session = dev-session +// sso_role_name = SSOReadOnlyRole +// sso_account_id = 123456789012 +// +// [sso-session dev-session] +// sso_start_url = https://my-sso-portal.awsapps.com/start +// sso_region = us-east-1 +// sso_registration_scopes = sso:account:access +// +// Using the config module, you can load the AWS SDK shared configuration, and +// specify that this profile be used to retrieve credentials. For example: +// +// config, err := config.LoadDefaultConfig(context.TODO(), config.WithSharedConfigProfile("devsso")) +// if err != nil { +// return err +// } +// +// # Programmatically loading AWS SSO credentials directly +// +// You can programmatically construct the AWS SSO Provider in your application, +// and provide the necessary information to load and retrieve temporary +// credentials using an access token from ~/.aws/sso/cache. +// +// ssoClient := sso.NewFromConfig(cfg) +// ssoOidcClient := ssooidc.NewFromConfig(cfg) +// tokenPath, err := ssocreds.StandardCachedTokenFilepath("dev-session") +// if err != nil { +// return err +// } +// +// var provider aws.CredentialsProvider +// provider = ssocreds.New(ssoClient, "123456789012", "SSOReadOnlyRole", "https://my-sso-portal.awsapps.com/start", func(options *ssocreds.Options) { +// options.SSOTokenProvider = ssocreds.NewSSOTokenProvider(ssoOidcClient, tokenPath) +// }) +// +// // Wrap the provider with aws.CredentialsCache to cache the credentials until their expire time +// provider = aws.NewCredentialsCache(provider) +// +// credentials, err := provider.Retrieve(context.TODO()) +// if err != nil { +// return err +// } +// +// It is important that you wrap the Provider with aws.CredentialsCache if you +// are programmatically constructing the provider directly. This prevents your +// application from accessing the cached access token and requesting new // credentials each time the credentials are used. // -// Additional Resources +// # Additional Resources // -// Configuring the AWS CLI to use AWS Single Sign-On: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html +// Configuring the AWS CLI to use AWS Single Sign-On: +// https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html // -// AWS Single Sign-On User Guide: https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html +// AWS Single Sign-On User Guide: +// https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html package ssocreds diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/os.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/os.go deleted file mode 100644 index ceca7dce..00000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/os.go +++ /dev/null @@ -1,9 +0,0 @@ -// +build !windows - -package ssocreds - -import "os" - -func getHomeDirectory() string { - return os.Getenv("HOME") -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/os_windows.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/os_windows.go deleted file mode 100644 index eb48f61e..00000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/os_windows.go +++ /dev/null @@ -1,7 +0,0 @@ -package ssocreds - -import "os" - -func getHomeDirectory() string { - return os.Getenv("USERPROFILE") -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/provider.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/provider.go deleted file mode 100644 index 279df7a1..00000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/provider.go +++ /dev/null @@ -1,184 +0,0 @@ -package ssocreds - -import ( - "context" - "crypto/sha1" - "encoding/hex" - "encoding/json" - "fmt" - "io/ioutil" - "path/filepath" - "strings" - "time" - - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/internal/sdk" - "github.com/aws/aws-sdk-go-v2/service/sso" -) - -// ProviderName is the name of the provider used to specify the source of credentials. -const ProviderName = "SSOProvider" - -var defaultCacheLocation func() string - -func defaultCacheLocationImpl() string { - return filepath.Join(getHomeDirectory(), ".aws", "sso", "cache") -} - -func init() { - defaultCacheLocation = defaultCacheLocationImpl -} - -// GetRoleCredentialsAPIClient is a API client that implements the GetRoleCredentials operation. -type GetRoleCredentialsAPIClient interface { - GetRoleCredentials(ctx context.Context, params *sso.GetRoleCredentialsInput, optFns ...func(*sso.Options)) (*sso.GetRoleCredentialsOutput, error) -} - -// Options is the Provider options structure. -type Options struct { - // The Client which is configured for the AWS Region where the AWS SSO user portal is located. - Client GetRoleCredentialsAPIClient - - // The AWS account that is assigned to the user. - AccountID string - - // The role name that is assigned to the user. - RoleName string - - // The URL that points to the organization's AWS Single Sign-On (AWS SSO) user portal. - StartURL string -} - -// Provider is an AWS credential provider that retrieves temporary AWS credentials by exchanging an SSO login token. -type Provider struct { - options Options -} - -// New returns a new AWS Single Sign-On (AWS SSO) credential provider. The provided client is expected to be configured -// for the AWS Region where the AWS SSO user portal is located. -func New(client GetRoleCredentialsAPIClient, accountID, roleName, startURL string, optFns ...func(options *Options)) *Provider { - options := Options{ - Client: client, - AccountID: accountID, - RoleName: roleName, - StartURL: startURL, - } - - for _, fn := range optFns { - fn(&options) - } - - return &Provider{ - options: options, - } -} - -// Retrieve retrieves temporary AWS credentials from the configured Amazon Single Sign-On (AWS SSO) user portal -// by exchanging the accessToken present in ~/.aws/sso/cache. -func (p *Provider) Retrieve(ctx context.Context) (aws.Credentials, error) { - tokenFile, err := loadTokenFile(p.options.StartURL) - if err != nil { - return aws.Credentials{}, err - } - - output, err := p.options.Client.GetRoleCredentials(ctx, &sso.GetRoleCredentialsInput{ - AccessToken: &tokenFile.AccessToken, - AccountId: &p.options.AccountID, - RoleName: &p.options.RoleName, - }) - if err != nil { - return aws.Credentials{}, err - } - - return aws.Credentials{ - AccessKeyID: aws.ToString(output.RoleCredentials.AccessKeyId), - SecretAccessKey: aws.ToString(output.RoleCredentials.SecretAccessKey), - SessionToken: aws.ToString(output.RoleCredentials.SessionToken), - Expires: time.Unix(0, output.RoleCredentials.Expiration*int64(time.Millisecond)).UTC(), - CanExpire: true, - Source: ProviderName, - }, nil -} - -func getCacheFileName(url string) (string, error) { - hash := sha1.New() - _, err := hash.Write([]byte(url)) - if err != nil { - return "", err - } - return strings.ToLower(hex.EncodeToString(hash.Sum(nil))) + ".json", nil -} - -type rfc3339 time.Time - -func (r *rfc3339) UnmarshalJSON(bytes []byte) error { - var value string - - if err := json.Unmarshal(bytes, &value); err != nil { - return err - } - - parse, err := time.Parse(time.RFC3339, value) - if err != nil { - return fmt.Errorf("expected RFC3339 timestamp: %w", err) - } - - *r = rfc3339(parse) - - return nil -} - -type token struct { - AccessToken string `json:"accessToken"` - ExpiresAt rfc3339 `json:"expiresAt"` - Region string `json:"region,omitempty"` - StartURL string `json:"startUrl,omitempty"` -} - -func (t token) Expired() bool { - return sdk.NowTime().Round(0).After(time.Time(t.ExpiresAt)) -} - -// InvalidTokenError is the error type that is returned if loaded token has expired or is otherwise invalid. -// To refresh the SSO session run aws sso login with the corresponding profile. -type InvalidTokenError struct { - Err error -} - -func (i *InvalidTokenError) Unwrap() error { - return i.Err -} - -func (i *InvalidTokenError) Error() string { - const msg = "the SSO session has expired or is invalid" - if i.Err == nil { - return msg - } - return msg + ": " + i.Err.Error() -} - -func loadTokenFile(startURL string) (t token, err error) { - key, err := getCacheFileName(startURL) - if err != nil { - return token{}, &InvalidTokenError{Err: err} - } - - fileBytes, err := ioutil.ReadFile(filepath.Join(defaultCacheLocation(), key)) - if err != nil { - return token{}, &InvalidTokenError{Err: err} - } - - if err := json.Unmarshal(fileBytes, &t); err != nil { - return token{}, &InvalidTokenError{Err: err} - } - - if len(t.AccessToken) == 0 { - return token{}, &InvalidTokenError{} - } - - if t.Expired() { - return token{}, &InvalidTokenError{Err: fmt.Errorf("access token is expired")} - } - - return t, nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_cached_token.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_cached_token.go new file mode 100644 index 00000000..3b97e6dd --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_cached_token.go @@ -0,0 +1,233 @@ +package ssocreds + +import ( + "crypto/sha1" + "encoding/hex" + "encoding/json" + "fmt" + "io/ioutil" + "os" + "path/filepath" + "strconv" + "strings" + "time" + + "github.com/aws/aws-sdk-go-v2/internal/sdk" + "github.com/aws/aws-sdk-go-v2/internal/shareddefaults" +) + +var osUserHomeDur = shareddefaults.UserHomeDir + +// StandardCachedTokenFilepath returns the filepath for the cached SSO token file, or +// error if unable get derive the path. Key that will be used to compute a SHA1 +// value that is hex encoded. +// +// Derives the filepath using the Key as: +// +// ~/.aws/sso/cache/.json +func StandardCachedTokenFilepath(key string) (string, error) { + homeDir := osUserHomeDur() + if len(homeDir) == 0 { + return "", fmt.Errorf("unable to get USER's home directory for cached token") + } + hash := sha1.New() + if _, err := hash.Write([]byte(key)); err != nil { + return "", fmt.Errorf("unable to compute cached token filepath key SHA1 hash, %w", err) + } + + cacheFilename := strings.ToLower(hex.EncodeToString(hash.Sum(nil))) + ".json" + + return filepath.Join(homeDir, ".aws", "sso", "cache", cacheFilename), nil +} + +type tokenKnownFields struct { + AccessToken string `json:"accessToken,omitempty"` + ExpiresAt *rfc3339 `json:"expiresAt,omitempty"` + + RefreshToken string `json:"refreshToken,omitempty"` + ClientID string `json:"clientId,omitempty"` + ClientSecret string `json:"clientSecret,omitempty"` +} + +type token struct { + tokenKnownFields + UnknownFields map[string]interface{} `json:"-"` +} + +func (t token) MarshalJSON() ([]byte, error) { + fields := map[string]interface{}{} + + setTokenFieldString(fields, "accessToken", t.AccessToken) + setTokenFieldRFC3339(fields, "expiresAt", t.ExpiresAt) + + setTokenFieldString(fields, "refreshToken", t.RefreshToken) + setTokenFieldString(fields, "clientId", t.ClientID) + setTokenFieldString(fields, "clientSecret", t.ClientSecret) + + for k, v := range t.UnknownFields { + if _, ok := fields[k]; ok { + return nil, fmt.Errorf("unknown token field %v, duplicates known field", k) + } + fields[k] = v + } + + return json.Marshal(fields) +} + +func setTokenFieldString(fields map[string]interface{}, key, value string) { + if value == "" { + return + } + fields[key] = value +} +func setTokenFieldRFC3339(fields map[string]interface{}, key string, value *rfc3339) { + if value == nil { + return + } + fields[key] = value +} + +func (t *token) UnmarshalJSON(b []byte) error { + var fields map[string]interface{} + if err := json.Unmarshal(b, &fields); err != nil { + return nil + } + + t.UnknownFields = map[string]interface{}{} + + for k, v := range fields { + var err error + switch k { + case "accessToken": + err = getTokenFieldString(v, &t.AccessToken) + case "expiresAt": + err = getTokenFieldRFC3339(v, &t.ExpiresAt) + case "refreshToken": + err = getTokenFieldString(v, &t.RefreshToken) + case "clientId": + err = getTokenFieldString(v, &t.ClientID) + case "clientSecret": + err = getTokenFieldString(v, &t.ClientSecret) + default: + t.UnknownFields[k] = v + } + + if err != nil { + return fmt.Errorf("field %q, %w", k, err) + } + } + + return nil +} + +func getTokenFieldString(v interface{}, value *string) error { + var ok bool + *value, ok = v.(string) + if !ok { + return fmt.Errorf("expect value to be string, got %T", v) + } + return nil +} + +func getTokenFieldRFC3339(v interface{}, value **rfc3339) error { + var stringValue string + if err := getTokenFieldString(v, &stringValue); err != nil { + return err + } + + timeValue, err := parseRFC3339(stringValue) + if err != nil { + return err + } + + *value = &timeValue + return nil +} + +func loadCachedToken(filename string) (token, error) { + fileBytes, err := ioutil.ReadFile(filename) + if err != nil { + return token{}, fmt.Errorf("failed to read cached SSO token file, %w", err) + } + + var t token + if err := json.Unmarshal(fileBytes, &t); err != nil { + return token{}, fmt.Errorf("failed to parse cached SSO token file, %w", err) + } + + if len(t.AccessToken) == 0 || t.ExpiresAt == nil || time.Time(*t.ExpiresAt).IsZero() { + return token{}, fmt.Errorf( + "cached SSO token must contain accessToken and expiresAt fields") + } + + return t, nil +} + +func storeCachedToken(filename string, t token, fileMode os.FileMode) (err error) { + tmpFilename := filename + ".tmp-" + strconv.FormatInt(sdk.NowTime().UnixNano(), 10) + if err := writeCacheFile(tmpFilename, fileMode, t); err != nil { + return err + } + + if err := os.Rename(tmpFilename, filename); err != nil { + return fmt.Errorf("failed to replace old cached SSO token file, %w", err) + } + + return nil +} + +func writeCacheFile(filename string, fileMode os.FileMode, t token) (err error) { + var f *os.File + f, err = os.OpenFile(filename, os.O_CREATE|os.O_TRUNC|os.O_RDWR, fileMode) + if err != nil { + return fmt.Errorf("failed to create cached SSO token file %w", err) + } + + defer func() { + closeErr := f.Close() + if err == nil && closeErr != nil { + err = fmt.Errorf("failed to close cached SSO token file, %w", closeErr) + } + }() + + encoder := json.NewEncoder(f) + + if err = encoder.Encode(t); err != nil { + return fmt.Errorf("failed to serialize cached SSO token, %w", err) + } + + return nil +} + +type rfc3339 time.Time + +func parseRFC3339(v string) (rfc3339, error) { + parsed, err := time.Parse(time.RFC3339, v) + if err != nil { + return rfc3339{}, fmt.Errorf("expected RFC3339 timestamp: %w", err) + } + + return rfc3339(parsed), nil +} + +func (r *rfc3339) UnmarshalJSON(bytes []byte) (err error) { + var value string + + // Use JSON unmarshal to unescape the quoted value making use of JSON's + // unquoting rules. + if err = json.Unmarshal(bytes, &value); err != nil { + return err + } + + *r, err = parseRFC3339(value) + + return nil +} + +func (r *rfc3339) MarshalJSON() ([]byte, error) { + value := time.Time(*r).Format(time.RFC3339) + + // Use JSON unmarshal to unescape the quoted value making use of JSON's + // quoting rules. + return json.Marshal(value) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_credentials_provider.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_credentials_provider.go new file mode 100644 index 00000000..b3cf7853 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_credentials_provider.go @@ -0,0 +1,152 @@ +package ssocreds + +import ( + "context" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/sdk" + "github.com/aws/aws-sdk-go-v2/service/sso" +) + +// ProviderName is the name of the provider used to specify the source of +// credentials. +const ProviderName = "SSOProvider" + +// GetRoleCredentialsAPIClient is a API client that implements the +// GetRoleCredentials operation. +type GetRoleCredentialsAPIClient interface { + GetRoleCredentials(context.Context, *sso.GetRoleCredentialsInput, ...func(*sso.Options)) ( + *sso.GetRoleCredentialsOutput, error, + ) +} + +// Options is the Provider options structure. +type Options struct { + // The Client which is configured for the AWS Region where the AWS SSO user + // portal is located. + Client GetRoleCredentialsAPIClient + + // The AWS account that is assigned to the user. + AccountID string + + // The role name that is assigned to the user. + RoleName string + + // The URL that points to the organization's AWS Single Sign-On (AWS SSO) + // user portal. + StartURL string + + // The filepath the cached token will be retrieved from. If unset Provider will + // use the startURL to determine the filepath at. + // + // ~/.aws/sso/cache/.json + // + // If custom cached token filepath is used, the Provider's startUrl + // parameter will be ignored. + CachedTokenFilepath string + + // Used by the SSOCredentialProvider if a token configuration + // profile is used in the shared config + SSOTokenProvider *SSOTokenProvider +} + +// Provider is an AWS credential provider that retrieves temporary AWS +// credentials by exchanging an SSO login token. +type Provider struct { + options Options + + cachedTokenFilepath string +} + +// New returns a new AWS Single Sign-On (AWS SSO) credential provider. The +// provided client is expected to be configured for the AWS Region where the +// AWS SSO user portal is located. +func New(client GetRoleCredentialsAPIClient, accountID, roleName, startURL string, optFns ...func(options *Options)) *Provider { + options := Options{ + Client: client, + AccountID: accountID, + RoleName: roleName, + StartURL: startURL, + } + + for _, fn := range optFns { + fn(&options) + } + + return &Provider{ + options: options, + cachedTokenFilepath: options.CachedTokenFilepath, + } +} + +// Retrieve retrieves temporary AWS credentials from the configured Amazon +// Single Sign-On (AWS SSO) user portal by exchanging the accessToken present +// in ~/.aws/sso/cache. However, if a token provider configuration exists +// in the shared config, then we ought to use the token provider rather then +// direct access on the cached token. +func (p *Provider) Retrieve(ctx context.Context) (aws.Credentials, error) { + var accessToken *string + if p.options.SSOTokenProvider != nil { + token, err := p.options.SSOTokenProvider.RetrieveBearerToken(ctx) + if err != nil { + return aws.Credentials{}, err + } + accessToken = &token.Value + } else { + if p.cachedTokenFilepath == "" { + cachedTokenFilepath, err := StandardCachedTokenFilepath(p.options.StartURL) + if err != nil { + return aws.Credentials{}, &InvalidTokenError{Err: err} + } + p.cachedTokenFilepath = cachedTokenFilepath + } + + tokenFile, err := loadCachedToken(p.cachedTokenFilepath) + if err != nil { + return aws.Credentials{}, &InvalidTokenError{Err: err} + } + + if tokenFile.ExpiresAt == nil || sdk.NowTime().After(time.Time(*tokenFile.ExpiresAt)) { + return aws.Credentials{}, &InvalidTokenError{} + } + accessToken = &tokenFile.AccessToken + } + + output, err := p.options.Client.GetRoleCredentials(ctx, &sso.GetRoleCredentialsInput{ + AccessToken: accessToken, + AccountId: &p.options.AccountID, + RoleName: &p.options.RoleName, + }) + if err != nil { + return aws.Credentials{}, err + } + + return aws.Credentials{ + AccessKeyID: aws.ToString(output.RoleCredentials.AccessKeyId), + SecretAccessKey: aws.ToString(output.RoleCredentials.SecretAccessKey), + SessionToken: aws.ToString(output.RoleCredentials.SessionToken), + CanExpire: true, + Expires: time.Unix(0, output.RoleCredentials.Expiration*int64(time.Millisecond)).UTC(), + Source: ProviderName, + }, nil +} + +// InvalidTokenError is the error type that is returned if loaded token has +// expired or is otherwise invalid. To refresh the SSO session run AWS SSO +// login with the corresponding profile. +type InvalidTokenError struct { + Err error +} + +func (i *InvalidTokenError) Unwrap() error { + return i.Err +} + +func (i *InvalidTokenError) Error() string { + const msg = "the SSO session has expired or is invalid" + if i.Err == nil { + return msg + } + return msg + ": " + i.Err.Error() +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_token_provider.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_token_provider.go new file mode 100644 index 00000000..7f4fc546 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_token_provider.go @@ -0,0 +1,147 @@ +package ssocreds + +import ( + "context" + "fmt" + "os" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/sdk" + "github.com/aws/aws-sdk-go-v2/service/ssooidc" + "github.com/aws/smithy-go/auth/bearer" +) + +// CreateTokenAPIClient provides the interface for the SSOTokenProvider's API +// client for calling CreateToken operation to refresh the SSO token. +type CreateTokenAPIClient interface { + CreateToken(context.Context, *ssooidc.CreateTokenInput, ...func(*ssooidc.Options)) ( + *ssooidc.CreateTokenOutput, error, + ) +} + +// SSOTokenProviderOptions provides the options for configuring the +// SSOTokenProvider. +type SSOTokenProviderOptions struct { + // Client that can be overridden + Client CreateTokenAPIClient + + // The set of API Client options to be applied when invoking the + // CreateToken operation. + ClientOptions []func(*ssooidc.Options) + + // The path the file containing the cached SSO token will be read from. + // Initialized the NewSSOTokenProvider's cachedTokenFilepath parameter. + CachedTokenFilepath string +} + +// SSOTokenProvider provides an utility for refreshing SSO AccessTokens for +// Bearer Authentication. The SSOTokenProvider can only be used to refresh +// already cached SSO Tokens. This utility cannot perform the initial SSO +// create token. +// +// The SSOTokenProvider is not safe to use concurrently. It must be wrapped in +// a utility such as smithy-go's auth/bearer#TokenCache. The SDK's +// config.LoadDefaultConfig will automatically wrap the SSOTokenProvider with +// the smithy-go TokenCache, if the external configuration loaded configured +// for an SSO session. +// +// The initial SSO create token should be preformed with the AWS CLI before the +// Go application using the SSOTokenProvider will need to retrieve the SSO +// token. If the AWS CLI has not created the token cache file, this provider +// will return an error when attempting to retrieve the cached token. +// +// This provider will attempt to refresh the cached SSO token periodically if +// needed when RetrieveBearerToken is called. +// +// A utility such as the AWS CLI must be used to initially create the SSO +// session and cached token file. +// https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html +type SSOTokenProvider struct { + options SSOTokenProviderOptions +} + +var _ bearer.TokenProvider = (*SSOTokenProvider)(nil) + +// NewSSOTokenProvider returns an initialized SSOTokenProvider that will +// periodically refresh the SSO token cached stored in the cachedTokenFilepath. +// The cachedTokenFilepath file's content will be rewritten by the token +// provider when the token is refreshed. +// +// The client must be configured for the AWS region the SSO token was created for. +func NewSSOTokenProvider(client CreateTokenAPIClient, cachedTokenFilepath string, optFns ...func(o *SSOTokenProviderOptions)) *SSOTokenProvider { + options := SSOTokenProviderOptions{ + Client: client, + CachedTokenFilepath: cachedTokenFilepath, + } + for _, fn := range optFns { + fn(&options) + } + + provider := &SSOTokenProvider{ + options: options, + } + + return provider +} + +// RetrieveBearerToken returns the SSO token stored in the cachedTokenFilepath +// the SSOTokenProvider was created with. If the token has expired +// RetrieveBearerToken will attempt to refresh it. If the token cannot be +// refreshed or is not present an error will be returned. +// +// A utility such as the AWS CLI must be used to initially create the SSO +// session and cached token file. https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html +func (p SSOTokenProvider) RetrieveBearerToken(ctx context.Context) (bearer.Token, error) { + cachedToken, err := loadCachedToken(p.options.CachedTokenFilepath) + if err != nil { + return bearer.Token{}, err + } + + if cachedToken.ExpiresAt != nil && sdk.NowTime().After(time.Time(*cachedToken.ExpiresAt)) { + cachedToken, err = p.refreshToken(ctx, cachedToken) + if err != nil { + return bearer.Token{}, fmt.Errorf("refresh cached SSO token failed, %w", err) + } + } + + expiresAt := aws.ToTime((*time.Time)(cachedToken.ExpiresAt)) + return bearer.Token{ + Value: cachedToken.AccessToken, + CanExpire: !expiresAt.IsZero(), + Expires: expiresAt, + }, nil +} + +func (p SSOTokenProvider) refreshToken(ctx context.Context, cachedToken token) (token, error) { + if cachedToken.ClientSecret == "" || cachedToken.ClientID == "" || cachedToken.RefreshToken == "" { + return token{}, fmt.Errorf("cached SSO token is expired, or not present, and cannot be refreshed") + } + + createResult, err := p.options.Client.CreateToken(ctx, &ssooidc.CreateTokenInput{ + ClientId: &cachedToken.ClientID, + ClientSecret: &cachedToken.ClientSecret, + RefreshToken: &cachedToken.RefreshToken, + GrantType: aws.String("refresh_token"), + }, p.options.ClientOptions...) + if err != nil { + return token{}, fmt.Errorf("unable to refresh SSO token, %w", err) + } + + expiresAt := sdk.NowTime().Add(time.Duration(createResult.ExpiresIn) * time.Second) + + cachedToken.AccessToken = aws.ToString(createResult.AccessToken) + cachedToken.ExpiresAt = (*rfc3339)(&expiresAt) + cachedToken.RefreshToken = aws.ToString(createResult.RefreshToken) + + fileInfo, err := os.Stat(p.options.CachedTokenFilepath) + if err != nil { + return token{}, fmt.Errorf("failed to stat cached SSO token file %w", err) + } + + if err = storeCachedToken(p.options.CachedTokenFilepath, cachedToken, fileInfo.Mode()); err != nil { + return token{}, fmt.Errorf("unable to cache refreshed SSO token, %w", err) + } + + return cachedToken, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/assume_role_provider.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/assume_role_provider.go index 1ea13c77..289707b6 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/assume_role_provider.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/assume_role_provider.go @@ -8,60 +8,64 @@ // ensure synchronous usage of the AssumeRoleProvider if the value is shared // between multiple Credentials or service clients. // -// Assume Role +// # Assume Role // // To assume an IAM role using STS with the SDK you can create a new Credentials // with the SDKs's stscreds package. // -// // Initial credentials loaded from SDK's default credential chain. Such as -// // the environment, shared credentials (~/.aws/credentials), or EC2 Instance -// // Role. These credentials will be used to to make the STS Assume Role API. -// cfg, err := config.LoadDefaultConfig(context.TODO()) -// if err != nil { -// panic(err) -// } +// // Initial credentials loaded from SDK's default credential chain. Such as +// // the environment, shared credentials (~/.aws/credentials), or EC2 Instance +// // Role. These credentials will be used to to make the STS Assume Role API. +// cfg, err := config.LoadDefaultConfig(context.TODO()) +// if err != nil { +// panic(err) +// } // -// // Create the credentials from AssumeRoleProvider to assume the role -// // referenced by the "myRoleARN" ARN. -// stsSvc := sts.NewFromConfig(cfg) -// creds := stscreds.NewAssumeRoleProvider(stsSvc, "myRoleArn") +// // Create the credentials from AssumeRoleProvider to assume the role +// // referenced by the "myRoleARN" ARN. +// stsSvc := sts.NewFromConfig(cfg) +// creds := stscreds.NewAssumeRoleProvider(stsSvc, "myRoleArn") // -// cfg.Credentials = &aws.CredentialsCache{Provider: creds} +// cfg.Credentials = aws.NewCredentialsCache(creds) // -// // Create service client value configured for credentials -// // from assumed role. -// svc := s3.NewFromConfig(cfg) +// // Create service client value configured for credentials +// // from assumed role. +// svc := s3.NewFromConfig(cfg) // -// Assume Role with static MFA Token +// # Assume Role with custom MFA Token provider // -// To assume an IAM role with a MFA token you can either specify a MFA token code -// directly or provide a function to prompt the user each time the credentials -// need to refresh the role's credentials. Specifying the TokenCode should be used -// for short lived operations that will not need to be refreshed, and when you do -// not want to have direct control over the user provides their MFA token. +// To assume an IAM role with a MFA token you can either specify a custom MFA +// token provider or use the SDK's built in StdinTokenProvider that will prompt +// the user for a token code each time the credentials need to to be refreshed. +// Specifying a custom token provider allows you to control where the token +// code is retrieved from, and how it is refreshed. // -// With TokenCode the AssumeRoleProvider will be not be able to refresh the role's -// credentials. +// With a custom token provider, the provider is responsible for refreshing the +// token code when called. // -// cfg, err := config.LoadDefaultConfig(context.TODO()) -// if err != nil { -// panic(err) -// } +// cfg, err := config.LoadDefaultConfig(context.TODO()) +// if err != nil { +// panic(err) +// } // -// // Create the credentials from AssumeRoleProvider to assume the role -// // referenced by the "myRoleARN" ARN using the MFA token code provided. -// creds := stscreds.NewAssumeRoleProvider(sts.NewFromConfig(cfg), "myRoleArn", func(o *stscreds.AssumeRoleOptions) { -// o.SerialNumber = aws.String("myTokenSerialNumber") -// o.TokenCode = aws.String("00000000") -// }) +// staticTokenProvider := func() (string, error) { +// return someTokenCode, nil +// } // -// cfg.Credentials = &aws.CredentialsCache{Provider: creds} +// // Create the credentials from AssumeRoleProvider to assume the role +// // referenced by the "myRoleARN" ARN using the MFA token code provided. +// creds := stscreds.NewAssumeRoleProvider(sts.NewFromConfig(cfg), "myRoleArn", func(o *stscreds.AssumeRoleOptions) { +// o.SerialNumber = aws.String("myTokenSerialNumber") +// o.TokenProvider = staticTokenProvider +// }) // -// // Create service client value configured for credentials -// // from assumed role. -// svc := s3.NewFromConfig(cfg) +// cfg.Credentials = aws.NewCredentialsCache(creds) // -// Assume Role with MFA Token Provider +// // Create service client value configured for credentials +// // from assumed role. +// svc := s3.NewFromConfig(cfg) +// +// # Assume Role with MFA Token Provider // // To assume an IAM role with MFA for longer running tasks where the credentials // may need to be refreshed setting the TokenProvider field of AssumeRoleProvider @@ -76,23 +80,23 @@ // have undesirable results as the StdinTokenProvider will not be synchronized. A // single Credentials with an AssumeRoleProvider can be shared safely. // -// cfg, err := config.LoadDefaultConfig(context.TODO()) -// if err != nil { -// panic(err) -// } +// cfg, err := config.LoadDefaultConfig(context.TODO()) +// if err != nil { +// panic(err) +// } // -// // Create the credentials from AssumeRoleProvider to assume the role -// // referenced by the "myRoleARN" ARN using the MFA token code provided. -// creds := stscreds.NewAssumeRoleProvider(sts.NewFromConfig(cfg), "myRoleArn", func(o *stscreds.AssumeRoleOptions) { -// o.SerialNumber = aws.String("myTokenSerialNumber") -// o.TokenProvider = stscreds.StdinTokenProvider -// }) +// // Create the credentials from AssumeRoleProvider to assume the role +// // referenced by the "myRoleARN" ARN using the MFA token code provided. +// creds := stscreds.NewAssumeRoleProvider(sts.NewFromConfig(cfg), "myRoleArn", func(o *stscreds.AssumeRoleOptions) { +// o.SerialNumber = aws.String("myTokenSerialNumber") +// o.TokenProvider = stscreds.StdinTokenProvider +// }) // -// cfg.Credentials = &aws.CredentialsCache{Provider: creds} +// cfg.Credentials = aws.NewCredentialsCache(creds) // -// // Create service client value configured for credentials -// // from assumed role. -// svc := s3.NewFromConfig(cfg) +// // Create service client value configured for credentials +// // from assumed role. +// svc := s3.NewFromConfig(cfg) package stscreds import ( @@ -132,8 +136,13 @@ type AssumeRoleAPIClient interface { AssumeRole(ctx context.Context, params *sts.AssumeRoleInput, optFns ...func(*sts.Options)) (*sts.AssumeRoleOutput, error) } -// DefaultDuration is the default amount of time in minutes that the credentials -// will be valid for. +// DefaultDuration is the default amount of time in minutes that the +// credentials will be valid for. This value is only used by AssumeRoleProvider +// for specifying the default expiry duration of an assume role. +// +// Other providers such as WebIdentityRoleProvider do not use this value, and +// instead rely on STS API's default parameter handing to assign a default +// value. var DefaultDuration = time.Duration(15) * time.Minute // AssumeRoleProvider retrieves temporary credentials from the STS service, and @@ -204,17 +213,40 @@ type AssumeRoleOptions struct { // or an Amazon Resource Name (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user). SerialNumber *string + // The source identity specified by the principal that is calling the AssumeRole + // operation. You can require users to specify a source identity when they assume a + // role. You do this by using the sts:SourceIdentity condition key in a role trust + // policy. You can use source identity information in CloudTrail logs to determine + // who took actions with a role. You can use the aws:SourceIdentity condition key + // to further control access to Amazon Web Services resources based on the value of + // source identity. For more information about using source identity, see Monitor + // and control actions taken with assumed roles + // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html) + // in the IAM User Guide. + SourceIdentity *string + // Async method of providing MFA token code for assuming an IAM role with MFA. // The value returned by the function will be used as the TokenCode in the Retrieve // call. See StdinTokenProvider for a provider that prompts and reads from stdin. // // This token provider will be called when ever the assumed role's - // credentials need to be refreshed when SerialNumber is also set and - // TokenCode is not set. - // - // If both TokenCode and TokenProvider is set, TokenProvider will be used and - // TokenCode is ignored. + // credentials need to be refreshed when SerialNumber is set. TokenProvider func() (string, error) + + // A list of session tags that you want to pass. Each session tag consists of a key + // name and an associated value. For more information about session tags, see + // Tagging STS Sessions + // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) in the + // IAM User Guide. This parameter is optional. You can pass up to 50 session tags. + Tags []types.Tag + + // A list of keys for session tags that you want to set as transitive. If you set a + // tag key as transitive, the corresponding key and value passes to subsequent + // sessions in a role chain. For more information, see Chaining Roles with Session + // Tags + // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) + // in the IAM User Guide. This parameter is optional. + TransitiveTagKeys []string } // NewAssumeRoleProvider constructs and returns a credentials provider that @@ -246,11 +278,14 @@ func (p *AssumeRoleProvider) Retrieve(ctx context.Context) (aws.Credentials, err p.options.Duration = DefaultDuration } input := &sts.AssumeRoleInput{ - DurationSeconds: aws.Int32(int32(p.options.Duration / time.Second)), - PolicyArns: p.options.PolicyARNs, - RoleArn: aws.String(p.options.RoleARN), - RoleSessionName: aws.String(p.options.RoleSessionName), - ExternalId: p.options.ExternalID, + DurationSeconds: aws.Int32(int32(p.options.Duration / time.Second)), + PolicyArns: p.options.PolicyARNs, + RoleArn: aws.String(p.options.RoleARN), + RoleSessionName: aws.String(p.options.RoleSessionName), + ExternalId: p.options.ExternalID, + SourceIdentity: p.options.SourceIdentity, + Tags: p.options.Tags, + TransitiveTagKeys: p.options.TransitiveTagKeys, } if p.options.Policy != nil { input.Policy = p.options.Policy @@ -264,7 +299,7 @@ func (p *AssumeRoleProvider) Retrieve(ctx context.Context) (aws.Credentials, err } input.TokenCode = aws.String(code) } else { - return aws.Credentials{}, fmt.Errorf("assume role with MFA enabled, but neither TokenCode nor TokenProvider are set") + return aws.Credentials{}, fmt.Errorf("assume role with MFA enabled, but TokenProvider is not set") } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/web_identity_provider.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/web_identity_provider.go index 7854a322..ddaf6df6 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/web_identity_provider.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/web_identity_provider.go @@ -5,6 +5,7 @@ import ( "fmt" "io/ioutil" "strconv" + "time" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/retry" @@ -45,6 +46,19 @@ type WebIdentityRoleOptions struct { // Session name, if you wish to uniquely identify this session. RoleSessionName string + // Expiry duration of the STS credentials. STS will assign a default expiry + // duration if this value is unset. This is different from the Duration + // option of AssumeRoleProvider, which automatically assigns 15 minutes if + // Duration is unset. + // + // See the STS AssumeRoleWithWebIdentity API reference guide for more + // information on defaults. + // https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html + Duration time.Duration + + // An IAM policy in JSON format that you want to use as an inline session policy. + Policy *string + // The Amazon Resource Names (ARNs) of the IAM managed policies that you // want to use as managed session policies. The policies must exist in the // same account as the role. @@ -100,12 +114,21 @@ func (p *WebIdentityRoleProvider) Retrieve(ctx context.Context) (aws.Credentials // uses unix time in nanoseconds to uniquely identify sessions. sessionName = strconv.FormatInt(sdk.NowTime().UnixNano(), 10) } - resp, err := p.options.Client.AssumeRoleWithWebIdentity(ctx, &sts.AssumeRoleWithWebIdentityInput{ + input := &sts.AssumeRoleWithWebIdentityInput{ PolicyArns: p.options.PolicyARNs, RoleArn: &p.options.RoleARN, RoleSessionName: &sessionName, WebIdentityToken: aws.String(string(b)), - }, func(options *sts.Options) { + } + if p.options.Duration != 0 { + // If set use the value, otherwise STS will assign a default expiration duration. + input.DurationSeconds = aws.Int32(int32(p.options.Duration / time.Second)) + } + if p.options.Policy != nil { + input.Policy = p.options.Policy + } + + resp, err := p.options.Client.AssumeRoleWithWebIdentity(ctx, input, func(options *sts.Options) { options.Retryer = retry.AddWithErrorCodes(options.Retryer, invalidIdentityTokenExceptionCode) }) if err != nil { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md new file mode 100644 index 00000000..40c317a9 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md @@ -0,0 +1,285 @@ +# v1.14.11 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.10 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.9 (2023-12-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.8 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.7 (2023-11-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.6 (2023-11-28.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.5 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.4 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# 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 + +# v1.13.12 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.11 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.10 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.9 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.8 (2023-08-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.7 (2023-07-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.6 (2023-07-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.5 (2023-07-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.4 (2023-06-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.3 (2023-04-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.2 (2023-04-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.1 (2023-03-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.0 (2023-03-14) + +* **Feature**: Add flag to disable IMDSv1 fallback + +# v1.12.24 (2023-03-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.23 (2023-02-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.22 (2023-02-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.21 (2022-12-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.20 (2022-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.19 (2022-10-24) + +* **Bug Fix**: Fixes an issue that prevented logging of the API request or responses when the respective log modes were enabled. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.18 (2022-10-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.17 (2022-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.16 (2022-09-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.15 (2022-09-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.14 (2022-08-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.13 (2022-08-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.12 (2022-08-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.11 (2022-08-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.10 (2022-08-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.9 (2022-08-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.8 (2022-07-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.7 (2022-06-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.6 (2022-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.5 (2022-05-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.4 (2022-04-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.3 (2022-03-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.2 (2022-03-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.1 (2022-03-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.0 (2022-03-08) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.0 (2022-02-24) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.0 (2022-01-14) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.0 (2022-01-07) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.2 (2021-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.1 (2021-11-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.0 (2021-11-06) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.7.0 (2021-10-21) + +* **Feature**: Updated to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.0 (2021-10-11) + +* **Feature**: Respect passed in Context Deadline/Timeout. Updates the IMDS Client operations to not override the passed in Context's Deadline or Timeout options. If an Client operation is called with a Context with a Deadline or Timeout, the client will no longer override it with the client's default timeout. +* **Bug Fix**: Fix IMDS client's response handling and operation timeout race. Fixes #1253 +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.1 (2021-09-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.0 (2021-08-27) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.1 (2021-08-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.0 (2021-08-04) + +* **Feature**: adds error handling for defered close calls +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.0 (2021-07-15) + +* **Feature**: Support has been added for EC2 IPv6-enabled Instance Metadata Service Endpoints. +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.0 (2021-06-25) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.1 (2021-05-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.0 (2021-05-14) + +* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. +* **Dependency Update**: Updated to the latest SDK module versions + diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_client.go index 998668d2..46e144d9 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_client.go @@ -12,6 +12,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/retry" awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalconfig "github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config" "github.com/aws/smithy-go" "github.com/aws/smithy-go/logging" "github.com/aws/smithy-go/middleware" @@ -29,21 +30,34 @@ type Client struct { // ClientEnableState provides an enumeration if the client is enabled, // disabled, or default behavior. -type ClientEnableState uint +type ClientEnableState = internalconfig.ClientEnableState // Enumeration values for ClientEnableState const ( - ClientDefaultEnableState ClientEnableState = iota // default behavior - ClientDisabled // client disabled - ClientEnabled // client enabled + ClientDefaultEnableState ClientEnableState = internalconfig.ClientDefaultEnableState // default behavior + ClientDisabled ClientEnableState = internalconfig.ClientDisabled // client disabled + ClientEnabled ClientEnableState = internalconfig.ClientEnabled // client enabled +) + +// EndpointModeState is an enum configuration variable describing the client endpoint mode. +// Not configurable directly, but used when using the NewFromConfig. +type EndpointModeState = internalconfig.EndpointModeState + +// Enumeration values for EndpointModeState +const ( + EndpointModeStateUnset EndpointModeState = internalconfig.EndpointModeStateUnset + EndpointModeStateIPv4 EndpointModeState = internalconfig.EndpointModeStateIPv4 + EndpointModeStateIPv6 EndpointModeState = internalconfig.EndpointModeStateIPv6 ) const ( disableClientEnvVar = "AWS_EC2_METADATA_DISABLED" // Client endpoint options - endpointEnvVar = "AWS_EC2_METADATA_SERVICE_ENDPOINT" - defaultEndpoint = "http://169.254.169.254" + endpointEnvVar = "AWS_EC2_METADATA_SERVICE_ENDPOINT" + + defaultIPv4Endpoint = "http://169.254.169.254" + defaultIPv6Endpoint = "http://[fd00:ec2::254]" ) // New returns an initialized Client based on the functional options. Provide @@ -72,8 +86,6 @@ func New(options Options, optFns ...func(*Options)) *Client { if len(options.Endpoint) == 0 { if v := os.Getenv(endpointEnvVar); len(v) != 0 { options.Endpoint = v - } else { - options.Endpoint = defaultEndpoint } } @@ -94,14 +106,21 @@ func New(options Options, optFns ...func(*Options)) *Client { // or adding custom middleware behavior. func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ - APIOptions: append([]func(*middleware.Stack) error{}, cfg.APIOptions...), - HTTPClient: cfg.HTTPClient, + APIOptions: append([]func(*middleware.Stack) error{}, cfg.APIOptions...), + HTTPClient: cfg.HTTPClient, + ClientLogMode: cfg.ClientLogMode, + Logger: cfg.Logger, } if cfg.Retryer != nil { opts.Retryer = cfg.Retryer() } + resolveClientEnableState(cfg, &opts) + resolveEndpointConfig(cfg, &opts) + resolveEndpointModeConfig(cfg, &opts) + resolveEnableFallback(cfg, &opts) + return New(opts, optFns...) } @@ -113,7 +132,8 @@ type Options struct { APIOptions []func(*middleware.Stack) error // The endpoint the client will use to retrieve EC2 instance metadata. - + // + // Specifies the EC2 Instance Metadata Service endpoint to use. If specified it overrides EndpointMode. // // If unset, and the environment variable AWS_EC2_METADATA_SERVICE_ENDPOINT // has a value the client will use the value of the environment variable as @@ -122,6 +142,14 @@ type Options struct { // AWS_EC2_METADATA_SERVICE_ENDPOINT=http://[::1] Endpoint string + // The endpoint selection mode the client will use if no explicit endpoint is provided using the Endpoint field. + // + // Setting EndpointMode to EndpointModeStateIPv4 will configure the client to use the default EC2 IPv4 endpoint. + // Setting EndpointMode to EndpointModeStateIPv6 will configure the client to use the default EC2 IPv6 endpoint. + // + // By default if EndpointMode is not set (EndpointModeStateUnset) than the default endpoint selection mode EndpointModeStateIPv4. + EndpointMode EndpointModeState + // The HTTP client to invoke API calls with. Defaults to client's default // HTTP implementation if nil. HTTPClient HTTPClient @@ -147,6 +175,16 @@ type Options struct { // The logger writer interface to write logging messages to. Logger logging.Logger + // Configure IMDSv1 fallback behavior. By default, the client will attempt + // to fall back to IMDSv1 as needed for backwards compatibility. When set to [aws.FalseTernary] + // the client will return any errors encountered from attempting to fetch a token + // instead of silently using the insecure data flow of IMDSv1. + // + // See [configuring IMDS] for more information. + // + // [configuring IMDS]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html + EnableFallback aws.Ternary + // provides the caching of API tokens used for operation calls. If unset, // the API token will not be retrieved for the operation. tokenProvider *tokenProvider @@ -255,3 +293,56 @@ func resolveHTTPClient(client HTTPClient) HTTPClient { return client } + +func resolveClientEnableState(cfg aws.Config, options *Options) error { + if options.ClientEnableState != ClientDefaultEnableState { + return nil + } + value, found, err := internalconfig.ResolveClientEnableState(cfg.ConfigSources) + if err != nil || !found { + return err + } + options.ClientEnableState = value + return nil +} + +func resolveEndpointModeConfig(cfg aws.Config, options *Options) error { + if options.EndpointMode != EndpointModeStateUnset { + return nil + } + value, found, err := internalconfig.ResolveEndpointModeConfig(cfg.ConfigSources) + if err != nil || !found { + return err + } + options.EndpointMode = value + return nil +} + +func resolveEndpointConfig(cfg aws.Config, options *Options) error { + if len(options.Endpoint) != 0 { + return nil + } + value, found, err := internalconfig.ResolveEndpointConfig(cfg.ConfigSources) + if err != nil || !found { + return err + } + 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/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetDynamicData.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetDynamicData.go index 9e3bdb0e..af58b6bb 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetDynamicData.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetDynamicData.go @@ -56,6 +56,7 @@ type GetDynamicDataOutput struct { func addGetDynamicDataMiddleware(stack *middleware.Stack, options Options) error { return addAPIRequestMiddleware(stack, options, + "GetDynamicData", buildGetDynamicDataPath, buildGetDynamicDataOutput) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetIAMInfo.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetIAMInfo.go index 62a466e9..5111cc90 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetIAMInfo.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetIAMInfo.go @@ -53,6 +53,7 @@ type GetIAMInfoOutput struct { func addGetIAMInfoMiddleware(stack *middleware.Stack, options Options) error { return addAPIRequestMiddleware(stack, options, + "GetIAMInfo", buildGetIAMInfoPath, buildGetIAMInfoOutput, ) @@ -62,15 +63,22 @@ func buildGetIAMInfoPath(params interface{}) (string, error) { return getIAMInfoPath, nil } -func buildGetIAMInfoOutput(resp *smithyhttp.Response) (interface{}, error) { - defer resp.Body.Close() +func buildGetIAMInfoOutput(resp *smithyhttp.Response) (v interface{}, err error) { + defer func() { + closeErr := resp.Body.Close() + if err == nil { + err = closeErr + } else if closeErr != nil { + err = fmt.Errorf("response body close error: %v, original error: %w", closeErr, err) + } + }() var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(resp.Body, ringBuffer) imdsResult := &GetIAMInfoOutput{} - if err := json.NewDecoder(body).Decode(&imdsResult.IAMInfo); err != nil { + if err = json.NewDecoder(body).Decode(&imdsResult.IAMInfo); err != nil { return nil, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode instance identity document, %w", err), Snapshot: ringBuffer.Bytes(), diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetInstanceIdentityDocument.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetInstanceIdentityDocument.go index 9a8dc836..dc8c09ed 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetInstanceIdentityDocument.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetInstanceIdentityDocument.go @@ -54,6 +54,7 @@ type GetInstanceIdentityDocumentOutput struct { func addGetInstanceIdentityDocumentMiddleware(stack *middleware.Stack, options Options) error { return addAPIRequestMiddleware(stack, options, + "GetInstanceIdentityDocument", buildGetInstanceIdentityDocumentPath, buildGetInstanceIdentityDocumentOutput, ) @@ -63,15 +64,22 @@ func buildGetInstanceIdentityDocumentPath(params interface{}) (string, error) { return getInstanceIdentityDocumentPath, nil } -func buildGetInstanceIdentityDocumentOutput(resp *smithyhttp.Response) (interface{}, error) { - defer resp.Body.Close() +func buildGetInstanceIdentityDocumentOutput(resp *smithyhttp.Response) (v interface{}, err error) { + defer func() { + closeErr := resp.Body.Close() + if err == nil { + err = closeErr + } else if closeErr != nil { + err = fmt.Errorf("response body close error: %v, original error: %w", closeErr, err) + } + }() var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(resp.Body, ringBuffer) output := &GetInstanceIdentityDocumentOutput{} - if err := json.NewDecoder(body).Decode(&output.InstanceIdentityDocument); err != nil { + if err = json.NewDecoder(body).Decode(&output.InstanceIdentityDocument); err != nil { return nil, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode instance identity document, %w", err), Snapshot: ringBuffer.Bytes(), diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetMetadata.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetMetadata.go index cb0ce4c0..869bfc9f 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetMetadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetMetadata.go @@ -56,6 +56,7 @@ type GetMetadataOutput struct { func addGetMetadataMiddleware(stack *middleware.Stack, options Options) error { return addAPIRequestMiddleware(stack, options, + "GetMetadata", buildGetMetadataPath, buildGetMetadataOutput) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetRegion.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetRegion.go index 7b9b4891..8c0572bb 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetRegion.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetRegion.go @@ -45,6 +45,7 @@ type GetRegionOutput struct { func addGetRegionMiddleware(stack *middleware.Stack, options Options) error { return addAPIRequestMiddleware(stack, options, + "GetRegion", buildGetInstanceIdentityDocumentPath, buildGetRegionOutput, ) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetToken.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetToken.go index 2f58b9cf..1f9ee97a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetToken.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetToken.go @@ -49,6 +49,7 @@ func addGetTokenMiddleware(stack *middleware.Stack, options Options) error { err := addRequestMiddleware(stack, options, "PUT", + "GetToken", buildGetTokenPath, buildGetTokenOutput) if err != nil { @@ -67,8 +68,15 @@ func buildGetTokenPath(interface{}) (string, error) { return getTokenPath, nil } -func buildGetTokenOutput(resp *smithyhttp.Response) (interface{}, error) { - defer resp.Body.Close() +func buildGetTokenOutput(resp *smithyhttp.Response) (v interface{}, err error) { + defer func() { + closeErr := resp.Body.Close() + if err == nil { + err = closeErr + } else if closeErr != nil { + err = fmt.Errorf("response body close error: %v, original error: %w", closeErr, err) + } + }() ttlHeader := resp.Header.Get(tokenTTLHeader) tokenTTL, err := strconv.ParseInt(ttlHeader, 10, 64) @@ -77,7 +85,7 @@ func buildGetTokenOutput(resp *smithyhttp.Response) (interface{}, error) { } var token strings.Builder - if _, err := io.Copy(&token, resp.Body); err != nil { + if _, err = io.Copy(&token, resp.Body); err != nil { return nil, fmt.Errorf("unable to read API token, %w", err) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetUserData.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetUserData.go index 88aa61e9..89036972 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetUserData.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetUserData.go @@ -45,6 +45,7 @@ type GetUserDataOutput struct { func addGetUserDataMiddleware(stack *middleware.Stack, options Options) error { return addAPIRequestMiddleware(stack, options, + "GetUserData", buildGetUserDataPath, buildGetUserDataOutput) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/auth.go new file mode 100644 index 00000000..ad283cf8 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/auth.go @@ -0,0 +1,48 @@ +package imds + +import ( + "context" + "github.com/aws/smithy-go/middleware" +) + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + return next.HandleFinalize(ctx, in) +} + +type signRequestMiddleware struct { +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + return next.HandleFinalize(ctx, in) +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/doc.go index 9ae60829..bacdb5d2 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/doc.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/doc.go @@ -1,6 +1,11 @@ // Package imds provides the API client for interacting with the Amazon EC2 // Instance Metadata Service. // +// All Client operation calls have a default timeout. If the operation is not +// completed before this timeout expires, the operation will be canceled. This +// timeout can be overridden by providing Context with a timeout or deadline +// with calling the client's operations. +// // See the EC2 IMDS user guide for more information on using the API. // https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html package imds diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/endpoints.go new file mode 100644 index 00000000..d7540da3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/endpoints.go @@ -0,0 +1,20 @@ +package imds + +import ( + "context" + "github.com/aws/smithy-go/middleware" +) + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go new file mode 100644 index 00000000..0d747b21 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package imds + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "1.14.11" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config/resolvers.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config/resolvers.go new file mode 100644 index 00000000..ce774558 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config/resolvers.go @@ -0,0 +1,114 @@ +package config + +import ( + "fmt" + "strings" +) + +// ClientEnableState provides an enumeration if the client is enabled, +// disabled, or default behavior. +type ClientEnableState uint + +// Enumeration values for ClientEnableState +const ( + ClientDefaultEnableState ClientEnableState = iota + ClientDisabled + ClientEnabled +) + +// EndpointModeState is the EC2 IMDS Endpoint Configuration Mode +type EndpointModeState uint + +// Enumeration values for ClientEnableState +const ( + EndpointModeStateUnset EndpointModeState = iota + EndpointModeStateIPv4 + EndpointModeStateIPv6 +) + +// SetFromString sets the EndpointModeState based on the provided string value. Unknown values will default to EndpointModeStateUnset +func (e *EndpointModeState) SetFromString(v string) error { + v = strings.TrimSpace(v) + + switch { + case len(v) == 0: + *e = EndpointModeStateUnset + case strings.EqualFold(v, "IPv6"): + *e = EndpointModeStateIPv6 + case strings.EqualFold(v, "IPv4"): + *e = EndpointModeStateIPv4 + default: + return fmt.Errorf("unknown EC2 IMDS endpoint mode, must be either IPv6 or IPv4") + } + return nil +} + +// ClientEnableStateResolver is a config resolver interface for retrieving whether the IMDS client is disabled. +type ClientEnableStateResolver interface { + GetEC2IMDSClientEnableState() (ClientEnableState, bool, error) +} + +// EndpointModeResolver is a config resolver interface for retrieving the EndpointModeState configuration. +type EndpointModeResolver interface { + GetEC2IMDSEndpointMode() (EndpointModeState, bool, error) +} + +// EndpointResolver is a config resolver interface for retrieving the endpoint. +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 { + if resolver, ok := source.(ClientEnableStateResolver); ok { + value, found, err = resolver.GetEC2IMDSClientEnableState() + if err != nil || found { + return value, found, err + } + } + } + return value, found, err +} + +// ResolveEndpointModeConfig resolves the EndpointModeState from a list of configuration sources. +func ResolveEndpointModeConfig(sources []interface{}) (value EndpointModeState, found bool, err error) { + for _, source := range sources { + if resolver, ok := source.(EndpointModeResolver); ok { + value, found, err = resolver.GetEC2IMDSEndpointMode() + if err != nil || found { + return value, found, err + } + } + } + return value, found, err +} + +// ResolveEndpointConfig resolves the endpoint from a list of configuration sources. +func ResolveEndpointConfig(sources []interface{}) (value string, found bool, err error) { + for _, source := range sources { + if resolver, ok := source.(EndpointResolver); ok { + value, found, err = resolver.GetEC2IMDSEndpoint() + if err != nil || found { + return value, found, 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/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/request_middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/request_middleware.go index 48a6bdb5..fc948c27 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/request_middleware.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/request_middleware.go @@ -1,8 +1,10 @@ package imds import ( + "bytes" "context" "fmt" + "io/ioutil" "net/url" "path" "time" @@ -15,10 +17,11 @@ import ( func addAPIRequestMiddleware(stack *middleware.Stack, options Options, + operation string, getPath func(interface{}) (string, error), getOutput func(*smithyhttp.Response) (interface{}, error), ) (err error) { - err = addRequestMiddleware(stack, options, "GET", getPath, getOutput) + err = addRequestMiddleware(stack, options, "GET", operation, getPath, getOutput) if err != nil { return err } @@ -42,6 +45,7 @@ func addAPIRequestMiddleware(stack *middleware.Stack, func addRequestMiddleware(stack *middleware.Stack, options Options, method string, + operation string, getPath func(interface{}) (string, error), getOutput func(*smithyhttp.Response) (interface{}, error), ) (err error) { @@ -52,7 +56,7 @@ func addRequestMiddleware(stack *middleware.Stack, // Operation timeout err = stack.Initialize.Add(&operationTimeout{ - Timeout: defaultOperationTimeout, + DefaultTimeout: defaultOperationTimeout, }, middleware.Before) if err != nil { return err @@ -69,7 +73,8 @@ func addRequestMiddleware(stack *middleware.Stack, // Operation endpoint resolver err = stack.Serialize.Insert(&resolveEndpoint{ - Endpoint: options.Endpoint, + Endpoint: options.Endpoint, + EndpointMode: options.EndpointMode, }, "OperationSerializer", middleware.Before) if err != nil { return err @@ -83,6 +88,25 @@ func addRequestMiddleware(stack *middleware.Stack, return err } + err = stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: options.ClientLogMode.IsRequest(), + LogRequestWithBody: options.ClientLogMode.IsRequestWithBody(), + LogResponse: options.ClientLogMode.IsResponse(), + LogResponseWithBody: options.ClientLogMode.IsResponseWithBody(), + }, middleware.After) + if err != nil { + return err + } + + err = addSetLoggerMiddleware(stack, options) + if err != nil { + return err + } + + if err := addProtocolFinalizerMiddlewares(stack, options, operation); err != nil { + return fmt.Errorf("add protocol finalizers: %w", err) + } + // Retry support return retry.AddRetryMiddlewares(stack, retry.AddRetryMiddlewaresOptions{ Retryer: options.Retryer, @@ -90,6 +114,10 @@ func addRequestMiddleware(stack *middleware.Stack, }) } +func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { + return middleware.AddSetLoggerMiddleware(stack, o.Logger) +} + type serializeRequest struct { GetPath func(interface{}) (string, error) Method string @@ -141,12 +169,20 @@ func (m *deserializeResponse) HandleDeserialize( resp, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, fmt.Errorf( - "unexpected transport response type, %T", out.RawResponse) + "unexpected transport response type, %T, want %T", out.RawResponse, resp) + } + defer resp.Body.Close() + + // read the full body so that any operation timeouts cleanup will not race + // the body being read. + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + return out, metadata, fmt.Errorf("read response body failed, %w", err) } + resp.Body = ioutil.NopCloser(bytes.NewReader(body)) - // Anything thats not 200 |< 300 is error + // Anything that's not 200 |< 300 is error if resp.StatusCode < 200 || resp.StatusCode >= 300 { - resp.Body.Close() return out, metadata, &smithyhttp.ResponseError{ Response: resp, Err: fmt.Errorf("request to EC2 IMDS failed"), @@ -165,7 +201,8 @@ func (m *deserializeResponse) HandleDeserialize( } type resolveEndpoint struct { - Endpoint string + Endpoint string + EndpointMode EndpointModeState } func (*resolveEndpoint) ID() string { @@ -183,7 +220,23 @@ func (m *resolveEndpoint) HandleSerialize( return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - req.URL, err = url.Parse(m.Endpoint) + var endpoint string + if len(m.Endpoint) > 0 { + endpoint = m.Endpoint + } else { + switch m.EndpointMode { + case EndpointModeStateIPv6: + endpoint = defaultIPv6Endpoint + case EndpointModeStateIPv4: + fallthrough + case EndpointModeStateUnset: + endpoint = defaultIPv4Endpoint + default: + return out, metadata, fmt.Errorf("unsupported IMDS endpoint mode") + } + } + + req.URL, err = url.Parse(endpoint) if err != nil { return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) } @@ -195,8 +248,19 @@ const ( defaultOperationTimeout = 5 * time.Second ) +// operationTimeout adds a timeout on the middleware stack if the Context the +// stack was called with does not have a deadline. The next middleware must +// complete before the timeout, or the context will be canceled. +// +// If DefaultTimeout is zero, no default timeout will be used if the Context +// does not have a timeout. +// +// The next middleware must also ensure that any resources that are also +// canceled by the stack's context are completely consumed before returning. +// Otherwise the timeout cleanup will race the resource being consumed +// upstream. type operationTimeout struct { - Timeout time.Duration + DefaultTimeout time.Duration } func (*operationTimeout) ID() string { return "OperationTimeout" } @@ -206,10 +270,11 @@ func (m *operationTimeout) HandleInitialize( ) ( output middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { - var cancelFn func() - - ctx, cancelFn = context.WithTimeout(ctx, m.Timeout) - defer cancelFn() + if _, ok := ctx.Deadline(); !ok && m.DefaultTimeout != 0 { + var cancelFn func() + ctx, cancelFn = context.WithTimeout(ctx, m.DefaultTimeout) + defer cancelFn() + } return next.HandleInitialize(ctx, input) } @@ -224,3 +289,19 @@ func appendURIPath(base, add string) string { } return reqPath } + +func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %w", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %w", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %w", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{}, "ResolveEndpointV2", middleware.After); err != nil { + return fmt.Errorf("add Signing: %w", err) + } + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/token_provider.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/token_provider.go index 275fade4..5703c6e1 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/token_provider.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/token_provider.go @@ -4,12 +4,14 @@ import ( "context" "errors" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/smithy-go" + "github.com/aws/smithy-go/logging" "net/http" "sync" "sync/atomic" "time" - smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -68,7 +70,7 @@ func (t *tokenProvider) HandleFinalize( ) ( out middleware.FinalizeOutput, metadata middleware.Metadata, err error, ) { - if !t.enabled() { + if t.fallbackEnabled() && !t.enabled() { // short-circuits to insecure data flow if token provider is disabled. return next.HandleFinalize(ctx, input) } @@ -115,23 +117,15 @@ func (t *tokenProvider) HandleDeserialize( } if resp.StatusCode == http.StatusUnauthorized { // unauthorized - err = &retryableError{Err: err} t.enable() + err = &retryableError{Err: err, isRetryable: true} } return out, metadata, err } -type retryableError struct { - Err error -} - -func (*retryableError) RetryableError() bool { return true } - -func (e *retryableError) Error() string { return e.Err.Error() } - func (t *tokenProvider) getToken(ctx context.Context) (tok *apiToken, err error) { - if !t.enabled() { + if t.fallbackEnabled() && !t.enabled() { return nil, &bypassTokenRetrievalError{ Err: fmt.Errorf("cannot get API token, provider disabled"), } @@ -147,7 +141,7 @@ func (t *tokenProvider) getToken(ctx context.Context) (tok *apiToken, err error) tok, err = t.updateToken(ctx) if err != nil { - return nil, fmt.Errorf("cannot get API token, %w", err) + return nil, err } return tok, nil @@ -167,17 +161,19 @@ func (t *tokenProvider) updateToken(ctx context.Context) (*apiToken, error) { TokenTTL: t.tokenTTL, }) if err != nil { - // change the disabled flag on token provider to true, when error is request timeout error. var statusErr interface{ HTTPStatusCode() int } if errors.As(err, &statusErr) { switch statusErr.HTTPStatusCode() { - - // Disable get token if failed because of 403, 404, or 405 + // Disable future get token if failed because of 403, 404, or 405 case http.StatusForbidden, http.StatusNotFound, http.StatusMethodNotAllowed: - t.disable() + if t.fallbackEnabled() { + logger := middleware.GetLogger(ctx) + logger.Logf(logging.Warn, "falling back to IMDSv1: %v", err) + t.disable() + } // 400 errors are terminal, and need to be upstreamed case http.StatusBadRequest: @@ -192,8 +188,17 @@ func (t *tokenProvider) updateToken(ctx context.Context) (*apiToken, error) { atomic.StoreUint32(&t.disabled, 1) } - // Token couldn't be retrieved, but bypass this, and allow the - // request to continue. + if !t.fallbackEnabled() { + // NOTE: getToken() is an implementation detail of some outer operation + // (e.g. GetMetadata). It has its own retries that have already been exhausted. + // Mark the underlying error as a terminal error. + err = &retryableError{Err: err, isRetryable: false} + return nil, err + } + + // Token couldn't be retrieved, fallback to IMDSv1 insecure flow for this request + // and allow the request to proceed. Future requests _may_ re-attempt fetching a + // token if not disabled. return nil, &bypassTokenRetrievalError{Err: err} } @@ -206,21 +211,21 @@ func (t *tokenProvider) updateToken(ctx context.Context) (*apiToken, error) { return tok, nil } -type bypassTokenRetrievalError struct { - Err error -} - -func (e *bypassTokenRetrievalError) Error() string { - return fmt.Sprintf("bypass token retrieval, %v", e.Err) -} - -func (e *bypassTokenRetrievalError) Unwrap() error { return e.Err } - // enabled returns if the token provider is current enabled or not. func (t *tokenProvider) enabled() bool { return atomic.LoadUint32(&t.disabled) == 0 } +// fallbackEnabled returns false if EnableFallback is [aws.FalseTernary], true otherwise +func (t *tokenProvider) fallbackEnabled() bool { + switch t.client.options.EnableFallback { + case aws.FalseTernary: + return false + default: + return true + } +} + // disable disables the token provider and it will no longer attempt to inject // the token, nor request updates. func (t *tokenProvider) disable() { @@ -235,3 +240,22 @@ func (t *tokenProvider) enable() { t.tokenMux.Unlock() atomic.StoreUint32(&t.disabled, 0) } + +type bypassTokenRetrievalError struct { + Err error +} + +func (e *bypassTokenRetrievalError) Error() string { + return fmt.Sprintf("bypass token retrieval, %v", e.Err) +} + +func (e *bypassTokenRetrievalError) Unwrap() error { return e.Err } + +type retryableError struct { + Err error + isRetryable bool +} + +func (e *retryableError) RetryableError() bool { return e.isRetryable } + +func (e *retryableError) Error() string { return e.Err.Error() } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/auth.go new file mode 100644 index 00000000..0b81db54 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/auth.go @@ -0,0 +1,45 @@ +package auth + +import ( + "github.com/aws/smithy-go/auth" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// HTTPAuthScheme is the SDK's internal implementation of smithyhttp.AuthScheme +// for pre-existing implementations where the signer was added to client +// config. SDK clients will key off of this type and ensure per-operation +// updates to those signers persist on the scheme itself. +type HTTPAuthScheme struct { + schemeID string + signer smithyhttp.Signer +} + +var _ smithyhttp.AuthScheme = (*HTTPAuthScheme)(nil) + +// NewHTTPAuthScheme returns an auth scheme instance with the given config. +func NewHTTPAuthScheme(schemeID string, signer smithyhttp.Signer) *HTTPAuthScheme { + return &HTTPAuthScheme{ + schemeID: schemeID, + signer: signer, + } +} + +// SchemeID identifies the auth scheme. +func (s *HTTPAuthScheme) SchemeID() string { + return s.schemeID +} + +// IdentityResolver gets the identity resolver for the auth scheme. +func (s *HTTPAuthScheme) IdentityResolver(o auth.IdentityResolverOptions) auth.IdentityResolver { + return o.GetIdentityResolver(s.schemeID) +} + +// Signer gets the signer for the auth scheme. +func (s *HTTPAuthScheme) Signer() smithyhttp.Signer { + return s.signer +} + +// WithSigner returns a new instance of the auth scheme with the updated signer. +func (s *HTTPAuthScheme) WithSigner(signer smithyhttp.Signer) *HTTPAuthScheme { + return NewHTTPAuthScheme(s.schemeID, signer) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/scheme.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/scheme.go new file mode 100644 index 00000000..bbc2ec06 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/scheme.go @@ -0,0 +1,191 @@ +package auth + +import ( + "context" + "fmt" + + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +// SigV4 is a constant representing +// Authentication Scheme Signature Version 4 +const SigV4 = "sigv4" + +// SigV4A is a constant representing +// Authentication Scheme Signature Version 4A +const SigV4A = "sigv4a" + +// SigV4S3Express identifies the S3 S3Express auth scheme. +const SigV4S3Express = "sigv4-s3express" + +// None is a constant representing the +// None Authentication Scheme +const None = "none" + +// SupportedSchemes is a data structure +// that indicates the list of supported AWS +// authentication schemes +var SupportedSchemes = map[string]bool{ + SigV4: true, + SigV4A: true, + SigV4S3Express: true, + None: true, +} + +// AuthenticationScheme is a representation of +// AWS authentication schemes +type AuthenticationScheme interface { + isAuthenticationScheme() +} + +// AuthenticationSchemeV4 is a AWS SigV4 representation +type AuthenticationSchemeV4 struct { + Name string + SigningName *string + SigningRegion *string + DisableDoubleEncoding *bool +} + +func (a *AuthenticationSchemeV4) isAuthenticationScheme() {} + +// AuthenticationSchemeV4A is a AWS SigV4A representation +type AuthenticationSchemeV4A struct { + Name string + SigningName *string + SigningRegionSet []string + DisableDoubleEncoding *bool +} + +func (a *AuthenticationSchemeV4A) isAuthenticationScheme() {} + +// AuthenticationSchemeNone is a representation for the none auth scheme +type AuthenticationSchemeNone struct{} + +func (a *AuthenticationSchemeNone) isAuthenticationScheme() {} + +// NoAuthenticationSchemesFoundError is used in signaling +// that no authentication schemes have been specified. +type NoAuthenticationSchemesFoundError struct{} + +func (e *NoAuthenticationSchemesFoundError) Error() string { + return fmt.Sprint("No authentication schemes specified.") +} + +// UnSupportedAuthenticationSchemeSpecifiedError is used in +// signaling that only unsupported authentication schemes +// were specified. +type UnSupportedAuthenticationSchemeSpecifiedError struct { + UnsupportedSchemes []string +} + +func (e *UnSupportedAuthenticationSchemeSpecifiedError) Error() string { + return fmt.Sprint("Unsupported authentication scheme specified.") +} + +// GetAuthenticationSchemes extracts the relevant authentication scheme data +// into a custom strongly typed Go data structure. +func GetAuthenticationSchemes(p *smithy.Properties) ([]AuthenticationScheme, error) { + var result []AuthenticationScheme + if !p.Has("authSchemes") { + return nil, &NoAuthenticationSchemesFoundError{} + } + + authSchemes, _ := p.Get("authSchemes").([]interface{}) + + var unsupportedSchemes []string + for _, scheme := range authSchemes { + authScheme, _ := scheme.(map[string]interface{}) + + version := authScheme["name"].(string) + switch version { + case SigV4, SigV4S3Express: + v4Scheme := AuthenticationSchemeV4{ + Name: version, + SigningName: getSigningName(authScheme), + SigningRegion: getSigningRegion(authScheme), + DisableDoubleEncoding: getDisableDoubleEncoding(authScheme), + } + result = append(result, AuthenticationScheme(&v4Scheme)) + case SigV4A: + v4aScheme := AuthenticationSchemeV4A{ + Name: SigV4A, + SigningName: getSigningName(authScheme), + SigningRegionSet: getSigningRegionSet(authScheme), + DisableDoubleEncoding: getDisableDoubleEncoding(authScheme), + } + result = append(result, AuthenticationScheme(&v4aScheme)) + case None: + noneScheme := AuthenticationSchemeNone{} + result = append(result, AuthenticationScheme(&noneScheme)) + default: + unsupportedSchemes = append(unsupportedSchemes, authScheme["name"].(string)) + continue + } + } + + if len(result) == 0 { + return nil, &UnSupportedAuthenticationSchemeSpecifiedError{ + UnsupportedSchemes: unsupportedSchemes, + } + } + + return result, nil +} + +type disableDoubleEncoding struct{} + +// SetDisableDoubleEncoding sets or modifies the disable double encoding option +// on the context. +// +// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues +// to clear all stack values. +func SetDisableDoubleEncoding(ctx context.Context, value bool) context.Context { + return middleware.WithStackValue(ctx, disableDoubleEncoding{}, value) +} + +// GetDisableDoubleEncoding retrieves the disable double encoding option +// from the context. +// +// Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues +// to clear all stack values. +func GetDisableDoubleEncoding(ctx context.Context) (value bool, ok bool) { + value, ok = middleware.GetStackValue(ctx, disableDoubleEncoding{}).(bool) + return value, ok +} + +func getSigningName(authScheme map[string]interface{}) *string { + signingName, ok := authScheme["signingName"].(string) + if !ok || signingName == "" { + return nil + } + return &signingName +} + +func getSigningRegionSet(authScheme map[string]interface{}) []string { + untypedSigningRegionSet, ok := authScheme["signingRegionSet"].([]interface{}) + if !ok { + return nil + } + signingRegionSet := []string{} + for _, item := range untypedSigningRegionSet { + signingRegionSet = append(signingRegionSet, item.(string)) + } + return signingRegionSet +} + +func getSigningRegion(authScheme map[string]interface{}) *string { + signingRegion, ok := authScheme["signingRegion"].(string) + if !ok || signingRegion == "" { + return nil + } + return &signingRegion +} + +func getDisableDoubleEncoding(authScheme map[string]interface{}) *bool { + disableDoubleEncoding, ok := authScheme["disableDoubleEncoding"].(bool) + if !ok { + return nil + } + return &disableDoubleEncoding +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/bearer_token_adapter.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/bearer_token_adapter.go new file mode 100644 index 00000000..f059b5d3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/bearer_token_adapter.go @@ -0,0 +1,43 @@ +package smithy + +import ( + "context" + "fmt" + "time" + + "github.com/aws/smithy-go" + "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/auth/bearer" +) + +// BearerTokenAdapter adapts smithy bearer.Token to smithy auth.Identity. +type BearerTokenAdapter struct { + Token bearer.Token +} + +var _ auth.Identity = (*BearerTokenAdapter)(nil) + +// Expiration returns the time of expiration for the token. +func (v *BearerTokenAdapter) Expiration() time.Time { + return v.Token.Expires +} + +// BearerTokenProviderAdapter adapts smithy bearer.TokenProvider to smithy +// auth.IdentityResolver. +type BearerTokenProviderAdapter struct { + Provider bearer.TokenProvider +} + +var _ (auth.IdentityResolver) = (*BearerTokenProviderAdapter)(nil) + +// GetIdentity retrieves a bearer token using the underlying provider. +func (v *BearerTokenProviderAdapter) GetIdentity(ctx context.Context, _ smithy.Properties) ( + auth.Identity, error, +) { + token, err := v.Provider.RetrieveBearerToken(ctx) + if err != nil { + return nil, fmt.Errorf("get token: %w", err) + } + + return &BearerTokenAdapter{Token: token}, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/bearer_token_signer_adapter.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/bearer_token_signer_adapter.go new file mode 100644 index 00000000..a8828152 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/bearer_token_signer_adapter.go @@ -0,0 +1,35 @@ +package smithy + +import ( + "context" + "fmt" + + "github.com/aws/smithy-go" + "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/auth/bearer" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// BearerTokenSignerAdapter adapts smithy bearer.Signer to smithy http +// auth.Signer. +type BearerTokenSignerAdapter struct { + Signer bearer.Signer +} + +var _ (smithyhttp.Signer) = (*BearerTokenSignerAdapter)(nil) + +// SignRequest signs the request with the provided bearer token. +func (v *BearerTokenSignerAdapter) SignRequest(ctx context.Context, r *smithyhttp.Request, identity auth.Identity, _ smithy.Properties) error { + ca, ok := identity.(*BearerTokenAdapter) + if !ok { + return fmt.Errorf("unexpected identity type: %T", identity) + } + + signed, err := v.Signer.SignWithBearerToken(ctx, ca.Token, r) + if err != nil { + return fmt.Errorf("sign request: %w", err) + } + + *r = *signed.(*smithyhttp.Request) + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/credentials_adapter.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/credentials_adapter.go new file mode 100644 index 00000000..f926c4aa --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/credentials_adapter.go @@ -0,0 +1,46 @@ +package smithy + +import ( + "context" + "fmt" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/smithy-go" + "github.com/aws/smithy-go/auth" +) + +// CredentialsAdapter adapts aws.Credentials to auth.Identity. +type CredentialsAdapter struct { + Credentials aws.Credentials +} + +var _ auth.Identity = (*CredentialsAdapter)(nil) + +// Expiration returns the time of expiration for the credentials. +func (v *CredentialsAdapter) Expiration() time.Time { + return v.Credentials.Expires +} + +// CredentialsProviderAdapter adapts aws.CredentialsProvider to auth.IdentityResolver. +type CredentialsProviderAdapter struct { + Provider aws.CredentialsProvider +} + +var _ (auth.IdentityResolver) = (*CredentialsProviderAdapter)(nil) + +// GetIdentity retrieves AWS credentials using the underlying provider. +func (v *CredentialsProviderAdapter) GetIdentity(ctx context.Context, _ smithy.Properties) ( + auth.Identity, error, +) { + if v.Provider == nil { + return &CredentialsAdapter{Credentials: aws.Credentials{}}, nil + } + + creds, err := v.Provider.Retrieve(ctx) + if err != nil { + return nil, fmt.Errorf("get credentials: %w", err) + } + + return &CredentialsAdapter{Credentials: creds}, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/smithy.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/smithy.go new file mode 100644 index 00000000..42b45867 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/smithy.go @@ -0,0 +1,2 @@ +// Package smithy adapts concrete AWS auth and signing types to the generic smithy versions. +package smithy diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/v4signer_adapter.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/v4signer_adapter.go new file mode 100644 index 00000000..0c5a2d40 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/v4signer_adapter.go @@ -0,0 +1,53 @@ +package smithy + +import ( + "context" + "fmt" + + v4 "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/internal/sdk" + "github.com/aws/smithy-go" + "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// V4SignerAdapter adapts v4.HTTPSigner to smithy http.Signer. +type V4SignerAdapter struct { + Signer v4.HTTPSigner + Logger logging.Logger + LogSigning bool +} + +var _ (smithyhttp.Signer) = (*V4SignerAdapter)(nil) + +// SignRequest signs the request with the provided identity. +func (v *V4SignerAdapter) SignRequest(ctx context.Context, r *smithyhttp.Request, identity auth.Identity, props smithy.Properties) error { + ca, ok := identity.(*CredentialsAdapter) + if !ok { + return fmt.Errorf("unexpected identity type: %T", identity) + } + + name, ok := smithyhttp.GetSigV4SigningName(&props) + if !ok { + return fmt.Errorf("sigv4 signing name is required") + } + + region, ok := smithyhttp.GetSigV4SigningRegion(&props) + if !ok { + return fmt.Errorf("sigv4 signing region is required") + } + + hash := v4.GetPayloadHash(ctx) + err := v.Signer.SignHTTP(ctx, ca.Credentials, r.Request, hash, name, region, sdk.NowTime(), func(o *v4.SignerOptions) { + o.DisableURIPathEscaping, _ = smithyhttp.GetDisableDoubleEncoding(&props) + + o.Logger = v.Logger + o.LogSigning = v.LogSigning + }) + if err != nil { + return fmt.Errorf("sign http: %w", err) + } + + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md new file mode 100644 index 00000000..dc87ec41 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md @@ -0,0 +1,255 @@ +# v1.2.10 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.9 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.8 (2023-12-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.7 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.6 (2023-11-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.5 (2023-11-28.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.4 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.3 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.2 (2023-11-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.1 (2023-11-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.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.1.43 (2023-10-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.42 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.41 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.40 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.39 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.38 (2023-08-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.37 (2023-07-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.36 (2023-07-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.35 (2023-07-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.34 (2023-06-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.33 (2023-04-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.32 (2023-04-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.31 (2023-03-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.30 (2023-03-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.29 (2023-02-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.28 (2023-02-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.27 (2022-12-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.26 (2022-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.25 (2022-10-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.24 (2022-10-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.23 (2022-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.22 (2022-09-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.21 (2022-09-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.20 (2022-08-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.19 (2022-08-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.18 (2022-08-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.17 (2022-08-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.16 (2022-08-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.15 (2022-08-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.14 (2022-07-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.13 (2022-06-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.12 (2022-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.11 (2022-05-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.10 (2022-04-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.9 (2022-03-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.8 (2022-03-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.7 (2022-03-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.6 (2022-03-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.5 (2022-02-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.4 (2022-01-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.3 (2022-01-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.2 (2021-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.1 (2021-11-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.0 (2021-11-06) + +* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.0.7 (2021-10-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.0.6 (2021-10-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.0.5 (2021-09-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.0.4 (2021-08-27) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.0.3 (2021-08-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.0.2 (2021-08-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.0.1 (2021-07-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.0.0 (2021-06-25) + +* **Release**: Release new modules +* **Dependency Update**: Updated to the latest SDK module versions + diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/LICENSE.txt new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/config.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/config.go new file mode 100644 index 00000000..cd4d19b8 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/config.go @@ -0,0 +1,65 @@ +package configsources + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" +) + +// EnableEndpointDiscoveryProvider is an interface for retrieving external configuration value +// for Enable Endpoint Discovery +type EnableEndpointDiscoveryProvider interface { + GetEnableEndpointDiscovery(ctx context.Context) (value aws.EndpointDiscoveryEnableState, found bool, err error) +} + +// ResolveEnableEndpointDiscovery extracts the first instance of a EnableEndpointDiscoveryProvider from the config slice. +// Additionally returns a aws.EndpointDiscoveryEnableState to indicate if the value was found in provided configs, +// and error if one is encountered. +func ResolveEnableEndpointDiscovery(ctx context.Context, configs []interface{}) (value aws.EndpointDiscoveryEnableState, found bool, err error) { + for _, cfg := range configs { + if p, ok := cfg.(EnableEndpointDiscoveryProvider); ok { + value, found, err = p.GetEnableEndpointDiscovery(ctx) + if err != nil || found { + break + } + } + } + return +} + +// UseDualStackEndpointProvider is an interface for retrieving external configuration values for UseDualStackEndpoint +type UseDualStackEndpointProvider interface { + GetUseDualStackEndpoint(context.Context) (value aws.DualStackEndpointState, found bool, err error) +} + +// ResolveUseDualStackEndpoint extracts the first instance of a UseDualStackEndpoint from the config slice. +// Additionally returns a boolean to indicate if the value was found in provided configs, and error if one is encountered. +func ResolveUseDualStackEndpoint(ctx context.Context, configs []interface{}) (value aws.DualStackEndpointState, found bool, err error) { + for _, cfg := range configs { + if p, ok := cfg.(UseDualStackEndpointProvider); ok { + value, found, err = p.GetUseDualStackEndpoint(ctx) + if err != nil || found { + break + } + } + } + return +} + +// UseFIPSEndpointProvider is an interface for retrieving external configuration values for UseFIPSEndpoint +type UseFIPSEndpointProvider interface { + GetUseFIPSEndpoint(context.Context) (value aws.FIPSEndpointState, found bool, err error) +} + +// ResolveUseFIPSEndpoint extracts the first instance of a UseFIPSEndpointProvider from the config slice. +// Additionally, returns a boolean to indicate if the value was found in provided configs, and error if one is encountered. +func ResolveUseFIPSEndpoint(ctx context.Context, configs []interface{}) (value aws.FIPSEndpointState, found bool, err error) { + for _, cfg := range configs { + if p, ok := cfg.(UseFIPSEndpointProvider); ok { + value, found, err = p.GetUseFIPSEndpoint(ctx) + if err != nil || found { + break + } + } + } + return +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/endpoints.go new file mode 100644 index 00000000..e7835f85 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/endpoints.go @@ -0,0 +1,57 @@ +package configsources + +import ( + "context" +) + +// ServiceBaseEndpointProvider is needed to search for all providers +// that provide a configured service endpoint +type ServiceBaseEndpointProvider interface { + GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error) +} + +// IgnoreConfiguredEndpointsProvider is needed to search for all providers +// that provide a flag to disable configured endpoints. +// +// Currently duplicated from github.com/aws/aws-sdk-go-v2/config because +// service packages cannot import github.com/aws/aws-sdk-go-v2/config +// due to result import cycle error. +type IgnoreConfiguredEndpointsProvider interface { + GetIgnoreConfiguredEndpoints(ctx context.Context) (bool, bool, error) +} + +// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured +// endpoints feature. +// +// Currently duplicated from github.com/aws/aws-sdk-go-v2/config because +// service packages cannot import github.com/aws/aws-sdk-go-v2/config +// due to result import cycle 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) + if err != nil || found { + break + } + } + } + return +} + +// ResolveServiceBaseEndpoint is used to retrieve service endpoints from configured sources +// while allowing for configured endpoints to be disabled +func ResolveServiceBaseEndpoint(ctx context.Context, sdkID string, configs []interface{}) (value string, found bool, err error) { + if val, found, _ := GetIgnoreConfiguredEndpoints(ctx, configs); found && val { + return "", false, nil + } + + for _, cs := range configs { + if p, ok := cs.(ServiceBaseEndpointProvider); ok { + value, found, err = p.GetServiceBaseEndpoint(context.Background(), sdkID) + if err != nil || found { + break + } + } + } + return +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go new file mode 100644 index 00000000..41ee0bfb --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package configsources + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "1.2.10" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/arn.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/arn.go new file mode 100644 index 00000000..e6223dd3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/arn.go @@ -0,0 +1,94 @@ +package awsrulesfn + +import ( + "strings" +) + +// ARN provides AWS ARN components broken out into a data structure. +type ARN struct { + Partition string + Service string + Region string + AccountId string + ResourceId OptionalStringSlice +} + +const ( + arnDelimiters = ":" + resourceDelimiters = "/:" + arnSections = 6 + arnPrefix = "arn:" + + // zero-indexed + sectionPartition = 1 + sectionService = 2 + sectionRegion = 3 + sectionAccountID = 4 + sectionResource = 5 +) + +// ParseARN returns an [ARN] value parsed from the input string provided. If +// the ARN cannot be parsed nil will be returned, and error added to +// [ErrorCollector]. +func ParseARN(input string) *ARN { + if !strings.HasPrefix(input, arnPrefix) { + return nil + } + + sections := strings.SplitN(input, arnDelimiters, arnSections) + if numSections := len(sections); numSections != arnSections { + return nil + } + + if sections[sectionPartition] == "" { + return nil + } + if sections[sectionService] == "" { + return nil + } + if sections[sectionResource] == "" { + return nil + } + + return &ARN{ + Partition: sections[sectionPartition], + Service: sections[sectionService], + Region: sections[sectionRegion], + AccountId: sections[sectionAccountID], + ResourceId: splitResource(sections[sectionResource]), + } +} + +// splitResource splits the resource components by the ARN resource delimiters. +func splitResource(v string) []string { + var parts []string + var offset int + + for offset <= len(v) { + idx := strings.IndexAny(v[offset:], "/:") + if idx < 0 { + parts = append(parts, v[offset:]) + break + } + parts = append(parts, v[offset:idx+offset]) + offset += idx + 1 + } + + return parts +} + +// OptionalStringSlice provides a helper to safely get the index of a string +// slice that may be out of bounds. Returns pointer to string if index is +// valid. Otherwise returns nil. +type OptionalStringSlice []string + +// Get returns a string pointer of the string at index i if the index is valid. +// Otherwise returns nil. +func (s OptionalStringSlice) Get(i int) *string { + if i < 0 || i >= len(s) { + return nil + } + + v := s[i] + return &v +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/doc.go new file mode 100644 index 00000000..d5a36585 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/doc.go @@ -0,0 +1,3 @@ +// Package awsrulesfn provides AWS focused endpoint rule functions for +// evaluating endpoint resolution rules. +package awsrulesfn diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/generate.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/generate.go new file mode 100644 index 00000000..df72da97 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/generate.go @@ -0,0 +1,7 @@ +//go:build codegen +// +build codegen + +package awsrulesfn + +//go:generate go run -tags codegen ./internal/partition/codegen.go -model partitions.json -output partitions.go +//go:generate gofmt -w -s . diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/host.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/host.go new file mode 100644 index 00000000..637e5fc1 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/host.go @@ -0,0 +1,51 @@ +package awsrulesfn + +import ( + "net" + "strings" + + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// IsVirtualHostableS3Bucket returns if the input is a DNS compatible bucket +// name and can be used with Amazon S3 virtual hosted style addressing. Similar +// to [rulesfn.IsValidHostLabel] with the added restriction that the length of label +// must be [3:63] characters long, all lowercase, and not formatted as an IP +// address. +func IsVirtualHostableS3Bucket(input string, allowSubDomains bool) bool { + // input should not be formatted as an IP address + // NOTE: this will technically trip up on IPv6 hosts with zone IDs, but + // validation further down will catch that anyway (it's guaranteed to have + // unfriendly characters % and : if that's the case) + if net.ParseIP(input) != nil { + return false + } + + var labels []string + if allowSubDomains { + labels = strings.Split(input, ".") + } else { + labels = []string{input} + } + + for _, label := range labels { + // validate special length constraints + if l := len(label); l < 3 || l > 63 { + return false + } + + // Validate no capital letters + for _, r := range label { + if r >= 'A' && r <= 'Z' { + return false + } + } + + // Validate valid host label + if !smithyhttp.ValidHostLabel(label) { + return false + } + } + + return true +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partition.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partition.go new file mode 100644 index 00000000..ba603275 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partition.go @@ -0,0 +1,75 @@ +package awsrulesfn + +import "regexp" + +// Partition provides the metadata describing an AWS partition. +type Partition struct { + ID string `json:"id"` + Regions map[string]RegionOverrides `json:"regions"` + RegionRegex string `json:"regionRegex"` + DefaultConfig PartitionConfig `json:"outputs"` +} + +// PartitionConfig provides the endpoint metadata for an AWS region or partition. +type PartitionConfig struct { + Name string `json:"name"` + DnsSuffix string `json:"dnsSuffix"` + DualStackDnsSuffix string `json:"dualStackDnsSuffix"` + SupportsFIPS bool `json:"supportsFIPS"` + SupportsDualStack bool `json:"supportsDualStack"` +} + +type RegionOverrides struct { + Name *string `json:"name"` + DnsSuffix *string `json:"dnsSuffix"` + DualStackDnsSuffix *string `json:"dualStackDnsSuffix"` + SupportsFIPS *bool `json:"supportsFIPS"` + SupportsDualStack *bool `json:"supportsDualStack"` +} + +const defaultPartition = "aws" + +func getPartition(partitions []Partition, region string) *PartitionConfig { + for _, partition := range partitions { + if v, ok := partition.Regions[region]; ok { + p := mergeOverrides(partition.DefaultConfig, v) + return &p + } + } + + for _, partition := range partitions { + regionRegex := regexp.MustCompile(partition.RegionRegex) + if regionRegex.MatchString(region) { + v := partition.DefaultConfig + return &v + } + } + + for _, partition := range partitions { + if partition.ID == defaultPartition { + v := partition.DefaultConfig + return &v + } + } + + return nil +} + +func mergeOverrides(into PartitionConfig, from RegionOverrides) PartitionConfig { + if from.Name != nil { + into.Name = *from.Name + } + if from.DnsSuffix != nil { + into.DnsSuffix = *from.DnsSuffix + } + if from.DualStackDnsSuffix != nil { + into.DualStackDnsSuffix = *from.DualStackDnsSuffix + } + if from.SupportsFIPS != nil { + into.SupportsFIPS = *from.SupportsFIPS + } + if from.SupportsDualStack != nil { + into.SupportsDualStack = *from.SupportsDualStack + } + return into +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.go new file mode 100644 index 00000000..849beffd --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.go @@ -0,0 +1,381 @@ +// Code generated by endpoint/awsrulesfn/internal/partition. DO NOT EDIT. + +package awsrulesfn + +// GetPartition returns an AWS [Partition] for the region provided. If the +// partition cannot be determined nil will be returned. +func GetPartition(region string) *PartitionConfig { + return getPartition(partitions, region) +} + +var partitions = []Partition{ + { + ID: "aws", + RegionRegex: "^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$", + DefaultConfig: PartitionConfig{ + Name: "aws", + DnsSuffix: "amazonaws.com", + DualStackDnsSuffix: "api.aws", + SupportsFIPS: true, + SupportsDualStack: true, + }, + Regions: map[string]RegionOverrides{ + "af-south-1": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "ap-east-1": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "ap-northeast-1": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "ap-northeast-2": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "ap-northeast-3": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "ap-south-1": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "ap-south-2": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "ap-southeast-1": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "ap-southeast-2": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "ap-southeast-3": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "ap-southeast-4": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "aws-global": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "ca-central-1": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "eu-central-1": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "eu-central-2": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "eu-north-1": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "eu-south-1": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "eu-south-2": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "eu-west-1": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "eu-west-2": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "eu-west-3": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "il-central-1": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "me-central-1": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "me-south-1": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "sa-east-1": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "us-east-1": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "us-east-2": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "us-west-1": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "us-west-2": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + }, + }, + { + ID: "aws-cn", + RegionRegex: "^cn\\-\\w+\\-\\d+$", + DefaultConfig: PartitionConfig{ + Name: "aws-cn", + DnsSuffix: "amazonaws.com.cn", + DualStackDnsSuffix: "api.amazonwebservices.com.cn", + SupportsFIPS: true, + SupportsDualStack: true, + }, + Regions: map[string]RegionOverrides{ + "aws-cn-global": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "cn-north-1": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "cn-northwest-1": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + }, + }, + { + ID: "aws-us-gov", + RegionRegex: "^us\\-gov\\-\\w+\\-\\d+$", + DefaultConfig: PartitionConfig{ + Name: "aws-us-gov", + DnsSuffix: "amazonaws.com", + DualStackDnsSuffix: "api.aws", + SupportsFIPS: true, + SupportsDualStack: true, + }, + Regions: map[string]RegionOverrides{ + "aws-us-gov-global": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "us-gov-east-1": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "us-gov-west-1": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + }, + }, + { + ID: "aws-iso", + RegionRegex: "^us\\-iso\\-\\w+\\-\\d+$", + DefaultConfig: PartitionConfig{ + Name: "aws-iso", + DnsSuffix: "c2s.ic.gov", + DualStackDnsSuffix: "c2s.ic.gov", + SupportsFIPS: true, + SupportsDualStack: false, + }, + Regions: map[string]RegionOverrides{ + "aws-iso-global": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "us-iso-east-1": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "us-iso-west-1": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + }, + }, + { + ID: "aws-iso-b", + RegionRegex: "^us\\-isob\\-\\w+\\-\\d+$", + DefaultConfig: PartitionConfig{ + Name: "aws-iso-b", + DnsSuffix: "sc2s.sgov.gov", + DualStackDnsSuffix: "sc2s.sgov.gov", + SupportsFIPS: true, + SupportsDualStack: false, + }, + Regions: map[string]RegionOverrides{ + "aws-iso-b-global": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + "us-isob-east-1": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + }, + }, + { + ID: "aws-iso-e", + RegionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$", + DefaultConfig: PartitionConfig{ + Name: "aws-iso-e", + DnsSuffix: "cloud.adc-e.uk", + DualStackDnsSuffix: "cloud.adc-e.uk", + SupportsFIPS: true, + SupportsDualStack: false, + }, + Regions: map[string]RegionOverrides{}, + }, + { + ID: "aws-iso-f", + RegionRegex: "^us\\-isof\\-\\w+\\-\\d+$", + DefaultConfig: PartitionConfig{ + Name: "aws-iso-f", + DnsSuffix: "csp.hci.ic.gov", + DualStackDnsSuffix: "csp.hci.ic.gov", + SupportsFIPS: true, + SupportsDualStack: false, + }, + Regions: map[string]RegionOverrides{}, + }, +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json new file mode 100644 index 00000000..f376f690 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json @@ -0,0 +1,216 @@ +{ + "partitions" : [ { + "id" : "aws", + "outputs" : { + "dnsSuffix" : "amazonaws.com", + "dualStackDnsSuffix" : "api.aws", + "implicitGlobalRegion" : "us-east-1", + "name" : "aws", + "supportsDualStack" : true, + "supportsFIPS" : true + }, + "regionRegex" : "^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$", + "regions" : { + "af-south-1" : { + "description" : "Africa (Cape Town)" + }, + "ap-east-1" : { + "description" : "Asia Pacific (Hong Kong)" + }, + "ap-northeast-1" : { + "description" : "Asia Pacific (Tokyo)" + }, + "ap-northeast-2" : { + "description" : "Asia Pacific (Seoul)" + }, + "ap-northeast-3" : { + "description" : "Asia Pacific (Osaka)" + }, + "ap-south-1" : { + "description" : "Asia Pacific (Mumbai)" + }, + "ap-south-2" : { + "description" : "Asia Pacific (Hyderabad)" + }, + "ap-southeast-1" : { + "description" : "Asia Pacific (Singapore)" + }, + "ap-southeast-2" : { + "description" : "Asia Pacific (Sydney)" + }, + "ap-southeast-3" : { + "description" : "Asia Pacific (Jakarta)" + }, + "ap-southeast-4" : { + "description" : "Asia Pacific (Melbourne)" + }, + "aws-global" : { + "description" : "AWS Standard global region" + }, + "ca-central-1" : { + "description" : "Canada (Central)" + }, + "ca-west-1" : { + "description" : "Canada West (Calgary)" + }, + "eu-central-1" : { + "description" : "Europe (Frankfurt)" + }, + "eu-central-2" : { + "description" : "Europe (Zurich)" + }, + "eu-north-1" : { + "description" : "Europe (Stockholm)" + }, + "eu-south-1" : { + "description" : "Europe (Milan)" + }, + "eu-south-2" : { + "description" : "Europe (Spain)" + }, + "eu-west-1" : { + "description" : "Europe (Ireland)" + }, + "eu-west-2" : { + "description" : "Europe (London)" + }, + "eu-west-3" : { + "description" : "Europe (Paris)" + }, + "il-central-1" : { + "description" : "Israel (Tel Aviv)" + }, + "me-central-1" : { + "description" : "Middle East (UAE)" + }, + "me-south-1" : { + "description" : "Middle East (Bahrain)" + }, + "sa-east-1" : { + "description" : "South America (Sao Paulo)" + }, + "us-east-1" : { + "description" : "US East (N. Virginia)" + }, + "us-east-2" : { + "description" : "US East (Ohio)" + }, + "us-west-1" : { + "description" : "US West (N. California)" + }, + "us-west-2" : { + "description" : "US West (Oregon)" + } + } + }, { + "id" : "aws-cn", + "outputs" : { + "dnsSuffix" : "amazonaws.com.cn", + "dualStackDnsSuffix" : "api.amazonwebservices.com.cn", + "implicitGlobalRegion" : "cn-northwest-1", + "name" : "aws-cn", + "supportsDualStack" : true, + "supportsFIPS" : true + }, + "regionRegex" : "^cn\\-\\w+\\-\\d+$", + "regions" : { + "aws-cn-global" : { + "description" : "AWS China global region" + }, + "cn-north-1" : { + "description" : "China (Beijing)" + }, + "cn-northwest-1" : { + "description" : "China (Ningxia)" + } + } + }, { + "id" : "aws-us-gov", + "outputs" : { + "dnsSuffix" : "amazonaws.com", + "dualStackDnsSuffix" : "api.aws", + "implicitGlobalRegion" : "us-gov-west-1", + "name" : "aws-us-gov", + "supportsDualStack" : true, + "supportsFIPS" : true + }, + "regionRegex" : "^us\\-gov\\-\\w+\\-\\d+$", + "regions" : { + "aws-us-gov-global" : { + "description" : "AWS GovCloud (US) global region" + }, + "us-gov-east-1" : { + "description" : "AWS GovCloud (US-East)" + }, + "us-gov-west-1" : { + "description" : "AWS GovCloud (US-West)" + } + } + }, { + "id" : "aws-iso", + "outputs" : { + "dnsSuffix" : "c2s.ic.gov", + "dualStackDnsSuffix" : "c2s.ic.gov", + "implicitGlobalRegion" : "us-iso-east-1", + "name" : "aws-iso", + "supportsDualStack" : false, + "supportsFIPS" : true + }, + "regionRegex" : "^us\\-iso\\-\\w+\\-\\d+$", + "regions" : { + "aws-iso-global" : { + "description" : "AWS ISO (US) global region" + }, + "us-iso-east-1" : { + "description" : "US ISO East" + }, + "us-iso-west-1" : { + "description" : "US ISO WEST" + } + } + }, { + "id" : "aws-iso-b", + "outputs" : { + "dnsSuffix" : "sc2s.sgov.gov", + "dualStackDnsSuffix" : "sc2s.sgov.gov", + "implicitGlobalRegion" : "us-isob-east-1", + "name" : "aws-iso-b", + "supportsDualStack" : false, + "supportsFIPS" : true + }, + "regionRegex" : "^us\\-isob\\-\\w+\\-\\d+$", + "regions" : { + "aws-iso-b-global" : { + "description" : "AWS ISOB (US) global region" + }, + "us-isob-east-1" : { + "description" : "US ISOB East (Ohio)" + } + } + }, { + "id" : "aws-iso-e", + "outputs" : { + "dnsSuffix" : "cloud.adc-e.uk", + "dualStackDnsSuffix" : "cloud.adc-e.uk", + "implicitGlobalRegion" : "eu-isoe-west-1", + "name" : "aws-iso-e", + "supportsDualStack" : false, + "supportsFIPS" : true + }, + "regionRegex" : "^eu\\-isoe\\-\\w+\\-\\d+$", + "regions" : { } + }, { + "id" : "aws-iso-f", + "outputs" : { + "dnsSuffix" : "csp.hci.ic.gov", + "dualStackDnsSuffix" : "csp.hci.ic.gov", + "implicitGlobalRegion" : "us-isof-south-1", + "name" : "aws-iso-f", + "supportsDualStack" : false, + "supportsFIPS" : true + }, + "regionRegex" : "^us\\-isof\\-\\w+\\-\\d+$", + "regions" : { } + } ], + "version" : "1.1" +} \ No newline at end of file diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/endpoints.go index 92635a1b..67950ca3 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/endpoints.go @@ -72,14 +72,14 @@ func (p Partition) ResolveEndpoint(region string, options Options) (resolved aws } func (p Partition) endpointForRegion(region string) (Endpoint, bool) { - if !p.IsRegionalized { - return p.Endpoints[p.PartitionEndpoint], region == p.PartitionEndpoint - } - if e, ok := p.Endpoints[region]; ok { return e, true } + if !p.IsRegionalized { + return p.Endpoints[p.PartitionEndpoint], region == p.PartitionEndpoint + } + // Unable to find any matching endpoint, return // blank that will be used for generic endpoint creation. return Endpoint{}, false @@ -181,3 +181,21 @@ func getByPriority(s []string, p []string, def string) string { return s[0] } + +// MapFIPSRegion extracts the intrinsic AWS region from one that may have an +// embedded FIPS microformat. +func MapFIPSRegion(region string) string { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(region, fipsInfix) || + strings.Contains(region, fipsPrefix) || + strings.Contains(region, fipsSuffix) { + region = strings.ReplaceAll(region, fipsInfix, "-") + region = strings.ReplaceAll(region, fipsPrefix, "") + region = strings.ReplaceAll(region, fipsSuffix, "") + } + + return region +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md new file mode 100644 index 00000000..e0265474 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md @@ -0,0 +1,228 @@ +# v2.5.10 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.5.9 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.5.8 (2023-12-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.5.7 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.5.6 (2023-11-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.5.5 (2023-11-28.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.5.4 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.5.3 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.5.2 (2023-11-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.5.1 (2023-11-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.5.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 + +# v2.4.37 (2023-10-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.36 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.35 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.34 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.33 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.32 (2023-08-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.31 (2023-07-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.30 (2023-07-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.29 (2023-07-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.28 (2023-06-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.27 (2023-04-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.26 (2023-04-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.25 (2023-03-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.24 (2023-03-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.23 (2023-02-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.22 (2023-02-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.21 (2022-12-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.20 (2022-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.19 (2022-10-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.18 (2022-10-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.17 (2022-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.16 (2022-09-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.15 (2022-09-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.14 (2022-08-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.13 (2022-08-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.12 (2022-08-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.11 (2022-08-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.10 (2022-08-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.9 (2022-08-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.8 (2022-07-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.7 (2022-06-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.6 (2022-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.5 (2022-05-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.4 (2022-04-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.3 (2022-03-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.2 (2022-03-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.1 (2022-03-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.0 (2022-03-08) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.3.0 (2022-02-24) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.2.0 (2022-01-14) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.1.0 (2022-01-07) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.0.2 (2021-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.0.1 (2021-11-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.0.0 (2021-11-06) + +* **Release**: Endpoint Variant Model Support +* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/LICENSE.txt new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/endpoints.go new file mode 100644 index 00000000..32251a7e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/endpoints.go @@ -0,0 +1,302 @@ +package endpoints + +import ( + "fmt" + "github.com/aws/smithy-go/logging" + "regexp" + "strings" + + "github.com/aws/aws-sdk-go-v2/aws" +) + +// DefaultKey is a compound map key of a variant and other values. +type DefaultKey struct { + Variant EndpointVariant + ServiceVariant ServiceVariant +} + +// EndpointKey is a compound map key of a region and associated variant value. +type EndpointKey struct { + Region string + Variant EndpointVariant + ServiceVariant ServiceVariant +} + +// EndpointVariant is a bit field to describe the endpoints attributes. +type EndpointVariant uint64 + +const ( + // FIPSVariant indicates that the endpoint is FIPS capable. + FIPSVariant EndpointVariant = 1 << (64 - 1 - iota) + + // DualStackVariant indicates that the endpoint is DualStack capable. + DualStackVariant +) + +// ServiceVariant is a bit field to describe the service endpoint attributes. +type ServiceVariant uint64 + +const ( + defaultProtocol = "https" + defaultSigner = "v4" +) + +var ( + protocolPriority = []string{"https", "http"} + signerPriority = []string{"v4", "s3v4"} +) + +// Options provide configuration needed to direct how endpoints are resolved. +type Options struct { + // Logger is a logging implementation that log events should be sent to. + Logger logging.Logger + + // LogDeprecated indicates that deprecated endpoints should be logged to the provided logger. + LogDeprecated bool + + // ResolvedRegion is the resolved region string. If provided (non-zero length) it takes priority + // over the region name passed to the ResolveEndpoint call. + ResolvedRegion string + + // Disable usage of HTTPS (TLS / SSL) + DisableHTTPS bool + + // Instruct the resolver to use a service endpoint that supports dual-stack. + // If a service does not have a dual-stack endpoint an error will be returned by the resolver. + UseDualStackEndpoint aws.DualStackEndpointState + + // Instruct the resolver to use a service endpoint that supports FIPS. + // If a service does not have a FIPS endpoint an error will be returned by the resolver. + UseFIPSEndpoint aws.FIPSEndpointState + + // ServiceVariant is a bitfield of service specified endpoint variant data. + ServiceVariant ServiceVariant +} + +// GetEndpointVariant returns the EndpointVariant for the variant associated options. +func (o Options) GetEndpointVariant() (v EndpointVariant) { + if o.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled { + v |= DualStackVariant + } + if o.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled { + v |= FIPSVariant + } + return v +} + +// Partitions is a slice of partition +type Partitions []Partition + +// ResolveEndpoint resolves a service endpoint for the given region and options. +func (ps Partitions) ResolveEndpoint(region string, opts Options) (aws.Endpoint, error) { + if len(ps) == 0 { + return aws.Endpoint{}, fmt.Errorf("no partitions found") + } + + if opts.Logger == nil { + opts.Logger = logging.Nop{} + } + + if len(opts.ResolvedRegion) > 0 { + region = opts.ResolvedRegion + } + + for i := 0; i < len(ps); i++ { + if !ps[i].canResolveEndpoint(region, opts) { + continue + } + + return ps[i].ResolveEndpoint(region, opts) + } + + // fallback to first partition format to use when resolving the endpoint. + return ps[0].ResolveEndpoint(region, opts) +} + +// Partition is an AWS partition description for a service and its' region endpoints. +type Partition struct { + ID string + RegionRegex *regexp.Regexp + PartitionEndpoint string + IsRegionalized bool + Defaults map[DefaultKey]Endpoint + Endpoints Endpoints +} + +func (p Partition) canResolveEndpoint(region string, opts Options) bool { + _, ok := p.Endpoints[EndpointKey{ + Region: region, + Variant: opts.GetEndpointVariant(), + }] + return ok || p.RegionRegex.MatchString(region) +} + +// ResolveEndpoint resolves and service endpoint for the given region and options. +func (p Partition) ResolveEndpoint(region string, options Options) (resolved aws.Endpoint, err error) { + if len(region) == 0 && len(p.PartitionEndpoint) != 0 { + region = p.PartitionEndpoint + } + + endpoints := p.Endpoints + + variant := options.GetEndpointVariant() + serviceVariant := options.ServiceVariant + + defaults := p.Defaults[DefaultKey{ + Variant: variant, + ServiceVariant: serviceVariant, + }] + + return p.endpointForRegion(region, variant, serviceVariant, endpoints).resolve(p.ID, region, defaults, options) +} + +func (p Partition) endpointForRegion(region string, variant EndpointVariant, serviceVariant ServiceVariant, endpoints Endpoints) Endpoint { + key := EndpointKey{ + Region: region, + Variant: variant, + } + + if e, ok := endpoints[key]; ok { + return e + } + + if !p.IsRegionalized { + return endpoints[EndpointKey{ + Region: p.PartitionEndpoint, + Variant: variant, + ServiceVariant: serviceVariant, + }] + } + + // Unable to find any matching endpoint, return + // blank that will be used for generic endpoint creation. + return Endpoint{} +} + +// Endpoints is a map of service config regions to endpoints +type Endpoints map[EndpointKey]Endpoint + +// CredentialScope is the credential scope of a region and service +type CredentialScope struct { + Region string + Service string +} + +// Endpoint is a service endpoint description +type Endpoint struct { + // True if the endpoint cannot be resolved for this partition/region/service + Unresolveable aws.Ternary + + Hostname string + Protocols []string + + CredentialScope CredentialScope + + SignatureVersions []string + + // Indicates that this endpoint is deprecated. + Deprecated aws.Ternary +} + +// IsZero returns whether the endpoint structure is an empty (zero) value. +func (e Endpoint) IsZero() bool { + switch { + case e.Unresolveable != aws.UnknownTernary: + return false + case len(e.Hostname) != 0: + return false + case len(e.Protocols) != 0: + return false + case e.CredentialScope != (CredentialScope{}): + return false + case len(e.SignatureVersions) != 0: + return false + } + return true +} + +func (e Endpoint) resolve(partition, region string, def Endpoint, options Options) (aws.Endpoint, error) { + var merged Endpoint + merged.mergeIn(def) + merged.mergeIn(e) + e = merged + + if e.IsZero() { + return aws.Endpoint{}, fmt.Errorf("unable to resolve endpoint for region: %v", region) + } + + var u string + if e.Unresolveable != aws.TrueTernary { + // Only attempt to resolve the endpoint if it can be resolved. + hostname := strings.Replace(e.Hostname, "{region}", region, 1) + + scheme := getEndpointScheme(e.Protocols, options.DisableHTTPS) + u = scheme + "://" + hostname + } + + signingRegion := e.CredentialScope.Region + if len(signingRegion) == 0 { + signingRegion = region + } + signingName := e.CredentialScope.Service + + if e.Deprecated == aws.TrueTernary && options.LogDeprecated { + options.Logger.Logf(logging.Warn, "endpoint identifier %q, url %q marked as deprecated", region, u) + } + + return aws.Endpoint{ + URL: u, + PartitionID: partition, + SigningRegion: signingRegion, + SigningName: signingName, + SigningMethod: getByPriority(e.SignatureVersions, signerPriority, defaultSigner), + }, nil +} + +func (e *Endpoint) mergeIn(other Endpoint) { + if other.Unresolveable != aws.UnknownTernary { + e.Unresolveable = other.Unresolveable + } + if len(other.Hostname) > 0 { + e.Hostname = other.Hostname + } + if len(other.Protocols) > 0 { + e.Protocols = other.Protocols + } + if len(other.CredentialScope.Region) > 0 { + e.CredentialScope.Region = other.CredentialScope.Region + } + if len(other.CredentialScope.Service) > 0 { + e.CredentialScope.Service = other.CredentialScope.Service + } + if len(other.SignatureVersions) > 0 { + e.SignatureVersions = other.SignatureVersions + } + if other.Deprecated != aws.UnknownTernary { + e.Deprecated = other.Deprecated + } +} + +func getEndpointScheme(protocols []string, disableHTTPS bool) string { + if disableHTTPS { + return "http" + } + + return getByPriority(protocols, protocolPriority, defaultProtocol) +} + +func getByPriority(s []string, p []string, def string) string { + if len(s) == 0 { + return def + } + + for i := 0; i < len(p); i++ { + for j := 0; j < len(s); j++ { + if s[j] == p[i] { + return s[j] + } + } + } + + return s[0] +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go new file mode 100644 index 00000000..bec2c6a1 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package endpoints + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "2.5.10" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md new file mode 100644 index 00000000..adbbf4ad --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md @@ -0,0 +1,263 @@ +# v1.7.2 (2023-12-08) + +* **Bug Fix**: Correct loading of [services *] sections into shared config. + +# v1.7.1 (2023-11-16) + +* **Bug Fix**: Fix recognition of trailing comments in shared config properties. # or ; separators that aren't preceded by whitespace at the end of a property value should be considered part of it. + +# v1.7.0 (2023-11-13) + +* **Feature**: Replace the legacy config parser with a modern, less-strict implementation. Parsing failures within a section will now simply ignore the invalid line rather than silently drop the entire section. + +# 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 + +# v1.3.44 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.43 (2023-09-22) + +* **Bug Fix**: Fixed a bug where merging `max_attempts` or `duration_seconds` fields across shared config files with invalid values would silently default them to 0. +* **Bug Fix**: Move type assertion of config values out of the parsing stage, which resolves an issue where the contents of a profile would silently be dropped with certain numeric formats. + +# v1.3.42 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.41 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.40 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.39 (2023-08-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.38 (2023-07-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.37 (2023-07-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.36 (2023-07-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.35 (2023-06-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.34 (2023-04-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.33 (2023-04-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.32 (2023-03-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.31 (2023-03-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.30 (2023-02-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.29 (2023-02-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.28 (2022-12-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.27 (2022-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.26 (2022-10-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.25 (2022-10-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.24 (2022-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.23 (2022-09-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.22 (2022-09-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.21 (2022-08-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.20 (2022-08-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.19 (2022-08-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.18 (2022-08-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.17 (2022-08-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.16 (2022-08-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.15 (2022-07-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.14 (2022-06-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.13 (2022-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.12 (2022-05-17) + +* **Bug Fix**: Removes the fuzz testing files from the module, as they are invalid and not used. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.11 (2022-04-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.10 (2022-03-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.9 (2022-03-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.8 (2022-03-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.7 (2022-03-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.6 (2022-02-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.5 (2022-01-28) + +* **Bug Fix**: Fixes the SDK's handling of `duration_sections` in the shared credentials file or specified in multiple shared config and shared credentials files under the same profile. [#1568](https://github.com/aws/aws-sdk-go-v2/pull/1568). Thanks to [Amir Szekely](https://github.com/kichik) for help reproduce this bug. + +# v1.3.4 (2022-01-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.3 (2022-01-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.2 (2021-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.1 (2021-11-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.0 (2021-11-06) + +* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.5 (2021-10-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.4 (2021-10-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.3 (2021-09-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.2 (2021-08-27) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.1 (2021-08-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.0 (2021-08-04) + +* **Feature**: adds error handling for defered close calls +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.1 (2021-07-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.0 (2021-07-01) + +* **Feature**: Support for `:`, `=`, `[`, `]` being present in expression values. + +# v1.0.1 (2021-06-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.0.0 (2021-05-20) + +* **Release**: The `github.com/aws/aws-sdk-go-v2/internal/ini` package is now a Go Module. +* **Dependency Update**: Updated to the latest SDK module versions + diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/LICENSE.txt new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ast.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ast.go deleted file mode 100644 index e83a9988..00000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ast.go +++ /dev/null @@ -1,120 +0,0 @@ -package ini - -// ASTKind represents different states in the parse table -// and the type of AST that is being constructed -type ASTKind int - -// ASTKind* is used in the parse table to transition between -// the different states -const ( - ASTKindNone = ASTKind(iota) - ASTKindStart - ASTKindExpr - ASTKindEqualExpr - ASTKindStatement - ASTKindSkipStatement - ASTKindExprStatement - ASTKindSectionStatement - ASTKindNestedSectionStatement - ASTKindCompletedNestedSectionStatement - ASTKindCommentStatement - ASTKindCompletedSectionStatement -) - -func (k ASTKind) String() string { - switch k { - case ASTKindNone: - return "none" - case ASTKindStart: - return "start" - case ASTKindExpr: - return "expr" - case ASTKindStatement: - return "stmt" - case ASTKindSectionStatement: - return "section_stmt" - case ASTKindExprStatement: - return "expr_stmt" - case ASTKindCommentStatement: - return "comment" - case ASTKindNestedSectionStatement: - return "nested_section_stmt" - case ASTKindCompletedSectionStatement: - return "completed_stmt" - case ASTKindSkipStatement: - return "skip" - default: - return "" - } -} - -// AST interface allows us to determine what kind of node we -// are on and casting may not need to be necessary. -// -// The root is always the first node in Children -type AST struct { - Kind ASTKind - Root Token - RootToken bool - Children []AST -} - -func newAST(kind ASTKind, root AST, children ...AST) AST { - return AST{ - Kind: kind, - Children: append([]AST{root}, children...), - } -} - -func newASTWithRootToken(kind ASTKind, root Token, children ...AST) AST { - return AST{ - Kind: kind, - Root: root, - RootToken: true, - Children: children, - } -} - -// AppendChild will append to the list of children an AST has. -func (a *AST) AppendChild(child AST) { - a.Children = append(a.Children, child) -} - -// GetRoot will return the root AST which can be the first entry -// in the children list or a token. -func (a *AST) GetRoot() AST { - if a.RootToken { - return *a - } - - if len(a.Children) == 0 { - return AST{} - } - - return a.Children[0] -} - -// GetChildren will return the current AST's list of children -func (a *AST) GetChildren() []AST { - if len(a.Children) == 0 { - return []AST{} - } - - if a.RootToken { - return a.Children - } - - return a.Children[1:] -} - -// SetChildren will set and override all children of the AST. -func (a *AST) SetChildren(children []AST) { - if a.RootToken { - a.Children = children - } else { - a.Children = append(a.Children[:1], children...) - } -} - -// Start is used to indicate the starting state of the parse table. -var Start = newAST(ASTKindStart, AST{}) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/comma_token.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/comma_token.go deleted file mode 100644 index 0895d53c..00000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/comma_token.go +++ /dev/null @@ -1,11 +0,0 @@ -package ini - -var commaRunes = []rune(",") - -func isComma(b rune) bool { - return b == ',' -} - -func newCommaToken() Token { - return newToken(TokenComma, commaRunes, NoneType) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/comment_token.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/comment_token.go deleted file mode 100644 index 0b76999b..00000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/comment_token.go +++ /dev/null @@ -1,35 +0,0 @@ -package ini - -// isComment will return whether or not the next byte(s) is a -// comment. -func isComment(b []rune) bool { - if len(b) == 0 { - return false - } - - switch b[0] { - case ';': - return true - case '#': - return true - } - - return false -} - -// newCommentToken will create a comment token and -// return how many bytes were read. -func newCommentToken(b []rune) (Token, int, error) { - i := 0 - for ; i < len(b); i++ { - if b[i] == '\n' { - break - } - - if len(b)-i > 2 && b[i] == '\r' && b[i+1] == '\n' { - break - } - } - - return newToken(TokenComment, b[:i], NoneType), i, nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/doc.go deleted file mode 100644 index 25ce0fe1..00000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/doc.go +++ /dev/null @@ -1,29 +0,0 @@ -// Package ini is an LL(1) parser for configuration files. -// -// Example: -// sections, err := ini.OpenFile("/path/to/file") -// if err != nil { -// panic(err) -// } -// -// profile := "foo" -// section, ok := sections.GetSection(profile) -// if !ok { -// fmt.Printf("section %q could not be found", profile) -// } -// -// Below is the BNF that describes this parser -// Grammar: -// stmt -> value stmt' -// stmt' -> epsilon | op stmt -// value -> number | string | boolean | quoted_string -// -// section -> [ section' -// section' -> value section_close -// section_close -> ] -// -// SkipState will skip (NL WS)+ -// -// comment -> # comment' | ; comment' -// comment' -> epsilon | value -package ini diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/empty_token.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/empty_token.go deleted file mode 100644 index 04345a54..00000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/empty_token.go +++ /dev/null @@ -1,4 +0,0 @@ -package ini - -// emptyToken is used to satisfy the Token interface -var emptyToken = newToken(TokenNone, []rune{}, NoneType) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/expression.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/expression.go deleted file mode 100644 index 91ba2a59..00000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/expression.go +++ /dev/null @@ -1,24 +0,0 @@ -package ini - -// newExpression will return an expression AST. -// Expr represents an expression -// -// grammar: -// expr -> string | number -func newExpression(tok Token) AST { - return newASTWithRootToken(ASTKindExpr, tok) -} - -func newEqualExpr(left AST, tok Token) AST { - return newASTWithRootToken(ASTKindEqualExpr, tok, left) -} - -// EqualExprKey will return a LHS value in the equal expr -func EqualExprKey(ast AST) string { - children := ast.GetChildren() - if len(children) == 0 || ast.Kind != ASTKindEqualExpr { - return "" - } - - return string(children[0].Root.Raw()) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/fuzz.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/fuzz.go deleted file mode 100644 index 8d462f77..00000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/fuzz.go +++ /dev/null @@ -1,17 +0,0 @@ -// +build gofuzz - -package ini - -import ( - "bytes" -) - -func Fuzz(data []byte) int { - b := bytes.NewReader(data) - - if _, err := Parse(b); err != nil { - return 0 - } - - return 1 -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go new file mode 100644 index 00000000..f0673f3a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package ini + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "1.7.2" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini.go index 4a80eb9a..cefcce91 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini.go @@ -1,49 +1,56 @@ +// Package ini implements parsing of the AWS shared config file. +// +// Example: +// sections, err := ini.OpenFile("/path/to/file") +// if err != nil { +// panic(err) +// } +// +// profile := "foo" +// section, ok := sections.GetSection(profile) +// if !ok { +// fmt.Printf("section %q could not be found", profile) +// } package ini import ( + "fmt" "io" "os" + "strings" ) -// OpenFile takes a path to a given file, and will open and parse -// that file. -func OpenFile(path string) (Sections, error) { - f, err := os.Open(path) - if err != nil { - return Sections{}, &UnableToReadFile{Err: err} +// OpenFile parses shared config from the given file path. +func OpenFile(path string) (sections Sections, err error) { + f, oerr := os.Open(path) + if oerr != nil { + return Sections{}, &UnableToReadFile{Err: oerr} } - defer f.Close() + + defer func() { + closeErr := f.Close() + if err == nil { + err = closeErr + } else if closeErr != nil { + err = fmt.Errorf("close error: %v, original error: %w", closeErr, err) + } + }() return Parse(f, path) } -// Parse will parse the given file using the shared config -// visitor. -func Parse(f io.Reader, path string) (Sections, error) { - tree, err := ParseAST(f) +// Parse parses shared config from the given reader. +func Parse(r io.Reader, path string) (Sections, error) { + contents, err := io.ReadAll(r) if err != nil { - return Sections{}, err - } - - v := NewDefaultVisitor(path) - if err = Walk(tree, v); err != nil { - return Sections{}, err + return Sections{}, fmt.Errorf("read all: %v", err) } - return v.Sections, nil -} - -// ParseBytes will parse the given bytes and return the parsed sections. -func ParseBytes(b []byte) (Sections, error) { - tree, err := ParseASTBytes(b) + lines := strings.Split(string(contents), "\n") + tokens, err := tokenize(lines) if err != nil { - return Sections{}, err - } - - v := NewDefaultVisitor("") - if err = Walk(tree, v); err != nil { - return Sections{}, err + return Sections{}, fmt.Errorf("tokenize: %v", err) } - return v.Sections, nil + return parse(tokens, path), nil } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini_lexer.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini_lexer.go deleted file mode 100644 index abf1fb03..00000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini_lexer.go +++ /dev/null @@ -1,157 +0,0 @@ -package ini - -import ( - "bytes" - "io" - "io/ioutil" -) - -// TokenType represents the various different tokens types -type TokenType int - -func (t TokenType) String() string { - switch t { - case TokenNone: - return "none" - case TokenLit: - return "literal" - case TokenSep: - return "sep" - case TokenOp: - return "op" - case TokenWS: - return "ws" - case TokenNL: - return "newline" - case TokenComment: - return "comment" - case TokenComma: - return "comma" - default: - return "" - } -} - -// TokenType enums -const ( - TokenNone = TokenType(iota) - TokenLit - TokenSep - TokenComma - TokenOp - TokenWS - TokenNL - TokenComment -) - -type iniLexer struct{} - -// Tokenize will return a list of tokens during lexical analysis of the -// io.Reader. -func (l *iniLexer) Tokenize(r io.Reader) ([]Token, error) { - b, err := ioutil.ReadAll(r) - if err != nil { - return nil, &UnableToReadFile{Err: err} - } - - return l.tokenize(b) -} - -func (l *iniLexer) tokenize(b []byte) ([]Token, error) { - runes := bytes.Runes(b) - var err error - n := 0 - tokenAmount := countTokens(runes) - tokens := make([]Token, tokenAmount) - count := 0 - - for len(runes) > 0 && count < tokenAmount { - switch { - case isWhitespace(runes[0]): - tokens[count], n, err = newWSToken(runes) - case isComma(runes[0]): - tokens[count], n = newCommaToken(), 1 - case isComment(runes): - tokens[count], n, err = newCommentToken(runes) - case isNewline(runes): - tokens[count], n, err = newNewlineToken(runes) - case isSep(runes): - tokens[count], n, err = newSepToken(runes) - case isOp(runes): - tokens[count], n, err = newOpToken(runes) - default: - tokens[count], n, err = newLitToken(runes) - } - - if err != nil { - return nil, err - } - - count++ - - runes = runes[n:] - } - - return tokens[:count], nil -} - -func countTokens(runes []rune) int { - count, n := 0, 0 - var err error - - for len(runes) > 0 { - switch { - case isWhitespace(runes[0]): - _, n, err = newWSToken(runes) - case isComma(runes[0]): - _, n = newCommaToken(), 1 - case isComment(runes): - _, n, err = newCommentToken(runes) - case isNewline(runes): - _, n, err = newNewlineToken(runes) - case isSep(runes): - _, n, err = newSepToken(runes) - case isOp(runes): - _, n, err = newOpToken(runes) - default: - _, n, err = newLitToken(runes) - } - - if err != nil { - return 0 - } - - count++ - runes = runes[n:] - } - - return count + 1 -} - -// Token indicates a metadata about a given value. -type Token struct { - t TokenType - ValueType ValueType - base int - raw []rune -} - -var emptyValue = Value{} - -func newToken(t TokenType, raw []rune, v ValueType) Token { - return Token{ - t: t, - raw: raw, - ValueType: v, - } -} - -// Raw return the raw runes that were consumed -func (tok Token) Raw() []rune { - return tok.raw -} - -// Type returns the token type -func (tok Token) Type() TokenType { - return tok.t -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini_parser.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini_parser.go deleted file mode 100644 index 643fbe46..00000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini_parser.go +++ /dev/null @@ -1,356 +0,0 @@ -package ini - -import ( - "fmt" - "io" -) - -// State enums for the parse table -const ( - InvalidState = iota - // stmt -> value stmt' - StatementState - // stmt' -> MarkComplete | op stmt - StatementPrimeState - // value -> number | string | boolean | quoted_string - ValueState - // section -> [ section' - OpenScopeState - // section' -> value section_close - SectionState - // section_close -> ] - CloseScopeState - // SkipState will skip (NL WS)+ - SkipState - // SkipTokenState will skip any token and push the previous - // state onto the stack. - SkipTokenState - // comment -> # comment' | ; comment' - // comment' -> MarkComplete | value - CommentState - // MarkComplete state will complete statements and move that - // to the completed AST list - MarkCompleteState - // TerminalState signifies that the tokens have been fully parsed - TerminalState -) - -// parseTable is a state machine to dictate the grammar above. -var parseTable = map[ASTKind]map[TokenType]int{ - ASTKindStart: { - TokenLit: StatementState, - TokenSep: OpenScopeState, - TokenWS: SkipTokenState, - TokenNL: SkipTokenState, - TokenComment: CommentState, - TokenNone: TerminalState, - }, - ASTKindCommentStatement: { - TokenLit: StatementState, - TokenSep: OpenScopeState, - TokenWS: SkipTokenState, - TokenNL: SkipTokenState, - TokenComment: CommentState, - TokenNone: MarkCompleteState, - }, - ASTKindExpr: { - TokenOp: StatementPrimeState, - TokenLit: ValueState, - TokenSep: OpenScopeState, - TokenWS: ValueState, - TokenNL: SkipState, - TokenComment: CommentState, - TokenNone: MarkCompleteState, - }, - ASTKindEqualExpr: { - TokenLit: ValueState, - TokenWS: SkipTokenState, - TokenNL: SkipState, - }, - ASTKindStatement: { - TokenLit: SectionState, - TokenSep: CloseScopeState, - TokenWS: SkipTokenState, - TokenNL: SkipTokenState, - TokenComment: CommentState, - TokenNone: MarkCompleteState, - }, - ASTKindExprStatement: { - TokenLit: ValueState, - TokenSep: OpenScopeState, - TokenOp: ValueState, - TokenWS: ValueState, - TokenNL: MarkCompleteState, - TokenComment: CommentState, - TokenNone: TerminalState, - TokenComma: SkipState, - }, - ASTKindSectionStatement: { - TokenLit: SectionState, - TokenOp: SectionState, - TokenSep: CloseScopeState, - TokenWS: SectionState, - TokenNL: SkipTokenState, - }, - ASTKindCompletedSectionStatement: { - TokenWS: SkipTokenState, - TokenNL: SkipTokenState, - TokenLit: StatementState, - TokenSep: OpenScopeState, - TokenComment: CommentState, - TokenNone: MarkCompleteState, - }, - ASTKindSkipStatement: { - TokenLit: StatementState, - TokenSep: OpenScopeState, - TokenWS: SkipTokenState, - TokenNL: SkipTokenState, - TokenComment: CommentState, - TokenNone: TerminalState, - }, -} - -// ParseAST will parse input from an io.Reader using -// an LL(1) parser. -func ParseAST(r io.Reader) ([]AST, error) { - lexer := iniLexer{} - tokens, err := lexer.Tokenize(r) - if err != nil { - return []AST{}, err - } - - return parse(tokens) -} - -// ParseASTBytes will parse input from a byte slice using -// an LL(1) parser. -func ParseASTBytes(b []byte) ([]AST, error) { - lexer := iniLexer{} - tokens, err := lexer.tokenize(b) - if err != nil { - return []AST{}, err - } - - return parse(tokens) -} - -func parse(tokens []Token) ([]AST, error) { - start := Start - stack := newParseStack(3, len(tokens)) - - stack.Push(start) - s := newSkipper() - -loop: - for stack.Len() > 0 { - k := stack.Pop() - - var tok Token - if len(tokens) == 0 { - // this occurs when all the tokens have been processed - // but reduction of what's left on the stack needs to - // occur. - tok = emptyToken - } else { - tok = tokens[0] - } - - step := parseTable[k.Kind][tok.Type()] - if s.ShouldSkip(tok) { - // being in a skip state with no tokens will break out of - // the parse loop since there is nothing left to process. - if len(tokens) == 0 { - break loop - } - // if should skip is true, we skip the tokens until should skip is set to false. - step = SkipTokenState - } - - switch step { - case TerminalState: - // Finished parsing. Push what should be the last - // statement to the stack. If there is anything left - // on the stack, an error in parsing has occurred. - if k.Kind != ASTKindStart { - stack.MarkComplete(k) - } - break loop - case SkipTokenState: - // When skipping a token, the previous state was popped off the stack. - // To maintain the correct state, the previous state will be pushed - // onto the stack. - stack.Push(k) - case StatementState: - if k.Kind != ASTKindStart { - stack.MarkComplete(k) - } - expr := newExpression(tok) - stack.Push(expr) - case StatementPrimeState: - if tok.Type() != TokenOp { - stack.MarkComplete(k) - continue - } - - if k.Kind != ASTKindExpr { - return nil, NewParseError( - fmt.Sprintf("invalid expression: expected Expr type, but found %T type", k), - ) - } - - k = trimSpaces(k) - expr := newEqualExpr(k, tok) - stack.Push(expr) - case ValueState: - // ValueState requires the previous state to either be an equal expression - // or an expression statement. - // - // This grammar occurs when the RHS is a number, word, or quoted string. - // equal_expr -> lit op equal_expr' - // equal_expr' -> number | string | quoted_string - // quoted_string -> " quoted_string' - // quoted_string' -> string quoted_string_end - // quoted_string_end -> " - // - // otherwise - // expr_stmt -> equal_expr (expr_stmt')* - // expr_stmt' -> ws S | op S | MarkComplete - // S -> equal_expr' expr_stmt' - switch k.Kind { - case ASTKindEqualExpr: - // assigning a value to some key - k.AppendChild(newExpression(tok)) - stack.Push(newExprStatement(k)) - case ASTKindExpr: - k.Root.raw = append(k.Root.raw, tok.Raw()...) - stack.Push(k) - case ASTKindExprStatement: - root := k.GetRoot() - children := root.GetChildren() - if len(children) == 0 { - return nil, NewParseError( - fmt.Sprintf("invalid expression: AST contains no children %s", k.Kind), - ) - } - - rhs := children[len(children)-1] - - if rhs.Root.ValueType != QuotedStringType { - rhs.Root.ValueType = StringType - rhs.Root.raw = append(rhs.Root.raw, tok.Raw()...) - - } - - children[len(children)-1] = rhs - k.SetChildren(children) - - stack.Push(k) - } - case OpenScopeState: - if !runeCompare(tok.Raw(), openBrace) { - return nil, NewParseError("expected '['") - } - // If OpenScopeState is not at the start, we must mark the previous ast as complete - // - // for example: if previous ast was a skip statement; - // we should mark it as complete before we create a new statement - if k.Kind != ASTKindStart { - stack.MarkComplete(k) - } - - stmt := newStatement() - stack.Push(stmt) - case CloseScopeState: - if !runeCompare(tok.Raw(), closeBrace) { - return nil, NewParseError("expected ']'") - } - - k = trimSpaces(k) - stack.Push(newCompletedSectionStatement(k)) - case SectionState: - var stmt AST - - switch k.Kind { - case ASTKindStatement: - // If there are multiple literals inside of a scope declaration, - // then the current token's raw value will be appended to the Name. - // - // This handles cases like [ profile default ] - // - // k will represent a SectionStatement with the children representing - // the label of the section - stmt = newSectionStatement(tok) - case ASTKindSectionStatement: - k.Root.raw = append(k.Root.raw, tok.Raw()...) - stmt = k - default: - return nil, NewParseError( - fmt.Sprintf("invalid statement: expected statement: %v", k.Kind), - ) - } - - stack.Push(stmt) - case MarkCompleteState: - if k.Kind != ASTKindStart { - stack.MarkComplete(k) - } - - if stack.Len() == 0 { - stack.Push(start) - } - case SkipState: - stack.Push(newSkipStatement(k)) - s.Skip() - case CommentState: - if k.Kind == ASTKindStart { - stack.Push(k) - } else { - stack.MarkComplete(k) - } - - stmt := newCommentStatement(tok) - stack.Push(stmt) - default: - return nil, NewParseError( - fmt.Sprintf("invalid state with ASTKind %v and TokenType %v", - k.Kind, tok.Type())) - } - - if len(tokens) > 0 { - tokens = tokens[1:] - } - } - - // this occurs when a statement has not been completed - if stack.top > 1 { - return nil, NewParseError(fmt.Sprintf("incomplete ini expression")) - } - - // returns a sublist which exludes the start symbol - return stack.List(), nil -} - -// trimSpaces will trim spaces on the left and right hand side of -// the literal. -func trimSpaces(k AST) AST { - // trim left hand side of spaces - for i := 0; i < len(k.Root.raw); i++ { - if !isWhitespace(k.Root.raw[i]) { - break - } - - k.Root.raw = k.Root.raw[1:] - i-- - } - - // trim right hand side of spaces - for i := len(k.Root.raw) - 1; i >= 0; i-- { - if !isWhitespace(k.Root.raw[i]) { - break - } - - k.Root.raw = k.Root.raw[:len(k.Root.raw)-1] - } - - return k -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/literal_tokens.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/literal_tokens.go deleted file mode 100644 index 91b37998..00000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/literal_tokens.go +++ /dev/null @@ -1,334 +0,0 @@ -package ini - -import ( - "fmt" - "strconv" - "strings" -) - -var ( - runesTrue = []rune("true") - runesFalse = []rune("false") -) - -var literalValues = [][]rune{ - runesTrue, - runesFalse, -} - -func isBoolValue(b []rune) bool { - for _, lv := range literalValues { - if isLitValue(lv, b) { - return true - } - } - return false -} - -func isLitValue(want, have []rune) bool { - if len(have) < len(want) { - return false - } - - for i := 0; i < len(want); i++ { - if want[i] != have[i] { - return false - } - } - - return true -} - -// isNumberValue will return whether not the leading characters in -// a byte slice is a number. A number is delimited by whitespace or -// the newline token. -// -// A number is defined to be in a binary, octal, decimal (int | float), hex format, -// or in scientific notation. -func isNumberValue(b []rune) bool { - negativeIndex := 0 - helper := numberHelper{} - needDigit := false - - for i := 0; i < len(b); i++ { - negativeIndex++ - - switch b[i] { - case '-': - if helper.IsNegative() || negativeIndex != 1 { - return false - } - helper.Determine(b[i]) - needDigit = true - continue - case 'e', 'E': - if err := helper.Determine(b[i]); err != nil { - return false - } - negativeIndex = 0 - needDigit = true - continue - case 'b': - if helper.numberFormat == hex { - break - } - fallthrough - case 'o', 'x': - needDigit = true - if i == 0 { - return false - } - - fallthrough - case '.': - if err := helper.Determine(b[i]); err != nil { - return false - } - needDigit = true - continue - } - - if i > 0 && (isNewline(b[i:]) || isWhitespace(b[i])) { - return !needDigit - } - - if !helper.CorrectByte(b[i]) { - return false - } - needDigit = false - } - - return !needDigit -} - -func isValid(b []rune) (bool, int, error) { - if len(b) == 0 { - // TODO: should probably return an error - return false, 0, nil - } - - return isValidRune(b[0]), 1, nil -} - -func isValidRune(r rune) bool { - return r != ':' && r != '=' && r != '[' && r != ']' && r != ' ' && r != '\n' -} - -// ValueType is an enum that will signify what type -// the Value is -type ValueType int - -func (v ValueType) String() string { - switch v { - case NoneType: - return "NONE" - case DecimalType: - return "FLOAT" - case IntegerType: - return "INT" - case StringType: - return "STRING" - case BoolType: - return "BOOL" - } - - return "" -} - -// ValueType enums -const ( - NoneType = ValueType(iota) - DecimalType - IntegerType - StringType - QuotedStringType - BoolType -) - -// Value is a union container -type Value struct { - Type ValueType - raw []rune - - integer int64 - decimal float64 - boolean bool - str string -} - -func newValue(t ValueType, base int, raw []rune) (Value, error) { - v := Value{ - Type: t, - raw: raw, - } - var err error - - switch t { - case DecimalType: - v.decimal, err = strconv.ParseFloat(string(raw), 64) - case IntegerType: - if base != 10 { - raw = raw[2:] - } - - v.integer, err = strconv.ParseInt(string(raw), base, 64) - case StringType: - v.str = string(raw) - case QuotedStringType: - v.str = string(raw[1 : len(raw)-1]) - case BoolType: - v.boolean = runeCompare(v.raw, runesTrue) - } - - // issue 2253 - // - // if the value trying to be parsed is too large, then we will use - // the 'StringType' and raw value instead. - if nerr, ok := err.(*strconv.NumError); ok && nerr.Err == strconv.ErrRange { - v.Type = StringType - v.str = string(raw) - err = nil - } - - return v, err -} - -// NewStringValue returns a Value type generated using a string input. -func NewStringValue(str string) (Value, error) { - return newValue(StringType, 10, []rune(str)) -} - -// NewIntValue returns a Value type generated using an int64 input. -func NewIntValue(i int64) (Value, error) { - return newValue(IntegerType, 10, []rune{rune(i)}) -} - -// Append will append values and change the type to a string -// type. -func (v *Value) Append(tok Token) { - r := tok.Raw() - if v.Type != QuotedStringType { - v.Type = StringType - r = tok.raw[1 : len(tok.raw)-1] - } - if tok.Type() != TokenLit { - v.raw = append(v.raw, tok.Raw()...) - } else { - v.raw = append(v.raw, r...) - } -} - -func (v Value) String() string { - switch v.Type { - case DecimalType: - return fmt.Sprintf("decimal: %f", v.decimal) - case IntegerType: - return fmt.Sprintf("integer: %d", v.integer) - case StringType: - return fmt.Sprintf("string: %s", string(v.raw)) - case QuotedStringType: - return fmt.Sprintf("quoted string: %s", string(v.raw)) - case BoolType: - return fmt.Sprintf("bool: %t", v.boolean) - default: - return "union not set" - } -} - -func newLitToken(b []rune) (Token, int, error) { - n := 0 - var err error - - token := Token{} - if b[0] == '"' { - n, err = getStringValue(b) - if err != nil { - return token, n, err - } - - token = newToken(TokenLit, b[:n], QuotedStringType) - } else if isNumberValue(b) { - var base int - base, n, err = getNumericalValue(b) - if err != nil { - return token, 0, err - } - - value := b[:n] - vType := IntegerType - if contains(value, '.') || hasExponent(value) { - vType = DecimalType - } - token = newToken(TokenLit, value, vType) - token.base = base - } else if isBoolValue(b) { - n, err = getBoolValue(b) - - token = newToken(TokenLit, b[:n], BoolType) - } else { - n, err = getValue(b) - token = newToken(TokenLit, b[:n], StringType) - } - - return token, n, err -} - -// IntValue returns an integer value -func (v Value) IntValue() int64 { - return v.integer -} - -// FloatValue returns a float value -func (v Value) FloatValue() float64 { - return v.decimal -} - -// BoolValue returns a bool value -func (v Value) BoolValue() bool { - return v.boolean -} - -func isTrimmable(r rune) bool { - switch r { - case '\n', ' ': - return true - } - return false -} - -// StringValue returns the string value -func (v Value) StringValue() string { - switch v.Type { - case StringType: - return strings.TrimFunc(string(v.raw), isTrimmable) - case QuotedStringType: - // preserve all characters in the quotes - return string(removeEscapedCharacters(v.raw[1 : len(v.raw)-1])) - default: - return strings.TrimFunc(string(v.raw), isTrimmable) - } -} - -func contains(runes []rune, c rune) bool { - for i := 0; i < len(runes); i++ { - if runes[i] == c { - return true - } - } - - return false -} - -func runeCompare(v1 []rune, v2 []rune) bool { - if len(v1) != len(v2) { - return false - } - - for i := 0; i < len(v1); i++ { - if v1[i] != v2[i] { - return false - } - } - - return true -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/newline_token.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/newline_token.go deleted file mode 100644 index e52ac399..00000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/newline_token.go +++ /dev/null @@ -1,30 +0,0 @@ -package ini - -func isNewline(b []rune) bool { - if len(b) == 0 { - return false - } - - if b[0] == '\n' { - return true - } - - if len(b) < 2 { - return false - } - - return b[0] == '\r' && b[1] == '\n' -} - -func newNewlineToken(b []rune) (Token, int, error) { - i := 1 - if b[0] == '\r' && isNewline(b[1:]) { - i++ - } - - if !isNewline([]rune(b[:i])) { - return emptyToken, 0, NewParseError("invalid new line token") - } - - return newToken(TokenNL, b[:i], NoneType), i, nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/number_helper.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/number_helper.go deleted file mode 100644 index a45c0bc5..00000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/number_helper.go +++ /dev/null @@ -1,152 +0,0 @@ -package ini - -import ( - "bytes" - "fmt" - "strconv" -) - -const ( - none = numberFormat(iota) - binary - octal - decimal - hex - exponent -) - -type numberFormat int - -// numberHelper is used to dictate what format a number is in -// and what to do for negative values. Since -1e-4 is a valid -// number, we cannot just simply check for duplicate negatives. -type numberHelper struct { - numberFormat numberFormat - - negative bool - negativeExponent bool -} - -func (b numberHelper) Exists() bool { - return b.numberFormat != none -} - -func (b numberHelper) IsNegative() bool { - return b.negative || b.negativeExponent -} - -func (b *numberHelper) Determine(c rune) error { - if b.Exists() { - return NewParseError(fmt.Sprintf("multiple number formats: 0%v", string(c))) - } - - switch c { - case 'b': - b.numberFormat = binary - case 'o': - b.numberFormat = octal - case 'x': - b.numberFormat = hex - case 'e', 'E': - b.numberFormat = exponent - case '-': - if b.numberFormat != exponent { - b.negative = true - } else { - b.negativeExponent = true - } - case '.': - b.numberFormat = decimal - default: - return NewParseError(fmt.Sprintf("invalid number character: %v", string(c))) - } - - return nil -} - -func (b numberHelper) CorrectByte(c rune) bool { - switch { - case b.numberFormat == binary: - if !isBinaryByte(c) { - return false - } - case b.numberFormat == octal: - if !isOctalByte(c) { - return false - } - case b.numberFormat == hex: - if !isHexByte(c) { - return false - } - case b.numberFormat == decimal: - if !isDigit(c) { - return false - } - case b.numberFormat == exponent: - if !isDigit(c) { - return false - } - case b.negativeExponent: - if !isDigit(c) { - return false - } - case b.negative: - if !isDigit(c) { - return false - } - default: - if !isDigit(c) { - return false - } - } - - return true -} - -func (b numberHelper) Base() int { - switch b.numberFormat { - case binary: - return 2 - case octal: - return 8 - case hex: - return 16 - default: - return 10 - } -} - -func (b numberHelper) String() string { - buf := bytes.Buffer{} - i := 0 - - switch b.numberFormat { - case binary: - i++ - buf.WriteString(strconv.Itoa(i) + ": binary format\n") - case octal: - i++ - buf.WriteString(strconv.Itoa(i) + ": octal format\n") - case hex: - i++ - buf.WriteString(strconv.Itoa(i) + ": hex format\n") - case exponent: - i++ - buf.WriteString(strconv.Itoa(i) + ": exponent format\n") - default: - i++ - buf.WriteString(strconv.Itoa(i) + ": integer format\n") - } - - if b.negative { - i++ - buf.WriteString(strconv.Itoa(i) + ": negative format\n") - } - - if b.negativeExponent { - i++ - buf.WriteString(strconv.Itoa(i) + ": negative exponent format\n") - } - - return buf.String() -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/op_tokens.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/op_tokens.go deleted file mode 100644 index 8a84c7cb..00000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/op_tokens.go +++ /dev/null @@ -1,39 +0,0 @@ -package ini - -import ( - "fmt" -) - -var ( - equalOp = []rune("=") - equalColonOp = []rune(":") -) - -func isOp(b []rune) bool { - if len(b) == 0 { - return false - } - - switch b[0] { - case '=': - return true - case ':': - return true - default: - return false - } -} - -func newOpToken(b []rune) (Token, int, error) { - tok := Token{} - - switch b[0] { - case '=': - tok = newToken(TokenOp, equalOp, NoneType) - case ':': - tok = newToken(TokenOp, equalColonOp, NoneType) - default: - return tok, 0, NewParseError(fmt.Sprintf("unexpected op type, %v", b[0])) - } - return tok, 1, nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/parse.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/parse.go new file mode 100644 index 00000000..2422d904 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/parse.go @@ -0,0 +1,109 @@ +package ini + +import ( + "fmt" + "strings" +) + +func parse(tokens []lineToken, path string) Sections { + parser := &parser{ + path: path, + sections: NewSections(), + } + parser.parse(tokens) + return parser.sections +} + +type parser struct { + csection, ckey string // current state + path string // source file path + sections Sections // parse result +} + +func (p *parser) parse(tokens []lineToken) { + for _, otok := range tokens { + switch tok := otok.(type) { + case *lineTokenProfile: + p.handleProfile(tok) + case *lineTokenProperty: + p.handleProperty(tok) + case *lineTokenSubProperty: + p.handleSubProperty(tok) + case *lineTokenContinuation: + p.handleContinuation(tok) + } + } +} + +func (p *parser) handleProfile(tok *lineTokenProfile) { + name := tok.Name + if tok.Type != "" { + name = fmt.Sprintf("%s %s", tok.Type, tok.Name) + } + p.ckey = "" + p.csection = name + if _, ok := p.sections.container[name]; !ok { + p.sections.container[name] = NewSection(name) + } +} + +func (p *parser) handleProperty(tok *lineTokenProperty) { + if p.csection == "" { + return // LEGACY: don't error on "global" properties + } + + p.ckey = tok.Key + if _, ok := p.sections.container[p.csection].values[tok.Key]; ok { + section := p.sections.container[p.csection] + section.Logs = append(p.sections.container[p.csection].Logs, + fmt.Sprintf( + "For profile: %v, overriding %v value, with a %v value found in a duplicate profile defined later in the same file %v. \n", + p.csection, tok.Key, tok.Key, p.path, + ), + ) + p.sections.container[p.csection] = section + } + + p.sections.container[p.csection].values[tok.Key] = Value{ + str: tok.Value, + } + p.sections.container[p.csection].SourceFile[tok.Key] = p.path +} + +func (p *parser) handleSubProperty(tok *lineTokenSubProperty) { + if p.csection == "" { + return // LEGACY: don't error on "global" properties + } + + if p.ckey == "" || p.sections.container[p.csection].values[p.ckey].str != "" { + // This is an "orphaned" subproperty, either because it's at + // the beginning of a section or because the last property's + // value isn't empty. Either way we're lenient here and + // "promote" this to a normal property. + p.handleProperty(&lineTokenProperty{ + Key: tok.Key, + Value: strings.TrimSpace(trimPropertyComment(tok.Value)), + }) + return + } + + if p.sections.container[p.csection].values[p.ckey].mp == nil { + p.sections.container[p.csection].values[p.ckey] = Value{ + mp: map[string]string{}, + } + } + p.sections.container[p.csection].values[p.ckey].mp[tok.Key] = tok.Value +} + +func (p *parser) handleContinuation(tok *lineTokenContinuation) { + if p.ckey == "" { + return + } + + value, _ := p.sections.container[p.csection].values[p.ckey] + if value.str != "" && value.mp == nil { + value.str = fmt.Sprintf("%s\n%s", value.str, tok.Value) + } + + p.sections.container[p.csection].values[p.ckey] = value +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/parse_error.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/parse_error.go deleted file mode 100644 index 30ae0b8f..00000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/parse_error.go +++ /dev/null @@ -1,19 +0,0 @@ -package ini - -// ParseError is an error which is returned during any part of -// the parsing process. -type ParseError struct { - msg string -} - -// NewParseError will return a new ParseError where message -// is the description of the error. -func NewParseError(message string) *ParseError { - return &ParseError{ - msg: message, - } -} - -func (err *ParseError) Error() string { - return err.msg -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/parse_stack.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/parse_stack.go deleted file mode 100644 index 7f01cf7c..00000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/parse_stack.go +++ /dev/null @@ -1,60 +0,0 @@ -package ini - -import ( - "bytes" - "fmt" -) - -// ParseStack is a stack that contains a container, the stack portion, -// and the list which is the list of ASTs that have been successfully -// parsed. -type ParseStack struct { - top int - container []AST - list []AST - index int -} - -func newParseStack(sizeContainer, sizeList int) ParseStack { - return ParseStack{ - container: make([]AST, sizeContainer), - list: make([]AST, sizeList), - } -} - -// Pop will return and truncate the last container element. -func (s *ParseStack) Pop() AST { - s.top-- - return s.container[s.top] -} - -// Push will add the new AST to the container -func (s *ParseStack) Push(ast AST) { - s.container[s.top] = ast - s.top++ -} - -// MarkComplete will append the AST to the list of completed statements -func (s *ParseStack) MarkComplete(ast AST) { - s.list[s.index] = ast - s.index++ -} - -// List will return the completed statements -func (s ParseStack) List() []AST { - return s.list[:s.index] -} - -// Len will return the length of the container -func (s *ParseStack) Len() int { - return s.top -} - -func (s ParseStack) String() string { - buf := bytes.Buffer{} - for i, node := range s.list { - buf.WriteString(fmt.Sprintf("%d: %v\n", i+1, node)) - } - - return buf.String() -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/sections.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/sections.go new file mode 100644 index 00000000..dd89848e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/sections.go @@ -0,0 +1,157 @@ +package ini + +import ( + "sort" +) + +// Sections is a map of Section structures that represent +// a configuration. +type Sections struct { + container map[string]Section +} + +// NewSections returns empty ini Sections +func NewSections() Sections { + return Sections{ + container: make(map[string]Section, 0), + } +} + +// GetSection will return section p. If section p does not exist, +// false will be returned in the second parameter. +func (t Sections) GetSection(p string) (Section, bool) { + v, ok := t.container[p] + return v, ok +} + +// HasSection denotes if Sections consist of a section with +// provided name. +func (t Sections) HasSection(p string) bool { + _, ok := t.container[p] + return ok +} + +// SetSection sets a section value for provided section name. +func (t Sections) SetSection(p string, v Section) Sections { + t.container[p] = v + return t +} + +// DeleteSection deletes a section entry/value for provided section name./ +func (t Sections) DeleteSection(p string) { + delete(t.container, p) +} + +// values represents a map of union values. +type values map[string]Value + +// List will return a list of all sections that were successfully +// parsed. +func (t Sections) List() []string { + keys := make([]string, len(t.container)) + i := 0 + for k := range t.container { + keys[i] = k + i++ + } + + sort.Strings(keys) + return keys +} + +// Section contains a name and values. This represent +// a sectioned entry in a configuration file. +type Section struct { + // Name is the Section profile name + Name string + + // values are the values within parsed profile + values values + + // Errors is the list of errors + Errors []error + + // Logs is the list of logs + Logs []string + + // SourceFile is the INI Source file from where this section + // was retrieved. They key is the property, value is the + // source file the property was retrieved from. + SourceFile map[string]string +} + +// NewSection returns an initialize section for the name +func NewSection(name string) Section { + return Section{ + Name: name, + values: values{}, + SourceFile: map[string]string{}, + } +} + +// 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 +} + +// UpdateValue updates value for a provided key with provided value +func (t Section) UpdateValue(k string, v Value) error { + t.values[k] = v + return nil +} + +// Has will return whether or not an entry exists in a given section +func (t Section) Has(k string) bool { + _, ok := t.values[k] + return ok +} + +// ValueType will returned what type the union is set to. If +// k was not found, the NoneType will be returned. +func (t Section) ValueType(k string) (ValueType, bool) { + v, ok := t.values[k] + return v.Type, ok +} + +// Bool returns a bool value at k +func (t Section) Bool(k string) (bool, bool) { + return t.values[k].BoolValue() +} + +// Int returns an integer value at k +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() +} + +// String returns the string value at k +func (t Section) String(k string) string { + _, ok := t.values[k] + if !ok { + return "" + } + return t.values[k].StringValue() +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/sep_tokens.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/sep_tokens.go deleted file mode 100644 index f82095ba..00000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/sep_tokens.go +++ /dev/null @@ -1,41 +0,0 @@ -package ini - -import ( - "fmt" -) - -var ( - emptyRunes = []rune{} -) - -func isSep(b []rune) bool { - if len(b) == 0 { - return false - } - - switch b[0] { - case '[', ']': - return true - default: - return false - } -} - -var ( - openBrace = []rune("[") - closeBrace = []rune("]") -) - -func newSepToken(b []rune) (Token, int, error) { - tok := Token{} - - switch b[0] { - case '[': - tok = newToken(TokenSep, openBrace, NoneType) - case ']': - tok = newToken(TokenSep, closeBrace, NoneType) - default: - return tok, 0, NewParseError(fmt.Sprintf("unexpected sep type, %v", b[0])) - } - return tok, 1, nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/skipper.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/skipper.go deleted file mode 100644 index 07e90876..00000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/skipper.go +++ /dev/null @@ -1,45 +0,0 @@ -package ini - -// skipper is used to skip certain blocks of an ini file. -// Currently skipper is used to skip nested blocks of ini -// files. See example below -// -// [ foo ] -// nested = ; this section will be skipped -// a=b -// c=d -// bar=baz ; this will be included -type skipper struct { - shouldSkip bool - TokenSet bool - prevTok Token -} - -func newSkipper() skipper { - return skipper{ - prevTok: emptyToken, - } -} - -func (s *skipper) ShouldSkip(tok Token) bool { - // should skip state will be modified only if previous token was new line (NL); - // and the current token is not WhiteSpace (WS). - if s.shouldSkip && - s.prevTok.Type() == TokenNL && - tok.Type() != TokenWS { - s.Continue() - return false - } - - s.prevTok = tok - return s.shouldSkip -} - -func (s *skipper) Skip() { - s.shouldSkip = true -} - -func (s *skipper) Continue() { - s.shouldSkip = false - s.prevTok = emptyToken -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/statement.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/statement.go deleted file mode 100644 index ba0af01b..00000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/statement.go +++ /dev/null @@ -1,35 +0,0 @@ -package ini - -// Statement is an empty AST mostly used for transitioning states. -func newStatement() AST { - return newAST(ASTKindStatement, AST{}) -} - -// SectionStatement represents a section AST -func newSectionStatement(tok Token) AST { - return newASTWithRootToken(ASTKindSectionStatement, tok) -} - -// ExprStatement represents a completed expression AST -func newExprStatement(ast AST) AST { - return newAST(ASTKindExprStatement, ast) -} - -// CommentStatement represents a comment in the ini defintion. -// -// grammar: -// comment -> #comment' | ;comment' -// comment' -> epsilon | value -func newCommentStatement(tok Token) AST { - return newAST(ASTKindCommentStatement, newExpression(tok)) -} - -// CompletedSectionStatement represents a completed section -func newCompletedSectionStatement(ast AST) AST { - return newAST(ASTKindCompletedSectionStatement, ast) -} - -// SkipStatement is used to skip whole statements -func newSkipStatement(ast AST) AST { - return newAST(ASTKindSkipStatement, ast) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/strings.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/strings.go new file mode 100644 index 00000000..661588c2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/strings.go @@ -0,0 +1,93 @@ +package ini + +import ( + "strings" +) + +func trimProfileComment(s string) string { + r, _, _ := strings.Cut(s, "#") + r, _, _ = strings.Cut(r, ";") + return r +} + +func trimPropertyComment(s string) string { + r, _, _ := strings.Cut(s, " #") + r, _, _ = strings.Cut(r, " ;") + r, _, _ = strings.Cut(r, "\t#") + r, _, _ = strings.Cut(r, "\t;") + return r +} + +// assumes no surrounding comment +func splitProperty(s string) (string, string, bool) { + equalsi := strings.Index(s, "=") + coloni := strings.Index(s, ":") // LEGACY: also supported for property assignment + sep := "=" + if equalsi == -1 || coloni != -1 && coloni < equalsi { + sep = ":" + } + + k, v, ok := strings.Cut(s, sep) + if !ok { + return "", "", false + } + return strings.TrimSpace(k), strings.TrimSpace(v), true +} + +// assumes no surrounding comment, whitespace, or profile brackets +func splitProfile(s string) (string, string) { + var first int + for i, r := range s { + if isLineSpace(r) { + if first == 0 { + first = i + } + } else { + if first != 0 { + return s[:first], s[i:] + } + } + } + if first == 0 { + return "", s // type component is effectively blank + } + return "", "" +} + +func isLineSpace(r rune) bool { + return r == ' ' || r == '\t' +} + +func unquote(s string) string { + if isSingleQuoted(s) || isDoubleQuoted(s) { + return s[1 : len(s)-1] + } + return s +} + +// applies various legacy conversions to property values: +// - remote wrapping single/doublequotes +// - expand escaped quote and newline sequences +func legacyStrconv(s string) string { + s = unquote(s) + s = strings.ReplaceAll(s, `\"`, `"`) + s = strings.ReplaceAll(s, `\'`, `'`) + s = strings.ReplaceAll(s, `\n`, "\n") + return s +} + +func isSingleQuoted(s string) bool { + return hasAffixes(s, "'", "'") +} + +func isDoubleQuoted(s string) bool { + return hasAffixes(s, `"`, `"`) +} + +func isBracketed(s string) bool { + return hasAffixes(s, "[", "]") +} + +func hasAffixes(s, left, right string) bool { + return strings.HasPrefix(s, left) && strings.HasSuffix(s, right) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/token.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/token.go new file mode 100644 index 00000000..6e9a0374 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/token.go @@ -0,0 +1,32 @@ +package ini + +type lineToken interface { + isLineToken() +} + +type lineTokenProfile struct { + Type string + Name string +} + +func (*lineTokenProfile) isLineToken() {} + +type lineTokenProperty struct { + Key string + Value string +} + +func (*lineTokenProperty) isLineToken() {} + +type lineTokenContinuation struct { + Value string +} + +func (*lineTokenContinuation) isLineToken() {} + +type lineTokenSubProperty struct { + Key string + Value string +} + +func (*lineTokenSubProperty) isLineToken() {} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/tokenize.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/tokenize.go new file mode 100644 index 00000000..89a77368 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/tokenize.go @@ -0,0 +1,92 @@ +package ini + +import ( + "strings" +) + +func tokenize(lines []string) ([]lineToken, error) { + tokens := make([]lineToken, 0, len(lines)) + for _, line := range lines { + if len(strings.TrimSpace(line)) == 0 || isLineComment(line) { + continue + } + + if tok := asProfile(line); tok != nil { + tokens = append(tokens, tok) + } else if tok := asProperty(line); tok != nil { + tokens = append(tokens, tok) + } else if tok := asSubProperty(line); tok != nil { + tokens = append(tokens, tok) + } else if tok := asContinuation(line); tok != nil { + tokens = append(tokens, tok) + } // unrecognized tokens are effectively ignored + } + return tokens, nil +} + +func isLineComment(line string) bool { + trimmed := strings.TrimLeft(line, " \t") + return strings.HasPrefix(trimmed, "#") || strings.HasPrefix(trimmed, ";") +} + +func asProfile(line string) *lineTokenProfile { // " [ type name ] ; comment" + trimmed := strings.TrimSpace(trimProfileComment(line)) // "[ type name ]" + if !isBracketed(trimmed) { + return nil + } + trimmed = trimmed[1 : len(trimmed)-1] // " type name " (or just " name ") + trimmed = strings.TrimSpace(trimmed) // "type name" / "name" + typ, name := splitProfile(trimmed) + return &lineTokenProfile{ + Type: typ, + Name: name, + } +} + +func asProperty(line string) *lineTokenProperty { + if isLineSpace(rune(line[0])) { + return nil + } + + trimmed := trimPropertyComment(line) + trimmed = strings.TrimRight(trimmed, " \t") + k, v, ok := splitProperty(trimmed) + if !ok { + return nil + } + + return &lineTokenProperty{ + Key: strings.ToLower(k), // LEGACY: normalize key case + Value: legacyStrconv(v), // LEGACY: see func docs + } +} + +func asSubProperty(line string) *lineTokenSubProperty { + if !isLineSpace(rune(line[0])) { + return nil + } + + // comments on sub-properties are included in the value + trimmed := strings.TrimLeft(line, " \t") + k, v, ok := splitProperty(trimmed) + if !ok { + return nil + } + + return &lineTokenSubProperty{ // same LEGACY constraints as in normal property + Key: strings.ToLower(k), + Value: legacyStrconv(v), + } +} + +func asContinuation(line string) *lineTokenContinuation { + if !isLineSpace(rune(line[0])) { + return nil + } + + // includes comments like sub-properties + trimmed := strings.TrimLeft(line, " \t") + return &lineTokenContinuation{ + Value: trimmed, + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/value.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/value.go new file mode 100644 index 00000000..e3706b3c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/value.go @@ -0,0 +1,93 @@ +package ini + +import ( + "fmt" + "strconv" + "strings" +) + +// ValueType is an enum that will signify what type +// the Value is +type ValueType int + +func (v ValueType) String() string { + switch v { + case NoneType: + return "NONE" + case StringType: + return "STRING" + } + + return "" +} + +// ValueType enums +const ( + NoneType = ValueType(iota) + StringType + QuotedStringType +) + +// Value is a union container +type Value struct { + Type ValueType + + str string + mp map[string]string +} + +// NewStringValue returns a Value type generated using a string input. +func NewStringValue(str string) (Value, error) { + return Value{str: str}, nil +} + +func (v Value) String() string { + switch v.Type { + case StringType: + return fmt.Sprintf("string: %s", string(v.str)) + case QuotedStringType: + return fmt.Sprintf("quoted string: %s", string(v.str)) + default: + return "union not set" + } +} + +// MapValue returns a map value for sub properties +func (v Value) MapValue() map[string]string { + return v.mp +} + +// IntValue returns an integer value +func (v Value) IntValue() (int64, bool) { + i, err := strconv.ParseInt(string(v.str), 0, 64) + if err != nil { + return 0, false + } + return i, true +} + +// FloatValue returns a float value +func (v Value) FloatValue() (float64, bool) { + f, err := strconv.ParseFloat(string(v.str), 64) + if err != nil { + return 0, false + } + return f, true +} + +// BoolValue returns a bool value +func (v Value) BoolValue() (bool, bool) { + // we don't use ParseBool as it recognizes more than what we've + // historically supported + if strings.EqualFold(v.str, "true") { + return true, true + } else if strings.EqualFold(v.str, "false") { + return false, true + } + return false, false +} + +// StringValue returns the string value +func (v Value) StringValue() string { + return v.str +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/value_util.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/value_util.go deleted file mode 100644 index 305999d2..00000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/value_util.go +++ /dev/null @@ -1,284 +0,0 @@ -package ini - -import ( - "fmt" -) - -// getStringValue will return a quoted string and the amount -// of bytes read -// -// an error will be returned if the string is not properly formatted -func getStringValue(b []rune) (int, error) { - if b[0] != '"' { - return 0, NewParseError("strings must start with '\"'") - } - - endQuote := false - i := 1 - - for ; i < len(b) && !endQuote; i++ { - if escaped := isEscaped(b[:i], b[i]); b[i] == '"' && !escaped { - endQuote = true - break - } else if escaped { - /*c, err := getEscapedByte(b[i]) - if err != nil { - return 0, err - } - - b[i-1] = c - b = append(b[:i], b[i+1:]...) - i--*/ - - continue - } - } - - if !endQuote { - return 0, NewParseError("missing '\"' in string value") - } - - return i + 1, nil -} - -// getBoolValue will return a boolean and the amount -// of bytes read -// -// an error will be returned if the boolean is not of a correct -// value -func getBoolValue(b []rune) (int, error) { - if len(b) < 4 { - return 0, NewParseError("invalid boolean value") - } - - n := 0 - for _, lv := range literalValues { - if len(lv) > len(b) { - continue - } - - if isLitValue(lv, b) { - n = len(lv) - } - } - - if n == 0 { - return 0, NewParseError("invalid boolean value") - } - - return n, nil -} - -// getNumericalValue will return a numerical string, the amount -// of bytes read, and the base of the number -// -// an error will be returned if the number is not of a correct -// value -func getNumericalValue(b []rune) (int, int, error) { - if !isDigit(b[0]) { - return 0, 0, NewParseError("invalid digit value") - } - - i := 0 - helper := numberHelper{} - -loop: - for negativeIndex := 0; i < len(b); i++ { - negativeIndex++ - - if !isDigit(b[i]) { - switch b[i] { - case '-': - if helper.IsNegative() || negativeIndex != 1 { - return 0, 0, NewParseError("parse error '-'") - } - - n := getNegativeNumber(b[i:]) - i += (n - 1) - helper.Determine(b[i]) - continue - case '.': - if err := helper.Determine(b[i]); err != nil { - return 0, 0, err - } - case 'e', 'E': - if err := helper.Determine(b[i]); err != nil { - return 0, 0, err - } - - negativeIndex = 0 - case 'b': - if helper.numberFormat == hex { - break - } - fallthrough - case 'o', 'x': - if i == 0 && b[i] != '0' { - return 0, 0, NewParseError("incorrect base format, expected leading '0'") - } - - if i != 1 { - return 0, 0, NewParseError(fmt.Sprintf("incorrect base format found %s at %d index", string(b[i]), i)) - } - - if err := helper.Determine(b[i]); err != nil { - return 0, 0, err - } - default: - if isWhitespace(b[i]) { - break loop - } - - if isNewline(b[i:]) { - break loop - } - - if !(helper.numberFormat == hex && isHexByte(b[i])) { - if i+2 < len(b) && !isNewline(b[i:i+2]) { - return 0, 0, NewParseError("invalid numerical character") - } else if !isNewline([]rune{b[i]}) { - return 0, 0, NewParseError("invalid numerical character") - } - - break loop - } - } - } - } - - return helper.Base(), i, nil -} - -// isDigit will return whether or not something is an integer -func isDigit(b rune) bool { - return b >= '0' && b <= '9' -} - -func hasExponent(v []rune) bool { - return contains(v, 'e') || contains(v, 'E') -} - -func isBinaryByte(b rune) bool { - switch b { - case '0', '1': - return true - default: - return false - } -} - -func isOctalByte(b rune) bool { - switch b { - case '0', '1', '2', '3', '4', '5', '6', '7': - return true - default: - return false - } -} - -func isHexByte(b rune) bool { - if isDigit(b) { - return true - } - return (b >= 'A' && b <= 'F') || - (b >= 'a' && b <= 'f') -} - -func getValue(b []rune) (int, error) { - i := 0 - - for i < len(b) { - if isNewline(b[i:]) { - break - } - - if isOp(b[i:]) { - break - } - - valid, n, err := isValid(b[i:]) - if err != nil { - return 0, err - } - - if !valid { - break - } - - i += n - } - - return i, nil -} - -// getNegativeNumber will return a negative number from a -// byte slice. This will iterate through all characters until -// a non-digit has been found. -func getNegativeNumber(b []rune) int { - if b[0] != '-' { - return 0 - } - - i := 1 - for ; i < len(b); i++ { - if !isDigit(b[i]) { - return i - } - } - - return i -} - -// isEscaped will return whether or not the character is an escaped -// character. -func isEscaped(value []rune, b rune) bool { - if len(value) == 0 { - return false - } - - switch b { - case '\'': // single quote - case '"': // quote - case 'n': // newline - case 't': // tab - case '\\': // backslash - default: - return false - } - - return value[len(value)-1] == '\\' -} - -func getEscapedByte(b rune) (rune, error) { - switch b { - case '\'': // single quote - return '\'', nil - case '"': // quote - return '"', nil - case 'n': // newline - return '\n', nil - case 't': // table - return '\t', nil - case '\\': // backslash - return '\\', nil - default: - return b, NewParseError(fmt.Sprintf("invalid escaped character %c", b)) - } -} - -func removeEscapedCharacters(b []rune) []rune { - for i := 0; i < len(b); i++ { - if isEscaped(b[:i], b[i]) { - c, err := getEscapedByte(b[i]) - if err != nil { - return b - } - - b[i-1] = c - b = append(b[:i], b[i+1:]...) - i-- - } - } - - return b -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/visitor.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/visitor.go deleted file mode 100644 index cfd6fe4d..00000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/visitor.go +++ /dev/null @@ -1,268 +0,0 @@ -package ini - -import ( - "fmt" - "sort" - "strings" -) - -// Visitor is an interface used by walkers that will -// traverse an array of ASTs. -type Visitor interface { - VisitExpr(AST) error - VisitStatement(AST) error -} - -// DefaultVisitor is used to visit statements and expressions -// and ensure that they are both of the correct format. -// In addition, upon visiting this will build sections and populate -// the Sections field which can be used to retrieve profile -// configuration. -type DefaultVisitor struct { - - // scope is the profile which is being visited - scope string - - // path is the file path which the visitor is visiting - path string - - // Sections defines list of the profile section - Sections Sections -} - -// NewDefaultVisitor returns a DefaultVisitor. It takes in a filepath -// which points to the file it is visiting. -func NewDefaultVisitor(filepath string) *DefaultVisitor { - return &DefaultVisitor{ - Sections: Sections{ - container: map[string]Section{}, - }, - path: filepath, - } -} - -// VisitExpr visits expressions... -func (v *DefaultVisitor) VisitExpr(expr AST) error { - t := v.Sections.container[v.scope] - if t.values == nil { - t.values = values{} - } - if t.SourceFile == nil { - t.SourceFile = make(map[string]string, 0) - } - - switch expr.Kind { - case ASTKindExprStatement: - opExpr := expr.GetRoot() - switch opExpr.Kind { - case ASTKindEqualExpr: - children := opExpr.GetChildren() - if len(children) <= 1 { - return NewParseError("unexpected token type") - } - - rhs := children[1] - - if rhs.Root.Type() != TokenLit { - return NewParseError("unexpected token type") - } - - key := EqualExprKey(opExpr) - val, err := newValue(rhs.Root.ValueType, rhs.Root.base, rhs.Root.Raw()) - if err != nil { - return err - } - - // lower case key to standardize - k := strings.ToLower(key) - - // identify if the section already had this key, append log on section - if t.Has(k) { - t.Logs = append(t.Logs, - fmt.Sprintf("For profile: %v, overriding %v value, "+ - "with a %v value found in a duplicate profile defined later in the same file %v. \n", - t.Name, k, k, v.path)) - } - - // assign the value - t.values[k] = val - // update the source file path for region - t.SourceFile[k] = v.path - default: - return NewParseError(fmt.Sprintf("unsupported expression %v", expr)) - } - default: - return NewParseError(fmt.Sprintf("unsupported expression %v", expr)) - } - - v.Sections.container[v.scope] = t - return nil -} - -// VisitStatement visits statements... -func (v *DefaultVisitor) VisitStatement(stmt AST) error { - switch stmt.Kind { - case ASTKindCompletedSectionStatement: - child := stmt.GetRoot() - if child.Kind != ASTKindSectionStatement { - return NewParseError(fmt.Sprintf("unsupported child statement: %T", child)) - } - - name := string(child.Root.Raw()) - - // trim start and end space - name = strings.TrimSpace(name) - - // if has prefix "profile " + [ws+] + "profile-name", - // we standardize by removing the [ws+] between prefix and profile-name. - if strings.HasPrefix(name, "profile ") { - names := strings.SplitN(name, " ", 2) - name = names[0] + " " + strings.TrimLeft(names[1], " ") - } - - // lower casing name to handle duplicates correctly. - name = strings.ToLower(name) - // attach profile name on section - if !v.Sections.HasSection(name) { - v.Sections.container[name] = NewSection(name) - } - v.scope = name - default: - return NewParseError(fmt.Sprintf("unsupported statement: %s", stmt.Kind)) - } - - return nil -} - -// Sections is a map of Section structures that represent -// a configuration. -type Sections struct { - container map[string]Section -} - -// NewSections returns empty ini Sections -func NewSections() Sections { - return Sections{ - container: make(map[string]Section, 0), - } -} - -// GetSection will return section p. If section p does not exist, -// false will be returned in the second parameter. -func (t Sections) GetSection(p string) (Section, bool) { - v, ok := t.container[p] - return v, ok -} - -// HasSection denotes if Sections consist of a section with -// provided name. -func (t Sections) HasSection(p string) bool { - _, ok := t.container[p] - return ok -} - -// SetSection sets a section value for provided section name. -func (t Sections) SetSection(p string, v Section) Sections { - t.container[p] = v - return t -} - -// DeleteSection deletes a section entry/value for provided section name./ -func (t Sections) DeleteSection(p string) { - delete(t.container, p) -} - -// values represents a map of union values. -type values map[string]Value - -// List will return a list of all sections that were successfully -// parsed. -func (t Sections) List() []string { - keys := make([]string, len(t.container)) - i := 0 - for k := range t.container { - keys[i] = k - i++ - } - - sort.Strings(keys) - return keys -} - -// Section contains a name and values. This represent -// a sectioned entry in a configuration file. -type Section struct { - // Name is the Section profile name - Name string - - // values are the values within parsed profile - values values - - // Errors is the list of errors - Errors []error - - // Logs is the list of logs - Logs []string - - // SourceFile is the INI Source file from where this section - // was retrieved. They key is the property, value is the - // source file the property was retrieved from. - SourceFile map[string]string -} - -// NewSection returns an initialize section for the name -func NewSection(name string) Section { - return Section{ - Name: name, - values: values{}, - SourceFile: map[string]string{}, - } -} - -// UpdateSourceFile updates source file for a property to provided filepath. -func (t Section) UpdateSourceFile(property string, filepath string) { - t.SourceFile[property] = filepath -} - -// UpdateValue updates value for a provided key with provided value -func (t Section) UpdateValue(k string, v Value) error { - t.values[k] = v - return nil -} - -// Has will return whether or not an entry exists in a given section -func (t Section) Has(k string) bool { - _, ok := t.values[k] - return ok -} - -// ValueType will returned what type the union is set to. If -// k was not found, the NoneType will be returned. -func (t Section) ValueType(k string) (ValueType, bool) { - v, ok := t.values[k] - return v.Type, ok -} - -// Bool returns a bool value at k -func (t Section) Bool(k string) bool { - return t.values[k].BoolValue() -} - -// Int returns an integer value at k -func (t Section) Int(k string) int64 { - return t.values[k].IntValue() -} - -// Float64 returns a float value at k -func (t Section) Float64(k string) float64 { - return t.values[k].FloatValue() -} - -// String returns the string value at k -func (t Section) String(k string) string { - _, ok := t.values[k] - if !ok { - return "" - } - return t.values[k].StringValue() -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/walker.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/walker.go deleted file mode 100644 index 99915f7f..00000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/walker.go +++ /dev/null @@ -1,25 +0,0 @@ -package ini - -// Walk will traverse the AST using the v, the Visitor. -func Walk(tree []AST, v Visitor) error { - for _, node := range tree { - switch node.Kind { - case ASTKindExpr, - ASTKindExprStatement: - - if err := v.VisitExpr(node); err != nil { - return err - } - case ASTKindStatement, - ASTKindCompletedSectionStatement, - ASTKindNestedSectionStatement, - ASTKindCompletedNestedSectionStatement: - - if err := v.VisitStatement(node); err != nil { - return err - } - } - } - - return nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ws_token.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ws_token.go deleted file mode 100644 index 7ffb4ae0..00000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ws_token.go +++ /dev/null @@ -1,24 +0,0 @@ -package ini - -import ( - "unicode" -) - -// isWhitespace will return whether or not the character is -// a whitespace character. -// -// Whitespace is defined as a space or tab. -func isWhitespace(c rune) bool { - return unicode.IsSpace(c) && c != '\n' && c != '\r' -} - -func newWSToken(b []rune) (Token, int, error) { - i := 0 - for ; i < len(b); i++ { - if !isWhitespace(b[i]) { - break - } - } - - return newToken(TokenWS, b[:i], NoneType), i, nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/rand/rand.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/rand/rand.go index 9791ea59..c8484dcd 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/rand/rand.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/rand/rand.go @@ -29,5 +29,5 @@ func Float64(reader io.Reader) (float64, error) { // CryptoRandFloat64 returns a random float64 obtained from the crypto rand // source. func CryptoRandFloat64() (float64, error) { - return Float64(rand.Reader) + return Float64(Reader) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/sdkio/ringbuffer.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/sdkio/ringbuffer.go deleted file mode 100644 index 1389bf0b..00000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/sdkio/ringbuffer.go +++ /dev/null @@ -1,72 +0,0 @@ -package sdkio - -import "io" - -// RingBuffer struct satisfies io.ReadWrite interface. -// -// ReadBuffer is a revolving buffer data structure, which can be used to store snapshots of data in a -// revolving window. -type RingBuffer struct { - slice []byte - start int - end int - size int -} - -// NewRingBuffer method takes in a byte slice as an input and returns a RingBuffer. -func NewRingBuffer(slice []byte) *RingBuffer { - ringBuf := RingBuffer{ - slice: slice, - } - return &ringBuf -} - -// Write method inserts the elements in a byte slice, and returns the number of bytes written along with an error. -func (r *RingBuffer) Write(p []byte) (int, error) { - for _, b := range p { - // check if end points to invalid index, we need to circle back - if r.end == len(r.slice) { - r.end = 0 - } - // check if start points to invalid index, we need to circle back - if r.start == len(r.slice) { - r.start = 0 - } - // if ring buffer is filled, increment the start index - if r.size == len(r.slice) { - r.size-- - r.start++ - } - - r.slice[r.end] = b - r.end++ - r.size++ - } - return r.size, nil -} - -// Read copies the data on the ring buffer into the byte slice provided to the method. -// Returns the read count along with Error encountered while reading -func (r *RingBuffer) Read(p []byte) (int, error) { - // readCount keeps track of the number of bytes read - var readCount int - for j := 0; j < len(p); j++ { - // if ring buffer is empty or completely read - // return EOF error. - if r.size == 0 { - return readCount, io.EOF - } - - p[j] = r.slice[r.start] - readCount++ - // increment the start pointer for ring buffer - r.start++ - // decrement the size of ring buffer - r.size-- - - if r.start == len(r.slice) { - r.start = 0 - } - } - return readCount, nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/shareddefaults/shared_config.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/shareddefaults/shared_config.go new file mode 100644 index 00000000..c96b717e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/shareddefaults/shared_config.go @@ -0,0 +1,47 @@ +package shareddefaults + +import ( + "os" + "os/user" + "path/filepath" +) + +// SharedCredentialsFilename returns the SDK's default file path +// for the shared credentials file. +// +// Builds the shared config file path based on the OS's platform. +// +// - Linux/Unix: $HOME/.aws/credentials +// - Windows: %USERPROFILE%\.aws\credentials +func SharedCredentialsFilename() string { + return filepath.Join(UserHomeDir(), ".aws", "credentials") +} + +// SharedConfigFilename returns the SDK's default file path for +// the shared config file. +// +// Builds the shared config file path based on the OS's platform. +// +// - Linux/Unix: $HOME/.aws/config +// - Windows: %USERPROFILE%\.aws\config +func SharedConfigFilename() string { + return filepath.Join(UserHomeDir(), ".aws", "config") +} + +// UserHomeDir returns the home directory for the user the process is +// running under. +func UserHomeDir() string { + // Ignore errors since we only care about Windows and *nix. + home, _ := os.UserHomeDir() + + if len(home) > 0 { + return home + } + + currUser, _ := user.Current() + if currUser != nil { + home = currUser.HomeDir + } + + return home +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/LICENSE b/vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/LICENSE index 6a66aea5..fe6a6200 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/LICENSE +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/LICENSE @@ -14,7 +14,7 @@ distribution. contributors may be used to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +THIS SOFTWARE IS PROVIDED BY THE COPYIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT @@ -25,3 +25,4 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/docs.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/docs.go new file mode 100644 index 00000000..cb70616e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/docs.go @@ -0,0 +1,7 @@ +// Package singleflight provides a duplicate function call suppression +// mechanism. This package is a fork of the Go golang.org/x/sync/singleflight +// package. The package is forked, because the package a part of the unstable +// and unversioned golang.org/x/sync module. +// +// https://github.com/golang/sync/tree/67f06af15bc961c363a7260195bcd53487529a21/singleflight +package singleflight diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/singleflight.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/singleflight.go index 14ad0c58..e8a1b17d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/singleflight.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/singleflight.go @@ -2,11 +2,44 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Package singleflight provides a duplicate function call suppression -// mechanism. package singleflight -import "sync" +import ( + "bytes" + "errors" + "fmt" + "runtime" + "runtime/debug" + "sync" +) + +// errGoexit indicates the runtime.Goexit was called in +// the user given function. +var errGoexit = errors.New("runtime.Goexit was called") + +// A panicError is an arbitrary value recovered from a panic +// with the stack trace during the execution of given function. +type panicError struct { + value interface{} + stack []byte +} + +// Error implements error interface. +func (p *panicError) Error() string { + return fmt.Sprintf("%v\n\n%s", p.value, p.stack) +} + +func newPanicError(v interface{}) error { + stack := debug.Stack() + + // The first line of the stack trace is of the form "goroutine N [status]:" + // but by the time the panic reaches Do the goroutine may no longer exist + // and its status will have changed. Trim out the misleading line. + if line := bytes.IndexByte(stack[:], '\n'); line >= 0 { + stack = stack[line+1:] + } + return &panicError{value: v, stack: stack} +} // call is an in-flight or completed singleflight.Do call type call struct { @@ -57,6 +90,12 @@ func (g *Group) Do(key string, fn func() (interface{}, error)) (v interface{}, e c.dups++ g.mu.Unlock() c.wg.Wait() + + if e, ok := c.err.(*panicError); ok { + panic(e) + } else if c.err == errGoexit { + runtime.Goexit() + } return c.val, c.err, true } c := new(call) @@ -70,6 +109,8 @@ func (g *Group) Do(key string, fn func() (interface{}, error)) (v interface{}, e // DoChan is like Do but returns a channel that will receive the // results when they are ready. +// +// The returned channel will not be closed. func (g *Group) DoChan(key string, fn func() (interface{}, error)) <-chan Result { ch := make(chan Result, 1) g.mu.Lock() @@ -94,17 +135,66 @@ func (g *Group) DoChan(key string, fn func() (interface{}, error)) <-chan Result // doCall handles the single call for a key. func (g *Group) doCall(c *call, key string, fn func() (interface{}, error)) { - c.val, c.err = fn() - c.wg.Done() - - g.mu.Lock() - if !c.forgotten { - delete(g.m, key) - } - for _, ch := range c.chans { - ch <- Result{c.val, c.err, c.dups > 0} + normalReturn := false + recovered := false + + // use double-defer to distinguish panic from runtime.Goexit, + // more details see https://golang.org/cl/134395 + defer func() { + // the given function invoked runtime.Goexit + if !normalReturn && !recovered { + c.err = errGoexit + } + + c.wg.Done() + g.mu.Lock() + defer g.mu.Unlock() + if !c.forgotten { + delete(g.m, key) + } + + if e, ok := c.err.(*panicError); ok { + // In order to prevent the waiting channels from being blocked forever, + // needs to ensure that this panic cannot be recovered. + if len(c.chans) > 0 { + go panic(e) + select {} // Keep this goroutine around so that it will appear in the crash dump. + } else { + panic(e) + } + } else if c.err == errGoexit { + // Already in the process of goexit, no need to call again + } else { + // Normal return + for _, ch := range c.chans { + ch <- Result{c.val, c.err, c.dups > 0} + } + } + }() + + func() { + defer func() { + if !normalReturn { + // Ideally, we would wait to take a stack trace until we've determined + // whether this is a panic or a runtime.Goexit. + // + // Unfortunately, the only way we can distinguish the two is to see + // whether the recover stopped the goroutine from terminating, and by + // the time we know that, the part of the stack trace relevant to the + // panic has been discarded. + if r := recover(); r != nil { + c.err = newPanicError(r) + } + } + }() + + c.val, c.err = fn() + normalReturn = true + }() + + if !normalReturn { + recovered = true } - g.mu.Unlock() } // Forget tells the singleflight to forget about a key. Future calls diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md new file mode 100644 index 00000000..c3525fd2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md @@ -0,0 +1,124 @@ +# v1.10.4 (2023-12-07) + +* No change notes available for this release. + +# v1.10.3 (2023-11-30) + +* No change notes available for this release. + +# v1.10.2 (2023-11-29) + +* No change notes available for this release. + +# v1.10.1 (2023-11-15) + +* No change notes available for this release. + +# 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/). + +# v1.9.15 (2023-10-06) + +* No change notes available for this release. + +# v1.9.14 (2023-08-18) + +* No change notes available for this release. + +# v1.9.13 (2023-08-07) + +* No change notes available for this release. + +# v1.9.12 (2023-07-31) + +* No change notes available for this release. + +# v1.9.11 (2022-12-02) + +* No change notes available for this release. + +# v1.9.10 (2022-10-24) + +* No change notes available for this release. + +# v1.9.9 (2022-09-14) + +* No change notes available for this release. + +# v1.9.8 (2022-09-02) + +* No change notes available for this release. + +# v1.9.7 (2022-08-31) + +* No change notes available for this release. + +# v1.9.6 (2022-08-29) + +* No change notes available for this release. + +# v1.9.5 (2022-08-11) + +* No change notes available for this release. + +# v1.9.4 (2022-08-09) + +* No change notes available for this release. + +# v1.9.3 (2022-06-29) + +* No change notes available for this release. + +# v1.9.2 (2022-06-07) + +* No change notes available for this release. + +# v1.9.1 (2022-03-24) + +* No change notes available for this release. + +# v1.9.0 (2022-03-08) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version + +# v1.8.0 (2022-02-24) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version + +# v1.7.0 (2022-01-14) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version + +# v1.6.0 (2022-01-07) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version + +# v1.5.0 (2021-11-06) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version + +# v1.4.0 (2021-10-21) + +* **Feature**: Updated to latest version + +# v1.3.0 (2021-08-27) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version + +# v1.2.2 (2021-08-04) + +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. + +# v1.2.1 (2021-07-15) + +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version + +# v1.2.0 (2021-06-25) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version + +# v1.1.0 (2021-05-14) + +* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. + diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/LICENSE.txt new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/accept_encoding_gzip.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/accept_encoding_gzip.go new file mode 100644 index 00000000..3f451fc9 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/accept_encoding_gzip.go @@ -0,0 +1,176 @@ +package acceptencoding + +import ( + "compress/gzip" + "context" + "fmt" + "io" + + "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +const acceptEncodingHeaderKey = "Accept-Encoding" +const contentEncodingHeaderKey = "Content-Encoding" + +// AddAcceptEncodingGzipOptions provides the options for the +// AddAcceptEncodingGzip middleware setup. +type AddAcceptEncodingGzipOptions struct { + Enable bool +} + +// AddAcceptEncodingGzip explicitly adds handling for accept-encoding GZIP +// middleware to the operation stack. This allows checksums to be correctly +// computed without disabling GZIP support. +func AddAcceptEncodingGzip(stack *middleware.Stack, options AddAcceptEncodingGzipOptions) error { + if options.Enable { + if err := stack.Finalize.Add(&EnableGzip{}, middleware.Before); err != nil { + return err + } + if err := stack.Deserialize.Insert(&DecompressGzip{}, "OperationDeserializer", middleware.After); err != nil { + return err + } + return nil + } + + return stack.Finalize.Add(&DisableGzip{}, middleware.Before) +} + +// DisableGzip provides the middleware that will +// disable the underlying http client automatically enabling for gzip +// decompress content-encoding support. +type DisableGzip struct{} + +// ID returns the id for the middleware. +func (*DisableGzip) ID() string { + return "DisableAcceptEncodingGzip" +} + +// HandleFinalize implements the FinalizeMiddleware interface. +func (*DisableGzip) HandleFinalize( + ctx context.Context, input middleware.FinalizeInput, next middleware.FinalizeHandler, +) ( + output middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := input.Request.(*smithyhttp.Request) + if !ok { + return output, metadata, &smithy.SerializationError{ + Err: fmt.Errorf("unknown request type %T", input.Request), + } + } + + // Explicitly enable gzip support, this will prevent the http client from + // auto extracting the zipped content. + req.Header.Set(acceptEncodingHeaderKey, "identity") + + return next.HandleFinalize(ctx, input) +} + +// EnableGzip provides a middleware to enable support for +// gzip responses, with manual decompression. This prevents the underlying HTTP +// client from performing the gzip decompression automatically. +type EnableGzip struct{} + +// ID returns the id for the middleware. +func (*EnableGzip) ID() string { + return "AcceptEncodingGzip" +} + +// HandleFinalize implements the FinalizeMiddleware interface. +func (*EnableGzip) HandleFinalize( + ctx context.Context, input middleware.FinalizeInput, next middleware.FinalizeHandler, +) ( + output middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := input.Request.(*smithyhttp.Request) + if !ok { + return output, metadata, &smithy.SerializationError{ + Err: fmt.Errorf("unknown request type %T", input.Request), + } + } + + // Explicitly enable gzip support, this will prevent the http client from + // auto extracting the zipped content. + req.Header.Set(acceptEncodingHeaderKey, "gzip") + + return next.HandleFinalize(ctx, input) +} + +// DecompressGzip provides the middleware for decompressing a gzip +// response from the service. +type DecompressGzip struct{} + +// ID returns the id for the middleware. +func (*DecompressGzip) ID() string { + return "DecompressGzip" +} + +// HandleDeserialize implements the DeserializeMiddlware interface. +func (*DecompressGzip) HandleDeserialize( + ctx context.Context, input middleware.DeserializeInput, next middleware.DeserializeHandler, +) ( + output middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + output, metadata, err = next.HandleDeserialize(ctx, input) + if err != nil { + return output, metadata, err + } + + resp, ok := output.RawResponse.(*smithyhttp.Response) + if !ok { + return output, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("unknown response type %T", output.RawResponse), + } + } + if v := resp.Header.Get(contentEncodingHeaderKey); v != "gzip" { + return output, metadata, err + } + + // Clear content length since it will no longer be valid once the response + // body is decompressed. + resp.Header.Del("Content-Length") + resp.ContentLength = -1 + + resp.Body = wrapGzipReader(resp.Body) + + return output, metadata, err +} + +type gzipReader struct { + reader io.ReadCloser + gzip *gzip.Reader +} + +func wrapGzipReader(reader io.ReadCloser) *gzipReader { + return &gzipReader{ + reader: reader, + } +} + +// Read wraps the gzip reader around the underlying io.Reader to extract the +// response bytes on the fly. +func (g *gzipReader) Read(b []byte) (n int, err error) { + if g.gzip == nil { + g.gzip, err = gzip.NewReader(g.reader) + if err != nil { + g.gzip = nil // ensure uninitialized gzip value isn't used in close. + return 0, fmt.Errorf("failed to decompress gzip response, %w", err) + } + } + + return g.gzip.Read(b) +} + +func (g *gzipReader) Close() error { + if g.gzip == nil { + return nil + } + + if err := g.gzip.Close(); err != nil { + g.reader.Close() + return fmt.Errorf("failed to decompress gzip response, %w", err) + } + + return g.reader.Close() +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/doc.go new file mode 100644 index 00000000..7056d9bf --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/doc.go @@ -0,0 +1,22 @@ +/* +Package acceptencoding provides customizations associated with Accept Encoding Header. + +# Accept encoding gzip + +The Go HTTP client automatically supports accept-encoding and content-encoding +gzip by default. This default behavior is not desired by the SDK, and prevents +validating the response body's checksum. To prevent this the SDK must manually +control usage of content-encoding gzip. + +To control content-encoding, the SDK must always set the `Accept-Encoding` +header to a value. This prevents the HTTP client from using gzip automatically. +When gzip is enabled on the API client, the SDK's customization will control +decompressing the gzip data in order to not break the checksum validation. When +gzip is disabled, the API client will disable gzip, preventing the HTTP +client's default behavior. + +An `EnableAcceptEncodingGzip` option may or may not be present depending on the client using +the below middleware. The option if present can be used to enable auto decompressing +gzip by the SDK. +*/ +package acceptencoding diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go new file mode 100644 index 00000000..cc638400 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package acceptencoding + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "1.10.4" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md new file mode 100644 index 00000000..a65890b5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md @@ -0,0 +1,272 @@ +# v1.10.10 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.9 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.8 (2023-12-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.7 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.6 (2023-11-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.5 (2023-11-28.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.4 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.3 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# 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 + +# v1.9.36 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.35 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.34 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.33 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.32 (2023-08-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.31 (2023-07-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.30 (2023-07-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.29 (2023-07-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.28 (2023-06-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.27 (2023-04-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.26 (2023-04-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.25 (2023-03-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.24 (2023-03-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.23 (2023-02-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.22 (2023-02-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.21 (2022-12-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.20 (2022-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.19 (2022-10-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.18 (2022-10-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.17 (2022-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.16 (2022-09-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.15 (2022-09-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.14 (2022-08-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.13 (2022-08-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.12 (2022-08-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.11 (2022-08-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.10 (2022-08-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.9 (2022-08-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.8 (2022-07-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.7 (2022-06-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.6 (2022-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.5 (2022-05-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.4 (2022-04-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.3 (2022-03-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.2 (2022-03-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.1 (2022-03-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.0 (2022-03-08) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.0 (2022-02-24) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.7.0 (2022-01-14) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.0 (2022-01-07) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.2 (2021-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.1 (2021-11-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.0 (2021-11-06) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.0 (2021-10-21) + +* **Feature**: Updated to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.2 (2021-10-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.1 (2021-09-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.0 (2021-08-27) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.3 (2021-08-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.2 (2021-08-04) + +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.1 (2021-07-15) + +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.0 (2021-06-25) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.1 (2021-05-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.0 (2021-05-14) + +* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. +* **Dependency Update**: Updated to the latest SDK module versions + diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go new file mode 100644 index 00000000..073e8866 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package presignedurl + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "1.10.10" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/CHANGELOG.md new file mode 100644 index 00000000..8c65e338 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/CHANGELOG.md @@ -0,0 +1,441 @@ +# v1.26.2 (2024-01-11) + +* **Documentation**: Doc only update for Secrets Manager + +# v1.26.1 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.0 (2023-12-22) + +* **Feature**: Update endpoint rules and examples. + +# v1.25.6 (2023-12-20) + +* No change notes available for this release. + +# v1.25.5 (2023-12-08) + +* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. + +# v1.25.4 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.3 (2023-12-06) + +* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. + +# v1.25.2 (2023-12-01) + +* **Bug Fix**: Correct wrapping of errors in authentication workflow. +* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.1 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.0 (2023-11-29) + +* **Feature**: Expose Options() accessor on service clients. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.2 (2023-11-28.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.1 (2023-11-28) + +* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction. + +# v1.24.0 (2023-11-27) + +* **Feature**: AWS Secrets Manager has released the BatchGetSecretValue API, which allows customers to fetch up to 20 Secrets with a single request using a list of secret names or filters. + +# v1.23.3 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.2 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.1 (2023-11-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.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.22.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.21.6 (2023-10-19) + +* **Documentation**: Documentation updates for Secrets Manager + +# v1.21.5 (2023-10-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.4 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.3 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.2 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.1 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.0 (2023-08-10) + +* **Feature**: Add additional InvalidRequestException to list of possible exceptions for ListSecret. + +# v1.20.2 (2023-08-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.1 (2023-08-01) + +* No change notes available for this release. + +# v1.20.0 (2023-07-31) + +* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.12 (2023-07-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.11 (2023-07-13) + +* **Documentation**: Documentation updates for Secrets Manager +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.10 (2023-06-15) + +* No change notes available for this release. + +# v1.19.9 (2023-06-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.8 (2023-05-16) + +* **Documentation**: Documentation updates for Secrets Manager + +# v1.19.7 (2023-05-04) + +* No change notes available for this release. + +# v1.19.6 (2023-04-27) + +* No change notes available for this release. + +# v1.19.5 (2023-04-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.4 (2023-04-19) + +* **Documentation**: Documentation updates for Secrets Manager + +# v1.19.3 (2023-04-10) + +* No change notes available for this release. + +# v1.19.2 (2023-04-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.1 (2023-03-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.0 (2023-03-10) + +* **Feature**: The type definitions of SecretString and SecretBinary now have a minimum length of 1 in the model to match the exception thrown when you pass in empty values. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.7 (2023-03-02) + +* No change notes available for this release. + +# v1.18.6 (2023-02-22) + +* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes. + +# v1.18.5 (2023-02-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.4 (2023-02-15) + +* **Announcement**: When receiving an error response in restJson-based services, an incorrect error type may have been returned based on the content of the response. This has been fixed via PR #2012 tracked in issue #1910. +* **Bug Fix**: Correct error type parsing for restJson services. + +# v1.18.3 (2023-02-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.2 (2023-01-23) + +* No change notes available for this release. + +# v1.18.1 (2023-01-12) + +* **Documentation**: Update documentation for new ListSecrets and DescribeSecret parameters + +# v1.18.0 (2023-01-05) + +* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401). + +# v1.17.0 (2022-12-29) + +* **Feature**: Added owning service filter, include planned deletion flag, and next rotation date response parameter in ListSecrets. + +# v1.16.11 (2022-12-22) + +* **Documentation**: Documentation updates for Secrets Manager + +# v1.16.10 (2022-12-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.9 (2022-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.8 (2022-11-22) + +* No change notes available for this release. + +# v1.16.7 (2022-11-17) + +* **Documentation**: Documentation updates for Secrets Manager. + +# v1.16.6 (2022-11-16) + +* No change notes available for this release. + +# v1.16.5 (2022-11-10) + +* No change notes available for this release. + +# v1.16.4 (2022-10-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.3 (2022-10-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.2 (2022-09-29) + +* **Documentation**: Documentation updates for Secrets Manager + +# v1.16.1 (2022-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.0 (2022-09-14) + +* **Feature**: Fixed a bug in the API client generation which caused some operation parameters to be incorrectly generated as value types instead of pointer types. The service API always required these affected parameters to be nilable. This fixes the SDK client to match the expectations of the the service API. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.22 (2022-09-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.21 (2022-08-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.20 (2022-08-30) + +* No change notes available for this release. + +# v1.15.19 (2022-08-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.18 (2022-08-17) + +* **Documentation**: Documentation updates for Secrets Manager. + +# v1.15.17 (2022-08-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.16 (2022-08-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.15 (2022-08-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.14 (2022-08-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.13 (2022-07-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.12 (2022-06-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.11 (2022-06-16) + +* **Documentation**: Documentation updates for Secrets Manager + +# v1.15.10 (2022-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.9 (2022-05-25) + +* **Documentation**: Documentation updates for Secrets Manager + +# v1.15.8 (2022-05-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.7 (2022-05-11) + +* **Documentation**: Doc only update for Secrets Manager that fixes several customer-reported issues. + +# v1.15.6 (2022-04-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.5 (2022-04-21) + +* **Documentation**: Documentation updates for Secrets Manager + +# v1.15.4 (2022-03-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.3 (2022-03-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.2 (2022-03-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.1 (2022-03-11) + +* **Documentation**: Documentation updates for Secrets Manager. + +# v1.15.0 (2022-03-08) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.0 (2022-02-24) + +* **Feature**: API client updated +* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.0 (2022-01-14) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.0 (2022-01-07) + +* **Feature**: API client updated +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.0 (2021-12-21) + +* **Feature**: API Paginators now support specifying the initial starting token, and support stopping on empty string tokens. +* **Documentation**: API client updated + +# v1.10.2 (2021-12-02) + +* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514)) +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.1 (2021-11-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.0 (2021-11-12) + +* **Feature**: Service clients now support custom endpoints that have an initial URI path defined. + +# v1.9.0 (2021-11-06) + +* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.0 (2021-10-21) + +* **Feature**: Updated to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.7.0 (2021-10-11) + +* **Feature**: API client updated +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.1 (2021-09-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.0 (2021-08-27) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.1 (2021-08-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.0 (2021-08-04) + +* **Feature**: Updated to latest API model. +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.1 (2021-07-15) + +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.0 (2021-06-25) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.1 (2021-05-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.0 (2021-05-14) + +* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. +* **Dependency Update**: Updated to the latest SDK module versions + diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_client.go index 175fa99d..99c25849 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_client.go @@ -5,16 +5,23 @@ package secretsmanager import ( "context" cryptorand "crypto/rand" + "fmt" "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/retry" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" smithy "github.com/aws/smithy-go" + smithydocument "github.com/aws/smithy-go/document" "github.com/aws/smithy-go/logging" "github.com/aws/smithy-go/middleware" smithyrand "github.com/aws/smithy-go/rand" smithyhttp "github.com/aws/smithy-go/transport/http" + "net" "net/http" "time" ) @@ -35,102 +42,61 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveDefaultLogger(&options) + setResolvedDefaultsMode(&options) + resolveRetryer(&options) resolveHTTPClient(&options) resolveHTTPSignerV4(&options) - resolveDefaultEndpointConfiguration(&options) - resolveIdempotencyTokenProvider(&options) + resolveEndpointResolverV2(&options) + + resolveAuthSchemeResolver(&options) + for _, fn := range optFns { fn(&options) } - client := &Client{ - options: options, - } - - return client -} - -type Options struct { - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - APIOptions []func(*middleware.Stack) error - - // Configures the events that will be sent to the configured logger. - ClientLogMode aws.ClientLogMode - - // The credentials object to use when signing requests. - Credentials aws.CredentialsProvider - - // The endpoint options to be used when attempting to resolve an endpoint. - EndpointOptions EndpointResolverOptions - - // The service endpoint resolver. - EndpointResolver EndpointResolver - - // Signature Version 4 (SigV4) Signer - HTTPSignerV4 HTTPSignerV4 - - // Provides idempotency tokens values that will be automatically populated into - // idempotent API operations. - IdempotencyTokenProvider IdempotencyTokenProvider + finalizeRetryMaxAttempts(&options) - // The logger writer interface to write logging messages to. - Logger logging.Logger + ignoreAnonymousAuth(&options) - // The region to send requests to. (Required) - Region string + wrapWithAnonymousAuth(&options) - // Retryer guides how HTTP requests should be retried in case of recoverable - // failures. When nil the API client will use a default retryer. - Retryer aws.Retryer + resolveAuthSchemes(&options) - // The HTTP client to invoke API calls with. Defaults to client's default HTTP - // implementation if nil. - HTTPClient HTTPClient -} - -// WithAPIOptions returns a functional option for setting the Client's APIOptions -// option. -func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { - return func(o *Options) { - o.APIOptions = append(o.APIOptions, optFns...) + client := &Client{ + options: options, } -} -// WithEndpointResolver returns a functional option for setting the Client's -// EndpointResolver option. -func WithEndpointResolver(v EndpointResolver) func(*Options) { - return func(o *Options) { - o.EndpointResolver = v - } + return client } -type HTTPClient interface { - Do(*http.Request) (*http.Response, error) +// Options returns a copy of the client configuration. +// +// Callers SHOULD NOT perform mutations on any inner structures within client +// config. Config overrides should instead be made on a per-operation basis through +// functional options. +func (c *Client) Options() Options { + return c.options.Copy() } -// Copy creates a clone where the APIOptions list is deep copied. -func (o Options) Copy() Options { - to := o - to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) - copy(to.APIOptions, o.APIOptions) - return to -} func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { ctx = middleware.ClearStackValues(ctx) stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) options := c.options.Copy() + for _, fn := range optFns { fn(&options) } + finalizeOperationRetryMaxAttempts(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + for _, fn := range stackFns { if err := fn(stack, options); err != nil { return nil, metadata, err @@ -155,6 +121,89 @@ func (c *Client) invokeOperation(ctx context.Context, opID string, params interf return result, metadata, err } +type operationInputKey struct{} + +func setOperationInput(ctx context.Context, input interface{}) context.Context { + return middleware.WithStackValue(ctx, operationInputKey{}, input) +} + +func getOperationInput(ctx context.Context) interface{} { + return middleware.GetStackValue(ctx, operationInputKey{}) +} + +type setOperationInputMiddleware struct { +} + +func (*setOperationInputMiddleware) ID() string { + return "setOperationInput" +} + +func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + ctx = setOperationInput(ctx, in.Parameters) + return next.HandleSerialize(ctx, in) +} + +func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %w", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %v", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %v", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{}, "ResolveEndpointV2", middleware.After); err != nil { + return fmt.Errorf("add Signing: %w", err) + } + return nil +} +func resolveAuthSchemeResolver(options *Options) { + if options.AuthSchemeResolver == nil { + options.AuthSchemeResolver = &defaultAuthSchemeResolver{} + } +} + +func resolveAuthSchemes(options *Options) { + if options.AuthSchemes == nil { + options.AuthSchemes = []smithyhttp.AuthScheme{ + internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ + Signer: options.HTTPSignerV4, + Logger: options.Logger, + LogSigning: options.ClientLogMode.IsSigning(), + }), + } + } +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +type legacyEndpointContextSetter struct { + LegacyResolver EndpointResolver +} + +func (*legacyEndpointContextSetter) ID() string { + return "legacyEndpointContextSetter" +} + +func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.LegacyResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) + } + + return next.HandleInitialize(ctx, in) + +} +func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { + return stack.Initialize.Add(&legacyEndpointContextSetter{ + LegacyResolver: o.EndpointResolver, + }, middleware.Before) +} + func resolveDefaultLogger(o *Options) { if o.Logger != nil { return @@ -166,33 +215,110 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { return middleware.AddSetLoggerMiddleware(stack, o.Logger) } +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + // NewFromConfig returns a new client from the provided config. func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ - Region: cfg.Region, - HTTPClient: cfg.HTTPClient, - Credentials: cfg.Credentials, - APIOptions: cfg.APIOptions, - Logger: cfg.Logger, - ClientLogMode: cfg.ClientLogMode, + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + AppID: cfg.AppID, } resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) return New(opts, optFns...) } func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + if o.HTTPClient != nil { - return + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) } - o.HTTPClient = awshttp.NewBuildableClient() + + o.HTTPClient = buildable } func resolveRetryer(o *Options) { if o.Retryer != nil { return } - o.Retryer = retry.NewStandard() + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } } func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { @@ -202,24 +328,52 @@ func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { o.Retryer = cfg.Retryer() } -func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { - if cfg.EndpointResolver == nil { +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttempts(o *Options) { + if o.RetryMaxAttempts == 0 { return } - o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, NewDefaultEndpointResolver()) + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) } -func addClientUserAgent(stack *middleware.Stack) error { - return awsmiddleware.AddRequestUserAgentMiddleware(stack) +func finalizeOperationRetryMaxAttempts(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) } -func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { - mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ - CredentialsProvider: o.Credentials, - Signer: o.HTTPSignerV4, - LogSigning: o.ClientLogMode.IsSigning(), - }) - return stack.Finalize.Add(mw, middleware.After) +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) +} + +func addClientUserAgent(stack *middleware.Stack, options Options) error { + if err := awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "secretsmanager", goModuleVersion)(stack); err != nil { + return err + } + + if len(options.AppID) > 0 { + return awsmiddleware.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID)(stack) + } + + return nil } type HTTPSignerV4 interface { @@ -255,6 +409,36 @@ func addRetryMiddlewares(stack *middleware.Stack, o Options) error { return retry.AddRetryMiddlewares(stack, mo) } +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + // IdempotencyTokenProvider interface for providing idempotency token type IdempotencyTokenProvider interface { GetIdempotencyToken() (string, error) @@ -276,3 +460,32 @@ func addRequestResponseLogging(stack *middleware.Stack, o Options) error { LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), }, middleware.After) } + +type disableHTTPSMiddleware struct { + DisableHTTPS bool +} + +func (*disableHTTPSMiddleware) ID() string { + return "disableHTTPS" +} + +func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { + req.URL.Scheme = "http" + } + + return next.HandleFinalize(ctx, in) +} + +func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { + return stack.Finalize.Insert(&disableHTTPSMiddleware{ + DisableHTTPS: o.EndpointOptions.DisableHTTPS, + }, "ResolveEndpointV2", middleware.After) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_BatchGetSecretValue.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_BatchGetSecretValue.go new file mode 100644 index 00000000..35dcda76 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_BatchGetSecretValue.go @@ -0,0 +1,267 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/secretsmanager/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves the contents of the encrypted fields SecretString or SecretBinary for +// up to 20 secrets. To retrieve a single secret, call GetSecretValue . To choose +// which secrets to retrieve, you can specify a list of secrets by name or ARN, or +// you can use filters. If Secrets Manager encounters errors such as +// AccessDeniedException while attempting to retrieve any of the secrets, you can +// see the errors in Errors in the response. Secrets Manager generates CloudTrail +// GetSecretValue log entries for each secret you request when you call this +// action. Do not include sensitive information in request parameters because it +// might be logged. For more information, see Logging Secrets Manager events with +// CloudTrail (https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html) +// . Required permissions: secretsmanager:BatchGetSecretValue , and you must have +// secretsmanager:GetSecretValue for each secret. If you use filters, you must also +// have secretsmanager:ListSecrets . If the secrets are encrypted using +// customer-managed keys instead of the Amazon Web Services managed key +// aws/secretsmanager , then you also need kms:Decrypt permissions for the keys. +// For more information, see IAM policy actions for Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions) +// and Authentication and access control in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html) +// . +func (c *Client) BatchGetSecretValue(ctx context.Context, params *BatchGetSecretValueInput, optFns ...func(*Options)) (*BatchGetSecretValueOutput, error) { + if params == nil { + params = &BatchGetSecretValueInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchGetSecretValue", params, optFns, c.addOperationBatchGetSecretValueMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchGetSecretValueOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchGetSecretValueInput struct { + + // The filters to choose which secrets to retrieve. You must include Filters or + // SecretIdList , but not both. + Filters []types.Filter + + // The number of results to include in the response. If there are more results + // available, in the response, Secrets Manager includes NextToken . To get the next + // results, call BatchGetSecretValue again with the value from NextToken . + MaxResults *int32 + + // A token that indicates where the output should continue from, if a previous + // call did not show all results. To get the next results, call BatchGetSecretValue + // again with this value. + NextToken *string + + // The ARN or names of the secrets to retrieve. You must include Filters or + // SecretIdList , but not both. + SecretIdList []string + + noSmithyDocumentSerde +} + +type BatchGetSecretValueOutput struct { + + // A list of errors Secrets Manager encountered while attempting to retrieve + // individual secrets. + Errors []types.APIErrorType + + // Secrets Manager includes this value if there's more output available than what + // is included in the current response. This can occur even when the response + // includes no values at all, such as when you ask for a filtered view of a long + // list. To get the next results, call BatchGetSecretValue again with this value. + NextToken *string + + // A list of secret values. + SecretValues []types.SecretValueEntry + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchGetSecretValueMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchGetSecretValue{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpBatchGetSecretValue{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "BatchGetSecretValue"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchGetSecretValue(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// BatchGetSecretValueAPIClient is a client that implements the +// BatchGetSecretValue operation. +type BatchGetSecretValueAPIClient interface { + BatchGetSecretValue(context.Context, *BatchGetSecretValueInput, ...func(*Options)) (*BatchGetSecretValueOutput, error) +} + +var _ BatchGetSecretValueAPIClient = (*Client)(nil) + +// BatchGetSecretValuePaginatorOptions is the paginator options for +// BatchGetSecretValue +type BatchGetSecretValuePaginatorOptions struct { + // The number of results to include in the response. If there are more results + // available, in the response, Secrets Manager includes NextToken . To get the next + // results, call BatchGetSecretValue again with the value from NextToken . + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// BatchGetSecretValuePaginator is a paginator for BatchGetSecretValue +type BatchGetSecretValuePaginator struct { + options BatchGetSecretValuePaginatorOptions + client BatchGetSecretValueAPIClient + params *BatchGetSecretValueInput + nextToken *string + firstPage bool +} + +// NewBatchGetSecretValuePaginator returns a new BatchGetSecretValuePaginator +func NewBatchGetSecretValuePaginator(client BatchGetSecretValueAPIClient, params *BatchGetSecretValueInput, optFns ...func(*BatchGetSecretValuePaginatorOptions)) *BatchGetSecretValuePaginator { + if params == nil { + params = &BatchGetSecretValueInput{} + } + + options := BatchGetSecretValuePaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &BatchGetSecretValuePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *BatchGetSecretValuePaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next BatchGetSecretValue page. +func (p *BatchGetSecretValuePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*BatchGetSecretValueOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.BatchGetSecretValue(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opBatchGetSecretValue(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "BatchGetSecretValue", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_CancelRotateSecret.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_CancelRotateSecret.go index 07efe12c..1baab024 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_CancelRotateSecret.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_CancelRotateSecret.go @@ -4,57 +4,36 @@ package secretsmanager import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Disables automatic scheduled rotation and cancels the rotation of a secret if -// currently in progress. To re-enable scheduled rotation, call RotateSecret with -// AutomaticallyRotateAfterDays set to a value greater than 0. This immediately -// rotates your secret and then enables the automatic schedule. If you cancel a -// rotation while in progress, it can leave the VersionStage labels in an -// unexpected state. Depending on the step of the rotation in progress, you might -// need to remove the staging label AWSPENDING from the partially created version, -// specified by the VersionId response value. You should also evaluate the -// partially rotated new version to see if it should be deleted, which you can do -// by removing all staging labels from the new version VersionStage field. To -// successfully start a rotation, the staging label AWSPENDING must be in one of -// the following states: -// -// * Not attached to any version at all -// -// * Attached to the -// same version as the staging label AWSCURRENT -// -// If the staging label AWSPENDING -// attached to a different version than the version with AWSCURRENT then the -// attempt to rotate fails. Minimum permissions To run this command, you must have -// the following permissions: -// -// * secretsmanager:CancelRotateSecret -// -// Related -// operations -// -// * To configure rotation for a secret or to manually trigger a -// rotation, use RotateSecret. -// -// * To get the rotation configuration details for a -// secret, use DescribeSecret. -// -// * To list all of the currently available secrets, -// use ListSecrets. -// -// * To list all of the versions currently associated with a -// secret, use ListSecretVersionIds. +// Turns off automatic rotation, and if a rotation is currently in progress, +// cancels the rotation. If you cancel a rotation in progress, it can leave the +// VersionStage labels in an unexpected state. You might need to remove the staging +// label AWSPENDING from the partially created version. You also need to determine +// whether to roll back to the previous version of the secret by moving the staging +// label AWSCURRENT to the version that has AWSPENDING . To determine which version +// has a specific staging label, call ListSecretVersionIds . Then use +// UpdateSecretVersionStage to change staging labels. For more information, see +// How rotation works (https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html) +// . To turn on automatic rotation again, call RotateSecret . Secrets Manager +// generates a CloudTrail log entry when you call this action. Do not include +// sensitive information in request parameters because it might be logged. For more +// information, see Logging Secrets Manager events with CloudTrail (https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html) +// . Required permissions: secretsmanager:CancelRotateSecret . For more +// information, see IAM policy actions for Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions) +// and Authentication and access control in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html) +// . func (c *Client) CancelRotateSecret(ctx context.Context, params *CancelRotateSecretInput, optFns ...func(*Options)) (*CancelRotateSecretOutput, error) { if params == nil { params = &CancelRotateSecretInput{} } - result, metadata, err := c.invokeOperation(ctx, "CancelRotateSecret", params, optFns, addOperationCancelRotateSecretMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "CancelRotateSecret", params, optFns, c.addOperationCancelRotateSecretMiddlewares) if err != nil { return nil, err } @@ -66,48 +45,41 @@ func (c *Client) CancelRotateSecret(ctx context.Context, params *CancelRotateSec type CancelRotateSecretInput struct { - // Specifies the secret to cancel a rotation request. You can specify either the - // Amazon Resource Name (ARN) or the friendly name of the secret. If you specify an - // ARN, we generally recommend that you specify a complete ARN. You can specify a - // partial ARN too—for example, if you don’t include the final hyphen and six - // random characters that Secrets Manager adds at the end of the ARN when you - // created the secret. A partial ARN match can work as long as it uniquely matches - // only one secret. However, if your secret has a name that ends in a hyphen - // followed by six characters (before Secrets Manager adds the hyphen and six - // characters to the ARN) and you try to use that as a partial ARN, then those - // characters cause Secrets Manager to assume that you’re specifying a complete - // ARN. This confusion can cause unexpected results. To avoid this situation, we - // recommend that you don’t create secret names ending with a hyphen followed by - // six characters. If you specify an incomplete ARN without the random suffix, and - // instead provide the 'friendly name', you must not include the random suffix. If - // you do include the random suffix added by Secrets Manager, you receive either a - // ResourceNotFoundException or an AccessDeniedException error, depending on your - // permissions. + // The ARN or name of the secret. For an ARN, we recommend that you specify a + // complete ARN rather than a partial ARN. See Finding a secret from a partial ARN (https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen) + // . // // This member is required. SecretId *string + + noSmithyDocumentSerde } type CancelRotateSecretOutput struct { - // The ARN of the secret for which rotation was canceled. + // The ARN of the secret. ARN *string - // The friendly name of the secret for which rotation was canceled. + // The name of the secret. Name *string // The unique identifier of the version of the secret created during the rotation. // This version might not be complete, and should be evaluated for possible - // deletion. At the very least, you should remove the VersionStage value AWSPENDING - // to enable this version to be deleted. Failing to clean up a cancelled rotation - // can block you from successfully starting future rotations. + // deletion. We recommend that you remove the VersionStage value AWSPENDING from + // this version so that Secrets Manager can delete it. Failing to clean up a + // cancelled rotation can block you from starting future rotations. VersionId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationCancelRotateSecretMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationCancelRotateSecretMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpCancelRotateSecret{}, middleware.After) if err != nil { return err @@ -116,6 +88,13 @@ func addOperationCancelRotateSecretMiddlewares(stack *middleware.Stack, options if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "CancelRotateSecret"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -134,16 +113,13 @@ func addOperationCancelRotateSecretMiddlewares(stack *middleware.Stack, options if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -152,12 +128,18 @@ func addOperationCancelRotateSecretMiddlewares(stack *middleware.Stack, options if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpCancelRotateSecretValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelRotateSecret(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -167,6 +149,9 @@ func addOperationCancelRotateSecretMiddlewares(stack *middleware.Stack, options if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -174,7 +159,6 @@ func newServiceMetadataMiddleware_opCancelRotateSecret(region string) *awsmiddle return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "secretsmanager", OperationName: "CancelRotateSecret", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_CreateSecret.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_CreateSecret.go index 6e85d33b..a783c39d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_CreateSecret.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_CreateSecret.go @@ -12,86 +12,47 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a new secret. A secret in Secrets Manager consists of both the protected -// secret data and the important information needed to manage the secret. Secrets -// Manager stores the encrypted secret data in one of a collection of "versions" -// associated with the secret. Each version contains a copy of the encrypted secret -// data. Each version is associated with one or more "staging labels" that identify -// where the version is in the rotation cycle. The SecretVersionsToStages field of -// the secret contains the mapping of staging labels to the active versions of the -// secret. Versions without a staging label are considered deprecated and not -// included in the list. You provide the secret data to be encrypted by putting -// text in either the SecretString parameter or binary data in the SecretBinary -// parameter, but not both. If you include SecretString or SecretBinary then -// Secrets Manager also creates an initial secret version and automatically -// attaches the staging label AWSCURRENT to the new version. -// -// * If you call an -// operation to encrypt or decrypt the SecretString or SecretBinary for a secret in -// the same account as the calling user and that secret doesn't specify a AWS KMS -// encryption key, Secrets Manager uses the account's default AWS managed customer -// master key (CMK) with the alias aws/secretsmanager. If this key doesn't already -// exist in your account then Secrets Manager creates it for you automatically. All -// users and roles in the same AWS account automatically have access to use the -// default CMK. Note that if an Secrets Manager API call results in AWS creating -// the account's AWS-managed CMK, it can result in a one-time significant delay in -// returning the result. -// -// * If the secret resides in a different AWS account from -// the credentials calling an API that requires encryption or decryption of the -// secret value then you must create and use a custom AWS KMS CMK because you can't -// access the default CMK for the account using credentials from a different AWS -// account. Store the ARN of the CMK in the secret when you create the secret or -// when you update it by including it in the KMSKeyId. If you call an API that must -// encrypt or decrypt SecretString or SecretBinary using credentials from a -// different account then the AWS KMS key policy must grant cross-account access to -// that other account's user or role for both the kms:GenerateDataKey and -// kms:Decrypt operations. -// -// Minimum permissions To run this command, you must have -// the following permissions: -// -// * secretsmanager:CreateSecret -// -// * kms:GenerateDataKey -// - needed only if you use a customer-managed AWS KMS key to encrypt the secret. -// You do not need this permission to use the account default AWS managed CMK for -// Secrets Manager. -// -// * kms:Decrypt - needed only if you use a customer-managed AWS -// KMS key to encrypt the secret. You do not need this permission to use the -// account default AWS managed CMK for Secrets Manager. -// -// * -// secretsmanager:TagResource - needed only if you include the Tags -// parameter. -// -// Related operations -// -// * To delete a secret, use DeleteSecret. -// -// * To -// modify an existing secret, use UpdateSecret. -// -// * To create a new version of a -// secret, use PutSecretValue. -// -// * To retrieve the encrypted secure string and -// secure binary values, use GetSecretValue. -// -// * To retrieve all other details for a -// secret, use DescribeSecret. This does not include the encrypted secure string -// and secure binary values. -// -// * To retrieve the list of secret versions associated -// with the current secret, use DescribeSecret and examine the -// SecretVersionsToStages response value. +// Creates a new secret. A secret can be a password, a set of credentials such as +// a user name and password, an OAuth token, or other secret information that you +// store in an encrypted form in Secrets Manager. The secret also includes the +// connection information to access a database or other service, which Secrets +// Manager doesn't encrypt. A secret in Secrets Manager consists of both the +// protected secret data and the important information needed to manage the secret. +// For secrets that use managed rotation, you need to create the secret through the +// managing service. For more information, see Secrets Manager secrets managed by +// other Amazon Web Services services (https://docs.aws.amazon.com/secretsmanager/latest/userguide/service-linked-secrets.html) +// . For information about creating a secret in the console, see Create a secret (https://docs.aws.amazon.com/secretsmanager/latest/userguide/manage_create-basic-secret.html) +// . To create a secret, you can provide the secret value to be encrypted in either +// the SecretString parameter or the SecretBinary parameter, but not both. If you +// include SecretString or SecretBinary then Secrets Manager creates an initial +// secret version and automatically attaches the staging label AWSCURRENT to it. +// For database credentials you want to rotate, for Secrets Manager to be able to +// rotate the secret, you must make sure the JSON you store in the SecretString +// matches the JSON structure of a database secret (https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_secret_json_structure.html) +// . If you don't specify an KMS encryption key, Secrets Manager uses the Amazon +// Web Services managed key aws/secretsmanager . If this key doesn't already exist +// in your account, then Secrets Manager creates it for you automatically. All +// users and roles in the Amazon Web Services account automatically have access to +// use aws/secretsmanager . Creating aws/secretsmanager can result in a one-time +// significant delay in returning the result. If the secret is in a different +// Amazon Web Services account from the credentials calling the API, then you can't +// use aws/secretsmanager to encrypt the secret, and you must create and use a +// customer managed KMS key. Secrets Manager generates a CloudTrail log entry when +// you call this action. Do not include sensitive information in request parameters +// except SecretBinary or SecretString because it might be logged. For more +// information, see Logging Secrets Manager events with CloudTrail (https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html) +// . Required permissions: secretsmanager:CreateSecret . If you include tags in the +// secret, you also need secretsmanager:TagResource . For more information, see +// IAM policy actions for Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions) +// and Authentication and access control in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html) +// . To encrypt the secret with a KMS key other than aws/secretsmanager , you need +// kms:GenerateDataKey and kms:Decrypt permission to the key. func (c *Client) CreateSecret(ctx context.Context, params *CreateSecretInput, optFns ...func(*Options)) (*CreateSecretOutput, error) { if params == nil { params = &CreateSecretInput{} } - result, metadata, err := c.invokeOperation(ctx, "CreateSecret", params, optFns, addOperationCreateSecretMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "CreateSecret", params, optFns, c.addOperationCreateSecretMiddlewares) if err != nil { return nil, err } @@ -103,162 +64,132 @@ func (c *Client) CreateSecret(ctx context.Context, params *CreateSecretInput, op type CreateSecretInput struct { - // Specifies the friendly name of the new secret. The secret name must be ASCII - // letters, digits, or the following characters : /_+=.@- Do not end your secret - // name with a hyphen followed by six characters. If you do so, you risk confusion - // and unexpected results when searching for a secret by partial ARN. Secrets - // Manager automatically adds a hyphen and six random characters at the end of the - // ARN. + // The name of the new secret. The secret name can contain ASCII letters, numbers, + // and the following characters: /_+=.@- Do not end your secret name with a hyphen + // followed by six characters. If you do so, you risk confusion and unexpected + // results when searching for a secret by partial ARN. Secrets Manager + // automatically adds a hyphen and six random characters after the secret name at + // the end of the ARN. // // This member is required. Name *string - // (Optional) If you include SecretString or SecretBinary, then an initial version - // is created as part of the secret, and this parameter specifies a unique - // identifier for the new version. If you use the AWS CLI or one of the AWS SDK to - // call this operation, then you can leave this parameter empty. The CLI or SDK - // generates a random UUID for you and includes it as the value for this parameter - // in the request. If you don't use the SDK and instead generate a raw HTTP request - // to the Secrets Manager service endpoint, then you must generate a - // ClientRequestToken yourself for the new version and include the value in the - // request. This value helps ensure idempotency. Secrets Manager uses this value to - // prevent the accidental creation of duplicate versions if there are failures and - // retries during a rotation. We recommend that you generate a UUID-type - // (https://wikipedia.org/wiki/Universally_unique_identifier) value to ensure - // uniqueness of your versions within the specified secret. - // - // * If the - // ClientRequestToken value isn't already associated with a version of the secret - // then a new version of the secret is created. - // - // * If a version with this value - // already exists and the version SecretString and SecretBinary values are the same - // as those in the request, then the request is ignored. - // - // * If a version with this - // value already exists and that version's SecretString and SecretBinary values are - // different from those in the request then the request fails because you cannot - // modify an existing version. Instead, use PutSecretValue to create a new - // version. - // + // A list of Regions and KMS keys to replicate secrets. + AddReplicaRegions []types.ReplicaRegionType + + // If you include SecretString or SecretBinary , then Secrets Manager creates an + // initial version for the secret, and this parameter specifies the unique + // identifier for the new version. If you use the Amazon Web Services CLI or one of + // the Amazon Web Services SDKs to call this operation, then you can leave this + // parameter empty. The CLI or SDK generates a random UUID for you and includes it + // as the value for this parameter in the request. If you generate a raw HTTP + // request to the Secrets Manager service endpoint, then you must generate a + // ClientRequestToken and include it in the request. This value helps ensure + // idempotency. Secrets Manager uses this value to prevent the accidental creation + // of duplicate versions if there are failures and retries during a rotation. We + // recommend that you generate a UUID-type (https://wikipedia.org/wiki/Universally_unique_identifier) + // value to ensure uniqueness of your versions within the specified secret. + // - If the ClientRequestToken value isn't already associated with a version of + // the secret then a new version of the secret is created. + // - If a version with this value already exists and the version SecretString and + // SecretBinary values are the same as those in the request, then the request is + // ignored. + // - If a version with this value already exists and that version's SecretString + // and SecretBinary values are different from those in the request, then the + // request fails because you cannot modify an existing version. Instead, use + // PutSecretValue to create a new version. // This value becomes the VersionId of the new version. ClientRequestToken *string - // (Optional) Specifies a user-provided description of the secret. + // The description of the secret. Description *string - // (Optional) Specifies the ARN, Key ID, or alias of the AWS KMS customer master - // key (CMK) to be used to encrypt the SecretString or SecretBinary values in the - // versions stored in this secret. You can specify any of the supported ways to - // identify a AWS KMS key ID. If you need to reference a CMK in a different - // account, you can use only the key ARN or the alias ARN. If you don't specify - // this value, then Secrets Manager defaults to using the AWS account's default CMK - // (the one named aws/secretsmanager). If a AWS KMS CMK with that name doesn't yet - // exist, then Secrets Manager creates it for you automatically the first time it - // needs to encrypt a version's SecretString or SecretBinary fields. You can use - // the account default CMK to encrypt and decrypt only if you call this operation - // using credentials from the same account that owns the secret. If the secret - // resides in a different account, then you must create a custom CMK and specify - // the ARN in this field. + // Specifies whether to overwrite a secret with the same name in the destination + // Region. By default, secrets aren't overwritten. + ForceOverwriteReplicaSecret bool + + // The ARN, key ID, or alias of the KMS key that Secrets Manager uses to encrypt + // the secret value in the secret. An alias is always prefixed by alias/ , for + // example alias/aws/secretsmanager . For more information, see About aliases (https://docs.aws.amazon.com/kms/latest/developerguide/alias-about.html) + // . To use a KMS key in a different account, use the key ARN or the alias ARN. If + // you don't specify this value, then Secrets Manager uses the key + // aws/secretsmanager . If that key doesn't yet exist, then Secrets Manager creates + // it for you automatically the first time it encrypts the secret value. If the + // secret is in a different Amazon Web Services account from the credentials + // calling the API, then you can't use aws/secretsmanager to encrypt the secret, + // and you must create and use a customer managed KMS key. KmsKeyId *string - // (Optional) Specifies binary data that you want to encrypt and store in the new - // version of the secret. To use this parameter in the command-line tools, we - // recommend that you store your binary data in a file and then use the appropriate - // technique for your tool to pass the contents of the file as a parameter. Either - // SecretString or SecretBinary must have a value, but not both. They cannot both - // be empty. This parameter is not available using the Secrets Manager console. It - // can be accessed only by using the AWS CLI or one of the AWS SDKs. + // The binary data to encrypt and store in the new version of the secret. We + // recommend that you store your binary data in a file and then pass the contents + // of the file as a parameter. Either SecretString or SecretBinary must have a + // value, but not both. This parameter is not available in the Secrets Manager + // console. SecretBinary []byte - // (Optional) Specifies text data that you want to encrypt and store in this new - // version of the secret. Either SecretString or SecretBinary must have a value, - // but not both. They cannot both be empty. If you create a secret by using the - // Secrets Manager console then Secrets Manager puts the protected secret text in - // only the SecretString parameter. The Secrets Manager console stores the - // information as a JSON structure of key/value pairs that the Lambda rotation - // function knows how to parse. For storing multiple values, we recommend that you - // use a JSON text string argument and specify key/value pairs. For information on - // how to format a JSON parameter for the various command line tool environments, - // see Using JSON for Parameters - // (https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json) - // in the AWS CLI User Guide. For example: - // {"username":"bob","password":"abc123xyz456"} If your command-line tool or SDK - // requires quotation marks around the parameter, you should use single quotes to - // avoid confusion with the double quotes required in the JSON text. + // The text data to encrypt and store in this new version of the secret. We + // recommend you use a JSON structure of key/value pairs for your secret value. + // Either SecretString or SecretBinary must have a value, but not both. If you + // create a secret by using the Secrets Manager console then Secrets Manager puts + // the protected secret text in only the SecretString parameter. The Secrets + // Manager console stores the information as a JSON structure of key/value pairs + // that a Lambda rotation function can parse. SecretString *string - // (Optional) Specifies a list of user-defined tags that are attached to the - // secret. Each tag is a "Key" and "Value" pair of strings. This operation only - // appends tags to the existing list of tags. To remove tags, you must use - // UntagResource. - // - // * Secrets Manager tag key names are case sensitive. A tag with - // the key "ABC" is a different tag from one with key "abc". - // - // * If you check tags - // in IAM policy Condition elements as part of your security strategy, then adding - // or removing a tag can change permissions. If the successful completion of this - // operation would result in you losing your permissions for this secret, then this - // operation is blocked and returns an Access Denied error. - // - // This parameter - // requires a JSON text string argument. For information on how to format a JSON - // parameter for the various command line tool environments, see Using JSON for - // Parameters - // (https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json) - // in the AWS CLI User Guide. For example: + // A list of tags to attach to the secret. Each tag is a key and value pair of + // strings in a JSON text string, for example: // [{"Key":"CostCenter","Value":"12345"},{"Key":"environment","Value":"production"}] - // If your command-line tool or SDK requires quotation marks around the parameter, - // you should use single quotes to avoid confusion with the double quotes required - // in the JSON text. The following basic restrictions apply to tags: - // - // * Maximum - // number of tags per secret—50 - // - // * Maximum key length—127 Unicode characters in - // UTF-8 - // - // * Maximum value length—255 Unicode characters in UTF-8 - // - // * Tag keys and - // values are case sensitive. - // - // * Do not use the aws: prefix in your tag names or - // values because AWS reserves it for AWS use. You can't edit or delete tag names - // or values with this prefix. Tags with this prefix do not count against your tags - // per secret limit. - // - // * If you use your tagging schema across multiple services and - // resources, remember other services might have restrictions on allowed - // characters. Generally allowed characters: letters, spaces, and numbers - // representable in UTF-8, plus the following special characters: + - = . _ : / @. + // Secrets Manager tag key names are case sensitive. A tag with the key "ABC" is a + // different tag from one with key "abc". If you check tags in permissions policies + // as part of your security strategy, then adding or removing a tag can change + // permissions. If the completion of this operation would result in you losing your + // permissions for this secret, then Secrets Manager blocks the operation and + // returns an Access Denied error. For more information, see Control access to + // secrets using tags (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#tag-secrets-abac) + // and Limit access to identities with tags that match secrets' tags (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#auth-and-access_tags2) + // . For information about how to format a JSON parameter for the various command + // line tool environments, see Using JSON for Parameters (https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json) + // . If your command-line tool or SDK requires quotation marks around the + // parameter, you should use single quotes to avoid confusion with the double + // quotes required in the JSON text. For tag quotas and naming restrictions, see + // Service quotas for Tagging (https://docs.aws.amazon.com/general/latest/gr/arg.html#taged-reference-quotas) + // in the Amazon Web Services General Reference guide. Tags []types.Tag + + noSmithyDocumentSerde } type CreateSecretOutput struct { - // The Amazon Resource Name (ARN) of the secret that you just created. Secrets - // Manager automatically adds several random characters to the name at the end of - // the ARN when you initially create a secret. This affects only the ARN and not - // the actual friendly name. This ensures that if you create a new secret with the - // same name as an old secret that you previously deleted, then users with access - // to the old secret don't automatically get access to the new secret because the - // ARNs are different. + // The ARN of the new secret. The ARN includes the name of the secret followed by + // six random characters. This ensures that if you create a new secret with the + // same name as a deleted secret, then users with access to the old secret don't + // get access to the new secret because the ARNs are different. ARN *string - // The friendly name of the secret that you just created. + // The name of the new secret. Name *string - // The unique identifier associated with the version of the secret you just - // created. + // A list of the replicas of this secret and their status: + // - Failed , which indicates that the replica was not created. + // - InProgress , which indicates that Secrets Manager is in the process of + // creating the replica. + // - InSync , which indicates that the replica was created. + ReplicationStatus []types.ReplicationStatusType + + // The unique identifier associated with the version of the new secret. VersionId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationCreateSecretMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationCreateSecretMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateSecret{}, middleware.After) if err != nil { return err @@ -267,6 +198,13 @@ func addOperationCreateSecretMiddlewares(stack *middleware.Stack, options Option if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateSecret"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -285,16 +223,13 @@ func addOperationCreateSecretMiddlewares(stack *middleware.Stack, options Option if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -303,6 +238,9 @@ func addOperationCreateSecretMiddlewares(stack *middleware.Stack, options Option if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addIdempotencyToken_opCreateSecretMiddleware(stack, options); err != nil { return err } @@ -312,6 +250,9 @@ func addOperationCreateSecretMiddlewares(stack *middleware.Stack, options Option if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSecret(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -321,6 +262,9 @@ func addOperationCreateSecretMiddlewares(stack *middleware.Stack, options Option if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -361,7 +305,6 @@ func newServiceMetadataMiddleware_opCreateSecret(region string) *awsmiddleware.R return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "secretsmanager", OperationName: "CreateSecret", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_DeleteResourcePolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_DeleteResourcePolicy.go index 4141a792..451ebd04 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_DeleteResourcePolicy.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_DeleteResourcePolicy.go @@ -4,34 +4,28 @@ package secretsmanager import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes the resource-based permission policy attached to the secret. Minimum -// permissions To run this command, you must have the following permissions: -// -// * -// secretsmanager:DeleteResourcePolicy -// -// Related operations -// -// * To attach a resource -// policy to a secret, use PutResourcePolicy. -// -// * To retrieve the current -// resource-based policy that's attached to a secret, use GetResourcePolicy. -// -// * To -// list all of the currently available secrets, use ListSecrets. +// Deletes the resource-based permission policy attached to the secret. To attach +// a policy to a secret, use PutResourcePolicy . Secrets Manager generates a +// CloudTrail log entry when you call this action. Do not include sensitive +// information in request parameters because it might be logged. For more +// information, see Logging Secrets Manager events with CloudTrail (https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html) +// . Required permissions: secretsmanager:DeleteResourcePolicy . For more +// information, see IAM policy actions for Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions) +// and Authentication and access control in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html) +// . func (c *Client) DeleteResourcePolicy(ctx context.Context, params *DeleteResourcePolicyInput, optFns ...func(*Options)) (*DeleteResourcePolicyOutput, error) { if params == nil { params = &DeleteResourcePolicyInput{} } - result, metadata, err := c.invokeOperation(ctx, "DeleteResourcePolicy", params, optFns, addOperationDeleteResourcePolicyMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DeleteResourcePolicy", params, optFns, c.addOperationDeleteResourcePolicyMiddlewares) if err != nil { return nil, err } @@ -43,26 +37,15 @@ func (c *Client) DeleteResourcePolicy(ctx context.Context, params *DeleteResourc type DeleteResourcePolicyInput struct { - // Specifies the secret that you want to delete the attached resource-based policy - // for. You can specify either the Amazon Resource Name (ARN) or the friendly name - // of the secret. If you specify an ARN, we generally recommend that you specify a - // complete ARN. You can specify a partial ARN too—for example, if you don’t - // include the final hyphen and six random characters that Secrets Manager adds at - // the end of the ARN when you created the secret. A partial ARN match can work as - // long as it uniquely matches only one secret. However, if your secret has a name - // that ends in a hyphen followed by six characters (before Secrets Manager adds - // the hyphen and six characters to the ARN) and you try to use that as a partial - // ARN, then those characters cause Secrets Manager to assume that you’re - // specifying a complete ARN. This confusion can cause unexpected results. To avoid - // this situation, we recommend that you don’t create secret names ending with a - // hyphen followed by six characters. If you specify an incomplete ARN without the - // random suffix, and instead provide the 'friendly name', you must not include the - // random suffix. If you do include the random suffix added by Secrets Manager, you - // receive either a ResourceNotFoundException or an AccessDeniedException error, - // depending on your permissions. + // The ARN or name of the secret to delete the attached resource-based policy for. + // For an ARN, we recommend that you specify a complete ARN rather than a partial + // ARN. See Finding a secret from a partial ARN (https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen) + // . // // This member is required. SecretId *string + + noSmithyDocumentSerde } type DeleteResourcePolicyOutput struct { @@ -70,14 +53,19 @@ type DeleteResourcePolicyOutput struct { // The ARN of the secret that the resource-based policy was deleted for. ARN *string - // The friendly name of the secret that the resource-based policy was deleted for. + // The name of the secret that the resource-based policy was deleted for. Name *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDeleteResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDeleteResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteResourcePolicy{}, middleware.After) if err != nil { return err @@ -86,6 +74,13 @@ func addOperationDeleteResourcePolicyMiddlewares(stack *middleware.Stack, option if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteResourcePolicy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -104,16 +99,13 @@ func addOperationDeleteResourcePolicyMiddlewares(stack *middleware.Stack, option if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -122,12 +114,18 @@ func addOperationDeleteResourcePolicyMiddlewares(stack *middleware.Stack, option if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDeleteResourcePolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteResourcePolicy(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -137,6 +135,9 @@ func addOperationDeleteResourcePolicyMiddlewares(stack *middleware.Stack, option if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -144,7 +145,6 @@ func newServiceMetadataMiddleware_opDeleteResourcePolicy(region string) *awsmidd return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "secretsmanager", OperationName: "DeleteResourcePolicy", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_DeleteSecret.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_DeleteSecret.go index 1716e3ec..62ec00a2 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_DeleteSecret.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_DeleteSecret.go @@ -4,6 +4,7 @@ package secretsmanager import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" @@ -11,47 +12,41 @@ import ( "time" ) -// Deletes an entire secret and all of its versions. You can optionally include a -// recovery window during which you can restore the secret. If you don't specify a -// recovery window value, the operation defaults to 30 days. Secrets Manager -// attaches a DeletionDate stamp to the secret that specifies the end of the -// recovery window. At the end of the recovery window, Secrets Manager deletes the -// secret permanently. At any time before recovery window ends, you can use -// RestoreSecret to remove the DeletionDate and cancel the deletion of the secret. -// You cannot access the encrypted secret information in any secret that is -// scheduled for deletion. If you need to access that information, you must cancel -// the deletion with RestoreSecret and then retrieve the information. -// -// * There is -// no explicit operation to delete a version of a secret. Instead, remove all -// staging labels from the VersionStage field of a version. That marks the version -// as deprecated and allows Secrets Manager to delete it as needed. Versions that -// do not have any staging labels do not show up in ListSecretVersionIds unless you -// specify IncludeDeprecated. -// -// * The permanent secret deletion at the end of the -// waiting period is performed as a background task with low priority. There is no -// guarantee of a specific time after the recovery window for the actual delete -// operation to occur. -// -// Minimum permissions To run this command, you must have the -// following permissions: -// -// * secretsmanager:DeleteSecret -// -// Related operations -// -// * To -// create a secret, use CreateSecret. -// -// * To cancel deletion of a version of a -// secret before the recovery window has expired, use RestoreSecret. +// Deletes a secret and all of its versions. You can specify a recovery window +// during which you can restore the secret. The minimum recovery window is 7 days. +// The default recovery window is 30 days. Secrets Manager attaches a DeletionDate +// stamp to the secret that specifies the end of the recovery window. At the end of +// the recovery window, Secrets Manager deletes the secret permanently. You can't +// delete a primary secret that is replicated to other Regions. You must first +// delete the replicas using RemoveRegionsFromReplication , and then delete the +// primary secret. When you delete a replica, it is deleted immediately. You can't +// directly delete a version of a secret. Instead, you remove all staging labels +// from the version using UpdateSecretVersionStage . This marks the version as +// deprecated, and then Secrets Manager can automatically delete the version in the +// background. To determine whether an application still uses a secret, you can +// create an Amazon CloudWatch alarm to alert you to any attempts to access a +// secret during the recovery window. For more information, see Monitor secrets +// scheduled for deletion (https://docs.aws.amazon.com/secretsmanager/latest/userguide/monitoring_cloudwatch_deleted-secrets.html) +// . Secrets Manager performs the permanent secret deletion at the end of the +// waiting period as a background task with low priority. There is no guarantee of +// a specific time after the recovery window for the permanent delete to occur. At +// any time before recovery window ends, you can use RestoreSecret to remove the +// DeletionDate and cancel the deletion of the secret. When a secret is scheduled +// for deletion, you cannot retrieve the secret value. You must first cancel the +// deletion with RestoreSecret and then you can retrieve the secret. Secrets +// Manager generates a CloudTrail log entry when you call this action. Do not +// include sensitive information in request parameters because it might be logged. +// For more information, see Logging Secrets Manager events with CloudTrail (https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html) +// . Required permissions: secretsmanager:DeleteSecret . For more information, see +// IAM policy actions for Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions) +// and Authentication and access control in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html) +// . func (c *Client) DeleteSecret(ctx context.Context, params *DeleteSecretInput, optFns ...func(*Options)) (*DeleteSecretOutput, error) { if params == nil { params = &DeleteSecretInput{} } - result, metadata, err := c.invokeOperation(ctx, "DeleteSecret", params, optFns, addOperationDeleteSecretMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DeleteSecret", params, optFns, c.addOperationDeleteSecretMiddlewares) if err != nil { return nil, err } @@ -63,65 +58,62 @@ func (c *Client) DeleteSecret(ctx context.Context, params *DeleteSecretInput, op type DeleteSecretInput struct { - // Specifies the secret that you want to delete. You can specify either the Amazon - // Resource Name (ARN) or the friendly name of the secret. If you specify an ARN, - // we generally recommend that you specify a complete ARN. You can specify a - // partial ARN too—for example, if you don’t include the final hyphen and six - // random characters that Secrets Manager adds at the end of the ARN when you - // created the secret. A partial ARN match can work as long as it uniquely matches - // only one secret. However, if your secret has a name that ends in a hyphen - // followed by six characters (before Secrets Manager adds the hyphen and six - // characters to the ARN) and you try to use that as a partial ARN, then those - // characters cause Secrets Manager to assume that you’re specifying a complete - // ARN. This confusion can cause unexpected results. To avoid this situation, we - // recommend that you don’t create secret names ending with a hyphen followed by - // six characters. If you specify an incomplete ARN without the random suffix, and - // instead provide the 'friendly name', you must not include the random suffix. If - // you do include the random suffix added by Secrets Manager, you receive either a - // ResourceNotFoundException or an AccessDeniedException error, depending on your - // permissions. + // The ARN or name of the secret to delete. For an ARN, we recommend that you + // specify a complete ARN rather than a partial ARN. See Finding a secret from a + // partial ARN (https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen) + // . // // This member is required. SecretId *string - // (Optional) Specifies that the secret is to be deleted without any recovery - // window. You can't use both this parameter and the RecoveryWindowInDays parameter - // in the same API call. An asynchronous background process performs the actual - // deletion, so there can be a short delay before the operation completes. If you - // write code to delete and then immediately recreate a secret with the same name, - // ensure that your code includes appropriate back off and retry logic. Use this - // parameter with caution. This parameter causes the operation to skip the normal - // waiting period before the permanent deletion that AWS would normally impose with - // the RecoveryWindowInDays parameter. If you delete a secret with the - // ForceDeleteWithouRecovery parameter, then you have no opportunity to recover the - // secret. It is permanently lost. - ForceDeleteWithoutRecovery bool - - // (Optional) Specifies the number of days that Secrets Manager waits before it can - // delete the secret. You can't use both this parameter and the - // ForceDeleteWithoutRecovery parameter in the same API call. This value can range - // from 7 to 30 days. The default value is 30. - RecoveryWindowInDays int64 + // Specifies whether to delete the secret without any recovery window. You can't + // use both this parameter and RecoveryWindowInDays in the same call. If you don't + // use either, then by default Secrets Manager uses a 30 day recovery window. + // Secrets Manager performs the actual deletion with an asynchronous background + // process, so there might be a short delay before the secret is permanently + // deleted. If you delete a secret and then immediately create a secret with the + // same name, use appropriate back off and retry logic. If you forcibly delete an + // already deleted or nonexistent secret, the operation does not return + // ResourceNotFoundException . Use this parameter with caution. This parameter + // causes the operation to skip the normal recovery window before the permanent + // deletion that Secrets Manager would normally impose with the + // RecoveryWindowInDays parameter. If you delete a secret with the + // ForceDeleteWithoutRecovery parameter, then you have no opportunity to recover + // the secret. You lose the secret permanently. + ForceDeleteWithoutRecovery *bool + + // The number of days from 7 to 30 that Secrets Manager waits before permanently + // deleting the secret. You can't use both this parameter and + // ForceDeleteWithoutRecovery in the same call. If you don't use either, then by + // default Secrets Manager uses a 30 day recovery window. + RecoveryWindowInDays *int64 + + noSmithyDocumentSerde } type DeleteSecretOutput struct { - // The ARN of the secret that is now scheduled for deletion. + // The ARN of the secret. ARN *string - // The date and time after which this secret can be deleted by Secrets Manager and - // can no longer be restored. This value is the date and time of the delete request - // plus the number of days specified in RecoveryWindowInDays. + // The date and time after which this secret Secrets Manager can permanently + // delete this secret, and it can no longer be restored. This value is the date and + // time of the delete request plus the number of days in RecoveryWindowInDays . DeletionDate *time.Time - // The friendly name of the secret that is now scheduled for deletion. + // The name of the secret. Name *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDeleteSecretMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDeleteSecretMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteSecret{}, middleware.After) if err != nil { return err @@ -130,6 +122,13 @@ func addOperationDeleteSecretMiddlewares(stack *middleware.Stack, options Option if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteSecret"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -148,16 +147,13 @@ func addOperationDeleteSecretMiddlewares(stack *middleware.Stack, options Option if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -166,12 +162,18 @@ func addOperationDeleteSecretMiddlewares(stack *middleware.Stack, options Option if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDeleteSecretValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSecret(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -181,6 +183,9 @@ func addOperationDeleteSecretMiddlewares(stack *middleware.Stack, options Option if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -188,7 +193,6 @@ func newServiceMetadataMiddleware_opDeleteSecret(region string) *awsmiddleware.R return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "secretsmanager", OperationName: "DeleteSecret", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_DescribeSecret.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_DescribeSecret.go index ff282301..2e714de6 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_DescribeSecret.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_DescribeSecret.go @@ -4,6 +4,7 @@ package secretsmanager import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/secretsmanager/types" @@ -12,32 +13,21 @@ import ( "time" ) -// Retrieves the details of a secret. It does not include the encrypted fields. -// Secrets Manager only returns fields populated with a value in the response. -// Minimum permissions To run this command, you must have the following -// permissions: -// -// * secretsmanager:DescribeSecret -// -// Related operations -// -// * To create a -// secret, use CreateSecret. -// -// * To modify a secret, use UpdateSecret. -// -// * To -// retrieve the encrypted secret information in a version of the secret, use -// GetSecretValue. -// -// * To list all of the secrets in the AWS account, use -// ListSecrets. +// Retrieves the details of a secret. It does not include the encrypted secret +// value. Secrets Manager only returns fields that have a value in the response. +// Secrets Manager generates a CloudTrail log entry when you call this action. Do +// not include sensitive information in request parameters because it might be +// logged. For more information, see Logging Secrets Manager events with CloudTrail (https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html) +// . Required permissions: secretsmanager:DescribeSecret . For more information, +// see IAM policy actions for Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions) +// and Authentication and access control in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html) +// . func (c *Client) DescribeSecret(ctx context.Context, params *DescribeSecretInput, optFns ...func(*Options)) (*DescribeSecretOutput, error) { if params == nil { params = &DescribeSecretInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeSecret", params, optFns, addOperationDescribeSecretMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeSecret", params, optFns, c.addOperationDescribeSecretMiddlewares) if err != nil { return nil, err } @@ -49,26 +39,14 @@ func (c *Client) DescribeSecret(ctx context.Context, params *DescribeSecretInput type DescribeSecretInput struct { - // The identifier of the secret whose details you want to retrieve. You can specify - // either the Amazon Resource Name (ARN) or the friendly name of the secret. If you - // specify an ARN, we generally recommend that you specify a complete ARN. You can - // specify a partial ARN too—for example, if you don’t include the final hyphen and - // six random characters that Secrets Manager adds at the end of the ARN when you - // created the secret. A partial ARN match can work as long as it uniquely matches - // only one secret. However, if your secret has a name that ends in a hyphen - // followed by six characters (before Secrets Manager adds the hyphen and six - // characters to the ARN) and you try to use that as a partial ARN, then those - // characters cause Secrets Manager to assume that you’re specifying a complete - // ARN. This confusion can cause unexpected results. To avoid this situation, we - // recommend that you don’t create secret names ending with a hyphen followed by - // six characters. If you specify an incomplete ARN without the random suffix, and - // instead provide the 'friendly name', you must not include the random suffix. If - // you do include the random suffix added by Secrets Manager, you receive either a - // ResourceNotFoundException or an AccessDeniedException error, depending on your - // permissions. + // The ARN or name of the secret. For an ARN, we recommend that you specify a + // complete ARN rather than a partial ARN. See Finding a secret from a partial ARN (https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen) + // . // // This member is required. SecretId *string + + noSmithyDocumentSerde } type DescribeSecretOutput struct { @@ -76,72 +54,108 @@ type DescribeSecretOutput struct { // The ARN of the secret. ARN *string - // The date that the secret was created. + // The date the secret was created. CreatedDate *time.Time - // This value exists if the secret is scheduled for deletion. Some time after the - // specified date and time, Secrets Manager deletes the secret and all of its - // versions. If a secret is scheduled for deletion, then its details, including the - // encrypted secret information, is not accessible. To cancel a scheduled deletion - // and restore access, use RestoreSecret. + // The date the secret is scheduled for deletion. If it is not scheduled for + // deletion, this field is omitted. When you delete a secret, Secrets Manager + // requires a recovery window of at least 7 days before deleting the secret. Some + // time after the deleted date, Secrets Manager deletes the secret, including all + // of its versions. If a secret is scheduled for deletion, then its details, + // including the encrypted secret value, is not accessible. To cancel a scheduled + // deletion and restore access to the secret, use RestoreSecret . DeletedDate *time.Time - // The user-provided description of the secret. + // The description of the secret. Description *string - // The ARN or alias of the AWS KMS customer master key (CMK) that's used to encrypt - // the SecretString or SecretBinary fields in each version of the secret. If you - // don't provide a key, then Secrets Manager defaults to encrypting the secret - // fields with the default AWS KMS CMK (the one named awssecretsmanager) for this - // account. + // The key ID or alias ARN of the KMS key that Secrets Manager uses to encrypt the + // secret value. If the secret is encrypted with the Amazon Web Services managed + // key aws/secretsmanager , this field is omitted. Secrets created using the + // console use an KMS key ID. KmsKeyId *string - // The last date that this secret was accessed. This value is truncated to midnight - // of the date and therefore shows only the date, not the time. + // The date that the secret was last accessed in the Region. This field is omitted + // if the secret has never been retrieved in the Region. LastAccessedDate *time.Time // The last date and time that this secret was modified in any way. LastChangedDate *time.Time - // The most recent date and time that the Secrets Manager rotation process was - // successfully completed. This value is null if the secret has never rotated. + // The last date and time that Secrets Manager rotated the secret. If the secret + // isn't configured for rotation or rotation has been disabled, Secrets Manager + // returns null. LastRotatedDate *time.Time - // The user-provided friendly name of the secret. + // The name of the secret. Name *string - // Returns the name of the service that created this secret. + // The next rotation is scheduled to occur on or before this date. If the secret + // isn't configured for rotation or rotation has been disabled, Secrets Manager + // returns null. + NextRotationDate *time.Time + + // The ID of the service that created this secret. For more information, see + // Secrets managed by other Amazon Web Services services (https://docs.aws.amazon.com/secretsmanager/latest/userguide/service-linked-secrets.html) + // . OwningService *string - // Specifies whether automatic rotation is enabled for this secret. To enable - // rotation, use RotateSecret with AutomaticallyRotateAfterDays set to a value - // greater than 0. To disable rotation, use CancelRotateSecret. - RotationEnabled bool + // The Region the secret is in. If a secret is replicated to other Regions, the + // replicas are listed in ReplicationStatus . + PrimaryRegion *string + + // A list of the replicas of this secret and their status: + // - Failed , which indicates that the replica was not created. + // - InProgress , which indicates that Secrets Manager is in the process of + // creating the replica. + // - InSync , which indicates that the replica was created. + ReplicationStatus []types.ReplicationStatusType - // The ARN of a Lambda function that's invoked by Secrets Manager to rotate the - // secret either automatically per the schedule or manually by a call to - // RotateSecret. + // Specifies whether automatic rotation is turned on for this secret. To turn on + // rotation, use RotateSecret . To turn off rotation, use CancelRotateSecret . + RotationEnabled *bool + + // The ARN of the Lambda function that Secrets Manager invokes to rotate the + // secret. RotationLambdaARN *string - // A structure that contains the rotation configuration for this secret. + // The rotation schedule and Lambda function for this secret. If the secret + // previously had rotation turned on, but it is now turned off, this field shows + // the previous rotation schedule and rotation function. If the secret never had + // rotation turned on, this field is omitted. RotationRules *types.RotationRulesType - // The list of user-defined tags that are associated with the secret. To add tags - // to a secret, use TagResource. To remove tags, use UntagResource. + // The list of tags attached to the secret. To add tags to a secret, use + // TagResource . To remove tags, use UntagResource . Tags []types.Tag - // A list of all of the currently assigned VersionStage staging labels and the - // VersionId that each is attached to. Staging labels are used to keep track of the - // different versions during the rotation process. A version that does not have any - // staging labels attached is considered deprecated and subject to deletion. Such - // versions are not included in this list. + // A list of the versions of the secret that have staging labels attached. + // Versions that don't have staging labels are considered deprecated and Secrets + // Manager can delete them. Secrets Manager uses staging labels to indicate the + // status of a secret version during rotation. The three staging labels for + // rotation are: + // - AWSCURRENT , which indicates the current version of the secret. + // - AWSPENDING , which indicates the version of the secret that contains new + // secret information that will become the next current version when rotation + // finishes. During rotation, Secrets Manager creates an AWSPENDING version ID + // before creating the new secret version. To check if a secret version exists, + // call GetSecretValue . + // - AWSPREVIOUS , which indicates the previous current version of the secret. + // You can use this as the last known good version. + // For more information about rotation and staging labels, see How rotation works (https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html) + // . VersionIdsToStages map[string][]string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeSecretMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeSecretMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeSecret{}, middleware.After) if err != nil { return err @@ -150,6 +164,13 @@ func addOperationDescribeSecretMiddlewares(stack *middleware.Stack, options Opti if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeSecret"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -168,16 +189,13 @@ func addOperationDescribeSecretMiddlewares(stack *middleware.Stack, options Opti if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -186,12 +204,18 @@ func addOperationDescribeSecretMiddlewares(stack *middleware.Stack, options Opti if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDescribeSecretValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSecret(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -201,6 +225,9 @@ func addOperationDescribeSecretMiddlewares(stack *middleware.Stack, options Opti if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -208,7 +235,6 @@ func newServiceMetadataMiddleware_opDescribeSecret(region string) *awsmiddleware return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "secretsmanager", OperationName: "DescribeSecret", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_GetRandomPassword.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_GetRandomPassword.go index 181dbeb9..a9b2deaa 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_GetRandomPassword.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_GetRandomPassword.go @@ -4,26 +4,31 @@ package secretsmanager import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Generates a random password of the specified complexity. This operation is -// intended for use in the Lambda rotation function. Per best practice, we -// recommend that you specify the maximum length and include every character type -// that the system you are generating a password for can support. Minimum -// permissions To run this command, you must have the following permissions: -// -// * -// secretsmanager:GetRandomPassword +// Generates a random password. We recommend that you specify the maximum length +// and include every character type that the system you are generating a password +// for can support. By default, Secrets Manager uses uppercase and lowercase +// letters, numbers, and the following characters in passwords: +// !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ Secrets Manager generates a CloudTrail log +// entry when you call this action. Do not include sensitive information in request +// parameters because it might be logged. For more information, see Logging +// Secrets Manager events with CloudTrail (https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html) +// . Required permissions: secretsmanager:GetRandomPassword . For more information, +// see IAM policy actions for Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions) +// and Authentication and access control in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html) +// . func (c *Client) GetRandomPassword(ctx context.Context, params *GetRandomPasswordInput, optFns ...func(*Options)) (*GetRandomPasswordOutput, error) { if params == nil { params = &GetRandomPasswordInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetRandomPassword", params, optFns, addOperationGetRandomPasswordMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetRandomPassword", params, optFns, c.addOperationGetRandomPasswordMiddlewares) if err != nil { return nil, err } @@ -35,57 +40,57 @@ func (c *Client) GetRandomPassword(ctx context.Context, params *GetRandomPasswor type GetRandomPasswordInput struct { - // A string that includes characters that should not be included in the generated - // password. The default is that all characters from the included sets can be used. + // A string of the characters that you don't want in the password. ExcludeCharacters *string - // Specifies that the generated password should not include lowercase letters. The - // default if you do not include this switch parameter is that lowercase letters - // can be included. - ExcludeLowercase bool - - // Specifies that the generated password should not include digits. The default if - // you do not include this switch parameter is that digits can be included. - ExcludeNumbers bool - - // Specifies that the generated password should not include punctuation characters. - // The default if you do not include this switch parameter is that punctuation - // characters can be included. The following are the punctuation characters that - // can be included in the generated password if you don't explicitly exclude them - // with ExcludeCharacters or ExcludePunctuation: ! " # $ % & ' ( ) * + , - . / : ; - // < = > ? @ [ \ ] ^ _ ` { | } ~ - ExcludePunctuation bool - - // Specifies that the generated password should not include uppercase letters. The - // default if you do not include this switch parameter is that uppercase letters - // can be included. - ExcludeUppercase bool - - // Specifies that the generated password can include the space character. The - // default if you do not include this switch parameter is that the space character - // is not included. - IncludeSpace bool - - // The desired length of the generated password. The default value if you do not - // include this parameter is 32 characters. - PasswordLength int64 - - // A boolean value that specifies whether the generated password must include at - // least one of every allowed character type. The default value is True and the - // operation requires at least one of every character type. - RequireEachIncludedType bool + // Specifies whether to exclude lowercase letters from the password. If you don't + // include this switch, the password can contain lowercase letters. + ExcludeLowercase *bool + + // Specifies whether to exclude numbers from the password. If you don't include + // this switch, the password can contain numbers. + ExcludeNumbers *bool + + // Specifies whether to exclude the following punctuation characters from the + // password: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ . If + // you don't include this switch, the password can contain punctuation. + ExcludePunctuation *bool + + // Specifies whether to exclude uppercase letters from the password. If you don't + // include this switch, the password can contain uppercase letters. + ExcludeUppercase *bool + + // Specifies whether to include the space character. If you include this switch, + // the password can contain space characters. + IncludeSpace *bool + + // The length of the password. If you don't include this parameter, the default + // length is 32 characters. + PasswordLength *int64 + + // Specifies whether to include at least one upper and lowercase letter, one + // number, and one punctuation. If you don't include this switch, the password + // contains at least one of every character type. + RequireEachIncludedType *bool + + noSmithyDocumentSerde } type GetRandomPasswordOutput struct { - // A string with the generated password. + // A string with the password. RandomPassword *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetRandomPasswordMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetRandomPasswordMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetRandomPassword{}, middleware.After) if err != nil { return err @@ -94,6 +99,13 @@ func addOperationGetRandomPasswordMiddlewares(stack *middleware.Stack, options O if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetRandomPassword"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -112,16 +124,13 @@ func addOperationGetRandomPasswordMiddlewares(stack *middleware.Stack, options O if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -130,9 +139,15 @@ func addOperationGetRandomPasswordMiddlewares(stack *middleware.Stack, options O if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRandomPassword(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -142,6 +157,9 @@ func addOperationGetRandomPasswordMiddlewares(stack *middleware.Stack, options O if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -149,7 +167,6 @@ func newServiceMetadataMiddleware_opGetRandomPassword(region string) *awsmiddlew return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "secretsmanager", OperationName: "GetRandomPassword", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_GetResourcePolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_GetResourcePolicy.go index 27c140dd..d2331cc8 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_GetResourcePolicy.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_GetResourcePolicy.go @@ -4,6 +4,7 @@ package secretsmanager import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" @@ -11,30 +12,21 @@ import ( ) // Retrieves the JSON text of the resource-based policy document attached to the -// specified secret. The JSON request string input and response output displays -// formatted code with white space and line breaks for better readability. Submit -// your input as a single line JSON string. Minimum permissions To run this -// command, you must have the following permissions: -// -// * -// secretsmanager:GetResourcePolicy -// -// Related operations -// -// * To attach a resource -// policy to a secret, use PutResourcePolicy. -// -// * To delete the resource-based -// policy attached to a secret, use DeleteResourcePolicy. -// -// * To list all of the -// currently available secrets, use ListSecrets. +// secret. For more information about permissions policies attached to a secret, +// see Permissions policies attached to a secret (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_resource-policies.html) +// . Secrets Manager generates a CloudTrail log entry when you call this action. Do +// not include sensitive information in request parameters because it might be +// logged. For more information, see Logging Secrets Manager events with CloudTrail (https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html) +// . Required permissions: secretsmanager:GetResourcePolicy . For more information, +// see IAM policy actions for Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions) +// and Authentication and access control in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html) +// . func (c *Client) GetResourcePolicy(ctx context.Context, params *GetResourcePolicyInput, optFns ...func(*Options)) (*GetResourcePolicyOutput, error) { if params == nil { params = &GetResourcePolicyInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetResourcePolicy", params, optFns, addOperationGetResourcePolicyMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetResourcePolicy", params, optFns, c.addOperationGetResourcePolicyMiddlewares) if err != nil { return nil, err } @@ -46,26 +38,15 @@ func (c *Client) GetResourcePolicy(ctx context.Context, params *GetResourcePolic type GetResourcePolicyInput struct { - // Specifies the secret that you want to retrieve the attached resource-based - // policy for. You can specify either the Amazon Resource Name (ARN) or the - // friendly name of the secret. If you specify an ARN, we generally recommend that - // you specify a complete ARN. You can specify a partial ARN too—for example, if - // you don’t include the final hyphen and six random characters that Secrets - // Manager adds at the end of the ARN when you created the secret. A partial ARN - // match can work as long as it uniquely matches only one secret. However, if your - // secret has a name that ends in a hyphen followed by six characters (before - // Secrets Manager adds the hyphen and six characters to the ARN) and you try to - // use that as a partial ARN, then those characters cause Secrets Manager to assume - // that you’re specifying a complete ARN. This confusion can cause unexpected - // results. To avoid this situation, we recommend that you don’t create secret - // names ending with a hyphen followed by six characters. If you specify an - // incomplete ARN without the random suffix, and instead provide the 'friendly - // name', you must not include the random suffix. If you do include the random - // suffix added by Secrets Manager, you receive either a ResourceNotFoundException - // or an AccessDeniedException error, depending on your permissions. + // The ARN or name of the secret to retrieve the attached resource-based policy + // for. For an ARN, we recommend that you specify a complete ARN rather than a + // partial ARN. See Finding a secret from a partial ARN (https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen) + // . // // This member is required. SecretId *string + + noSmithyDocumentSerde } type GetResourcePolicyOutput struct { @@ -73,25 +54,25 @@ type GetResourcePolicyOutput struct { // The ARN of the secret that the resource-based policy was retrieved for. ARN *string - // The friendly name of the secret that the resource-based policy was retrieved - // for. + // The name of the secret that the resource-based policy was retrieved for. Name *string - // A JSON-formatted string that describes the permissions that are associated with - // the attached secret. These permissions are combined with any permissions that - // are associated with the user or role that attempts to access this secret. The - // combined permissions specify who can access the secret and what actions they can - // perform. For more information, see Authentication and Access Control for AWS - // Secrets Manager - // (http://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html) - // in the AWS Secrets Manager User Guide. + // A JSON-formatted string that contains the permissions policy attached to the + // secret. For more information about permissions policies, see Authentication and + // access control for Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html) + // . ResourcePolicy *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetResourcePolicy{}, middleware.After) if err != nil { return err @@ -100,6 +81,13 @@ func addOperationGetResourcePolicyMiddlewares(stack *middleware.Stack, options O if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetResourcePolicy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -118,16 +106,13 @@ func addOperationGetResourcePolicyMiddlewares(stack *middleware.Stack, options O if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -136,12 +121,18 @@ func addOperationGetResourcePolicyMiddlewares(stack *middleware.Stack, options O if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpGetResourcePolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetResourcePolicy(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -151,6 +142,9 @@ func addOperationGetResourcePolicyMiddlewares(stack *middleware.Stack, options O if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -158,7 +152,6 @@ func newServiceMetadataMiddleware_opGetResourcePolicy(region string) *awsmiddlew return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "secretsmanager", OperationName: "GetResourcePolicy", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_GetSecretValue.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_GetSecretValue.go index 1a73303a..11ecfcd3 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_GetSecretValue.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_GetSecretValue.go @@ -4,6 +4,7 @@ package secretsmanager import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" @@ -11,31 +12,30 @@ import ( "time" ) -// Retrieves the contents of the encrypted fields SecretString or SecretBinary from -// the specified version of a secret, whichever contains content. Minimum -// permissions To run this command, you must have the following permissions: -// -// * -// secretsmanager:GetSecretValue -// -// * kms:Decrypt - required only if you use a -// customer-managed AWS KMS key to encrypt the secret. You do not need this -// permission to use the account's default AWS managed CMK for Secrets -// Manager. -// -// Related operations -// -// * To create a new version of the secret with -// different encrypted information, use PutSecretValue. -// -// * To retrieve the -// non-encrypted details for the secret, use DescribeSecret. +// Retrieves the contents of the encrypted fields SecretString or SecretBinary +// from the specified version of a secret, whichever contains content. To retrieve +// the values for a group of secrets, call BatchGetSecretValue . We recommend that +// you cache your secret values by using client-side caching. Caching secrets +// improves speed and reduces your costs. For more information, see Cache secrets +// for your applications (https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieving-secrets.html) +// . To retrieve the previous version of a secret, use VersionStage and specify +// AWSPREVIOUS. To revert to the previous version of a secret, call +// UpdateSecretVersionStage (https://docs.aws.amazon.com/cli/latest/reference/secretsmanager/update-secret-version-stage.html) +// . Secrets Manager generates a CloudTrail log entry when you call this action. Do +// not include sensitive information in request parameters because it might be +// logged. For more information, see Logging Secrets Manager events with CloudTrail (https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html) +// . Required permissions: secretsmanager:GetSecretValue . If the secret is +// encrypted using a customer-managed key instead of the Amazon Web Services +// managed key aws/secretsmanager , then you also need kms:Decrypt permissions for +// that key. For more information, see IAM policy actions for Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions) +// and Authentication and access control in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html) +// . func (c *Client) GetSecretValue(ctx context.Context, params *GetSecretValueInput, optFns ...func(*Options)) (*GetSecretValueOutput, error) { if params == nil { params = &GetSecretValueInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetSecretValue", params, optFns, addOperationGetSecretValueMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetSecretValue", params, optFns, c.addOperationGetSecretValueMiddlewares) if err != nil { return nil, err } @@ -47,43 +47,30 @@ func (c *Client) GetSecretValue(ctx context.Context, params *GetSecretValueInput type GetSecretValueInput struct { - // Specifies the secret containing the version that you want to retrieve. You can - // specify either the Amazon Resource Name (ARN) or the friendly name of the - // secret. If you specify an ARN, we generally recommend that you specify a - // complete ARN. You can specify a partial ARN too—for example, if you don’t - // include the final hyphen and six random characters that Secrets Manager adds at - // the end of the ARN when you created the secret. A partial ARN match can work as - // long as it uniquely matches only one secret. However, if your secret has a name - // that ends in a hyphen followed by six characters (before Secrets Manager adds - // the hyphen and six characters to the ARN) and you try to use that as a partial - // ARN, then those characters cause Secrets Manager to assume that you’re - // specifying a complete ARN. This confusion can cause unexpected results. To avoid - // this situation, we recommend that you don’t create secret names ending with a - // hyphen followed by six characters. If you specify an incomplete ARN without the - // random suffix, and instead provide the 'friendly name', you must not include the - // random suffix. If you do include the random suffix added by Secrets Manager, you - // receive either a ResourceNotFoundException or an AccessDeniedException error, - // depending on your permissions. + // The ARN or name of the secret to retrieve. For an ARN, we recommend that you + // specify a complete ARN rather than a partial ARN. See Finding a secret from a + // partial ARN (https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen) + // . // // This member is required. SecretId *string - // Specifies the unique identifier of the version of the secret that you want to - // retrieve. If you specify this parameter then don't specify VersionStage. If you - // don't specify either a VersionStage or VersionId then the default is to perform - // the operation on the version with the VersionStage value of AWSCURRENT. This - // value is typically a UUID-type - // (https://wikipedia.org/wiki/Universally_unique_identifier) value with 32 - // hexadecimal digits. + // The unique identifier of the version of the secret to retrieve. If you include + // both this parameter and VersionStage , the two parameters must refer to the same + // secret version. If you don't specify either a VersionStage or VersionId , then + // Secrets Manager returns the AWSCURRENT version. This value is typically a + // UUID-type (https://wikipedia.org/wiki/Universally_unique_identifier) value with + // 32 hexadecimal digits. VersionId *string - // Specifies the secret version that you want to retrieve by the staging label - // attached to the version. Staging labels are used to keep track of different - // versions during the rotation process. If you use this parameter then don't - // specify VersionId. If you don't specify either a VersionStage or VersionId, then - // the default is to perform the operation on the version with the VersionStage - // value of AWSCURRENT. + // The staging label of the version of the secret to retrieve. Secrets Manager + // uses staging labels to keep track of different versions during the rotation + // process. If you include both this parameter and VersionId , the two parameters + // must refer to the same secret version. If you don't specify either a + // VersionStage or VersionId , Secrets Manager returns the AWSCURRENT version. VersionStage *string + + noSmithyDocumentSerde } type GetSecretValueOutput struct { @@ -91,31 +78,27 @@ type GetSecretValueOutput struct { // The ARN of the secret. ARN *string - // The date and time that this version of the secret was created. + // The date and time that this version of the secret was created. If you don't + // specify which version in VersionId or VersionStage , then Secrets Manager uses + // the AWSCURRENT version. CreatedDate *time.Time // The friendly name of the secret. Name *string - // The decrypted part of the protected secret information that was originally - // provided as binary data in the form of a byte array. The response parameter - // represents the binary data as a base64-encoded - // (https://tools.ietf.org/html/rfc4648#section-4) string. This parameter is not - // used if the secret is created by the Secrets Manager console. If you store - // custom information in this field of the secret, then you must code your Lambda - // rotation function to parse and interpret whatever you store in the SecretString - // or SecretBinary fields. + // The decrypted secret value, if the secret value was originally provided as + // binary data in the form of a byte array. When you retrieve a SecretBinary using + // the HTTP API, the Python SDK, or the Amazon Web Services CLI, the value is + // Base64-encoded. Otherwise, it is not encoded. If the secret was created by using + // the Secrets Manager console, or if the secret value was originally provided as a + // string, then this field is omitted. The secret value appears in SecretString + // instead. SecretBinary []byte - // The decrypted part of the protected secret information that was originally - // provided as a string. If you create this secret by using the Secrets Manager - // console then only the SecretString parameter contains data. Secrets Manager - // stores the information as a JSON structure of key/value pairs that the Lambda - // rotation function knows how to parse. If you store custom information in the - // secret by using the CreateSecret, UpdateSecret, or PutSecretValue API operations - // instead of the Secrets Manager console, or by using the Other secret type in the - // console, then you must code your Lambda rotation function to parse and interpret - // those values. + // The decrypted secret value, if the secret value was originally provided as a + // string or through the Secrets Manager console. If this secret was created by + // using the console, then Secrets Manager stores the information as a JSON + // structure of key/value pairs. SecretString *string // The unique identifier of this version of the secret. @@ -127,9 +110,14 @@ type GetSecretValueOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetSecretValueMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetSecretValueMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetSecretValue{}, middleware.After) if err != nil { return err @@ -138,6 +126,13 @@ func addOperationGetSecretValueMiddlewares(stack *middleware.Stack, options Opti if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetSecretValue"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -156,16 +151,13 @@ func addOperationGetSecretValueMiddlewares(stack *middleware.Stack, options Opti if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -174,12 +166,18 @@ func addOperationGetSecretValueMiddlewares(stack *middleware.Stack, options Opti if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpGetSecretValueValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSecretValue(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -189,6 +187,9 @@ func addOperationGetSecretValueMiddlewares(stack *middleware.Stack, options Opti if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -196,7 +197,6 @@ func newServiceMetadataMiddleware_opGetSecretValue(region string) *awsmiddleware return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "secretsmanager", OperationName: "GetSecretValue", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ListSecretVersionIds.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ListSecretVersionIds.go index 49be4e0e..62af6310 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ListSecretVersionIds.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ListSecretVersionIds.go @@ -12,29 +12,23 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists all of the versions attached to the specified secret. The output does not -// include the SecretString or SecretBinary fields. By default, the list includes -// only versions that have at least one staging label in VersionStage attached. -// Always check the NextToken response parameter when calling any of the List* -// operations. These operations can occasionally return an empty or shorter than -// expected list of results even when there more results become available. When -// this happens, the NextToken response parameter contains a value to pass to the -// next call to the same API to request the next part of the list. Minimum -// permissions To run this command, you must have the following permissions: -// -// * -// secretsmanager:ListSecretVersionIds -// -// Related operations -// -// * To list the secrets -// in an account, use ListSecrets. +// Lists the versions of a secret. Secrets Manager uses staging labels to indicate +// the different versions of a secret. For more information, see Secrets Manager +// concepts: Versions (https://docs.aws.amazon.com/secretsmanager/latest/userguide/getting-started.html#term_version) +// . To list the secrets in the account, use ListSecrets . Secrets Manager +// generates a CloudTrail log entry when you call this action. Do not include +// sensitive information in request parameters because it might be logged. For more +// information, see Logging Secrets Manager events with CloudTrail (https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html) +// . Required permissions: secretsmanager:ListSecretVersionIds . For more +// information, see IAM policy actions for Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions) +// and Authentication and access control in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html) +// . func (c *Client) ListSecretVersionIds(ctx context.Context, params *ListSecretVersionIdsInput, optFns ...func(*Options)) (*ListSecretVersionIdsOutput, error) { if params == nil { params = &ListSecretVersionIdsInput{} } - result, metadata, err := c.invokeOperation(ctx, "ListSecretVersionIds", params, optFns, addOperationListSecretVersionIdsMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "ListSecretVersionIds", params, optFns, c.addOperationListSecretVersionIdsMiddlewares) if err != nil { return nil, err } @@ -46,80 +40,60 @@ func (c *Client) ListSecretVersionIds(ctx context.Context, params *ListSecretVer type ListSecretVersionIdsInput struct { - // The identifier for the secret containing the versions you want to list. You can - // specify either the Amazon Resource Name (ARN) or the friendly name of the - // secret. If you specify an ARN, we generally recommend that you specify a - // complete ARN. You can specify a partial ARN too—for example, if you don’t - // include the final hyphen and six random characters that Secrets Manager adds at - // the end of the ARN when you created the secret. A partial ARN match can work as - // long as it uniquely matches only one secret. However, if your secret has a name - // that ends in a hyphen followed by six characters (before Secrets Manager adds - // the hyphen and six characters to the ARN) and you try to use that as a partial - // ARN, then those characters cause Secrets Manager to assume that you’re - // specifying a complete ARN. This confusion can cause unexpected results. To avoid - // this situation, we recommend that you don’t create secret names ending with a - // hyphen followed by six characters. If you specify an incomplete ARN without the - // random suffix, and instead provide the 'friendly name', you must not include the - // random suffix. If you do include the random suffix added by Secrets Manager, you - // receive either a ResourceNotFoundException or an AccessDeniedException error, - // depending on your permissions. + // The ARN or name of the secret whose versions you want to list. For an ARN, we + // recommend that you specify a complete ARN rather than a partial ARN. See + // Finding a secret from a partial ARN (https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen) + // . // // This member is required. SecretId *string - // (Optional) Specifies that you want the results to include versions that do not - // have any staging labels attached to them. Such versions are considered - // deprecated and are subject to deletion by Secrets Manager as needed. - IncludeDeprecated bool - - // (Optional) Limits the number of results you want to include in the response. If - // you don't include this parameter, it defaults to a value that's specific to the - // operation. If additional items exist beyond the maximum you specify, the - // NextToken response element is present and has a value (isn't null). Include that - // value as the NextToken request parameter in the next call to the operation to - // get the next part of the results. Note that Secrets Manager might return fewer - // results than the maximum even when there are more results available. You should - // check NextToken after every operation to ensure that you receive all of the - // results. - MaxResults int32 - - // (Optional) Use this parameter in a request if you receive a NextToken response - // in a previous request indicating there's more output available. In a subsequent - // call, set it to the value of the previous call NextToken response to indicate - // where the output should continue from. + // Specifies whether to include versions of secrets that don't have any staging + // labels attached to them. Versions without staging labels are considered + // deprecated and are subject to deletion by Secrets Manager. By default, versions + // without staging labels aren't included. + IncludeDeprecated *bool + + // The number of results to include in the response. If there are more results + // available, in the response, Secrets Manager includes NextToken . To get the next + // results, call ListSecretVersionIds again with the value from NextToken . + MaxResults *int32 + + // A token that indicates where the output should continue from, if a previous + // call did not show all results. To get the next results, call + // ListSecretVersionIds again with this value. NextToken *string + + noSmithyDocumentSerde } type ListSecretVersionIdsOutput struct { - // The Amazon Resource Name (ARN) for the secret. Secrets Manager automatically - // adds several random characters to the name at the end of the ARN when you - // initially create a secret. This affects only the ARN and not the actual friendly - // name. This ensures that if you create a new secret with the same name as an old - // secret that you previously deleted, then users with access to the old secret - // don't automatically get access to the new secret because the ARNs are different. + // The ARN of the secret. ARN *string - // The friendly name of the secret. + // The name of the secret. Name *string - // If present in the response, this value indicates that there's more output - // available than included in the current response. This can occur even when the - // response includes no values at all, such as when you ask for a filtered view of - // a very long list. Use this value in the NextToken request parameter in a - // subsequent call to the operation to continue processing and get the next part of - // the output. You should repeat this until the NextToken response element comes - // back empty (as null). + // Secrets Manager includes this value if there's more output available than what + // is included in the current response. This can occur even when the response + // includes no values at all, such as when you ask for a filtered view of a long + // list. To get the next results, call ListSecretVersionIds again with this value. NextToken *string - // The list of the currently available versions of the specified secret. + // A list of the versions of the secret. Versions []types.SecretVersionsListEntry // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationListSecretVersionIdsMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationListSecretVersionIdsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpListSecretVersionIds{}, middleware.After) if err != nil { return err @@ -128,6 +102,13 @@ func addOperationListSecretVersionIdsMiddlewares(stack *middleware.Stack, option if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListSecretVersionIds"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -146,16 +127,13 @@ func addOperationListSecretVersionIdsMiddlewares(stack *middleware.Stack, option if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -164,12 +142,18 @@ func addOperationListSecretVersionIdsMiddlewares(stack *middleware.Stack, option if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpListSecretVersionIdsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSecretVersionIds(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -179,6 +163,9 @@ func addOperationListSecretVersionIdsMiddlewares(stack *middleware.Stack, option if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -193,15 +180,9 @@ var _ ListSecretVersionIdsAPIClient = (*Client)(nil) // ListSecretVersionIdsPaginatorOptions is the paginator options for // ListSecretVersionIds type ListSecretVersionIdsPaginatorOptions struct { - // (Optional) Limits the number of results you want to include in the response. If - // you don't include this parameter, it defaults to a value that's specific to the - // operation. If additional items exist beyond the maximum you specify, the - // NextToken response element is present and has a value (isn't null). Include that - // value as the NextToken request parameter in the next call to the operation to - // get the next part of the results. Note that Secrets Manager might return fewer - // results than the maximum even when there are more results available. You should - // check NextToken after every operation to ensure that you receive all of the - // results. + // The number of results to include in the response. If there are more results + // available, in the response, Secrets Manager includes NextToken . To get the next + // results, call ListSecretVersionIds again with the value from NextToken . Limit int32 // Set to true if pagination should stop if the service returns a pagination token @@ -220,30 +201,31 @@ type ListSecretVersionIdsPaginator struct { // NewListSecretVersionIdsPaginator returns a new ListSecretVersionIdsPaginator func NewListSecretVersionIdsPaginator(client ListSecretVersionIdsAPIClient, params *ListSecretVersionIdsInput, optFns ...func(*ListSecretVersionIdsPaginatorOptions)) *ListSecretVersionIdsPaginator { + if params == nil { + params = &ListSecretVersionIdsInput{} + } + options := ListSecretVersionIdsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &ListSecretVersionIdsInput{} - } - return &ListSecretVersionIdsPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListSecretVersionIdsPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListSecretVersionIds page. @@ -255,7 +237,11 @@ func (p *ListSecretVersionIdsPaginator) NextPage(ctx context.Context, optFns ... params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListSecretVersionIds(ctx, ¶ms, optFns...) if err != nil { @@ -266,7 +252,10 @@ func (p *ListSecretVersionIdsPaginator) NextPage(ctx context.Context, optFns ... prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -277,7 +266,6 @@ func newServiceMetadataMiddleware_opListSecretVersionIds(region string) *awsmidd return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "secretsmanager", OperationName: "ListSecretVersionIds", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ListSecrets.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ListSecrets.go index 88ae4697..3ae0e70b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ListSecrets.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ListSecrets.go @@ -12,30 +12,27 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists all of the secrets that are stored by Secrets Manager in the AWS account. -// To list the versions currently stored for a specific secret, use -// ListSecretVersionIds. The encrypted fields SecretString and SecretBinary are not -// included in the output. To get that information, call the GetSecretValue -// operation. Always check the NextToken response parameter when calling any of the -// List* operations. These operations can occasionally return an empty or shorter -// than expected list of results even when there more results become available. -// When this happens, the NextToken response parameter contains a value to pass to -// the next call to the same API to request the next part of the list. Minimum -// permissions To run this command, you must have the following permissions: -// -// * -// secretsmanager:ListSecrets -// -// Related operations -// -// * To list the versions attached -// to a secret, use ListSecretVersionIds. +// Lists the secrets that are stored by Secrets Manager in the Amazon Web Services +// account, not including secrets that are marked for deletion. To see secrets +// marked for deletion, use the Secrets Manager console. ListSecrets is eventually +// consistent, however it might not reflect changes from the last five minutes. To +// get the latest information for a specific secret, use DescribeSecret . To list +// the versions of a secret, use ListSecretVersionIds . To retrieve the values for +// the secrets, call BatchGetSecretValue or GetSecretValue . For information about +// finding secrets in the console, see Find secrets in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/manage_search-secret.html) +// . Secrets Manager generates a CloudTrail log entry when you call this action. Do +// not include sensitive information in request parameters because it might be +// logged. For more information, see Logging Secrets Manager events with CloudTrail (https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html) +// . Required permissions: secretsmanager:ListSecrets . For more information, see +// IAM policy actions for Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions) +// and Authentication and access control in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html) +// . func (c *Client) ListSecrets(ctx context.Context, params *ListSecretsInput, optFns ...func(*Options)) (*ListSecretsOutput, error) { if params == nil { params = &ListSecretsInput{} } - result, metadata, err := c.invokeOperation(ctx, "ListSecrets", params, optFns, addOperationListSecretsMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "ListSecrets", params, optFns, c.addOperationListSecretsMiddlewares) if err != nil { return nil, err } @@ -47,39 +44,35 @@ func (c *Client) ListSecrets(ctx context.Context, params *ListSecretsInput, optF type ListSecretsInput struct { - // Lists the secret request filters. + // The filters to apply to the list of secrets. Filters []types.Filter - // (Optional) Limits the number of results you want to include in the response. If - // you don't include this parameter, it defaults to a value that's specific to the - // operation. If additional items exist beyond the maximum you specify, the - // NextToken response element is present and has a value (isn't null). Include that - // value as the NextToken request parameter in the next call to the operation to - // get the next part of the results. Note that Secrets Manager might return fewer - // results than the maximum even when there are more results available. You should - // check NextToken after every operation to ensure that you receive all of the - // results. - MaxResults int32 - - // (Optional) Use this parameter in a request if you receive a NextToken response - // in a previous request indicating there's more output available. In a subsequent - // call, set it to the value of the previous call NextToken response to indicate - // where the output should continue from. + // Specifies whether to include secrets scheduled for deletion. By default, + // secrets scheduled for deletion aren't included. + IncludePlannedDeletion *bool + + // The number of results to include in the response. If there are more results + // available, in the response, Secrets Manager includes NextToken . To get the next + // results, call ListSecrets again with the value from NextToken . + MaxResults *int32 + + // A token that indicates where the output should continue from, if a previous + // call did not show all results. To get the next results, call ListSecrets again + // with this value. NextToken *string - // Lists secrets in the requested order. + // Secrets are listed by CreatedDate . SortOrder types.SortOrderType + + noSmithyDocumentSerde } type ListSecretsOutput struct { - // If present in the response, this value indicates that there's more output - // available than included in the current response. This can occur even when the - // response includes no values at all, such as when you ask for a filtered view of - // a very long list. Use this value in the NextToken request parameter in a - // subsequent call to the operation to continue processing and get the next part of - // the output. You should repeat this until the NextToken response element comes - // back empty (as null). + // Secrets Manager includes this value if there's more output available than what + // is included in the current response. This can occur even when the response + // includes no values at all, such as when you ask for a filtered view of a long + // list. To get the next results, call ListSecrets again with this value. NextToken *string // A list of the secrets in the account. @@ -87,9 +80,14 @@ type ListSecretsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationListSecretsMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationListSecretsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpListSecrets{}, middleware.After) if err != nil { return err @@ -98,6 +96,13 @@ func addOperationListSecretsMiddlewares(stack *middleware.Stack, options Options if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListSecrets"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -116,16 +121,13 @@ func addOperationListSecretsMiddlewares(stack *middleware.Stack, options Options if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -134,9 +136,15 @@ func addOperationListSecretsMiddlewares(stack *middleware.Stack, options Options if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSecrets(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -146,6 +154,9 @@ func addOperationListSecretsMiddlewares(stack *middleware.Stack, options Options if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -158,15 +169,9 @@ var _ ListSecretsAPIClient = (*Client)(nil) // ListSecretsPaginatorOptions is the paginator options for ListSecrets type ListSecretsPaginatorOptions struct { - // (Optional) Limits the number of results you want to include in the response. If - // you don't include this parameter, it defaults to a value that's specific to the - // operation. If additional items exist beyond the maximum you specify, the - // NextToken response element is present and has a value (isn't null). Include that - // value as the NextToken request parameter in the next call to the operation to - // get the next part of the results. Note that Secrets Manager might return fewer - // results than the maximum even when there are more results available. You should - // check NextToken after every operation to ensure that you receive all of the - // results. + // The number of results to include in the response. If there are more results + // available, in the response, Secrets Manager includes NextToken . To get the next + // results, call ListSecrets again with the value from NextToken . Limit int32 // Set to true if pagination should stop if the service returns a pagination token @@ -185,30 +190,31 @@ type ListSecretsPaginator struct { // NewListSecretsPaginator returns a new ListSecretsPaginator func NewListSecretsPaginator(client ListSecretsAPIClient, params *ListSecretsInput, optFns ...func(*ListSecretsPaginatorOptions)) *ListSecretsPaginator { + if params == nil { + params = &ListSecretsInput{} + } + options := ListSecretsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &ListSecretsInput{} - } - return &ListSecretsPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListSecretsPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListSecrets page. @@ -220,7 +226,11 @@ func (p *ListSecretsPaginator) NextPage(ctx context.Context, optFns ...func(*Opt params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListSecrets(ctx, ¶ms, optFns...) if err != nil { @@ -231,7 +241,10 @@ func (p *ListSecretsPaginator) NextPage(ctx context.Context, optFns ...func(*Opt prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -242,7 +255,6 @@ func newServiceMetadataMiddleware_opListSecrets(region string) *awsmiddleware.Re return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "secretsmanager", OperationName: "ListSecrets", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_PutResourcePolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_PutResourcePolicy.go index ede511b8..b6632d0a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_PutResourcePolicy.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_PutResourcePolicy.go @@ -4,45 +4,31 @@ package secretsmanager import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Attaches the contents of the specified resource-based permission policy to a -// secret. A resource-based policy is optional. Alternatively, you can use IAM -// identity-based policies that specify the secret's Amazon Resource Name (ARN) in -// the policy statement's Resources element. You can also use a combination of both -// identity-based and resource-based policies. The affected users and roles receive -// the permissions that are permitted by all of the relevant policies. For more -// information, see Using Resource-Based Policies for AWS Secrets Manager -// (http://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_resource-based-policies.html). -// For the complete description of the AWS policy syntax and grammar, see IAM JSON -// Policy Reference -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html) in -// the IAM User Guide. Minimum permissions To run this command, you must have the -// following permissions: -// -// * secretsmanager:PutResourcePolicy -// -// Related -// operations -// -// * To retrieve the resource policy attached to a secret, use -// GetResourcePolicy. -// -// * To delete the resource-based policy that's attached to a -// secret, use DeleteResourcePolicy. -// -// * To list all of the currently available -// secrets, use ListSecrets. +// Attaches a resource-based permission policy to a secret. A resource-based +// policy is optional. For more information, see Authentication and access control +// for Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html) +// For information about attaching a policy in the console, see Attach a +// permissions policy to a secret (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_resource-based-policies.html) +// . Secrets Manager generates a CloudTrail log entry when you call this action. Do +// not include sensitive information in request parameters because it might be +// logged. For more information, see Logging Secrets Manager events with CloudTrail (https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html) +// . Required permissions: secretsmanager:PutResourcePolicy . For more information, +// see IAM policy actions for Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions) +// and Authentication and access control in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html) +// . func (c *Client) PutResourcePolicy(ctx context.Context, params *PutResourcePolicyInput, optFns ...func(*Options)) (*PutResourcePolicyOutput, error) { if params == nil { params = &PutResourcePolicyInput{} } - result, metadata, err := c.invokeOperation(ctx, "PutResourcePolicy", params, optFns, addOperationPutResourcePolicyMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "PutResourcePolicy", params, optFns, c.addOperationPutResourcePolicyMiddlewares) if err != nil { return nil, err } @@ -54,56 +40,47 @@ func (c *Client) PutResourcePolicy(ctx context.Context, params *PutResourcePolic type PutResourcePolicyInput struct { - // A JSON-formatted string that's constructed according to the grammar and syntax - // for an AWS resource-based policy. The policy in the string identifies who can - // access or manage this secret and its versions. For information on how to format - // a JSON parameter for the various command line tool environments, see Using JSON - // for Parameters - // (http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json) - // in the AWS CLI User Guide. + // A JSON-formatted string for an Amazon Web Services resource-based policy. For + // example policies, see Permissions policy examples (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html) + // . // // This member is required. ResourcePolicy *string - // Specifies the secret that you want to attach the resource-based policy to. You - // can specify either the ARN or the friendly name of the secret. If you specify an - // ARN, we generally recommend that you specify a complete ARN. You can specify a - // partial ARN too—for example, if you don’t include the final hyphen and six - // random characters that Secrets Manager adds at the end of the ARN when you - // created the secret. A partial ARN match can work as long as it uniquely matches - // only one secret. However, if your secret has a name that ends in a hyphen - // followed by six characters (before Secrets Manager adds the hyphen and six - // characters to the ARN) and you try to use that as a partial ARN, then those - // characters cause Secrets Manager to assume that you’re specifying a complete - // ARN. This confusion can cause unexpected results. To avoid this situation, we - // recommend that you don’t create secret names ending with a hyphen followed by - // six characters. If you specify an incomplete ARN without the random suffix, and - // instead provide the 'friendly name', you must not include the random suffix. If - // you do include the random suffix added by Secrets Manager, you receive either a - // ResourceNotFoundException or an AccessDeniedException error, depending on your - // permissions. + // The ARN or name of the secret to attach the resource-based policy. For an ARN, + // we recommend that you specify a complete ARN rather than a partial ARN. See + // Finding a secret from a partial ARN (https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen) + // . // // This member is required. SecretId *string - // Makes an optional API call to Zelkova to validate the Resource Policy to prevent - // broad access to your secret. - BlockPublicPolicy bool + // Specifies whether to block resource-based policies that allow broad access to + // the secret, for example those that use a wildcard for the principal. By default, + // public policies aren't blocked. + BlockPublicPolicy *bool + + noSmithyDocumentSerde } type PutResourcePolicyOutput struct { - // The ARN of the secret retrieved by the resource-based policy. + // The ARN of the secret. ARN *string - // The friendly name of the secret that the retrieved by the resource-based policy. + // The name of the secret. Name *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationPutResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationPutResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutResourcePolicy{}, middleware.After) if err != nil { return err @@ -112,6 +89,13 @@ func addOperationPutResourcePolicyMiddlewares(stack *middleware.Stack, options O if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutResourcePolicy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -130,16 +114,13 @@ func addOperationPutResourcePolicyMiddlewares(stack *middleware.Stack, options O if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -148,12 +129,18 @@ func addOperationPutResourcePolicyMiddlewares(stack *middleware.Stack, options O if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpPutResourcePolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutResourcePolicy(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -163,6 +150,9 @@ func addOperationPutResourcePolicyMiddlewares(stack *middleware.Stack, options O if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -170,7 +160,6 @@ func newServiceMetadataMiddleware_opPutResourcePolicy(region string) *awsmiddlew return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "secretsmanager", OperationName: "PutResourcePolicy", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_PutSecretValue.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_PutSecretValue.go index 371f11a5..862437ac 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_PutSecretValue.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_PutSecretValue.go @@ -11,85 +11,40 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Stores a new encrypted secret value in the specified secret. To do this, the -// operation creates a new version and attaches it to the secret. The version can -// contain a new SecretString value or a new SecretBinary value. You can also -// specify the staging labels that are initially attached to the new version. The -// Secrets Manager console uses only the SecretString field. To add binary data to -// a secret with the SecretBinary field you must use the AWS CLI or one of the AWS -// SDKs. -// -// * If this operation creates the first version for the secret then Secrets -// Manager automatically attaches the staging label AWSCURRENT to the new -// version. -// -// * If another version of this secret already exists, then this -// operation does not automatically move any staging labels other than those that -// you explicitly specify in the VersionStages parameter. -// -// * If this operation -// moves the staging label AWSCURRENT from another version to this version (because -// you included it in the StagingLabels parameter) then Secrets Manager also -// automatically moves the staging label AWSPREVIOUS to the version that AWSCURRENT -// was removed from. -// -// * This operation is idempotent. If a version with a VersionId -// with the same value as the ClientRequestToken parameter already exists and you -// specify the same secret data, the operation succeeds but does nothing. However, -// if the secret data is different, then the operation fails because you cannot -// modify an existing version; you can only create new ones. -// -// * If you call an -// operation to encrypt or decrypt the SecretString or SecretBinary for a secret in -// the same account as the calling user and that secret doesn't specify a AWS KMS -// encryption key, Secrets Manager uses the account's default AWS managed customer -// master key (CMK) with the alias aws/secretsmanager. If this key doesn't already -// exist in your account then Secrets Manager creates it for you automatically. All -// users and roles in the same AWS account automatically have access to use the -// default CMK. Note that if an Secrets Manager API call results in AWS creating -// the account's AWS-managed CMK, it can result in a one-time significant delay in -// returning the result. -// -// * If the secret resides in a different AWS account from -// the credentials calling an API that requires encryption or decryption of the -// secret value then you must create and use a custom AWS KMS CMK because you can't -// access the default CMK for the account using credentials from a different AWS -// account. Store the ARN of the CMK in the secret when you create the secret or -// when you update it by including it in the KMSKeyId. If you call an API that must -// encrypt or decrypt SecretString or SecretBinary using credentials from a -// different account then the AWS KMS key policy must grant cross-account access to -// that other account's user or role for both the kms:GenerateDataKey and -// kms:Decrypt operations. -// -// Minimum permissions To run this command, you must have -// the following permissions: -// -// * secretsmanager:PutSecretValue -// -// * -// kms:GenerateDataKey - needed only if you use a customer-managed AWS KMS key to -// encrypt the secret. You do not need this permission to use the account's default -// AWS managed CMK for Secrets Manager. -// -// Related operations -// -// * To retrieve the -// encrypted value you store in the version of a secret, use GetSecretValue. -// -// * To -// create a secret, use CreateSecret. -// -// * To get the details for a secret, use -// DescribeSecret. -// -// * To list the versions attached to a secret, use -// ListSecretVersionIds. +// Creates a new version with a new encrypted secret value and attaches it to the +// secret. The version can contain a new SecretString value or a new SecretBinary +// value. We recommend you avoid calling PutSecretValue at a sustained rate of +// more than once every 10 minutes. When you update the secret value, Secrets +// Manager creates a new version of the secret. Secrets Manager removes outdated +// versions when there are more than 100, but it does not remove versions created +// less than 24 hours ago. If you call PutSecretValue more than once every 10 +// minutes, you create more versions than Secrets Manager removes, and you will +// reach the quota for secret versions. You can specify the staging labels to +// attach to the new version in VersionStages . If you don't include VersionStages +// , then Secrets Manager automatically moves the staging label AWSCURRENT to this +// version. If this operation creates the first version for the secret, then +// Secrets Manager automatically attaches the staging label AWSCURRENT to it. If +// this operation moves the staging label AWSCURRENT from another version to this +// version, then Secrets Manager also automatically moves the staging label +// AWSPREVIOUS to the version that AWSCURRENT was removed from. This operation is +// idempotent. If you call this operation with a ClientRequestToken that matches +// an existing version's VersionId, and you specify the same secret data, the +// operation succeeds but does nothing. However, if the secret data is different, +// then the operation fails because you can't modify an existing version; you can +// only create new ones. Secrets Manager generates a CloudTrail log entry when you +// call this action. Do not include sensitive information in request parameters +// except SecretBinary or SecretString because it might be logged. For more +// information, see Logging Secrets Manager events with CloudTrail (https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html) +// . Required permissions: secretsmanager:PutSecretValue . For more information, +// see IAM policy actions for Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions) +// and Authentication and access control in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html) +// . func (c *Client) PutSecretValue(ctx context.Context, params *PutSecretValueInput, optFns ...func(*Options)) (*PutSecretValueOutput, error) { if params == nil { params = &PutSecretValueInput{} } - result, metadata, err := c.invokeOperation(ctx, "PutSecretValue", params, optFns, addOperationPutSecretValueMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "PutSecretValue", params, optFns, c.addOperationPutSecretValueMiddlewares) if err != nil { return nil, err } @@ -101,116 +56,88 @@ func (c *Client) PutSecretValue(ctx context.Context, params *PutSecretValueInput type PutSecretValueInput struct { - // Specifies the secret to which you want to add a new version. You can specify - // either the Amazon Resource Name (ARN) or the friendly name of the secret. The - // secret must already exist. If you specify an ARN, we generally recommend that - // you specify a complete ARN. You can specify a partial ARN too—for example, if - // you don’t include the final hyphen and six random characters that Secrets - // Manager adds at the end of the ARN when you created the secret. A partial ARN - // match can work as long as it uniquely matches only one secret. However, if your - // secret has a name that ends in a hyphen followed by six characters (before - // Secrets Manager adds the hyphen and six characters to the ARN) and you try to - // use that as a partial ARN, then those characters cause Secrets Manager to assume - // that you’re specifying a complete ARN. This confusion can cause unexpected - // results. To avoid this situation, we recommend that you don’t create secret - // names ending with a hyphen followed by six characters. If you specify an - // incomplete ARN without the random suffix, and instead provide the 'friendly - // name', you must not include the random suffix. If you do include the random - // suffix added by Secrets Manager, you receive either a ResourceNotFoundException - // or an AccessDeniedException error, depending on your permissions. + // The ARN or name of the secret to add a new version to. For an ARN, we recommend + // that you specify a complete ARN rather than a partial ARN. See Finding a secret + // from a partial ARN (https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen) + // . If the secret doesn't already exist, use CreateSecret instead. // // This member is required. SecretId *string - // (Optional) Specifies a unique identifier for the new version of the secret. If - // you use the AWS CLI or one of the AWS SDK to call this operation, then you can - // leave this parameter empty. The CLI or SDK generates a random UUID for you and - // includes that in the request. If you don't use the SDK and instead generate a - // raw HTTP request to the Secrets Manager service endpoint, then you must generate - // a ClientRequestToken yourself for new versions and include that value in the - // request. This value helps ensure idempotency. Secrets Manager uses this value to - // prevent the accidental creation of duplicate versions if there are failures and - // retries during the Lambda rotation function's processing. We recommend that you - // generate a UUID-type (https://wikipedia.org/wiki/Universally_unique_identifier) - // value to ensure uniqueness within the specified secret. - // - // * If the - // ClientRequestToken value isn't already associated with a version of the secret - // then a new version of the secret is created. - // - // * If a version with this value - // already exists and that version's SecretString or SecretBinary values are the - // same as those in the request then the request is ignored (the operation is - // idempotent). - // - // * If a version with this value already exists and the version of - // the SecretString and SecretBinary values are different from those in the request - // then the request fails because you cannot modify an existing secret version. You - // can only create new versions to store new secret values. - // - // This value becomes the - // VersionId of the new version. + // A unique identifier for the new version of the secret. If you use the Amazon + // Web Services CLI or one of the Amazon Web Services SDKs to call this operation, + // then you can leave this parameter empty. The CLI or SDK generates a random UUID + // for you and includes it as the value for this parameter in the request. If you + // generate a raw HTTP request to the Secrets Manager service endpoint, then you + // must generate a ClientRequestToken and include it in the request. This value + // helps ensure idempotency. Secrets Manager uses this value to prevent the + // accidental creation of duplicate versions if there are failures and retries + // during a rotation. We recommend that you generate a UUID-type (https://wikipedia.org/wiki/Universally_unique_identifier) + // value to ensure uniqueness of your versions within the specified secret. + // - If the ClientRequestToken value isn't already associated with a version of + // the secret then a new version of the secret is created. + // - If a version with this value already exists and that version's SecretString + // or SecretBinary values are the same as those in the request then the request + // is ignored. The operation is idempotent. + // - If a version with this value already exists and the version of the + // SecretString and SecretBinary values are different from those in the request, + // then the request fails because you can't modify a secret version. You can only + // create new versions to store new secret values. + // This value becomes the VersionId of the new version. ClientRequestToken *string - // (Optional) Specifies binary data that you want to encrypt and store in the new - // version of the secret. To use this parameter in the command-line tools, we - // recommend that you store your binary data in a file and then use the appropriate - // technique for your tool to pass the contents of the file as a parameter. Either - // SecretBinary or SecretString must have a value, but not both. They cannot both - // be empty. This parameter is not accessible if the secret using the Secrets - // Manager console. + // The binary data to encrypt and store in the new version of the secret. To use + // this parameter in the command-line tools, we recommend that you store your + // binary data in a file and then pass the contents of the file as a parameter. You + // must include SecretBinary or SecretString , but not both. You can't access this + // value from the Secrets Manager console. SecretBinary []byte - // (Optional) Specifies text data that you want to encrypt and store in this new - // version of the secret. Either SecretString or SecretBinary must have a value, - // but not both. They cannot both be empty. If you create this secret by using the - // Secrets Manager console then Secrets Manager puts the protected secret text in - // only the SecretString parameter. The Secrets Manager console stores the - // information as a JSON structure of key/value pairs that the default Lambda - // rotation function knows how to parse. For storing multiple values, we recommend - // that you use a JSON text string argument and specify key/value pairs. For - // information on how to format a JSON parameter for the various command line tool - // environments, see Using JSON for Parameters - // (https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json) - // in the AWS CLI User Guide. For example: - // [{"username":"bob"},{"password":"abc123xyz456"}] If your command-line tool or - // SDK requires quotation marks around the parameter, you should use single quotes - // to avoid confusion with the double quotes required in the JSON text. + // The text to encrypt and store in the new version of the secret. You must + // include SecretBinary or SecretString , but not both. We recommend you create the + // secret string as JSON key/value pairs, as shown in the example. SecretString *string - // (Optional) Specifies a list of staging labels that are attached to this version - // of the secret. These staging labels are used to track the versions through the - // rotation process by the Lambda rotation function. A staging label must be unique - // to a single version of the secret. If you specify a staging label that's already - // associated with a different version of the same secret then that staging label - // is automatically removed from the other version and attached to this version. If - // you do not specify a value for VersionStages then Secrets Manager automatically - // moves the staging label AWSCURRENT to this new version. + // A list of staging labels to attach to this version of the secret. Secrets + // Manager uses staging labels to track versions of a secret through the rotation + // process. If you specify a staging label that's already associated with a + // different version of the same secret, then Secrets Manager removes the label + // from the other version and attaches it to this version. If you specify + // AWSCURRENT , and it is already attached to another version, then Secrets Manager + // also moves the staging label AWSPREVIOUS to the version that AWSCURRENT was + // removed from. If you don't include VersionStages , then Secrets Manager + // automatically moves the staging label AWSCURRENT to this version. VersionStages []string + + noSmithyDocumentSerde } type PutSecretValueOutput struct { - // The Amazon Resource Name (ARN) for the secret for which you just created a - // version. + // The ARN of the secret. ARN *string - // The friendly name of the secret for which you just created or updated a version. + // The name of the secret. Name *string - // The unique identifier of the version of the secret you just created or updated. + // The unique identifier of the version of the secret. VersionId *string // The list of staging labels that are currently attached to this version of the - // secret. Staging labels are used to track a version as it progresses through the - // secret rotation process. + // secret. Secrets Manager uses staging labels to track a version as it progresses + // through the secret rotation process. VersionStages []string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationPutSecretValueMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationPutSecretValueMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutSecretValue{}, middleware.After) if err != nil { return err @@ -219,6 +146,13 @@ func addOperationPutSecretValueMiddlewares(stack *middleware.Stack, options Opti if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutSecretValue"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -237,16 +171,13 @@ func addOperationPutSecretValueMiddlewares(stack *middleware.Stack, options Opti if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -255,6 +186,9 @@ func addOperationPutSecretValueMiddlewares(stack *middleware.Stack, options Opti if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addIdempotencyToken_opPutSecretValueMiddleware(stack, options); err != nil { return err } @@ -264,6 +198,9 @@ func addOperationPutSecretValueMiddlewares(stack *middleware.Stack, options Opti if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutSecretValue(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -273,6 +210,9 @@ func addOperationPutSecretValueMiddlewares(stack *middleware.Stack, options Opti if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -313,7 +253,6 @@ func newServiceMetadataMiddleware_opPutSecretValue(region string) *awsmiddleware return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "secretsmanager", OperationName: "PutSecretValue", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_RemoveRegionsFromReplication.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_RemoveRegionsFromReplication.go new file mode 100644 index 00000000..772f8c85 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_RemoveRegionsFromReplication.go @@ -0,0 +1,153 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/secretsmanager/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// For a secret that is replicated to other Regions, deletes the secret replicas +// from the Regions you specify. Secrets Manager generates a CloudTrail log entry +// when you call this action. Do not include sensitive information in request +// parameters because it might be logged. For more information, see Logging +// Secrets Manager events with CloudTrail (https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html) +// . Required permissions: secretsmanager:RemoveRegionsFromReplication . For more +// information, see IAM policy actions for Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions) +// and Authentication and access control in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html) +// . +func (c *Client) RemoveRegionsFromReplication(ctx context.Context, params *RemoveRegionsFromReplicationInput, optFns ...func(*Options)) (*RemoveRegionsFromReplicationOutput, error) { + if params == nil { + params = &RemoveRegionsFromReplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RemoveRegionsFromReplication", params, optFns, c.addOperationRemoveRegionsFromReplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RemoveRegionsFromReplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RemoveRegionsFromReplicationInput struct { + + // The Regions of the replicas to remove. + // + // This member is required. + RemoveReplicaRegions []string + + // The ARN or name of the secret. + // + // This member is required. + SecretId *string + + noSmithyDocumentSerde +} + +type RemoveRegionsFromReplicationOutput struct { + + // The ARN of the primary secret. + ARN *string + + // The status of replicas for this secret after you remove Regions. + ReplicationStatus []types.ReplicationStatusType + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRemoveRegionsFromReplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpRemoveRegionsFromReplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRemoveRegionsFromReplication{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RemoveRegionsFromReplication"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpRemoveRegionsFromReplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveRegionsFromReplication(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRemoveRegionsFromReplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RemoveRegionsFromReplication", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ReplicateSecretToRegions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ReplicateSecretToRegions.go new file mode 100644 index 00000000..44d3acb0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ReplicateSecretToRegions.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/secretsmanager/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Replicates the secret to a new Regions. See Multi-Region secrets (https://docs.aws.amazon.com/secretsmanager/latest/userguide/create-manage-multi-region-secrets.html) +// . Secrets Manager generates a CloudTrail log entry when you call this action. Do +// not include sensitive information in request parameters because it might be +// logged. For more information, see Logging Secrets Manager events with CloudTrail (https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html) +// . Required permissions: secretsmanager:ReplicateSecretToRegions . If the primary +// secret is encrypted with a KMS key other than aws/secretsmanager , you also need +// kms:Decrypt permission to the key. To encrypt the replicated secret with a KMS +// key other than aws/secretsmanager , you need kms:GenerateDataKey and kms:Encrypt +// to the key. For more information, see IAM policy actions for Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions) +// and Authentication and access control in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html) +// . +func (c *Client) ReplicateSecretToRegions(ctx context.Context, params *ReplicateSecretToRegionsInput, optFns ...func(*Options)) (*ReplicateSecretToRegionsOutput, error) { + if params == nil { + params = &ReplicateSecretToRegionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ReplicateSecretToRegions", params, optFns, c.addOperationReplicateSecretToRegionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ReplicateSecretToRegionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ReplicateSecretToRegionsInput struct { + + // A list of Regions in which to replicate the secret. + // + // This member is required. + AddReplicaRegions []types.ReplicaRegionType + + // The ARN or name of the secret to replicate. + // + // This member is required. + SecretId *string + + // Specifies whether to overwrite a secret with the same name in the destination + // Region. By default, secrets aren't overwritten. + ForceOverwriteReplicaSecret bool + + noSmithyDocumentSerde +} + +type ReplicateSecretToRegionsOutput struct { + + // The ARN of the primary secret. + ARN *string + + // The status of replication. + ReplicationStatus []types.ReplicationStatusType + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationReplicateSecretToRegionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpReplicateSecretToRegions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpReplicateSecretToRegions{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ReplicateSecretToRegions"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpReplicateSecretToRegionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opReplicateSecretToRegions(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opReplicateSecretToRegions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ReplicateSecretToRegions", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_RestoreSecret.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_RestoreSecret.go index 39fad7f6..e722e170 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_RestoreSecret.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_RestoreSecret.go @@ -4,6 +4,7 @@ package secretsmanager import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" @@ -11,22 +12,20 @@ import ( ) // Cancels the scheduled deletion of a secret by removing the DeletedDate time -// stamp. This makes the secret accessible to query once again. Minimum permissions -// To run this command, you must have the following permissions: -// -// * -// secretsmanager:RestoreSecret -// -// Related operations -// -// * To delete a secret, use -// DeleteSecret. +// stamp. You can access a secret again after it has been restored. Secrets Manager +// generates a CloudTrail log entry when you call this action. Do not include +// sensitive information in request parameters because it might be logged. For more +// information, see Logging Secrets Manager events with CloudTrail (https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html) +// . Required permissions: secretsmanager:RestoreSecret . For more information, see +// IAM policy actions for Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions) +// and Authentication and access control in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html) +// . func (c *Client) RestoreSecret(ctx context.Context, params *RestoreSecretInput, optFns ...func(*Options)) (*RestoreSecretOutput, error) { if params == nil { params = &RestoreSecretInput{} } - result, metadata, err := c.invokeOperation(ctx, "RestoreSecret", params, optFns, addOperationRestoreSecretMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "RestoreSecret", params, optFns, c.addOperationRestoreSecretMiddlewares) if err != nil { return nil, err } @@ -38,26 +37,15 @@ func (c *Client) RestoreSecret(ctx context.Context, params *RestoreSecretInput, type RestoreSecretInput struct { - // Specifies the secret that you want to restore from a previously scheduled - // deletion. You can specify either the Amazon Resource Name (ARN) or the friendly - // name of the secret. If you specify an ARN, we generally recommend that you - // specify a complete ARN. You can specify a partial ARN too—for example, if you - // don’t include the final hyphen and six random characters that Secrets Manager - // adds at the end of the ARN when you created the secret. A partial ARN match can - // work as long as it uniquely matches only one secret. However, if your secret has - // a name that ends in a hyphen followed by six characters (before Secrets Manager - // adds the hyphen and six characters to the ARN) and you try to use that as a - // partial ARN, then those characters cause Secrets Manager to assume that you’re - // specifying a complete ARN. This confusion can cause unexpected results. To avoid - // this situation, we recommend that you don’t create secret names ending with a - // hyphen followed by six characters. If you specify an incomplete ARN without the - // random suffix, and instead provide the 'friendly name', you must not include the - // random suffix. If you do include the random suffix added by Secrets Manager, you - // receive either a ResourceNotFoundException or an AccessDeniedException error, - // depending on your permissions. + // The ARN or name of the secret to restore. For an ARN, we recommend that you + // specify a complete ARN rather than a partial ARN. See Finding a secret from a + // partial ARN (https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen) + // . // // This member is required. SecretId *string + + noSmithyDocumentSerde } type RestoreSecretOutput struct { @@ -65,14 +53,19 @@ type RestoreSecretOutput struct { // The ARN of the secret that was restored. ARN *string - // The friendly name of the secret that was restored. + // The name of the secret that was restored. Name *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationRestoreSecretMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationRestoreSecretMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpRestoreSecret{}, middleware.After) if err != nil { return err @@ -81,6 +74,13 @@ func addOperationRestoreSecretMiddlewares(stack *middleware.Stack, options Optio if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "RestoreSecret"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -99,16 +99,13 @@ func addOperationRestoreSecretMiddlewares(stack *middleware.Stack, options Optio if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -117,12 +114,18 @@ func addOperationRestoreSecretMiddlewares(stack *middleware.Stack, options Optio if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpRestoreSecretValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRestoreSecret(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -132,6 +135,9 @@ func addOperationRestoreSecretMiddlewares(stack *middleware.Stack, options Optio if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -139,7 +145,6 @@ func newServiceMetadataMiddleware_opRestoreSecret(region string) *awsmiddleware. return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "secretsmanager", OperationName: "RestoreSecret", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_RotateSecret.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_RotateSecret.go index b794b71a..686d06e3 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_RotateSecret.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_RotateSecret.go @@ -12,66 +12,35 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Configures and starts the asynchronous process of rotating this secret. If you -// include the configuration parameters, the operation sets those values for the -// secret and then immediately starts a rotation. If you do not include the -// configuration parameters, the operation starts a rotation with the values -// already stored in the secret. After the rotation completes, the protected -// service and its clients all use the new version of the secret. This required -// configuration information includes the ARN of an AWS Lambda function and the -// time between scheduled rotations. The Lambda rotation function creates a new -// version of the secret and creates or updates the credentials on the protected -// service to match. After testing the new credentials, the function marks the new -// secret with the staging label AWSCURRENT so that your clients all immediately -// begin to use the new version. For more information about rotating secrets and -// how to configure a Lambda function to rotate the secrets for your protected -// service, see Rotating Secrets in AWS Secrets Manager -// (https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotating-secrets.html) -// in the AWS Secrets Manager User Guide. Secrets Manager schedules the next -// rotation when the previous one completes. Secrets Manager schedules the date by -// adding the rotation interval (number of days) to the actual date of the last -// rotation. The service chooses the hour within that 24-hour date window randomly. -// The minute is also chosen somewhat randomly, but weighted towards the top of the -// hour and influenced by a variety of factors that help distribute load. The -// rotation function must end with the versions of the secret in one of two -// states: -// -// * The AWSPENDING and AWSCURRENT staging labels are attached to the same -// version of the secret, or -// -// * The AWSPENDING staging label is not attached to any -// version of the secret. -// -// If the AWSPENDING staging label is present but not -// attached to the same version as AWSCURRENT then any later invocation of -// RotateSecret assumes that a previous rotation request is still in progress and -// returns an error. Minimum permissions To run this command, you must have the -// following permissions: -// -// * secretsmanager:RotateSecret -// -// * lambda:InvokeFunction -// (on the function specified in the secret's metadata) -// -// Related operations -// -// * To -// list the secrets in your account, use ListSecrets. -// -// * To get the details for a -// version of a secret, use DescribeSecret. -// -// * To create a new version of a secret, -// use CreateSecret. -// -// * To attach staging labels to or remove staging labels from a -// version of a secret, use UpdateSecretVersionStage. +// Configures and starts the asynchronous process of rotating the secret. For +// information about rotation, see Rotate secrets (https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotating-secrets.html) +// in the Secrets Manager User Guide. If you include the configuration parameters, +// the operation sets the values for the secret and then immediately starts a +// rotation. If you don't include the configuration parameters, the operation +// starts a rotation with the values already stored in the secret. When rotation is +// successful, the AWSPENDING staging label might be attached to the same version +// as the AWSCURRENT version, or it might not be attached to any version. If the +// AWSPENDING staging label is present but not attached to the same version as +// AWSCURRENT , then any later invocation of RotateSecret assumes that a previous +// rotation request is still in progress and returns an error. When rotation is +// unsuccessful, the AWSPENDING staging label might be attached to an empty secret +// version. For more information, see Troubleshoot rotation (https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot_rotation.html) +// in the Secrets Manager User Guide. Secrets Manager generates a CloudTrail log +// entry when you call this action. Do not include sensitive information in request +// parameters because it might be logged. For more information, see Logging +// Secrets Manager events with CloudTrail (https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html) +// . Required permissions: secretsmanager:RotateSecret . For more information, see +// IAM policy actions for Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions) +// and Authentication and access control in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html) +// . You also need lambda:InvokeFunction permissions on the rotation function. For +// more information, see Permissions for rotation (https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotating-secrets-required-permissions-function.html) +// . func (c *Client) RotateSecret(ctx context.Context, params *RotateSecretInput, optFns ...func(*Options)) (*RotateSecretOutput, error) { if params == nil { params = &RotateSecretInput{} } - result, metadata, err := c.invokeOperation(ctx, "RotateSecret", params, optFns, addOperationRotateSecretMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "RotateSecret", params, optFns, c.addOperationRotateSecretMiddlewares) if err != nil { return nil, err } @@ -83,49 +52,48 @@ func (c *Client) RotateSecret(ctx context.Context, params *RotateSecretInput, op type RotateSecretInput struct { - // Specifies the secret that you want to rotate. You can specify either the Amazon - // Resource Name (ARN) or the friendly name of the secret. If you specify an ARN, - // we generally recommend that you specify a complete ARN. You can specify a - // partial ARN too—for example, if you don’t include the final hyphen and six - // random characters that Secrets Manager adds at the end of the ARN when you - // created the secret. A partial ARN match can work as long as it uniquely matches - // only one secret. However, if your secret has a name that ends in a hyphen - // followed by six characters (before Secrets Manager adds the hyphen and six - // characters to the ARN) and you try to use that as a partial ARN, then those - // characters cause Secrets Manager to assume that you’re specifying a complete - // ARN. This confusion can cause unexpected results. To avoid this situation, we - // recommend that you don’t create secret names ending with a hyphen followed by - // six characters. If you specify an incomplete ARN without the random suffix, and - // instead provide the 'friendly name', you must not include the random suffix. If - // you do include the random suffix added by Secrets Manager, you receive either a - // ResourceNotFoundException or an AccessDeniedException error, depending on your - // permissions. + // The ARN or name of the secret to rotate. For an ARN, we recommend that you + // specify a complete ARN rather than a partial ARN. See Finding a secret from a + // partial ARN (https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen) + // . // // This member is required. SecretId *string - // (Optional) Specifies a unique identifier for the new version of the secret that - // helps ensure idempotency. If you use the AWS CLI or one of the AWS SDK to call - // this operation, then you can leave this parameter empty. The CLI or SDK - // generates a random UUID for you and includes that in the request for this - // parameter. If you don't use the SDK and instead generate a raw HTTP request to - // the Secrets Manager service endpoint, then you must generate a - // ClientRequestToken yourself for new versions and include that value in the - // request. You only need to specify your own value if you implement your own retry - // logic and want to ensure that a given secret is not created twice. We recommend - // that you generate a UUID-type - // (https://wikipedia.org/wiki/Universally_unique_identifier) value to ensure - // uniqueness within the specified secret. Secrets Manager uses this value to + // A unique identifier for the new version of the secret. You only need to specify + // this value if you implement your own retry logic and you want to ensure that + // Secrets Manager doesn't attempt to create a secret version twice. If you use the + // Amazon Web Services CLI or one of the Amazon Web Services SDKs to call this + // operation, then you can leave this parameter empty. The CLI or SDK generates a + // random UUID for you and includes it as the value for this parameter in the + // request. If you generate a raw HTTP request to the Secrets Manager service + // endpoint, then you must generate a ClientRequestToken and include it in the + // request. This value helps ensure idempotency. Secrets Manager uses this value to // prevent the accidental creation of duplicate versions if there are failures and - // retries during the function's processing. This value becomes the VersionId of - // the new version. + // retries during a rotation. We recommend that you generate a UUID-type (https://wikipedia.org/wiki/Universally_unique_identifier) + // value to ensure uniqueness of your versions within the specified secret. ClientRequestToken *string - // (Optional) Specifies the ARN of the Lambda function that can rotate the secret. + // Specifies whether to rotate the secret immediately or wait until the next + // scheduled rotation window. The rotation schedule is defined in + // RotateSecretRequest$RotationRules . For secrets that use a Lambda rotation + // function to rotate, if you don't immediately rotate the secret, Secrets Manager + // tests the rotation configuration by running the testSecret step (https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html) + // of the Lambda rotation function. The test creates an AWSPENDING version of the + // secret and then removes it. By default, Secrets Manager rotates the secret + // immediately. + RotateImmediately *bool + + // For secrets that use a Lambda rotation function to rotate, the ARN of the + // Lambda rotation function. For secrets that use managed rotation, omit this + // field. For more information, see Managed rotation (https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_managed.html) + // in the Secrets Manager User Guide. RotationLambdaARN *string // A structure that defines the rotation configuration for this secret. RotationRules *types.RotationRulesType + + noSmithyDocumentSerde } type RotateSecretOutput struct { @@ -133,18 +101,22 @@ type RotateSecretOutput struct { // The ARN of the secret. ARN *string - // The friendly name of the secret. + // The name of the secret. Name *string - // The ID of the new version of the secret created by the rotation started by this - // request. + // The ID of the new version of the secret. VersionId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationRotateSecretMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationRotateSecretMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpRotateSecret{}, middleware.After) if err != nil { return err @@ -153,6 +125,13 @@ func addOperationRotateSecretMiddlewares(stack *middleware.Stack, options Option if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "RotateSecret"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -171,16 +150,13 @@ func addOperationRotateSecretMiddlewares(stack *middleware.Stack, options Option if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -189,6 +165,9 @@ func addOperationRotateSecretMiddlewares(stack *middleware.Stack, options Option if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addIdempotencyToken_opRotateSecretMiddleware(stack, options); err != nil { return err } @@ -198,6 +177,9 @@ func addOperationRotateSecretMiddlewares(stack *middleware.Stack, options Option if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRotateSecret(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -207,6 +189,9 @@ func addOperationRotateSecretMiddlewares(stack *middleware.Stack, options Option if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -247,7 +232,6 @@ func newServiceMetadataMiddleware_opRotateSecret(region string) *awsmiddleware.R return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "secretsmanager", OperationName: "RotateSecret", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_StopReplicationToReplica.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_StopReplicationToReplica.go new file mode 100644 index 00000000..45870101 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_StopReplicationToReplica.go @@ -0,0 +1,147 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes the link between the replica secret and the primary secret and promotes +// the replica to a primary secret in the replica Region. You must call this +// operation from the Region in which you want to promote the replica to a primary +// secret. Secrets Manager generates a CloudTrail log entry when you call this +// action. Do not include sensitive information in request parameters because it +// might be logged. For more information, see Logging Secrets Manager events with +// CloudTrail (https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html) +// . Required permissions: secretsmanager:StopReplicationToReplica . For more +// information, see IAM policy actions for Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions) +// and Authentication and access control in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html) +// . +func (c *Client) StopReplicationToReplica(ctx context.Context, params *StopReplicationToReplicaInput, optFns ...func(*Options)) (*StopReplicationToReplicaOutput, error) { + if params == nil { + params = &StopReplicationToReplicaInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StopReplicationToReplica", params, optFns, c.addOperationStopReplicationToReplicaMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StopReplicationToReplicaOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StopReplicationToReplicaInput struct { + + // The ARN of the primary secret. + // + // This member is required. + SecretId *string + + noSmithyDocumentSerde +} + +type StopReplicationToReplicaOutput struct { + + // The ARN of the promoted secret. The ARN is the same as the original primary + // secret except the Region is changed. + ARN *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStopReplicationToReplicaMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpStopReplicationToReplica{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStopReplicationToReplica{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StopReplicationToReplica"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpStopReplicationToReplicaValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopReplicationToReplica(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStopReplicationToReplica(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StopReplicationToReplica", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_TagResource.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_TagResource.go index d59a763b..594db9b5 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_TagResource.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_TagResource.go @@ -4,6 +4,7 @@ package secretsmanager import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/secretsmanager/types" @@ -11,56 +12,28 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Attaches one or more tags, each consisting of a key name and a value, to the -// specified secret. Tags are part of the secret's overall metadata, and are not -// associated with any specific version of the secret. This operation only appends -// tags to the existing list of tags. To remove tags, you must use UntagResource. -// The following basic restrictions apply to tags: -// -// * Maximum number of tags per -// secret—50 -// -// * Maximum key length—127 Unicode characters in UTF-8 -// -// * Maximum value -// length—255 Unicode characters in UTF-8 -// -// * Tag keys and values are case -// sensitive. -// -// * Do not use the aws: prefix in your tag names or values because AWS -// reserves it for AWS use. You can't edit or delete tag names or values with this -// prefix. Tags with this prefix do not count against your tags per secret -// limit. -// -// * If you use your tagging schema across multiple services and resources, -// remember other services might have restrictions on allowed characters. Generally -// allowed characters: letters, spaces, and numbers representable in UTF-8, plus -// the following special characters: + - = . _ : / @. -// -// If you use tags as part of +// Attaches tags to a secret. Tags consist of a key name and a value. Tags are +// part of the secret's metadata. They are not associated with specific versions of +// the secret. This operation appends tags to the existing list of tags. For tag +// quotas and naming restrictions, see Service quotas for Tagging (https://docs.aws.amazon.com/general/latest/gr/arg.html#taged-reference-quotas) +// in the Amazon Web Services General Reference guide. If you use tags as part of // your security strategy, then adding or removing a tag can change permissions. If // successfully completing this operation would result in you losing your // permissions for this secret, then the operation is blocked and returns an Access -// Denied error. Minimum permissions To run this command, you must have the -// following permissions: -// -// * secretsmanager:TagResource -// -// Related operations -// -// * To -// remove one or more tags from the collection attached to a secret, use -// UntagResource. -// -// * To view the list of tags attached to a secret, use -// DescribeSecret. +// Denied error. Secrets Manager generates a CloudTrail log entry when you call +// this action. Do not include sensitive information in request parameters because +// it might be logged. For more information, see Logging Secrets Manager events +// with CloudTrail (https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html) +// . Required permissions: secretsmanager:TagResource . For more information, see +// IAM policy actions for Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions) +// and Authentication and access control in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html) +// . func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { if params == nil { params = &TagResourceInput{} } - result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, addOperationTagResourceMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) if err != nil { return nil, err } @@ -72,45 +45,39 @@ func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optF type TagResourceInput struct { - // The identifier for the secret that you want to attach tags to. You can specify - // either the Amazon Resource Name (ARN) or the friendly name of the secret. If you - // specify an ARN, we generally recommend that you specify a complete ARN. You can - // specify a partial ARN too—for example, if you don’t include the final hyphen and - // six random characters that Secrets Manager adds at the end of the ARN when you - // created the secret. A partial ARN match can work as long as it uniquely matches - // only one secret. However, if your secret has a name that ends in a hyphen - // followed by six characters (before Secrets Manager adds the hyphen and six - // characters to the ARN) and you try to use that as a partial ARN, then those - // characters cause Secrets Manager to assume that you’re specifying a complete - // ARN. This confusion can cause unexpected results. To avoid this situation, we - // recommend that you don’t create secret names ending with a hyphen followed by - // six characters. If you specify an incomplete ARN without the random suffix, and - // instead provide the 'friendly name', you must not include the random suffix. If - // you do include the random suffix added by Secrets Manager, you receive either a - // ResourceNotFoundException or an AccessDeniedException error, depending on your - // permissions. + // The identifier for the secret to attach tags to. You can specify either the + // Amazon Resource Name (ARN) or the friendly name of the secret. For an ARN, we + // recommend that you specify a complete ARN rather than a partial ARN. See + // Finding a secret from a partial ARN (https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen) + // . // // This member is required. SecretId *string - // The tags to attach to the secret. Each element in the list consists of a Key and - // a Value. This parameter to the API requires a JSON text string argument. For - // information on how to format a JSON parameter for the various command line tool - // environments, see Using JSON for Parameters - // (https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json) - // in the AWS CLI User Guide. For the AWS CLI, you can also use the syntax: --Tags - // Key="Key1",Value="Value1",Key="Key2",Value="Value2"[,…] + // The tags to attach to the secret as a JSON text string argument. Each element + // in the list consists of a Key and a Value . For storing multiple values, we + // recommend that you use a JSON text string argument and specify key/value pairs. + // For more information, see Specifying parameter values for the Amazon Web + // Services CLI (https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters.html) + // in the Amazon Web Services CLI User Guide. // // This member is required. Tags []types.Tag + + noSmithyDocumentSerde } type TagResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpTagResource{}, middleware.After) if err != nil { return err @@ -119,6 +86,13 @@ func addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "TagResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -137,16 +111,13 @@ func addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -155,12 +126,18 @@ func addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpTagResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -170,6 +147,9 @@ func addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -177,7 +157,6 @@ func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.Re return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "secretsmanager", OperationName: "TagResource", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_UntagResource.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_UntagResource.go index e14be9ff..ab5d7ecb 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_UntagResource.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_UntagResource.go @@ -4,36 +4,32 @@ package secretsmanager import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Removes one or more tags from the specified secret. This operation is -// idempotent. If a requested tag is not attached to the secret, no error is -// returned and the secret metadata is unchanged. If you use tags as part of your -// security strategy, then removing a tag can change permissions. If successfully -// completing this operation would result in you losing your permissions for this -// secret, then the operation is blocked and returns an Access Denied error. -// Minimum permissions To run this command, you must have the following -// permissions: -// -// * secretsmanager:UntagResource -// -// Related operations -// -// * To add one -// or more tags to the collection attached to a secret, use TagResource. -// -// * To view -// the list of tags attached to a secret, use DescribeSecret. +// Removes specific tags from a secret. This operation is idempotent. If a +// requested tag is not attached to the secret, no error is returned and the secret +// metadata is unchanged. If you use tags as part of your security strategy, then +// removing a tag can change permissions. If successfully completing this operation +// would result in you losing your permissions for this secret, then the operation +// is blocked and returns an Access Denied error. Secrets Manager generates a +// CloudTrail log entry when you call this action. Do not include sensitive +// information in request parameters because it might be logged. For more +// information, see Logging Secrets Manager events with CloudTrail (https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html) +// . Required permissions: secretsmanager:UntagResource . For more information, see +// IAM policy actions for Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions) +// and Authentication and access control in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html) +// . func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { if params == nil { params = &UntagResourceInput{} } - result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, addOperationUntagResourceMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) if err != nil { return nil, err } @@ -45,45 +41,37 @@ func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, type UntagResourceInput struct { - // The identifier for the secret that you want to remove tags from. You can specify - // either the Amazon Resource Name (ARN) or the friendly name of the secret. If you - // specify an ARN, we generally recommend that you specify a complete ARN. You can - // specify a partial ARN too—for example, if you don’t include the final hyphen and - // six random characters that Secrets Manager adds at the end of the ARN when you - // created the secret. A partial ARN match can work as long as it uniquely matches - // only one secret. However, if your secret has a name that ends in a hyphen - // followed by six characters (before Secrets Manager adds the hyphen and six - // characters to the ARN) and you try to use that as a partial ARN, then those - // characters cause Secrets Manager to assume that you’re specifying a complete - // ARN. This confusion can cause unexpected results. To avoid this situation, we - // recommend that you don’t create secret names ending with a hyphen followed by - // six characters. If you specify an incomplete ARN without the random suffix, and - // instead provide the 'friendly name', you must not include the random suffix. If - // you do include the random suffix added by Secrets Manager, you receive either a - // ResourceNotFoundException or an AccessDeniedException error, depending on your - // permissions. + // The ARN or name of the secret. For an ARN, we recommend that you specify a + // complete ARN rather than a partial ARN. See Finding a secret from a partial ARN (https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen) + // . // // This member is required. SecretId *string // A list of tag key names to remove from the secret. You don't specify the value. - // Both the key and its associated value are removed. This parameter to the API - // requires a JSON text string argument. For information on how to format a JSON - // parameter for the various command line tool environments, see Using JSON for - // Parameters - // (https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json) - // in the AWS CLI User Guide. + // Both the key and its associated value are removed. This parameter requires a + // JSON text string argument. For storing multiple values, we recommend that you + // use a JSON text string argument and specify key/value pairs. For more + // information, see Specifying parameter values for the Amazon Web Services CLI (https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters.html) + // in the Amazon Web Services CLI User Guide. // // This member is required. TagKeys []string + + noSmithyDocumentSerde } type UntagResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpUntagResource{}, middleware.After) if err != nil { return err @@ -92,6 +80,13 @@ func addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Optio if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "UntagResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -110,16 +105,13 @@ func addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Optio if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -128,12 +120,18 @@ func addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Optio if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpUntagResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -143,6 +141,9 @@ func addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Optio if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -150,7 +151,6 @@ func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware. return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "secretsmanager", OperationName: "UntagResource", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_UpdateSecret.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_UpdateSecret.go index fe642458..9599a211 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_UpdateSecret.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_UpdateSecret.go @@ -11,77 +11,44 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Modifies many of the details of the specified secret. If you include a -// ClientRequestToken and either SecretString or SecretBinary then it also creates -// a new version attached to the secret. To modify the rotation configuration of a -// secret, use RotateSecret instead. The Secrets Manager console uses only the -// SecretString parameter and therefore limits you to encrypting and storing only a -// text string. To encrypt and store binary data as part of the version of a -// secret, you must use either the AWS CLI or one of the AWS SDKs. -// -// * If a version -// with a VersionId with the same value as the ClientRequestToken parameter already -// exists, the operation results in an error. You cannot modify an existing -// version, you can only create a new version. -// -// * If you include SecretString or -// SecretBinary to create a new secret version, Secrets Manager automatically -// attaches the staging label AWSCURRENT to the new version. -// -// * If you call an -// operation to encrypt or decrypt the SecretString or SecretBinary for a secret in -// the same account as the calling user and that secret doesn't specify a AWS KMS -// encryption key, Secrets Manager uses the account's default AWS managed customer -// master key (CMK) with the alias aws/secretsmanager. If this key doesn't already -// exist in your account then Secrets Manager creates it for you automatically. All -// users and roles in the same AWS account automatically have access to use the -// default CMK. Note that if an Secrets Manager API call results in AWS creating -// the account's AWS-managed CMK, it can result in a one-time significant delay in -// returning the result. -// -// * If the secret resides in a different AWS account from -// the credentials calling an API that requires encryption or decryption of the -// secret value then you must create and use a custom AWS KMS CMK because you can't -// access the default CMK for the account using credentials from a different AWS -// account. Store the ARN of the CMK in the secret when you create the secret or -// when you update it by including it in the KMSKeyId. If you call an API that must -// encrypt or decrypt SecretString or SecretBinary using credentials from a -// different account then the AWS KMS key policy must grant cross-account access to -// that other account's user or role for both the kms:GenerateDataKey and -// kms:Decrypt operations. -// -// Minimum permissions To run this command, you must have -// the following permissions: -// -// * secretsmanager:UpdateSecret -// -// * kms:GenerateDataKey -// - needed only if you use a custom AWS KMS key to encrypt the secret. You do not -// need this permission to use the account's AWS managed CMK for Secrets -// Manager. -// -// * kms:Decrypt - needed only if you use a custom AWS KMS key to encrypt -// the secret. You do not need this permission to use the account's AWS managed CMK -// for Secrets Manager. -// -// Related operations -// -// * To create a new secret, use -// CreateSecret. -// -// * To add only a new version to an existing secret, use -// PutSecretValue. -// -// * To get the details for a secret, use DescribeSecret. -// -// * To -// list the versions contained in a secret, use ListSecretVersionIds. +// Modifies the details of a secret, including metadata and the secret value. To +// change the secret value, you can also use PutSecretValue . To change the +// rotation configuration of a secret, use RotateSecret instead. To change a +// secret so that it is managed by another service, you need to recreate the secret +// in that service. See Secrets Manager secrets managed by other Amazon Web +// Services services (https://docs.aws.amazon.com/secretsmanager/latest/userguide/service-linked-secrets.html) +// . We recommend you avoid calling UpdateSecret at a sustained rate of more than +// once every 10 minutes. When you call UpdateSecret to update the secret value, +// Secrets Manager creates a new version of the secret. Secrets Manager removes +// outdated versions when there are more than 100, but it does not remove versions +// created less than 24 hours ago. If you update the secret value more than once +// every 10 minutes, you create more versions than Secrets Manager removes, and you +// will reach the quota for secret versions. If you include SecretString or +// SecretBinary to create a new secret version, Secrets Manager automatically moves +// the staging label AWSCURRENT to the new version. Then it attaches the label +// AWSPREVIOUS to the version that AWSCURRENT was removed from. If you call this +// operation with a ClientRequestToken that matches an existing version's VersionId +// , the operation results in an error. You can't modify an existing version, you +// can only create a new version. To remove a version, remove all staging labels +// from it. See UpdateSecretVersionStage . Secrets Manager generates a CloudTrail +// log entry when you call this action. Do not include sensitive information in +// request parameters except SecretBinary or SecretString because it might be +// logged. For more information, see Logging Secrets Manager events with CloudTrail (https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html) +// . Required permissions: secretsmanager:UpdateSecret . For more information, see +// IAM policy actions for Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions) +// and Authentication and access control in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html) +// . If you use a customer managed key, you must also have kms:GenerateDataKey , +// kms:Encrypt , and kms:Decrypt permissions on the key. If you change the KMS key +// and you don't have kms:Encrypt permission to the new key, Secrets Manager does +// not re-ecrypt existing secret versions with the new key. For more information, +// see Secret encryption and decryption (https://docs.aws.amazon.com/secretsmanager/latest/userguide/security-encryption.html) +// . func (c *Client) UpdateSecret(ctx context.Context, params *UpdateSecretInput, optFns ...func(*Options)) (*UpdateSecretOutput, error) { if params == nil { params = &UpdateSecretInput{} } - result, metadata, err := c.invokeOperation(ctx, "UpdateSecret", params, optFns, addOperationUpdateSecretMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "UpdateSecret", params, optFns, c.addOperationUpdateSecretMiddlewares) if err != nil { return nil, err } @@ -93,124 +60,89 @@ func (c *Client) UpdateSecret(ctx context.Context, params *UpdateSecretInput, op type UpdateSecretInput struct { - // Specifies the secret that you want to modify or to which you want to add a new - // version. You can specify either the Amazon Resource Name (ARN) or the friendly - // name of the secret. If you specify an ARN, we generally recommend that you - // specify a complete ARN. You can specify a partial ARN too—for example, if you - // don’t include the final hyphen and six random characters that Secrets Manager - // adds at the end of the ARN when you created the secret. A partial ARN match can - // work as long as it uniquely matches only one secret. However, if your secret has - // a name that ends in a hyphen followed by six characters (before Secrets Manager - // adds the hyphen and six characters to the ARN) and you try to use that as a - // partial ARN, then those characters cause Secrets Manager to assume that you’re - // specifying a complete ARN. This confusion can cause unexpected results. To avoid - // this situation, we recommend that you don’t create secret names ending with a - // hyphen followed by six characters. If you specify an incomplete ARN without the - // random suffix, and instead provide the 'friendly name', you must not include the - // random suffix. If you do include the random suffix added by Secrets Manager, you - // receive either a ResourceNotFoundException or an AccessDeniedException error, - // depending on your permissions. + // The ARN or name of the secret. For an ARN, we recommend that you specify a + // complete ARN rather than a partial ARN. See Finding a secret from a partial ARN (https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen) + // . // // This member is required. SecretId *string - // (Optional) If you want to add a new version to the secret, this parameter - // specifies a unique identifier for the new version that helps ensure idempotency. - // If you use the AWS CLI or one of the AWS SDK to call this operation, then you - // can leave this parameter empty. The CLI or SDK generates a random UUID for you - // and includes that in the request. If you don't use the SDK and instead generate - // a raw HTTP request to the Secrets Manager service endpoint, then you must - // generate a ClientRequestToken yourself for new versions and include that value - // in the request. You typically only need to interact with this value if you - // implement your own retry logic and want to ensure that a given secret is not - // created twice. We recommend that you generate a UUID-type - // (https://wikipedia.org/wiki/Universally_unique_identifier) value to ensure - // uniqueness within the specified secret. Secrets Manager uses this value to - // prevent the accidental creation of duplicate versions if there are failures and - // retries during the Lambda rotation function's processing. - // - // * If the - // ClientRequestToken value isn't already associated with a version of the secret - // then a new version of the secret is created. - // - // * If a version with this value - // already exists and that version's SecretString and SecretBinary values are the - // same as those in the request then the request is ignored (the operation is - // idempotent). - // - // * If a version with this value already exists and that version's - // SecretString and SecretBinary values are different from the request then an - // error occurs because you cannot modify an existing secret value. - // - // This value - // becomes the VersionId of the new version. + // If you include SecretString or SecretBinary , then Secrets Manager creates a new + // version for the secret, and this parameter specifies the unique identifier for + // the new version. If you use the Amazon Web Services CLI or one of the Amazon Web + // Services SDKs to call this operation, then you can leave this parameter empty. + // The CLI or SDK generates a random UUID for you and includes it as the value for + // this parameter in the request. If you generate a raw HTTP request to the Secrets + // Manager service endpoint, then you must generate a ClientRequestToken and + // include it in the request. This value helps ensure idempotency. Secrets Manager + // uses this value to prevent the accidental creation of duplicate versions if + // there are failures and retries during a rotation. We recommend that you generate + // a UUID-type (https://wikipedia.org/wiki/Universally_unique_identifier) value to + // ensure uniqueness of your versions within the specified secret. ClientRequestToken *string - // (Optional) Specifies an updated user-provided description of the secret. + // The description of the secret. Description *string - // (Optional) Specifies an updated ARN or alias of the AWS KMS customer master key - // (CMK) to be used to encrypt the protected text in new versions of this secret. - // You can only use the account's default CMK to encrypt and decrypt if you call - // this operation using credentials from the same account that owns the secret. If - // the secret is in a different account, then you must create a custom CMK and - // provide the ARN of that CMK in this field. The user making the call must have - // permissions to both the secret and the CMK in their respective accounts. + // The ARN, key ID, or alias of the KMS key that Secrets Manager uses to encrypt + // new secret versions as well as any existing versions with the staging labels + // AWSCURRENT , AWSPENDING , or AWSPREVIOUS . If you don't have kms:Encrypt + // permission to the new key, Secrets Manager does not re-ecrypt existing secret + // versions with the new key. For more information about versions and staging + // labels, see Concepts: Version (https://docs.aws.amazon.com/secretsmanager/latest/userguide/getting-started.html#term_version) + // . A key alias is always prefixed by alias/ , for example + // alias/aws/secretsmanager . For more information, see About aliases (https://docs.aws.amazon.com/kms/latest/developerguide/alias-about.html) + // . If you set this to an empty string, Secrets Manager uses the Amazon Web + // Services managed key aws/secretsmanager . If this key doesn't already exist in + // your account, then Secrets Manager creates it for you automatically. All users + // and roles in the Amazon Web Services account automatically have access to use + // aws/secretsmanager . Creating aws/secretsmanager can result in a one-time + // significant delay in returning the result. You can only use the Amazon Web + // Services managed key aws/secretsmanager if you call this operation using + // credentials from the same Amazon Web Services account that owns the secret. If + // the secret is in a different account, then you must use a customer managed key + // and provide the ARN of that KMS key in this field. The user making the call must + // have permissions to both the secret and the KMS key in their respective + // accounts. KmsKeyId *string - // (Optional) Specifies updated binary data that you want to encrypt and store in - // the new version of the secret. To use this parameter in the command-line tools, - // we recommend that you store your binary data in a file and then use the - // appropriate technique for your tool to pass the contents of the file as a - // parameter. Either SecretBinary or SecretString must have a value, but not both. - // They cannot both be empty. This parameter is not accessible using the Secrets - // Manager console. + // The binary data to encrypt and store in the new version of the secret. We + // recommend that you store your binary data in a file and then pass the contents + // of the file as a parameter. Either SecretBinary or SecretString must have a + // value, but not both. You can't access this parameter in the Secrets Manager + // console. SecretBinary []byte - // (Optional) Specifies updated text data that you want to encrypt and store in - // this new version of the secret. Either SecretBinary or SecretString must have a - // value, but not both. They cannot both be empty. If you create this secret by - // using the Secrets Manager console then Secrets Manager puts the protected secret - // text in only the SecretString parameter. The Secrets Manager console stores the - // information as a JSON structure of key/value pairs that the default Lambda - // rotation function knows how to parse. For storing multiple values, we recommend - // that you use a JSON text string argument and specify key/value pairs. For - // information on how to format a JSON parameter for the various command line tool - // environments, see Using JSON for Parameters - // (https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json) - // in the AWS CLI User Guide. For example: - // [{"username":"bob"},{"password":"abc123xyz456"}] If your command-line tool or - // SDK requires quotation marks around the parameter, you should use single quotes - // to avoid confusion with the double quotes required in the JSON text. You can - // also 'escape' the double quote character in the embedded JSON text by prefacing - // each with a backslash. For example, the following string is surrounded by - // double-quotes. All of the embedded double quotes are escaped: - // "[{\"username\":\"bob\"},{\"password\":\"abc123xyz456\"}]" + // The text data to encrypt and store in the new version of the secret. We + // recommend you use a JSON structure of key/value pairs for your secret value. + // Either SecretBinary or SecretString must have a value, but not both. SecretString *string + + noSmithyDocumentSerde } type UpdateSecretOutput struct { - // The ARN of the secret that was updated. Secrets Manager automatically adds - // several random characters to the name at the end of the ARN when you initially - // create a secret. This affects only the ARN and not the actual friendly name. - // This ensures that if you create a new secret with the same name as an old secret - // that you previously deleted, then users with access to the old secret don't - // automatically get access to the new secret because the ARNs are different. + // The ARN of the secret that was updated. ARN *string - // The friendly name of the secret that was updated. + // The name of the secret that was updated. Name *string - // If a new version of the secret was created by this operation, then VersionId - // contains the unique identifier of the new version. + // If Secrets Manager created a new version of the secret during this operation, + // then VersionId contains the unique identifier of the new version. VersionId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationUpdateSecretMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationUpdateSecretMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateSecret{}, middleware.After) if err != nil { return err @@ -219,6 +151,13 @@ func addOperationUpdateSecretMiddlewares(stack *middleware.Stack, options Option if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateSecret"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -237,16 +176,13 @@ func addOperationUpdateSecretMiddlewares(stack *middleware.Stack, options Option if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -255,6 +191,9 @@ func addOperationUpdateSecretMiddlewares(stack *middleware.Stack, options Option if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addIdempotencyToken_opUpdateSecretMiddleware(stack, options); err != nil { return err } @@ -264,6 +203,9 @@ func addOperationUpdateSecretMiddlewares(stack *middleware.Stack, options Option if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSecret(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -273,6 +215,9 @@ func addOperationUpdateSecretMiddlewares(stack *middleware.Stack, options Option if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -313,7 +258,6 @@ func newServiceMetadataMiddleware_opUpdateSecret(region string) *awsmiddleware.R return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "secretsmanager", OperationName: "UpdateSecret", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_UpdateSecretVersionStage.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_UpdateSecretVersionStage.go index 2624b56b..77e308ae 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_UpdateSecretVersionStage.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_UpdateSecretVersionStage.go @@ -4,43 +4,40 @@ package secretsmanager import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Modifies the staging labels attached to a version of a secret. Staging labels -// are used to track a version as it progresses through the secret rotation -// process. You can attach a staging label to only one version of a secret at a -// time. If a staging label to be added is already attached to another version, -// then it is moved--removed from the other version first and then attached to this -// one. For more information about staging labels, see Staging Labels -// (https://docs.aws.amazon.com/secretsmanager/latest/userguide/terms-concepts.html#term_staging-label) -// in the AWS Secrets Manager User Guide. The staging labels that you specify in -// the VersionStage parameter are added to the existing list of staging -// labels--they don't replace it. You can move the AWSCURRENT staging label to this -// version by including it in this call. Whenever you move AWSCURRENT, Secrets -// Manager automatically moves the label AWSPREVIOUS to the version that AWSCURRENT -// was removed from. If this action results in the last label being removed from a -// version, then the version is considered to be 'deprecated' and can be deleted by -// Secrets Manager. Minimum permissions To run this command, you must have the -// following permissions: -// -// * secretsmanager:UpdateSecretVersionStage -// -// Related -// operations -// -// * To get the list of staging labels that are currently associated -// with a version of a secret, use DescribeSecret and examine the -// SecretVersionsToStages response value. +// Modifies the staging labels attached to a version of a secret. Secrets Manager +// uses staging labels to track a version as it progresses through the secret +// rotation process. Each staging label can be attached to only one version at a +// time. To add a staging label to a version when it is already attached to another +// version, Secrets Manager first removes it from the other version first and then +// attaches it to this one. For more information about versions and staging labels, +// see Concepts: Version (https://docs.aws.amazon.com/secretsmanager/latest/userguide/getting-started.html#term_version) +// . The staging labels that you specify in the VersionStage parameter are added +// to the existing list of staging labels for the version. You can move the +// AWSCURRENT staging label to this version by including it in this call. Whenever +// you move AWSCURRENT , Secrets Manager automatically moves the label AWSPREVIOUS +// to the version that AWSCURRENT was removed from. If this action results in the +// last label being removed from a version, then the version is considered to be +// 'deprecated' and can be deleted by Secrets Manager. Secrets Manager generates a +// CloudTrail log entry when you call this action. Do not include sensitive +// information in request parameters because it might be logged. For more +// information, see Logging Secrets Manager events with CloudTrail (https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html) +// . Required permissions: secretsmanager:UpdateSecretVersionStage . For more +// information, see IAM policy actions for Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions) +// and Authentication and access control in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html) +// . func (c *Client) UpdateSecretVersionStage(ctx context.Context, params *UpdateSecretVersionStageInput, optFns ...func(*Options)) (*UpdateSecretVersionStageOutput, error) { if params == nil { params = &UpdateSecretVersionStageInput{} } - result, metadata, err := c.invokeOperation(ctx, "UpdateSecretVersionStage", params, optFns, addOperationUpdateSecretVersionStageMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "UpdateSecretVersionStage", params, optFns, c.addOperationUpdateSecretVersionStageMiddlewares) if err != nil { return nil, err } @@ -52,23 +49,10 @@ func (c *Client) UpdateSecretVersionStage(ctx context.Context, params *UpdateSec type UpdateSecretVersionStageInput struct { - // Specifies the secret with the version with the list of staging labels you want - // to modify. You can specify either the Amazon Resource Name (ARN) or the friendly - // name of the secret. If you specify an ARN, we generally recommend that you - // specify a complete ARN. You can specify a partial ARN too—for example, if you - // don’t include the final hyphen and six random characters that Secrets Manager - // adds at the end of the ARN when you created the secret. A partial ARN match can - // work as long as it uniquely matches only one secret. However, if your secret has - // a name that ends in a hyphen followed by six characters (before Secrets Manager - // adds the hyphen and six characters to the ARN) and you try to use that as a - // partial ARN, then those characters cause Secrets Manager to assume that you’re - // specifying a complete ARN. This confusion can cause unexpected results. To avoid - // this situation, we recommend that you don’t create secret names ending with a - // hyphen followed by six characters. If you specify an incomplete ARN without the - // random suffix, and instead provide the 'friendly name', you must not include the - // random suffix. If you do include the random suffix added by Secrets Manager, you - // receive either a ResourceNotFoundException or an AccessDeniedException error, - // depending on your permissions. + // The ARN or the name of the secret with the version and staging labelsto modify. + // For an ARN, we recommend that you specify a complete ARN rather than a partial + // ARN. See Finding a secret from a partial ARN (https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen) + // . // // This member is required. SecretId *string @@ -78,34 +62,41 @@ type UpdateSecretVersionStageInput struct { // This member is required. VersionStage *string - // (Optional) The secret version ID that you want to add the staging label. If you - // want to remove a label from a version, then do not specify this parameter. If - // the staging label is already attached to a different version of the secret, then - // you must also specify the RemoveFromVersionId parameter. + // The ID of the version to add the staging label to. To remove a label from a + // version, then do not specify this parameter. If the staging label is already + // attached to a different version of the secret, then you must also specify the + // RemoveFromVersionId parameter. MoveToVersionId *string - // Specifies the secret version ID of the version that the staging label is to be - // removed from. If the staging label you are trying to attach to one version is - // already attached to a different version, then you must include this parameter - // and specify the version that the label is to be removed from. If the label is - // attached and you either do not specify this parameter, or the version ID does - // not match, then the operation fails. + // The ID of the version that the staging label is to be removed from. If the + // staging label you are trying to attach to one version is already attached to a + // different version, then you must include this parameter and specify the version + // that the label is to be removed from. If the label is attached and you either do + // not specify this parameter, or the version ID does not match, then the operation + // fails. RemoveFromVersionId *string + + noSmithyDocumentSerde } type UpdateSecretVersionStageOutput struct { - // The ARN of the secret with the modified staging label. + // The ARN of the secret that was updated. ARN *string - // The friendly name of the secret with the modified staging label. + // The name of the secret that was updated. Name *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationUpdateSecretVersionStageMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationUpdateSecretVersionStageMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateSecretVersionStage{}, middleware.After) if err != nil { return err @@ -114,6 +105,13 @@ func addOperationUpdateSecretVersionStageMiddlewares(stack *middleware.Stack, op if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateSecretVersionStage"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -132,16 +130,13 @@ func addOperationUpdateSecretVersionStageMiddlewares(stack *middleware.Stack, op if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -150,12 +145,18 @@ func addOperationUpdateSecretVersionStageMiddlewares(stack *middleware.Stack, op if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpUpdateSecretVersionStageValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSecretVersionStage(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -165,6 +166,9 @@ func addOperationUpdateSecretVersionStageMiddlewares(stack *middleware.Stack, op if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -172,7 +176,6 @@ func newServiceMetadataMiddleware_opUpdateSecretVersionStage(region string) *aws return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "secretsmanager", OperationName: "UpdateSecretVersionStage", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ValidateResourcePolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ValidateResourcePolicy.go index 2bac40fd..0de3d3f1 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ValidateResourcePolicy.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_ValidateResourcePolicy.go @@ -4,6 +4,7 @@ package secretsmanager import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/secretsmanager/types" @@ -11,16 +12,30 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Validates the JSON text of the resource-based policy document attached to the -// specified secret. The JSON request string input and response output displays -// formatted code with white space and line breaks for better readability. Submit -// your input as a single line JSON string. A resource-based policy is optional. +// Validates that a resource policy does not grant a wide range of principals +// access to your secret. A resource-based policy is optional for secrets. The API +// performs three checks when validating the policy: +// - Sends a call to Zelkova (https://aws.amazon.com/blogs/security/protect-sensitive-data-in-the-cloud-with-automated-reasoning-zelkova/) +// , an automated reasoning engine, to ensure your resource policy does not allow +// broad access to your secret, for example policies that use a wildcard for the +// principal. +// - Checks for correct syntax in a policy. +// - Verifies the policy does not lock out a caller. +// +// Secrets Manager generates a CloudTrail log entry when you call this action. Do +// not include sensitive information in request parameters because it might be +// logged. For more information, see Logging Secrets Manager events with CloudTrail (https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html) +// . Required permissions: secretsmanager:ValidateResourcePolicy and +// secretsmanager:PutResourcePolicy . For more information, see IAM policy +// actions for Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions) +// and Authentication and access control in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html) +// . func (c *Client) ValidateResourcePolicy(ctx context.Context, params *ValidateResourcePolicyInput, optFns ...func(*Options)) (*ValidateResourcePolicyOutput, error) { if params == nil { params = &ValidateResourcePolicyInput{} } - result, metadata, err := c.invokeOperation(ctx, "ValidateResourcePolicy", params, optFns, addOperationValidateResourcePolicyMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "ValidateResourcePolicy", params, optFns, c.addOperationValidateResourcePolicyMiddlewares) if err != nil { return nil, err } @@ -32,44 +47,38 @@ func (c *Client) ValidateResourcePolicy(ctx context.Context, params *ValidateRes type ValidateResourcePolicyInput struct { - // Identifies the Resource Policy attached to the secret. + // A JSON-formatted string that contains an Amazon Web Services resource-based + // policy. The policy in the string identifies who can access or manage this secret + // and its versions. For example policies, see Permissions policy examples (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html) + // . // // This member is required. ResourcePolicy *string - // The identifier for the secret that you want to validate a resource policy. You - // can specify either the Amazon Resource Name (ARN) or the friendly name of the - // secret. If you specify an ARN, we generally recommend that you specify a - // complete ARN. You can specify a partial ARN too—for example, if you don’t - // include the final hyphen and six random characters that Secrets Manager adds at - // the end of the ARN when you created the secret. A partial ARN match can work as - // long as it uniquely matches only one secret. However, if your secret has a name - // that ends in a hyphen followed by six characters (before Secrets Manager adds - // the hyphen and six characters to the ARN) and you try to use that as a partial - // ARN, then those characters cause Secrets Manager to assume that you’re - // specifying a complete ARN. This confusion can cause unexpected results. To avoid - // this situation, we recommend that you don’t create secret names ending with a - // hyphen followed by six characters. If you specify an incomplete ARN without the - // random suffix, and instead provide the 'friendly name', you must not include the - // random suffix. If you do include the random suffix added by Secrets Manager, you - // receive either a ResourceNotFoundException or an AccessDeniedException error, - // depending on your permissions. + // This field is reserved for internal use. SecretId *string + + noSmithyDocumentSerde } type ValidateResourcePolicyOutput struct { - // Returns a message stating that your Reource Policy passed validation. + // True if your policy passes validation, otherwise false. PolicyValidationPassed bool - // Returns an error message if your policy doesn't pass validatation. + // Validation errors if your policy didn't pass validation. ValidationErrors []types.ValidationErrorsEntry // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationValidateResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationValidateResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpValidateResourcePolicy{}, middleware.After) if err != nil { return err @@ -78,6 +87,13 @@ func addOperationValidateResourcePolicyMiddlewares(stack *middleware.Stack, opti if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ValidateResourcePolicy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -96,16 +112,13 @@ func addOperationValidateResourcePolicyMiddlewares(stack *middleware.Stack, opti if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -114,12 +127,18 @@ func addOperationValidateResourcePolicyMiddlewares(stack *middleware.Stack, opti if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpValidateResourcePolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opValidateResourcePolicy(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -129,6 +148,9 @@ func addOperationValidateResourcePolicyMiddlewares(stack *middleware.Stack, opti if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -136,7 +158,6 @@ func newServiceMetadataMiddleware_opValidateResourcePolicy(region string) *awsmi return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "secretsmanager", OperationName: "ValidateResourcePolicy", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/auth.go new file mode 100644 index 00000000..ff911710 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/auth.go @@ -0,0 +1,284 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func bindAuthParamsRegion(params *AuthResolverParameters, _ interface{}, options Options) { + params.Region = options.Region +} + +type setLegacyContextSigningOptionsMiddleware struct { +} + +func (*setLegacyContextSigningOptionsMiddleware) ID() string { + return "setLegacyContextSigningOptions" +} + +func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + schemeID := rscheme.Scheme.SchemeID() + + if sn := awsmiddleware.GetSigningName(ctx); sn != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) + } + } + + if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) + } + } + + return next.HandleFinalize(ctx, in) +} + +func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) +} + +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + +// AuthResolverParameters contains the set of inputs necessary for auth scheme +// resolution. +type AuthResolverParameters struct { + // The name of the operation being invoked. + Operation string + + // The region in which the operation is being invoked. + Region string +} + +func bindAuthResolverParams(operation string, input interface{}, options Options) *AuthResolverParameters { + params := &AuthResolverParameters{ + Operation: operation, + } + + bindAuthParamsRegion(params, input, options) + + return params +} + +// AuthSchemeResolver returns a set of possible authentication options for an +// operation. +type AuthSchemeResolver interface { + ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) +} + +type defaultAuthSchemeResolver struct{} + +var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) + +func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + if overrides, ok := operationAuthOptions[params.Operation]; ok { + return overrides(params), nil + } + return serviceAuthOptions(params), nil +} + +var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{} + +func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + { + SchemeID: smithyauth.SchemeIDSigV4, + SignerProperties: func() smithy.Properties { + var props smithy.Properties + smithyhttp.SetSigV4SigningName(&props, "secretsmanager") + smithyhttp.SetSigV4SigningRegion(&props, params.Region) + return props + }(), + }, + } +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + params := bindAuthResolverParams(m.operation, getOperationInput(ctx), m.options) + options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) + } + + scheme, ok := m.selectScheme(options) + if !ok { + return out, metadata, fmt.Errorf("could not select an auth scheme") + } + + ctx = setResolvedAuthScheme(ctx, scheme) + return next.HandleFinalize(ctx, in) +} + +func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { + for _, option := range options { + if option.SchemeID == smithyauth.SchemeIDAnonymous { + return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true + } + + for _, scheme := range m.options.AuthSchemes { + if scheme.SchemeID() != option.SchemeID { + continue + } + + if scheme.IdentityResolver(m.options) != nil { + return newResolvedAuthScheme(scheme, option), true + } + } + } + + return nil, false +} + +type resolvedAuthSchemeKey struct{} + +type resolvedAuthScheme struct { + Scheme smithyhttp.AuthScheme + IdentityProperties smithy.Properties + SignerProperties smithy.Properties +} + +func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { + return &resolvedAuthScheme{ + Scheme: scheme, + IdentityProperties: option.IdentityProperties, + SignerProperties: option.SignerProperties, + } +} + +func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { + return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) +} + +func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { + v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) + return v +} + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + resolver := rscheme.Scheme.IdentityResolver(m.options) + if resolver == nil { + return out, metadata, fmt.Errorf("no identity resolver") + } + + identity, err := resolver.GetIdentity(ctx, rscheme.IdentityProperties) + if err != nil { + return out, metadata, fmt.Errorf("get identity: %w", err) + } + + ctx = setIdentity(ctx, identity) + return next.HandleFinalize(ctx, in) +} + +type identityKey struct{} + +func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { + return middleware.WithStackValue(ctx, identityKey{}, identity) +} + +func getIdentity(ctx context.Context) smithyauth.Identity { + v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) + return v +} + +type signRequestMiddleware struct { +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + signer := rscheme.Scheme.Signer() + if signer == nil { + return out, metadata, fmt.Errorf("no signer") + } + + if err := signer.SignRequest(ctx, req, identity, rscheme.SignerProperties); err != nil { + return out, metadata, fmt.Errorf("sign request: %w", err) + } + + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/deserializers.go index 41f6370a..5e0d8b27 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/deserializers.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/deserializers.go @@ -21,6 +21,132 @@ import ( "strings" ) +type awsAwsjson11_deserializeOpBatchGetSecretValue struct { +} + +func (*awsAwsjson11_deserializeOpBatchGetSecretValue) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpBatchGetSecretValue) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorBatchGetSecretValue(response, &metadata) + } + output := &BatchGetSecretValueOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentBatchGetSecretValueOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorBatchGetSecretValue(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("DecryptionFailure", errorCode): + return awsAwsjson11_deserializeErrorDecryptionFailure(response, errorBody) + + case strings.EqualFold("InternalServiceError", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidNextTokenException", errorCode): + return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpCancelRotateSecret struct { } @@ -88,9 +214,9 @@ func awsAwsjson11_deserializeOpErrorCancelRotateSecret(response *smithyhttp.Resp errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -99,7 +225,7 @@ func awsAwsjson11_deserializeOpErrorCancelRotateSecret(response *smithyhttp.Resp body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -111,8 +237,8 @@ func awsAwsjson11_deserializeOpErrorCancelRotateSecret(response *smithyhttp.Resp } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -208,9 +334,9 @@ func awsAwsjson11_deserializeOpErrorCreateSecret(response *smithyhttp.Response, errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -219,7 +345,7 @@ func awsAwsjson11_deserializeOpErrorCreateSecret(response *smithyhttp.Response, body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -231,14 +357,17 @@ func awsAwsjson11_deserializeOpErrorCreateSecret(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { + case strings.EqualFold("DecryptionFailure", errorCode): + return awsAwsjson11_deserializeErrorDecryptionFailure(response, errorBody) + case strings.EqualFold("EncryptionFailure", errorCode): return awsAwsjson11_deserializeErrorEncryptionFailure(response, errorBody) @@ -343,9 +472,9 @@ func awsAwsjson11_deserializeOpErrorDeleteResourcePolicy(response *smithyhttp.Re errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -354,7 +483,7 @@ func awsAwsjson11_deserializeOpErrorDeleteResourcePolicy(response *smithyhttp.Re body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -366,8 +495,8 @@ func awsAwsjson11_deserializeOpErrorDeleteResourcePolicy(response *smithyhttp.Re } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -377,6 +506,9 @@ func awsAwsjson11_deserializeOpErrorDeleteResourcePolicy(response *smithyhttp.Re case strings.EqualFold("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) @@ -460,9 +592,9 @@ func awsAwsjson11_deserializeOpErrorDeleteSecret(response *smithyhttp.Response, errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -471,7 +603,7 @@ func awsAwsjson11_deserializeOpErrorDeleteSecret(response *smithyhttp.Response, body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -483,8 +615,8 @@ func awsAwsjson11_deserializeOpErrorDeleteSecret(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -580,9 +712,9 @@ func awsAwsjson11_deserializeOpErrorDescribeSecret(response *smithyhttp.Response errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -591,7 +723,7 @@ func awsAwsjson11_deserializeOpErrorDescribeSecret(response *smithyhttp.Response body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -603,8 +735,8 @@ func awsAwsjson11_deserializeOpErrorDescribeSecret(response *smithyhttp.Response } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -614,6 +746,9 @@ func awsAwsjson11_deserializeOpErrorDescribeSecret(response *smithyhttp.Response case strings.EqualFold("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -694,9 +829,9 @@ func awsAwsjson11_deserializeOpErrorGetRandomPassword(response *smithyhttp.Respo errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -705,7 +840,7 @@ func awsAwsjson11_deserializeOpErrorGetRandomPassword(response *smithyhttp.Respo body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -717,8 +852,8 @@ func awsAwsjson11_deserializeOpErrorGetRandomPassword(response *smithyhttp.Respo } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -811,9 +946,9 @@ func awsAwsjson11_deserializeOpErrorGetResourcePolicy(response *smithyhttp.Respo errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -822,7 +957,7 @@ func awsAwsjson11_deserializeOpErrorGetResourcePolicy(response *smithyhttp.Respo body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -834,8 +969,8 @@ func awsAwsjson11_deserializeOpErrorGetResourcePolicy(response *smithyhttp.Respo } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -845,6 +980,9 @@ func awsAwsjson11_deserializeOpErrorGetResourcePolicy(response *smithyhttp.Respo case strings.EqualFold("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) @@ -928,9 +1066,9 @@ func awsAwsjson11_deserializeOpErrorGetSecretValue(response *smithyhttp.Response errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -939,7 +1077,7 @@ func awsAwsjson11_deserializeOpErrorGetSecretValue(response *smithyhttp.Response body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -951,8 +1089,8 @@ func awsAwsjson11_deserializeOpErrorGetSecretValue(response *smithyhttp.Response } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -1051,9 +1189,9 @@ func awsAwsjson11_deserializeOpErrorListSecrets(response *smithyhttp.Response, m errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -1062,7 +1200,7 @@ func awsAwsjson11_deserializeOpErrorListSecrets(response *smithyhttp.Response, m body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1074,8 +1212,8 @@ func awsAwsjson11_deserializeOpErrorListSecrets(response *smithyhttp.Response, m } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -1091,6 +1229,9 @@ func awsAwsjson11_deserializeOpErrorListSecrets(response *smithyhttp.Response, m case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1168,9 +1309,9 @@ func awsAwsjson11_deserializeOpErrorListSecretVersionIds(response *smithyhttp.Re errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -1179,7 +1320,7 @@ func awsAwsjson11_deserializeOpErrorListSecretVersionIds(response *smithyhttp.Re body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1191,8 +1332,8 @@ func awsAwsjson11_deserializeOpErrorListSecretVersionIds(response *smithyhttp.Re } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -1205,6 +1346,9 @@ func awsAwsjson11_deserializeOpErrorListSecretVersionIds(response *smithyhttp.Re case strings.EqualFold("InvalidNextTokenException", errorCode): return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -1285,9 +1429,9 @@ func awsAwsjson11_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Respo errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -1296,7 +1440,7 @@ func awsAwsjson11_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Respo body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1308,8 +1452,8 @@ func awsAwsjson11_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Respo } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -1411,9 +1555,9 @@ func awsAwsjson11_deserializeOpErrorPutSecretValue(response *smithyhttp.Response errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -1422,7 +1566,7 @@ func awsAwsjson11_deserializeOpErrorPutSecretValue(response *smithyhttp.Response body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1434,14 +1578,17 @@ func awsAwsjson11_deserializeOpErrorPutSecretValue(response *smithyhttp.Response } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { + case strings.EqualFold("DecryptionFailure", errorCode): + return awsAwsjson11_deserializeErrorDecryptionFailure(response, errorBody) + case strings.EqualFold("EncryptionFailure", errorCode): return awsAwsjson11_deserializeErrorEncryptionFailure(response, errorBody) @@ -1473,14 +1620,14 @@ func awsAwsjson11_deserializeOpErrorPutSecretValue(response *smithyhttp.Response } } -type awsAwsjson11_deserializeOpRestoreSecret struct { +type awsAwsjson11_deserializeOpRemoveRegionsFromReplication struct { } -func (*awsAwsjson11_deserializeOpRestoreSecret) ID() string { +func (*awsAwsjson11_deserializeOpRemoveRegionsFromReplication) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpRestoreSecret) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpRemoveRegionsFromReplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1494,9 +1641,9 @@ func (m *awsAwsjson11_deserializeOpRestoreSecret) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorRestoreSecret(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorRemoveRegionsFromReplication(response, &metadata) } - output := &RestoreSecretOutput{} + output := &RemoveRegionsFromReplicationOutput{} out.Result = output var buff [1024]byte @@ -1516,7 +1663,7 @@ func (m *awsAwsjson11_deserializeOpRestoreSecret) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentRestoreSecretOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentRemoveRegionsFromReplicationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1530,7 +1677,7 @@ func (m *awsAwsjson11_deserializeOpRestoreSecret) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson11_deserializeOpErrorRestoreSecret(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorRemoveRegionsFromReplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1540,9 +1687,9 @@ func awsAwsjson11_deserializeOpErrorRestoreSecret(response *smithyhttp.Response, errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -1551,7 +1698,7 @@ func awsAwsjson11_deserializeOpErrorRestoreSecret(response *smithyhttp.Response, body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1563,8 +1710,8 @@ func awsAwsjson11_deserializeOpErrorRestoreSecret(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -1593,14 +1740,14 @@ func awsAwsjson11_deserializeOpErrorRestoreSecret(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpRotateSecret struct { +type awsAwsjson11_deserializeOpReplicateSecretToRegions struct { } -func (*awsAwsjson11_deserializeOpRotateSecret) ID() string { +func (*awsAwsjson11_deserializeOpReplicateSecretToRegions) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpRotateSecret) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpReplicateSecretToRegions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1614,9 +1761,9 @@ func (m *awsAwsjson11_deserializeOpRotateSecret) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorRotateSecret(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorReplicateSecretToRegions(response, &metadata) } - output := &RotateSecretOutput{} + output := &ReplicateSecretToRegionsOutput{} out.Result = output var buff [1024]byte @@ -1636,7 +1783,7 @@ func (m *awsAwsjson11_deserializeOpRotateSecret) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentRotateSecretOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentReplicateSecretToRegionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1650,7 +1797,7 @@ func (m *awsAwsjson11_deserializeOpRotateSecret) HandleDeserialize(ctx context.C return out, metadata, err } -func awsAwsjson11_deserializeOpErrorRotateSecret(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorReplicateSecretToRegions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1660,9 +1807,9 @@ func awsAwsjson11_deserializeOpErrorRotateSecret(response *smithyhttp.Response, errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -1671,7 +1818,7 @@ func awsAwsjson11_deserializeOpErrorRotateSecret(response *smithyhttp.Response, body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1683,8 +1830,8 @@ func awsAwsjson11_deserializeOpErrorRotateSecret(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -1713,14 +1860,14 @@ func awsAwsjson11_deserializeOpErrorRotateSecret(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpTagResource struct { +type awsAwsjson11_deserializeOpRestoreSecret struct { } -func (*awsAwsjson11_deserializeOpTagResource) ID() string { +func (*awsAwsjson11_deserializeOpRestoreSecret) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpRestoreSecret) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1734,21 +1881,43 @@ func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorRestoreSecret(response, &metadata) } - output := &TagResourceOutput{} + output := &RestoreSecretOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentRestoreSecretOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), } + return out, metadata, err } return out, metadata, err } -func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorRestoreSecret(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1758,9 +1927,9 @@ func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, m errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -1769,7 +1938,7 @@ func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, m body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1781,8 +1950,8 @@ func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, m } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -1811,14 +1980,14 @@ func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -type awsAwsjson11_deserializeOpUntagResource struct { +type awsAwsjson11_deserializeOpRotateSecret struct { } -func (*awsAwsjson11_deserializeOpUntagResource) ID() string { +func (*awsAwsjson11_deserializeOpRotateSecret) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpRotateSecret) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1832,21 +2001,43 @@ func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorRotateSecret(response, &metadata) } - output := &UntagResourceOutput{} + output := &RotateSecretOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentRotateSecretOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), } + return out, metadata, err } return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorRotateSecret(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1856,9 +2047,9 @@ func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -1867,7 +2058,7 @@ func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1879,8 +2070,8 @@ func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -1909,14 +2100,14 @@ func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpUpdateSecret struct { +type awsAwsjson11_deserializeOpStopReplicationToReplica struct { } -func (*awsAwsjson11_deserializeOpUpdateSecret) ID() string { +func (*awsAwsjson11_deserializeOpStopReplicationToReplica) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateSecret) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpStopReplicationToReplica) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1930,9 +2121,9 @@ func (m *awsAwsjson11_deserializeOpUpdateSecret) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateSecret(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorStopReplicationToReplica(response, &metadata) } - output := &UpdateSecretOutput{} + output := &StopReplicationToReplicaOutput{} out.Result = output var buff [1024]byte @@ -1952,7 +2143,7 @@ func (m *awsAwsjson11_deserializeOpUpdateSecret) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateSecretOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentStopReplicationToReplicaOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1966,7 +2157,7 @@ func (m *awsAwsjson11_deserializeOpUpdateSecret) HandleDeserialize(ctx context.C return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateSecret(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorStopReplicationToReplica(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1976,9 +2167,9 @@ func awsAwsjson11_deserializeOpErrorUpdateSecret(response *smithyhttp.Response, errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -1987,7 +2178,7 @@ func awsAwsjson11_deserializeOpErrorUpdateSecret(response *smithyhttp.Response, body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1999,17 +2190,14 @@ func awsAwsjson11_deserializeOpErrorUpdateSecret(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { - case strings.EqualFold("EncryptionFailure", errorCode): - return awsAwsjson11_deserializeErrorEncryptionFailure(response, errorBody) - case strings.EqualFold("InternalServiceError", errorCode): return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) @@ -2019,18 +2207,6 @@ func awsAwsjson11_deserializeOpErrorUpdateSecret(response *smithyhttp.Response, case strings.EqualFold("InvalidRequestException", errorCode): return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("MalformedPolicyDocumentException", errorCode): - return awsAwsjson11_deserializeErrorMalformedPolicyDocumentException(response, errorBody) - - case strings.EqualFold("PreconditionNotMetException", errorCode): - return awsAwsjson11_deserializeErrorPreconditionNotMetException(response, errorBody) - - case strings.EqualFold("ResourceExistsException", errorCode): - return awsAwsjson11_deserializeErrorResourceExistsException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -2044,14 +2220,348 @@ func awsAwsjson11_deserializeOpErrorUpdateSecret(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpUpdateSecretVersionStage struct { +type awsAwsjson11_deserializeOpTagResource struct { } -func (*awsAwsjson11_deserializeOpUpdateSecretVersionStage) ID() string { +func (*awsAwsjson11_deserializeOpTagResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateSecretVersionStage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata) + } + output := &TagResourceOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServiceError", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUntagResource struct { +} + +func (*awsAwsjson11_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServiceError", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdateSecret struct { +} + +func (*awsAwsjson11_deserializeOpUpdateSecret) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateSecret) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateSecret(response, &metadata) + } + output := &UpdateSecretOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentUpdateSecretOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorUpdateSecret(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("DecryptionFailure", errorCode): + return awsAwsjson11_deserializeErrorDecryptionFailure(response, errorBody) + + case strings.EqualFold("EncryptionFailure", errorCode): + return awsAwsjson11_deserializeErrorEncryptionFailure(response, errorBody) + + case strings.EqualFold("InternalServiceError", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("MalformedPolicyDocumentException", errorCode): + return awsAwsjson11_deserializeErrorMalformedPolicyDocumentException(response, errorBody) + + case strings.EqualFold("PreconditionNotMetException", errorCode): + return awsAwsjson11_deserializeErrorPreconditionNotMetException(response, errorBody) + + case strings.EqualFold("ResourceExistsException", errorCode): + return awsAwsjson11_deserializeErrorResourceExistsException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdateSecretVersionStage struct { +} + +func (*awsAwsjson11_deserializeOpUpdateSecretVersionStage) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateSecretVersionStage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2111,9 +2621,9 @@ func awsAwsjson11_deserializeOpErrorUpdateSecretVersionStage(response *smithyhtt errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -2122,7 +2632,7 @@ func awsAwsjson11_deserializeOpErrorUpdateSecretVersionStage(response *smithyhtt body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2134,8 +2644,8 @@ func awsAwsjson11_deserializeOpErrorUpdateSecretVersionStage(response *smithyhtt } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -2234,9 +2744,9 @@ func awsAwsjson11_deserializeOpErrorValidateResourcePolicy(response *smithyhttp. errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -2245,7 +2755,7 @@ func awsAwsjson11_deserializeOpErrorValidateResourcePolicy(response *smithyhttp. body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2257,8 +2767,8 @@ func awsAwsjson11_deserializeOpErrorValidateResourcePolicy(response *smithyhttp. } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -2710,6 +3220,98 @@ func awsAwsjson11_deserializeErrorResourceNotFoundException(response *smithyhttp return output } +func awsAwsjson11_deserializeDocumentAPIErrorListType(v *[]types.APIErrorType, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.APIErrorType + if *v == nil { + cv = []types.APIErrorType{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.APIErrorType + destAddr := &col + if err := awsAwsjson11_deserializeDocumentAPIErrorType(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentAPIErrorType(v **types.APIErrorType, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.APIErrorType + if *v == nil { + sv = &types.APIErrorType{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ErrorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + } + sv.ErrorCode = ptr.String(jtv) + } + + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "SecretId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretIdType to be of type string, got %T instead", value) + } + sv.SecretId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentDecryptionFailure(v **types.DecryptionFailure, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -2925,7 +3527,123 @@ func awsAwsjson11_deserializeDocumentInvalidRequestException(v **types.InvalidRe var sv *types.InvalidRequestException if *v == nil { - sv = &types.InvalidRequestException{} + sv = &types.InvalidRequestException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentKmsKeyIdListType(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyIdType to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LimitExceededException + if *v == nil { + sv = &types.LimitExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentMalformedPolicyDocumentException(v **types.MalformedPolicyDocumentException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.MalformedPolicyDocumentException + if *v == nil { + sv = &types.MalformedPolicyDocumentException{} } else { sv = *v } @@ -2950,7 +3668,7 @@ func awsAwsjson11_deserializeDocumentInvalidRequestException(v **types.InvalidRe return nil } -func awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { +func awsAwsjson11_deserializeDocumentPreconditionNotMetException(v **types.PreconditionNotMetException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2963,9 +3681,9 @@ func awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExcee return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.LimitExceededException + var sv *types.PreconditionNotMetException if *v == nil { - sv = &types.LimitExceededException{} + sv = &types.PreconditionNotMetException{} } else { sv = *v } @@ -2990,7 +3708,7 @@ func awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExcee return nil } -func awsAwsjson11_deserializeDocumentMalformedPolicyDocumentException(v **types.MalformedPolicyDocumentException, value interface{}) error { +func awsAwsjson11_deserializeDocumentPublicPolicyException(v **types.PublicPolicyException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3003,9 +3721,9 @@ func awsAwsjson11_deserializeDocumentMalformedPolicyDocumentException(v **types. return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.MalformedPolicyDocumentException + var sv *types.PublicPolicyException if *v == nil { - sv = &types.MalformedPolicyDocumentException{} + sv = &types.PublicPolicyException{} } else { sv = *v } @@ -3030,7 +3748,7 @@ func awsAwsjson11_deserializeDocumentMalformedPolicyDocumentException(v **types. return nil } -func awsAwsjson11_deserializeDocumentPreconditionNotMetException(v **types.PreconditionNotMetException, value interface{}) error { +func awsAwsjson11_deserializeDocumentReplicationStatusListType(v *[]types.ReplicationStatusType, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3038,39 +3756,33 @@ func awsAwsjson11_deserializeDocumentPreconditionNotMetException(v **types.Preco return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.PreconditionNotMetException + var cv []types.ReplicationStatusType if *v == nil { - sv = &types.PreconditionNotMetException{} + cv = []types.ReplicationStatusType{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.ReplicationStatusType + destAddr := &col + if err := awsAwsjson11_deserializeDocumentReplicationStatusType(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsAwsjson11_deserializeDocumentPublicPolicyException(v **types.PublicPolicyException, value interface{}) error { +func awsAwsjson11_deserializeDocumentReplicationStatusType(v **types.ReplicationStatusType, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3083,22 +3795,65 @@ func awsAwsjson11_deserializeDocumentPublicPolicyException(v **types.PublicPolic return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.PublicPolicyException + var sv *types.ReplicationStatusType if *v == nil { - sv = &types.PublicPolicyException{} + sv = &types.ReplicationStatusType{} } else { sv = *v } for key, value := range shape { switch key { - case "Message": + case "KmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + return fmt.Errorf("expected KmsKeyIdType to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.KmsKeyId = ptr.String(jtv) + } + + case "LastAccessedDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastAccessedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastAccessedDateType to be a JSON Number, got %T instead", value) + + } + } + + case "Region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionType to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StatusType to be of type string, got %T instead", value) + } + sv.Status = types.StatusType(jtv) + } + + case "StatusMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StatusMessageType to be of type string, got %T instead", value) + } + sv.StatusMessage = ptr.String(jtv) } default: @@ -3222,7 +3977,25 @@ func awsAwsjson11_deserializeDocumentRotationRulesType(v **types.RotationRulesTy if err != nil { return err } - sv.AutomaticallyAfterDays = i64 + sv.AutomaticallyAfterDays = ptr.Int64(i64) + } + + case "Duration": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DurationType to be of type string, got %T instead", value) + } + sv.Duration = ptr.String(jtv) + } + + case "ScheduleExpression": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScheduleExpressionType to be of type string, got %T instead", value) + } + sv.ScheduleExpression = ptr.String(jtv) } default: @@ -3267,28 +4040,34 @@ func awsAwsjson11_deserializeDocumentSecretListEntry(v **types.SecretListEntry, case "CreatedDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected TimestampType to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected TimestampType to be a JSON Number, got %T instead", value) + } - sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "DeletedDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DeletedDateType to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DeletedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DeletedDateType to be a JSON Number, got %T instead", value) + } - sv.DeletedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Description": @@ -3311,41 +4090,50 @@ func awsAwsjson11_deserializeDocumentSecretListEntry(v **types.SecretListEntry, case "LastAccessedDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected LastAccessedDateType to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastAccessedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastAccessedDateType to be a JSON Number, got %T instead", value) + } - sv.LastAccessedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "LastChangedDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected LastChangedDateType to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastChangedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastChangedDateType to be a JSON Number, got %T instead", value) + } - sv.LastChangedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "LastRotatedDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected LastRotatedDateType to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastRotatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastRotatedDateType to be a JSON Number, got %T instead", value) + } - sv.LastRotatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Name": @@ -3357,6 +4145,22 @@ func awsAwsjson11_deserializeDocumentSecretListEntry(v **types.SecretListEntry, sv.Name = ptr.String(jtv) } + case "NextRotationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.NextRotationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected NextRotationDateType to be a JSON Number, got %T instead", value) + + } + } + case "OwningService": if value != nil { jtv, ok := value.(string) @@ -3366,13 +4170,22 @@ func awsAwsjson11_deserializeDocumentSecretListEntry(v **types.SecretListEntry, sv.OwningService = ptr.String(jtv) } + case "PrimaryRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionType to be of type string, got %T instead", value) + } + sv.PrimaryRegion = ptr.String(jtv) + } + case "RotationEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected RotationEnabledType to be of type *bool, got %T instead", value) } - sv.RotationEnabled = jtv + sv.RotationEnabled = ptr.Bool(jtv) } case "RotationLambdaARN": @@ -3394,8 +4207,143 @@ func awsAwsjson11_deserializeDocumentSecretListEntry(v **types.SecretListEntry, return err } - case "Tags": - if err := awsAwsjson11_deserializeDocumentTagListType(&sv.Tags, value); err != nil { + case "Tags": + if err := awsAwsjson11_deserializeDocumentTagListType(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentSecretListType(v *[]types.SecretListEntry, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.SecretListEntry + if *v == nil { + cv = []types.SecretListEntry{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SecretListEntry + destAddr := &col + if err := awsAwsjson11_deserializeDocumentSecretListEntry(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentSecretValueEntry(v **types.SecretValueEntry, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SecretValueEntry + if *v == nil { + sv = &types.SecretValueEntry{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ARN": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretARNType to be of type string, got %T instead", value) + } + sv.ARN = ptr.String(jtv) + } + + case "CreatedDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected CreatedDateType to be a JSON Number, got %T instead", value) + + } + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretNameType to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "SecretBinary": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretBinaryType to be []byte, got %T instead", value) + } + dv, err := base64.StdEncoding.DecodeString(jtv) + if err != nil { + return fmt.Errorf("failed to base64 decode SecretBinaryType, %w", err) + } + sv.SecretBinary = dv + } + + case "SecretString": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretStringType to be of type string, got %T instead", value) + } + sv.SecretString = ptr.String(jtv) + } + + case "VersionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretVersionIdType to be of type string, got %T instead", value) + } + sv.VersionId = ptr.String(jtv) + } + + case "VersionStages": + if err := awsAwsjson11_deserializeDocumentSecretVersionStagesType(&sv.VersionStages, value); err != nil { return err } @@ -3408,7 +4356,7 @@ func awsAwsjson11_deserializeDocumentSecretListEntry(v **types.SecretListEntry, return nil } -func awsAwsjson11_deserializeDocumentSecretListType(v *[]types.SecretListEntry, value interface{}) error { +func awsAwsjson11_deserializeDocumentSecretValuesType(v *[]types.SecretValueEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3421,17 +4369,17 @@ func awsAwsjson11_deserializeDocumentSecretListType(v *[]types.SecretListEntry, return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.SecretListEntry + var cv []types.SecretValueEntry if *v == nil { - cv = []types.SecretListEntry{} + cv = []types.SecretValueEntry{} } else { cv = *v } for _, value := range shape { - var col types.SecretListEntry + var col types.SecretValueEntry destAddr := &col - if err := awsAwsjson11_deserializeDocumentSecretListEntry(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentSecretValueEntry(&destAddr, value); err != nil { return err } col = *destAddr @@ -3466,28 +4414,39 @@ func awsAwsjson11_deserializeDocumentSecretVersionsListEntry(v **types.SecretVer switch key { case "CreatedDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected CreatedDateType to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected CreatedDateType to be a JSON Number, got %T instead", value) + } - sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "KmsKeyIds": + if err := awsAwsjson11_deserializeDocumentKmsKeyIdListType(&sv.KmsKeyIds, value); err != nil { + return err } case "LastAccessedDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected LastAccessedDateType to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastAccessedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastAccessedDateType to be a JSON Number, got %T instead", value) + } - sv.LastAccessedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "VersionId": @@ -3783,6 +4742,56 @@ func awsAwsjson11_deserializeDocumentValidationErrorsType(v *[]types.ValidationE return nil } +func awsAwsjson11_deserializeOpDocumentBatchGetSecretValueOutput(v **BatchGetSecretValueOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *BatchGetSecretValueOutput + if *v == nil { + sv = &BatchGetSecretValueOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Errors": + if err := awsAwsjson11_deserializeDocumentAPIErrorListType(&sv.Errors, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextTokenType to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "SecretValues": + if err := awsAwsjson11_deserializeDocumentSecretValuesType(&sv.SecretValues, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentCancelRotateSecretOutput(v **CancelRotateSecretOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -3881,6 +4890,11 @@ func awsAwsjson11_deserializeOpDocumentCreateSecretOutput(v **CreateSecretOutput sv.Name = ptr.String(jtv) } + case "ReplicationStatus": + if err := awsAwsjson11_deserializeDocumentReplicationStatusListType(&sv.ReplicationStatus, value); err != nil { + return err + } + case "VersionId": if value != nil { jtv, ok := value.(string) @@ -3981,15 +4995,18 @@ func awsAwsjson11_deserializeOpDocumentDeleteSecretOutput(v **DeleteSecretOutput case "DeletionDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DeletionDateType to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DeletionDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DeletionDateType to be a JSON Number, got %T instead", value) + } - sv.DeletionDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Name": @@ -4043,28 +5060,34 @@ func awsAwsjson11_deserializeOpDocumentDescribeSecretOutput(v **DescribeSecretOu case "CreatedDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected TimestampType to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected TimestampType to be a JSON Number, got %T instead", value) + } - sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "DeletedDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DeletedDateType to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DeletedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DeletedDateType to be a JSON Number, got %T instead", value) + } - sv.DeletedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Description": @@ -4087,41 +5110,50 @@ func awsAwsjson11_deserializeOpDocumentDescribeSecretOutput(v **DescribeSecretOu case "LastAccessedDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected LastAccessedDateType to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastAccessedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastAccessedDateType to be a JSON Number, got %T instead", value) + } - sv.LastAccessedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "LastChangedDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected LastChangedDateType to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastChangedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastChangedDateType to be a JSON Number, got %T instead", value) + } - sv.LastChangedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "LastRotatedDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected LastRotatedDateType to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastRotatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastRotatedDateType to be a JSON Number, got %T instead", value) + } - sv.LastRotatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Name": @@ -4133,6 +5165,22 @@ func awsAwsjson11_deserializeOpDocumentDescribeSecretOutput(v **DescribeSecretOu sv.Name = ptr.String(jtv) } + case "NextRotationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.NextRotationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected NextRotationDateType to be a JSON Number, got %T instead", value) + + } + } + case "OwningService": if value != nil { jtv, ok := value.(string) @@ -4142,13 +5190,27 @@ func awsAwsjson11_deserializeOpDocumentDescribeSecretOutput(v **DescribeSecretOu sv.OwningService = ptr.String(jtv) } + case "PrimaryRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegionType to be of type string, got %T instead", value) + } + sv.PrimaryRegion = ptr.String(jtv) + } + + case "ReplicationStatus": + if err := awsAwsjson11_deserializeDocumentReplicationStatusListType(&sv.ReplicationStatus, value); err != nil { + return err + } + case "RotationEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected RotationEnabledType to be of type *bool, got %T instead", value) } - sv.RotationEnabled = jtv + sv.RotationEnabled = ptr.Bool(jtv) } case "RotationLambdaARN": @@ -4315,15 +5377,18 @@ func awsAwsjson11_deserializeOpDocumentGetSecretValueOutput(v **GetSecretValueOu case "CreatedDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected CreatedDateType to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected CreatedDateType to be a JSON Number, got %T instead", value) + } - sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Name": @@ -4600,6 +5665,96 @@ func awsAwsjson11_deserializeOpDocumentPutSecretValueOutput(v **PutSecretValueOu return nil } +func awsAwsjson11_deserializeOpDocumentRemoveRegionsFromReplicationOutput(v **RemoveRegionsFromReplicationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *RemoveRegionsFromReplicationOutput + if *v == nil { + sv = &RemoveRegionsFromReplicationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ARN": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretARNType to be of type string, got %T instead", value) + } + sv.ARN = ptr.String(jtv) + } + + case "ReplicationStatus": + if err := awsAwsjson11_deserializeDocumentReplicationStatusListType(&sv.ReplicationStatus, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentReplicateSecretToRegionsOutput(v **ReplicateSecretToRegionsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ReplicateSecretToRegionsOutput + if *v == nil { + sv = &ReplicateSecretToRegionsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ARN": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretARNType to be of type string, got %T instead", value) + } + sv.ARN = ptr.String(jtv) + } + + case "ReplicationStatus": + if err := awsAwsjson11_deserializeDocumentReplicationStatusListType(&sv.ReplicationStatus, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentRestoreSecretOutput(v **RestoreSecretOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4707,6 +5862,46 @@ func awsAwsjson11_deserializeOpDocumentRotateSecretOutput(v **RotateSecretOutput return nil } +func awsAwsjson11_deserializeOpDocumentStopReplicationToReplicaOutput(v **StopReplicationToReplicaOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *StopReplicationToReplicaOutput + if *v == nil { + sv = &StopReplicationToReplicaOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ARN": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretARNType to be of type string, got %T instead", value) + } + sv.ARN = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentUpdateSecretOutput(v **UpdateSecretOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/doc.go index aee3ff1b..e3e68d83 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/doc.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/doc.go @@ -3,51 +3,29 @@ // Package secretsmanager provides the API client, operations, and parameter types // for AWS Secrets Manager. // -// AWS Secrets Manager API Reference AWS Secrets Manager provides a service to -// enable you to store, manage, and retrieve, secrets. This guide provides -// descriptions of the Secrets Manager API. For more information about using this -// service, see the AWS Secrets Manager User Guide -// (https://docs.aws.amazon.com/secretsmanager/latest/userguide/introduction.html). -// API Version This version of the Secrets Manager API Reference documents the -// Secrets Manager API version 2017-10-17. As an alternative to using the API, you -// can use one of the AWS SDKs, which consist of libraries and sample code for -// various programming languages and platforms such as Java, Ruby, .NET, iOS, and -// Android. The SDKs provide a convenient way to create programmatic access to AWS -// Secrets Manager. For example, the SDKs provide cryptographically signing -// requests, managing errors, and retrying requests automatically. For more -// information about the AWS SDKs, including downloading and installing them, see -// Tools for Amazon Web Services (http://aws.amazon.com/tools/). We recommend you -// use the AWS SDKs to make programmatic API calls to Secrets Manager. However, you -// also can use the Secrets Manager HTTP Query API to make direct calls to the -// Secrets Manager web service. To learn more about the Secrets Manager HTTP Query -// API, see Making Query Requests -// (https://docs.aws.amazon.com/secretsmanager/latest/userguide/query-requests.html) -// in the AWS Secrets Manager User Guide. Secrets Manager API supports GET and POST -// requests for all actions, and doesn't require you to use GET for some actions -// and POST for others. However, GET requests are subject to the limitation size of -// a URL. Therefore, for operations that require larger sizes, use a POST request. -// Support and Feedback for AWS Secrets Manager We welcome your feedback. Send your -// comments to awssecretsmanager-feedback@amazon.com -// (mailto:awssecretsmanager-feedback@amazon.com), or post your feedback and -// questions in the AWS Secrets Manager Discussion Forum -// (http://forums.aws.amazon.com/forum.jspa?forumID=296). For more information -// about the AWS Discussion Forums, see Forums Help -// (http://forums.aws.amazon.com/help.jspa). How examples are presented The JSON -// that AWS Secrets Manager expects as your request parameters and the service -// returns as a response to HTTP query requests contain single, long strings -// without line breaks or white space formatting. The JSON shown in the examples -// displays the code formatted with both line breaks and white space to improve -// readability. When example input parameters can also cause long strings extending -// beyond the screen, you can insert line breaks to enhance readability. You should -// always submit the input as a single JSON text string. Logging API Requests AWS -// Secrets Manager supports AWS CloudTrail, a service that records AWS API calls -// for your AWS account and delivers log files to an Amazon S3 bucket. By using -// information that's collected by AWS CloudTrail, you can determine the requests -// successfully made to Secrets Manager, who made the request, when it was made, -// and so on. For more about AWS Secrets Manager and support for AWS CloudTrail, -// see Logging AWS Secrets Manager Events with AWS CloudTrail -// (http://docs.aws.amazon.com/secretsmanager/latest/userguide/monitoring.html#monitoring_cloudtrail) -// in the AWS Secrets Manager User Guide. To learn more about CloudTrail, including -// enabling it and find your log files, see the AWS CloudTrail User Guide -// (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html). +// Amazon Web Services Secrets Manager Amazon Web Services Secrets Manager +// provides a service to enable you to store, manage, and retrieve, secrets. This +// guide provides descriptions of the Secrets Manager API. For more information +// about using this service, see the Amazon Web Services Secrets Manager User Guide (https://docs.aws.amazon.com/secretsmanager/latest/userguide/introduction.html) +// . API Version This version of the Secrets Manager API Reference documents the +// Secrets Manager API version 2017-10-17. For a list of endpoints, see Amazon Web +// Services Secrets Manager endpoints (https://docs.aws.amazon.com/secretsmanager/latest/userguide/asm_access.html#endpoints) +// . Support and Feedback for Amazon Web Services Secrets Manager We welcome your +// feedback. Send your comments to awssecretsmanager-feedback@amazon.com (mailto:awssecretsmanager-feedback@amazon.com) +// , or post your feedback and questions in the Amazon Web Services Secrets +// Manager Discussion Forum (http://forums.aws.amazon.com/forum.jspa?forumID=296) . +// For more information about the Amazon Web Services Discussion Forums, see +// Forums Help (http://forums.aws.amazon.com/help.jspa) . Logging API Requests +// Amazon Web Services Secrets Manager supports Amazon Web Services CloudTrail, a +// service that records Amazon Web Services API calls for your Amazon Web Services +// account and delivers log files to an Amazon S3 bucket. By using information +// that's collected by Amazon Web Services CloudTrail, you can determine the +// requests successfully made to Secrets Manager, who made the request, when it was +// made, and so on. For more about Amazon Web Services Secrets Manager and support +// for Amazon Web Services CloudTrail, see Logging Amazon Web Services Secrets +// Manager Events with Amazon Web Services CloudTrail (https://docs.aws.amazon.com/secretsmanager/latest/userguide/monitoring.html#monitoring_cloudtrail) +// in the Amazon Web Services Secrets Manager User Guide. To learn more about +// CloudTrail, including enabling it and find your log files, see the Amazon Web +// Services CloudTrail User Guide (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html) +// . package secretsmanager diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/endpoints.go index a9c5bb12..347bcf0d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/endpoints.go @@ -8,10 +8,19 @@ 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" + "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" internalendpoints "github.com/aws/aws-sdk-go-v2/service/secretsmanager/internal/endpoints" + smithyauth "github.com/aws/smithy-go/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" "net/url" + "os" + "strings" ) // EndpointResolverOptions is the service endpoint resolver options @@ -38,13 +47,6 @@ func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointRe return fn(region, options) } -func resolveDefaultEndpointConfiguration(o *Options) { - if o.EndpointResolver != nil { - return - } - o.EndpointResolver = NewDefaultEndpointResolver() -} - // EndpointResolverFromURL returns an EndpointResolver configured using the // provided endpoint url. By default, the resolved endpoint resolver uses the // client region as signing region, and the endpoint source is set to @@ -78,6 +80,10 @@ func (*ResolveEndpoint) ID() string { func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -87,9 +93,17 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") } + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + var endpoint aws.Endpoint - endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), m.Options) + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) if err != nil { + nf := (&aws.EndpointNotFoundError{}) + if errors.As(err, &nf) { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) + return next.HandleSerialize(ctx, in) + } return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) } @@ -124,37 +138,467 @@ func removeResolveEndpointMiddleware(stack *middleware.Stack) error { } type wrappedEndpointResolver struct { - awsResolver aws.EndpointResolver - resolver EndpointResolver + awsResolver aws.EndpointResolverWithOptions } func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { - if w.awsResolver == nil { - goto fallback + return w.awsResolver.ResolveEndpoint(ServiceID, region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, +// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked +// via its middleware. +// +// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) } - endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region) - if err == nil { - return endpoint, nil + + return &wrappedEndpointResolver{ + awsResolver: resolver, } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" - if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { - return endpoint, err + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } } -fallback: - if w.resolver == nil { - return endpoint, fmt.Errorf("default endpoint resolver provided was nil") +} + +func resolveEndpointResolverV2(options *Options) { + if options.EndpointResolverV2 == nil { + options.EndpointResolverV2 = NewDefaultEndpointResolverV2() } - return w.resolver.ResolveEndpoint(region, options) } -// withEndpointResolver returns an EndpointResolver that first delegates endpoint -// resolution to the awsResolver. If awsResolver returns aws.EndpointNotFoundError -// error, the resolver will use the the provided fallbackResolver for resolution. -// awsResolver and fallbackResolver must not be nil -func withEndpointResolver(awsResolver aws.EndpointResolver, fallbackResolver EndpointResolver) EndpointResolver { - return &wrappedEndpointResolver{ - awsResolver: awsResolver, - resolver: fallbackResolver, +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_SECRETS_MANAGER") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "Secrets Manager", cfg.ConfigSources) + if found && err == nil { + o.BaseEndpoint = &value + } +} + +// EndpointParameters provides the parameters that influence how endpoints are +// resolved. +type EndpointParameters struct { + // The AWS region used to dispatch the request. + // + // Parameter is + // required. + // + // AWS::Region + Region *string + + // When true, use the dual-stack endpoint. If the configured endpoint does not + // support dual-stack, dispatching the request MAY return an error. + // + // Defaults to + // false if no value is provided. + // + // AWS::UseDualStack + UseDualStack *bool + + // When true, send this request to the FIPS-compliant regional endpoint. If the + // configured endpoint does not have a FIPS compliant endpoint, dispatching the + // request will return an error. + // + // Defaults to false if no value is + // provided. + // + // AWS::UseFIPS + UseFIPS *bool + + // Override the endpoint used to send this request + // + // Parameter is + // required. + // + // SDK::Endpoint + Endpoint *string +} + +// ValidateRequired validates required parameters are set. +func (p EndpointParameters) ValidateRequired() error { + if p.UseDualStack == nil { + return fmt.Errorf("parameter UseDualStack is required") + } + + if p.UseFIPS == nil { + return fmt.Errorf("parameter UseFIPS is required") + } + + return nil +} + +// WithDefaults returns a shallow copy of EndpointParameterswith default values +// applied to members where applicable. +func (p EndpointParameters) WithDefaults() EndpointParameters { + if p.UseDualStack == nil { + p.UseDualStack = ptr.Bool(false) + } + + if p.UseFIPS == nil { + p.UseFIPS = ptr.Bool(false) } + return p +} + +// EndpointResolverV2 provides the interface for resolving service endpoints. +type EndpointResolverV2 interface { + // ResolveEndpoint attempts to resolve the endpoint with the provided options, + // returning the endpoint if found. Otherwise an error is returned. + ResolveEndpoint(ctx context.Context, params EndpointParameters) ( + smithyendpoints.Endpoint, error, + ) +} + +// resolver provides the implementation for resolving endpoints. +type resolver struct{} + +func NewDefaultEndpointResolverV2() EndpointResolverV2 { + return &resolver{} +} + +// ResolveEndpoint attempts to resolve the endpoint with the provided options, +// returning the endpoint if found. Otherwise an error is returned. +func (r *resolver) ResolveEndpoint( + ctx context.Context, params EndpointParameters, +) ( + endpoint smithyendpoints.Endpoint, err error, +) { + params = params.WithDefaults() + if err = params.ValidateRequired(); err != nil { + return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) + } + _UseDualStack := *params.UseDualStack + _UseFIPS := *params.UseFIPS + + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if _UseFIPS == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") + } + if _UseDualStack == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") + } + uriString := _Endpoint + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if exprVal := params.Region; exprVal != nil { + _Region := *exprVal + _ = _Region + if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { + _PartitionResult := *exprVal + _ = _PartitionResult + if _UseFIPS == true { + if _UseDualStack == true { + if true == _PartitionResult.SupportsFIPS { + if true == _PartitionResult.SupportsDualStack { + if "aws" == _PartitionResult.Name { + uriString := func() string { + var out strings.Builder + out.WriteString("https://secretsmanager-fips.") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if "aws-us-gov" == _PartitionResult.Name { + uriString := func() string { + var out strings.Builder + out.WriteString("https://secretsmanager-fips.") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://secretsmanager-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") + } + } + if _UseFIPS == true { + if _PartitionResult.SupportsFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://secretsmanager-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") + } + if _UseDualStack == true { + if true == _PartitionResult.SupportsDualStack { + if "aws" == _PartitionResult.Name { + uriString := func() string { + var out strings.Builder + out.WriteString("https://secretsmanager.") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if "aws-cn" == _PartitionResult.Name { + uriString := func() string { + var out strings.Builder + out.WriteString("https://secretsmanager.") + out.WriteString(_Region) + out.WriteString(".amazonaws.com.cn") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if "aws-us-gov" == _PartitionResult.Name { + uriString := func() string { + var out strings.Builder + out.WriteString("https://secretsmanager.") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://secretsmanager.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://secretsmanager.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") +} + +type endpointParamsBinder interface { + bindEndpointParams(*EndpointParameters) +} + +func bindEndpointParams(input interface{}, options Options) *EndpointParameters { + params := &EndpointParameters{} + + params.Region = aws.String(endpoints.MapFIPSRegion(options.Region)) + params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) + params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) + params.Endpoint = options.BaseEndpoint + + if b, ok := input.(endpointParamsBinder); ok { + b.bindEndpointParams(params) + } + + return params +} + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.options.EndpointResolverV2 == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := bindEndpointParams(getOperationInput(ctx), m.options) + endpt, err := m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + if endpt.URI.RawPath == "" && req.URL.RawPath != "" { + endpt.URI.RawPath = endpt.URI.Path + } + req.URL.Scheme = endpt.URI.Scheme + req.URL.Host = endpt.URI.Host + req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) + req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) + for k := range endpt.Headers { + req.Header.Set(k, endpt.Headers.Get(k)) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) + for _, o := range opts { + rscheme.SignerProperties.SetAll(&o.SignerProperties) + } + + return next.HandleFinalize(ctx, in) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/generated.json new file mode 100644 index 00000000..eba7c923 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/generated.json @@ -0,0 +1,55 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", + "github.com/aws/smithy-go": "v1.4.0", + "github.com/google/go-cmp": "v0.5.4" + }, + "files": [ + "api_client.go", + "api_client_test.go", + "api_op_BatchGetSecretValue.go", + "api_op_CancelRotateSecret.go", + "api_op_CreateSecret.go", + "api_op_DeleteResourcePolicy.go", + "api_op_DeleteSecret.go", + "api_op_DescribeSecret.go", + "api_op_GetRandomPassword.go", + "api_op_GetResourcePolicy.go", + "api_op_GetSecretValue.go", + "api_op_ListSecretVersionIds.go", + "api_op_ListSecrets.go", + "api_op_PutResourcePolicy.go", + "api_op_PutSecretValue.go", + "api_op_RemoveRegionsFromReplication.go", + "api_op_ReplicateSecretToRegions.go", + "api_op_RestoreSecret.go", + "api_op_RotateSecret.go", + "api_op_StopReplicationToReplica.go", + "api_op_TagResource.go", + "api_op_UntagResource.go", + "api_op_UpdateSecret.go", + "api_op_UpdateSecretVersionStage.go", + "api_op_ValidateResourcePolicy.go", + "auth.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "endpoints_config_test.go", + "endpoints_test.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "options.go", + "protocol_test.go", + "serializers.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/secretsmanager", + "unstable": false +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/go_module_metadata.go new file mode 100644 index 00000000..06f6ae94 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package secretsmanager + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "1.26.2" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/internal/endpoints/endpoints.go index 8dd22ea3..4181a93f 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/internal/endpoints/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/internal/endpoints/endpoints.go @@ -4,13 +4,62 @@ package endpoints import ( "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/internal/endpoints" + endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" + "github.com/aws/smithy-go/logging" "regexp" ) // Options is the endpoint resolver configuration options type Options struct { + // Logger is a logging implementation that log events should be sent to. + Logger logging.Logger + + // LogDeprecated indicates that deprecated endpoints should be logged to the + // provided logger. + LogDeprecated bool + + // ResolvedRegion is used to override the region to be resolved, rather then the + // using the value passed to the ResolveEndpoint method. This value is used by the + // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative + // name. You must not set this value directly in your application. + ResolvedRegion string + + // DisableHTTPS informs the resolver to return an endpoint that does not use the + // HTTPS scheme. DisableHTTPS bool + + // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. + UseDualStackEndpoint aws.DualStackEndpointState + + // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. + UseFIPSEndpoint aws.FIPSEndpointState +} + +func (o Options) GetResolvedRegion() string { + return o.ResolvedRegion +} + +func (o Options) GetDisableHTTPS() bool { + return o.DisableHTTPS +} + +func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { + return o.UseDualStackEndpoint +} + +func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { + return o.UseFIPSEndpoint +} + +func transformToSharedOptions(options Options) endpoints.Options { + return endpoints.Options{ + Logger: options.Logger, + LogDeprecated: options.LogDeprecated, + ResolvedRegion: options.ResolvedRegion, + DisableHTTPS: options.DisableHTTPS, + UseDualStackEndpoint: options.UseDualStackEndpoint, + UseFIPSEndpoint: options.UseFIPSEndpoint, + } } // Resolver Secrets Manager endpoint resolver @@ -24,9 +73,7 @@ func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws return endpoint, &aws.MissingRegionError{} } - opt := endpoints.Options{ - DisableHTTPS: options.DisableHTTPS, - } + opt := transformToSharedOptions(options) return r.partitions.ResolveEndpoint(region, opt) } @@ -37,120 +84,566 @@ func New() *Resolver { } } +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsIsoE *regexp.Regexp + AwsIsoF *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), + AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + var defaultPartitions = endpoints.Partitions{ { ID: "aws", - Defaults: endpoints.Endpoint{ - Hostname: "secretsmanager.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "secretsmanager.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "secretsmanager-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "secretsmanager-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "secretsmanager.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, }, - RegionRegex: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), + RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ - "af-south-1": endpoints.Endpoint{}, - "ap-east-1": endpoints.Endpoint{}, - "ap-northeast-1": endpoints.Endpoint{}, - "ap-northeast-2": endpoints.Endpoint{}, - "ap-south-1": endpoints.Endpoint{}, - "ap-southeast-1": endpoints.Endpoint{}, - "ap-southeast-2": endpoints.Endpoint{}, - "ca-central-1": endpoints.Endpoint{}, - "eu-central-1": endpoints.Endpoint{}, - "eu-north-1": endpoints.Endpoint{}, - "eu-south-1": endpoints.Endpoint{}, - "eu-west-1": endpoints.Endpoint{}, - "eu-west-2": endpoints.Endpoint{}, - "eu-west-3": endpoints.Endpoint{}, - "me-south-1": endpoints.Endpoint{}, - "sa-east-1": endpoints.Endpoint{}, - "us-east-1": endpoints.Endpoint{}, - "us-east-1-fips": endpoints.Endpoint{ - Hostname: "secretsmanager-fips.us-east-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-east-1", - }, - }, - "us-east-2": endpoints.Endpoint{}, - "us-east-2-fips": endpoints.Endpoint{ - Hostname: "secretsmanager-fips.us-east-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-east-2", - }, - }, - "us-west-1": endpoints.Endpoint{}, - "us-west-1-fips": endpoints.Endpoint{ - Hostname: "secretsmanager-fips.us-west-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-west-1", - }, - }, - "us-west-2": endpoints.Endpoint{}, - "us-west-2-fips": endpoints.Endpoint{ - Hostname: "secretsmanager-fips.us-west-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-west-2", - }, + endpoints.EndpointKey{ + Region: "af-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "af-south-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ap-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-east-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ap-northeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ap-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ap-south-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-2", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ap-southeast-4", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-4", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ca-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-central-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ca-central-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ca-central-1", + Variant: endpoints.FIPSVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ca-central-1-fips", + }: endpoints.Endpoint{ + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "ca-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-west-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ca-west-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ca-west-1", + Variant: endpoints.FIPSVariant, + }: {}, + endpoints.EndpointKey{ + Region: "ca-west-1-fips", + }: endpoints.Endpoint{ + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "eu-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "eu-north-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-north-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "eu-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "eu-south-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-2", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "eu-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "eu-west-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-2", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "eu-west-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-3", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "il-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "il-central-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "me-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-central-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "me-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-south-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "sa-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "sa-east-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.FIPSVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-east-1-fips", + }: endpoints.Endpoint{ + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-east-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-2", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-east-2", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-east-2", + Variant: endpoints.FIPSVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-east-2-fips", + }: endpoints.Endpoint{ + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-west-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-west-1", + Variant: endpoints.FIPSVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-west-1-fips", + }: endpoints.Endpoint{ + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-west-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.FIPSVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-west-2-fips", + }: endpoints.Endpoint{ + Deprecated: aws.TrueTernary, }, }, }, { ID: "aws-cn", - Defaults: endpoints.Endpoint{ - Hostname: "secretsmanager.{region}.amazonaws.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "secretsmanager.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "secretsmanager-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "secretsmanager-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "secretsmanager.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, }, - RegionRegex: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + RegionRegex: partitionRegexp.AwsCn, IsRegionalized: true, Endpoints: endpoints.Endpoints{ - "cn-north-1": endpoints.Endpoint{}, - "cn-northwest-1": endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "cn-north-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "cn-north-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "cn-northwest-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "cn-northwest-1", + Variant: endpoints.DualStackVariant, + }: {}, }, }, { ID: "aws-iso", - Defaults: endpoints.Endpoint{ - Hostname: "secretsmanager.{region}.c2s.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "secretsmanager-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "secretsmanager.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, }, - RegionRegex: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + RegionRegex: partitionRegexp.AwsIso, IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-iso-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-iso-west-1", + }: endpoints.Endpoint{}, + }, }, { ID: "aws-iso-b", - Defaults: endpoints.Endpoint{ - Hostname: "secretsmanager.{region}.sc2s.sgov.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "secretsmanager-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "secretsmanager.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, }, - RegionRegex: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-isob-east-1", + }: endpoints.Endpoint{}, + }, + }, + { + ID: "aws-iso-e", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "secretsmanager-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "secretsmanager.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoE, + IsRegionalized: true, + }, + { + ID: "aws-iso-f", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "secretsmanager-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "secretsmanager.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoF, IsRegionalized: true, }, { ID: "aws-us-gov", - Defaults: endpoints.Endpoint{ - Hostname: "secretsmanager.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "secretsmanager.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "secretsmanager-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "secretsmanager-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "secretsmanager.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, }, - RegionRegex: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), + RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, Endpoints: endpoints.Endpoints{ - "us-gov-east-1": endpoints.Endpoint{}, - "us-gov-east-1-fips": endpoints.Endpoint{ - Hostname: "secretsmanager-fips.us-gov-east-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-gov-east-1", - }, - }, - "us-gov-west-1": endpoints.Endpoint{}, - "us-gov-west-1-fips": endpoints.Endpoint{ - Hostname: "secretsmanager-fips.us-gov-west-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-gov-west-1", - }, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + Variant: endpoints.FIPSVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-gov-east-1-fips", + }: endpoints.Endpoint{ + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + Variant: endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + Variant: endpoints.FIPSVariant, + }: {}, + endpoints.EndpointKey{ + Region: "us-gov-west-1-fips", + }: endpoints.Endpoint{ + Deprecated: aws.TrueTernary, }, }, }, diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/options.go new file mode 100644 index 00000000..a8817523 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/options.go @@ -0,0 +1,221 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" +) + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // The optional application specific identifier appended to the User-Agent header. + AppID string + + // This endpoint will be given as input to an EndpointResolverV2. It is used for + // providing a custom base endpoint that is subject to modifications by the + // processing EndpointResolverV2. + BaseEndpoint *string + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + // + // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a + // value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. To migrate an EndpointResolver implementation that uses a custom + // endpoint, set the client option BaseEndpoint instead. + EndpointResolver EndpointResolver + + // Resolves the endpoint used for a particular service operation. This should be + // used over the deprecated EndpointResolver. + EndpointResolverV2 EndpointResolverV2 + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // Provides idempotency tokens values that will be automatically populated into + // idempotent API operations. + IdempotencyTokenProvider IdempotencyTokenProvider + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. If specified in an operation call's + // functional options with a value that is different than the constructed client's + // Options, the Client's Retryer will be wrapped to use the operation's specific + // RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. Currently does not support per operation call + // overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. Currently does not support per operation call + // overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient + + // The auth scheme resolver which determines how to authenticate for each + // operation. + AuthSchemeResolver AuthSchemeResolver + + // The list of auth schemes supported by the client. + AuthSchemes []smithyhttp.AuthScheme +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} + +func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { + if schemeID == "aws.auth#sigv4" { + return getSigV4IdentityResolver(o) + } + if schemeID == "smithy.api#noAuth" { + return &smithyauth.AnonymousIdentityResolver{} + } + return nil +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for +// this field will likely prevent you from using any endpoint-related service +// features released after the introduction of EndpointResolverV2 and BaseEndpoint. +// To migrate an EndpointResolver implementation that uses a custom endpoint, set +// the client option BaseEndpoint instead. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +// WithEndpointResolverV2 returns a functional option for setting the Client's +// EndpointResolverV2 option. +func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { + return func(o *Options) { + o.EndpointResolverV2 = v + } +} + +func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { + if o.Credentials != nil { + return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} + } + return nil +} + +// WithSigV4SigningName applies an override to the authentication workflow to +// use the given signing name for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing name from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningName(name string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), + middleware.Before, + ) + }) + } +} + +// WithSigV4SigningRegion applies an override to the authentication workflow to +// use the given signing region for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing region from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningRegion(region string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), + middleware.Before, + ) + }) + } +} + +func ignoreAnonymousAuth(options *Options) { + if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { + options.Credentials = nil + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/serializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/serializers.go index bb042185..564feb18 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/serializers.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/serializers.go @@ -12,8 +12,64 @@ import ( smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" + "path" ) +type awsAwsjson11_serializeOpBatchGetSecretValue struct { +} + +func (*awsAwsjson11_serializeOpBatchGetSecretValue) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpBatchGetSecretValue) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*BatchGetSecretValueInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("secretsmanager.BatchGetSecretValue") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentBatchGetSecretValueInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpCancelRotateSecret struct { } @@ -35,7 +91,15 @@ func (m *awsAwsjson11_serializeOpCancelRotateSecret) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -82,7 +146,15 @@ func (m *awsAwsjson11_serializeOpCreateSecret) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -129,7 +201,15 @@ func (m *awsAwsjson11_serializeOpDeleteResourcePolicy) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -176,7 +256,15 @@ func (m *awsAwsjson11_serializeOpDeleteSecret) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -223,7 +311,15 @@ func (m *awsAwsjson11_serializeOpDescribeSecret) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -270,7 +366,15 @@ func (m *awsAwsjson11_serializeOpGetRandomPassword) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -317,7 +421,15 @@ func (m *awsAwsjson11_serializeOpGetResourcePolicy) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -364,7 +476,15 @@ func (m *awsAwsjson11_serializeOpGetSecretValue) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -411,7 +531,15 @@ func (m *awsAwsjson11_serializeOpListSecrets) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -458,7 +586,15 @@ func (m *awsAwsjson11_serializeOpListSecretVersionIds) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -505,7 +641,15 @@ func (m *awsAwsjson11_serializeOpPutResourcePolicy) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -552,7 +696,15 @@ func (m *awsAwsjson11_serializeOpPutSecretValue) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -578,6 +730,116 @@ func (m *awsAwsjson11_serializeOpPutSecretValue) HandleSerialize(ctx context.Con return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpRemoveRegionsFromReplication struct { +} + +func (*awsAwsjson11_serializeOpRemoveRegionsFromReplication) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpRemoveRegionsFromReplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RemoveRegionsFromReplicationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("secretsmanager.RemoveRegionsFromReplication") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentRemoveRegionsFromReplicationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpReplicateSecretToRegions struct { +} + +func (*awsAwsjson11_serializeOpReplicateSecretToRegions) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpReplicateSecretToRegions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ReplicateSecretToRegionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("secretsmanager.ReplicateSecretToRegions") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentReplicateSecretToRegionsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpRestoreSecret struct { } @@ -599,7 +861,15 @@ func (m *awsAwsjson11_serializeOpRestoreSecret) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -646,7 +916,15 @@ func (m *awsAwsjson11_serializeOpRotateSecret) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -672,6 +950,61 @@ func (m *awsAwsjson11_serializeOpRotateSecret) HandleSerialize(ctx context.Conte return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpStopReplicationToReplica struct { +} + +func (*awsAwsjson11_serializeOpStopReplicationToReplica) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpStopReplicationToReplica) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StopReplicationToReplicaInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("secretsmanager.StopReplicationToReplica") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentStopReplicationToReplicaInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpTagResource struct { } @@ -693,7 +1026,15 @@ func (m *awsAwsjson11_serializeOpTagResource) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -740,7 +1081,15 @@ func (m *awsAwsjson11_serializeOpUntagResource) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -787,7 +1136,15 @@ func (m *awsAwsjson11_serializeOpUpdateSecret) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -834,7 +1191,15 @@ func (m *awsAwsjson11_serializeOpUpdateSecretVersionStage) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -881,7 +1246,15 @@ func (m *awsAwsjson11_serializeOpValidateResourcePolicy) HandleSerialize(ctx con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -906,6 +1279,19 @@ func (m *awsAwsjson11_serializeOpValidateResourcePolicy) HandleSerialize(ctx con return next.HandleSerialize(ctx, in) } +func awsAwsjson11_serializeDocumentAddReplicaRegionListType(v []types.ReplicaRegionType, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentReplicaRegionType(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsjson11_serializeDocumentFilter(v *types.Filter, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -949,18 +1335,67 @@ func awsAwsjson11_serializeDocumentFilterValuesStringList(v []string, value smit return nil } +func awsAwsjson11_serializeDocumentRemoveReplicaRegionListType(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentReplicaRegionType(v *types.ReplicaRegionType, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.KmsKeyId != nil { + ok := object.Key("KmsKeyId") + ok.String(*v.KmsKeyId) + } + + if v.Region != nil { + ok := object.Key("Region") + ok.String(*v.Region) + } + + return nil +} + func awsAwsjson11_serializeDocumentRotationRulesType(v *types.RotationRulesType, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.AutomaticallyAfterDays != 0 { + if v.AutomaticallyAfterDays != nil { ok := object.Key("AutomaticallyAfterDays") - ok.Long(v.AutomaticallyAfterDays) + ok.Long(*v.AutomaticallyAfterDays) + } + + if v.Duration != nil { + ok := object.Key("Duration") + ok.String(*v.Duration) + } + + if v.ScheduleExpression != nil { + ok := object.Key("ScheduleExpression") + ok.String(*v.ScheduleExpression) } return nil } +func awsAwsjson11_serializeDocumentSecretIdListType(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsAwsjson11_serializeDocumentSecretVersionStagesType(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -1013,6 +1448,37 @@ func awsAwsjson11_serializeDocumentTagListType(v []types.Tag, value smithyjson.V return nil } +func awsAwsjson11_serializeOpDocumentBatchGetSecretValueInput(v *BatchGetSecretValueInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("Filters") + if err := awsAwsjson11_serializeDocumentFiltersListType(v.Filters, ok); err != nil { + return err + } + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if v.SecretIdList != nil { + ok := object.Key("SecretIdList") + if err := awsAwsjson11_serializeDocumentSecretIdListType(v.SecretIdList, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentCancelRotateSecretInput(v *CancelRotateSecretInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1029,6 +1495,13 @@ func awsAwsjson11_serializeOpDocumentCreateSecretInput(v *CreateSecretInput, val object := value.Object() defer object.Close() + if v.AddReplicaRegions != nil { + ok := object.Key("AddReplicaRegions") + if err := awsAwsjson11_serializeDocumentAddReplicaRegionListType(v.AddReplicaRegions, ok); err != nil { + return err + } + } + if v.ClientRequestToken != nil { ok := object.Key("ClientRequestToken") ok.String(*v.ClientRequestToken) @@ -1039,6 +1512,11 @@ func awsAwsjson11_serializeOpDocumentCreateSecretInput(v *CreateSecretInput, val ok.String(*v.Description) } + if v.ForceOverwriteReplicaSecret { + ok := object.Key("ForceOverwriteReplicaSecret") + ok.Boolean(v.ForceOverwriteReplicaSecret) + } + if v.KmsKeyId != nil { ok := object.Key("KmsKeyId") ok.String(*v.KmsKeyId) @@ -1085,14 +1563,14 @@ func awsAwsjson11_serializeOpDocumentDeleteSecretInput(v *DeleteSecretInput, val object := value.Object() defer object.Close() - if v.ForceDeleteWithoutRecovery { + if v.ForceDeleteWithoutRecovery != nil { ok := object.Key("ForceDeleteWithoutRecovery") - ok.Boolean(v.ForceDeleteWithoutRecovery) + ok.Boolean(*v.ForceDeleteWithoutRecovery) } - if v.RecoveryWindowInDays != 0 { + if v.RecoveryWindowInDays != nil { ok := object.Key("RecoveryWindowInDays") - ok.Long(v.RecoveryWindowInDays) + ok.Long(*v.RecoveryWindowInDays) } if v.SecretId != nil { @@ -1124,39 +1602,39 @@ func awsAwsjson11_serializeOpDocumentGetRandomPasswordInput(v *GetRandomPassword ok.String(*v.ExcludeCharacters) } - if v.ExcludeLowercase { + if v.ExcludeLowercase != nil { ok := object.Key("ExcludeLowercase") - ok.Boolean(v.ExcludeLowercase) + ok.Boolean(*v.ExcludeLowercase) } - if v.ExcludeNumbers { + if v.ExcludeNumbers != nil { ok := object.Key("ExcludeNumbers") - ok.Boolean(v.ExcludeNumbers) + ok.Boolean(*v.ExcludeNumbers) } - if v.ExcludePunctuation { + if v.ExcludePunctuation != nil { ok := object.Key("ExcludePunctuation") - ok.Boolean(v.ExcludePunctuation) + ok.Boolean(*v.ExcludePunctuation) } - if v.ExcludeUppercase { + if v.ExcludeUppercase != nil { ok := object.Key("ExcludeUppercase") - ok.Boolean(v.ExcludeUppercase) + ok.Boolean(*v.ExcludeUppercase) } - if v.IncludeSpace { + if v.IncludeSpace != nil { ok := object.Key("IncludeSpace") - ok.Boolean(v.IncludeSpace) + ok.Boolean(*v.IncludeSpace) } - if v.PasswordLength != 0 { + if v.PasswordLength != nil { ok := object.Key("PasswordLength") - ok.Long(v.PasswordLength) + ok.Long(*v.PasswordLength) } - if v.RequireEachIncludedType { + if v.RequireEachIncludedType != nil { ok := object.Key("RequireEachIncludedType") - ok.Boolean(v.RequireEachIncludedType) + ok.Boolean(*v.RequireEachIncludedType) } return nil @@ -1207,9 +1685,14 @@ func awsAwsjson11_serializeOpDocumentListSecretsInput(v *ListSecretsInput, value } } - if v.MaxResults != 0 { + if v.IncludePlannedDeletion != nil { + ok := object.Key("IncludePlannedDeletion") + ok.Boolean(*v.IncludePlannedDeletion) + } + + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -1229,14 +1712,14 @@ func awsAwsjson11_serializeOpDocumentListSecretVersionIdsInput(v *ListSecretVers object := value.Object() defer object.Close() - if v.IncludeDeprecated { + if v.IncludeDeprecated != nil { ok := object.Key("IncludeDeprecated") - ok.Boolean(v.IncludeDeprecated) + ok.Boolean(*v.IncludeDeprecated) } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -1256,9 +1739,9 @@ func awsAwsjson11_serializeOpDocumentPutResourcePolicyInput(v *PutResourcePolicy object := value.Object() defer object.Close() - if v.BlockPublicPolicy { + if v.BlockPublicPolicy != nil { ok := object.Key("BlockPublicPolicy") - ok.Boolean(v.BlockPublicPolicy) + ok.Boolean(*v.BlockPublicPolicy) } if v.ResourcePolicy != nil { @@ -1308,6 +1791,49 @@ func awsAwsjson11_serializeOpDocumentPutSecretValueInput(v *PutSecretValueInput, return nil } +func awsAwsjson11_serializeOpDocumentRemoveRegionsFromReplicationInput(v *RemoveRegionsFromReplicationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.RemoveReplicaRegions != nil { + ok := object.Key("RemoveReplicaRegions") + if err := awsAwsjson11_serializeDocumentRemoveReplicaRegionListType(v.RemoveReplicaRegions, ok); err != nil { + return err + } + } + + if v.SecretId != nil { + ok := object.Key("SecretId") + ok.String(*v.SecretId) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentReplicateSecretToRegionsInput(v *ReplicateSecretToRegionsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AddReplicaRegions != nil { + ok := object.Key("AddReplicaRegions") + if err := awsAwsjson11_serializeDocumentAddReplicaRegionListType(v.AddReplicaRegions, ok); err != nil { + return err + } + } + + if v.ForceOverwriteReplicaSecret { + ok := object.Key("ForceOverwriteReplicaSecret") + ok.Boolean(v.ForceOverwriteReplicaSecret) + } + + if v.SecretId != nil { + ok := object.Key("SecretId") + ok.String(*v.SecretId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentRestoreSecretInput(v *RestoreSecretInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1329,6 +1855,11 @@ func awsAwsjson11_serializeOpDocumentRotateSecretInput(v *RotateSecretInput, val ok.String(*v.ClientRequestToken) } + if v.RotateImmediately != nil { + ok := object.Key("RotateImmediately") + ok.Boolean(*v.RotateImmediately) + } + if v.RotationLambdaARN != nil { ok := object.Key("RotationLambdaARN") ok.String(*v.RotationLambdaARN) @@ -1349,6 +1880,18 @@ func awsAwsjson11_serializeOpDocumentRotateSecretInput(v *RotateSecretInput, val return nil } +func awsAwsjson11_serializeOpDocumentStopReplicationToReplicaInput(v *StopReplicationToReplicaInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SecretId != nil { + ok := object.Key("SecretId") + ok.String(*v.SecretId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/types/enums.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/types/enums.go index 8b957cfd..84f46d0b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/types/enums.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/types/enums.go @@ -6,11 +6,13 @@ type FilterNameStringType string // Enum values for FilterNameStringType const ( - FilterNameStringTypeDescription FilterNameStringType = "description" - FilterNameStringTypeName FilterNameStringType = "name" - FilterNameStringTypeTagKey FilterNameStringType = "tag-key" - FilterNameStringTypeTagValue FilterNameStringType = "tag-value" - FilterNameStringTypeAll FilterNameStringType = "all" + FilterNameStringTypeDescription FilterNameStringType = "description" + FilterNameStringTypeName FilterNameStringType = "name" + FilterNameStringTypeTagKey FilterNameStringType = "tag-key" + FilterNameStringTypeTagValue FilterNameStringType = "tag-value" + FilterNameStringTypePrimaryRegion FilterNameStringType = "primary-region" + FilterNameStringTypeOwningService FilterNameStringType = "owning-service" + FilterNameStringTypeAll FilterNameStringType = "all" ) // Values returns all known values for FilterNameStringType. Note that this can be @@ -22,6 +24,8 @@ func (FilterNameStringType) Values() []FilterNameStringType { "name", "tag-key", "tag-value", + "primary-region", + "owning-service", "all", } } @@ -43,3 +47,23 @@ func (SortOrderType) Values() []SortOrderType { "desc", } } + +type StatusType string + +// Enum values for StatusType +const ( + StatusTypeInSync StatusType = "InSync" + StatusTypeFailed StatusType = "Failed" + StatusTypeInProgress StatusType = "InProgress" +) + +// Values returns all known values for StatusType. Note that this can be expanded +// in the future, and so it is only as up to date as the client. The ordering of +// this slice is not guaranteed to be stable across updates. +func (StatusType) Values() []StatusType { + return []StatusType{ + "InSync", + "Failed", + "InProgress", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/types/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/types/errors.go index 65fd6ecc..aff130bb 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/types/errors.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/types/errors.go @@ -11,6 +11,10 @@ import ( // key. type DecryptionFailure struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *DecryptionFailure) Error() string { @@ -22,16 +26,24 @@ func (e *DecryptionFailure) ErrorMessage() string { } return *e.Message } -func (e *DecryptionFailure) ErrorCode() string { return "DecryptionFailure" } +func (e *DecryptionFailure) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DecryptionFailure" + } + return *e.ErrorCodeOverride +} func (e *DecryptionFailure) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Secrets Manager can't encrypt the protected secret text using the provided KMS -// key. Check that the customer master key (CMK) is available, enabled, and not in -// an invalid state. For more information, see How Key State Affects Use of a -// Customer Master Key -// (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html). +// key. Check that the KMS key is available, enabled, and not in an invalid state. +// For more information, see Key state: Effect on your KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// . type EncryptionFailure struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *EncryptionFailure) Error() string { @@ -43,12 +55,21 @@ func (e *EncryptionFailure) ErrorMessage() string { } return *e.Message } -func (e *EncryptionFailure) ErrorCode() string { return "EncryptionFailure" } +func (e *EncryptionFailure) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "EncryptionFailure" + } + return *e.ErrorCodeOverride +} func (e *EncryptionFailure) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // An error occurred on the server side. type InternalServiceError struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InternalServiceError) Error() string { @@ -60,12 +81,21 @@ func (e *InternalServiceError) ErrorMessage() string { } return *e.Message } -func (e *InternalServiceError) ErrorCode() string { return "InternalServiceError" } +func (e *InternalServiceError) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InternalServiceError" + } + return *e.ErrorCodeOverride +} func (e *InternalServiceError) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } -// You provided an invalid NextToken value. +// The NextToken value is invalid. type InvalidNextTokenException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidNextTokenException) Error() string { @@ -77,12 +107,21 @@ func (e *InvalidNextTokenException) ErrorMessage() string { } return *e.Message } -func (e *InvalidNextTokenException) ErrorCode() string { return "InvalidNextTokenException" } +func (e *InvalidNextTokenException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidNextTokenException" + } + return *e.ErrorCodeOverride +} func (e *InvalidNextTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// You provided an invalid value for a parameter. +// The parameter name or value is invalid. type InvalidParameterException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidParameterException) Error() string { @@ -94,20 +133,30 @@ func (e *InvalidParameterException) ErrorMessage() string { } return *e.Message } -func (e *InvalidParameterException) ErrorCode() string { return "InvalidParameterException" } +func (e *InvalidParameterException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidParameterException" + } + return *e.ErrorCodeOverride +} func (e *InvalidParameterException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// You provided a parameter value that is not valid for the current state of the -// resource. Possible causes: -// -// * You tried to perform the operation on a secret -// that's currently marked deleted. -// -// * You tried to enable rotation on a secret -// that doesn't already have a Lambda function ARN configured and you didn't -// include such an ARN as a parameter in this call. +// A parameter value is not valid for the current state of the resource. Possible +// causes: +// - The secret is scheduled for deletion. +// - You tried to enable rotation on a secret that doesn't already have a Lambda +// function ARN configured and you didn't include such an ARN as a parameter in +// this call. +// - The secret is managed by another service, and you must use that service to +// update it. For more information, see Secrets managed by other Amazon Web +// Services services (https://docs.aws.amazon.com/secretsmanager/latest/userguide/service-linked-secrets.html) +// . type InvalidRequestException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidRequestException) Error() string { @@ -119,13 +168,21 @@ func (e *InvalidRequestException) ErrorMessage() string { } return *e.Message } -func (e *InvalidRequestException) ErrorCode() string { return "InvalidRequestException" } +func (e *InvalidRequestException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidRequestException" + } + return *e.ErrorCodeOverride +} func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The request failed because it would exceed one of the Secrets Manager internal -// limits. +// The request failed because it would exceed one of the Secrets Manager quotas. type LimitExceededException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *LimitExceededException) Error() string { @@ -137,12 +194,21 @@ func (e *LimitExceededException) ErrorMessage() string { } return *e.Message } -func (e *LimitExceededException) ErrorCode() string { return "LimitExceededException" } +func (e *LimitExceededException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "LimitExceededException" + } + return *e.ErrorCodeOverride +} func (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The policy document that you provided isn't valid. +// The resource policy has syntax errors. type MalformedPolicyDocumentException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *MalformedPolicyDocumentException) Error() string { @@ -155,13 +221,20 @@ func (e *MalformedPolicyDocumentException) ErrorMessage() string { return *e.Message } func (e *MalformedPolicyDocumentException) ErrorCode() string { - return "MalformedPolicyDocumentException" + if e == nil || e.ErrorCodeOverride == nil { + return "MalformedPolicyDocumentException" + } + return *e.ErrorCodeOverride } func (e *MalformedPolicyDocumentException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request failed because you did not complete all the prerequisite steps. type PreconditionNotMetException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *PreconditionNotMetException) Error() string { @@ -173,12 +246,22 @@ func (e *PreconditionNotMetException) ErrorMessage() string { } return *e.Message } -func (e *PreconditionNotMetException) ErrorCode() string { return "PreconditionNotMetException" } +func (e *PreconditionNotMetException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "PreconditionNotMetException" + } + return *e.ErrorCodeOverride +} func (e *PreconditionNotMetException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The resource policy did not prevent broad access to the secret. +// The BlockPublicPolicy parameter is set to true, and the resource policy did not +// prevent broad access to the secret. type PublicPolicyException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *PublicPolicyException) Error() string { @@ -190,12 +273,21 @@ func (e *PublicPolicyException) ErrorMessage() string { } return *e.Message } -func (e *PublicPolicyException) ErrorCode() string { return "PublicPolicyException" } +func (e *PublicPolicyException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "PublicPolicyException" + } + return *e.ErrorCodeOverride +} func (e *PublicPolicyException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // A resource with the ID you requested already exists. type ResourceExistsException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *ResourceExistsException) Error() string { @@ -207,12 +299,21 @@ func (e *ResourceExistsException) ErrorMessage() string { } return *e.Message } -func (e *ResourceExistsException) ErrorCode() string { return "ResourceExistsException" } +func (e *ResourceExistsException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceExistsException" + } + return *e.ErrorCodeOverride +} func (e *ResourceExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// We can't find the resource that you asked for. +// Secrets Manager can't find the resource that you asked for. type ResourceNotFoundException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *ResourceNotFoundException) Error() string { @@ -224,5 +325,10 @@ func (e *ResourceNotFoundException) ErrorMessage() string { } return *e.Message } -func (e *ResourceNotFoundException) ErrorCode() string { return "ResourceNotFoundException" } +func (e *ResourceNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceNotFoundException" + } + return *e.ErrorCodeOverride +} func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/types/types.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/types/types.go index a2602503..e04e17e7 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/types/types.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/types/types.go @@ -3,41 +3,146 @@ package types import ( + smithydocument "github.com/aws/smithy-go/document" "time" ) -// Allows you to filter your list of secrets. +// The error Secrets Manager encountered while retrieving an individual secret as +// part of BatchGetSecretValue . +type APIErrorType struct { + + // The error Secrets Manager encountered while retrieving an individual secret as + // part of BatchGetSecretValue , for example ResourceNotFoundException , + // InvalidParameterException , InvalidRequestException , DecryptionFailure , or + // AccessDeniedException . + ErrorCode *string + + // A message describing the error. + Message *string + + // The ARN or name of the secret. + SecretId *string + + noSmithyDocumentSerde +} + +// Allows you to add filters when you use the search function in Secrets Manager. +// For more information, see Find secrets in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/manage_search-secret.html) +// . type Filter struct { - // Filters your list of secrets by a specific key. + // The following are keys you can use: + // - description: Prefix match, not case-sensitive. + // - name: Prefix match, case-sensitive. + // - tag-key: Prefix match, case-sensitive. + // - tag-value: Prefix match, case-sensitive. + // - primary-region: Prefix match, case-sensitive. + // - owning-service: Prefix match, case-sensitive. + // - all: Breaks the filter value string into words and then searches all + // attributes for matches. Not case-sensitive. Key FilterNameStringType - // Filters your list of secrets by a specific value. + // The keyword to filter for. You can prefix your search value with an exclamation + // mark ( ! ) in order to perform negation filters. Values []string + + noSmithyDocumentSerde +} + +// A custom type that specifies a Region and the KmsKeyId for a replica secret. +type ReplicaRegionType struct { + + // The ARN, key ID, or alias of the KMS key to encrypt the secret. If you don't + // include this field, Secrets Manager uses aws/secretsmanager . + KmsKeyId *string + + // A Region code. For a list of Region codes, see Name and code of Regions (https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints) + // . + Region *string + + noSmithyDocumentSerde +} + +// A replication object consisting of a RegionReplicationStatus object and +// includes a Region, KMSKeyId, status, and status message. +type ReplicationStatusType struct { + + // Can be an ARN , Key ID , or Alias . + KmsKeyId *string + + // The date that the secret was last accessed in the Region. This field is omitted + // if the secret has never been retrieved in the Region. + LastAccessedDate *time.Time + + // The Region where replication occurs. + Region *string + + // The status can be InProgress , Failed , or InSync . + Status StatusType + + // Status message such as "Secret with this name already exists in this region". + StatusMessage *string + + noSmithyDocumentSerde } // A structure that defines the rotation configuration for the secret. type RotationRulesType struct { - // Specifies the number of days between automatic scheduled rotations of the - // secret. Secrets Manager schedules the next rotation when the previous one is - // complete. Secrets Manager schedules the date by adding the rotation interval - // (number of days) to the actual date of the last rotation. The service chooses - // the hour within that 24-hour date window randomly. The minute is also chosen - // somewhat randomly, but weighted towards the top of the hour and influenced by a - // variety of factors that help distribute load. - AutomaticallyAfterDays int64 + // The number of days between rotations of the secret. You can use this value to + // check that your secret meets your compliance guidelines for how often secrets + // must be rotated. If you use this field to set the rotation schedule, Secrets + // Manager calculates the next rotation date based on the previous rotation. + // Manually updating the secret value by calling PutSecretValue or UpdateSecret is + // considered a valid rotation. In DescribeSecret and ListSecrets , this value is + // calculated from the rotation schedule after every successful rotation. In + // RotateSecret , you can set the rotation schedule in RotationRules with + // AutomaticallyAfterDays or ScheduleExpression , but not both. To set a rotation + // schedule in hours, use ScheduleExpression . + AutomaticallyAfterDays *int64 + + // The length of the rotation window in hours, for example 3h for a three hour + // window. Secrets Manager rotates your secret at any time during this window. The + // window must not extend into the next rotation window or the next UTC day. The + // window starts according to the ScheduleExpression . If you don't specify a + // Duration , for a ScheduleExpression in hours, the window automatically closes + // after one hour. For a ScheduleExpression in days, the window automatically + // closes at the end of the UTC day. For more information, including examples, see + // Schedule expressions in Secrets Manager rotation (https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_schedule.html) + // in the Secrets Manager Users Guide. + Duration *string + + // A cron() or rate() expression that defines the schedule for rotating your + // secret. Secrets Manager rotation schedules use UTC time zone. Secrets Manager + // rotates your secret any time during a rotation window. Secrets Manager rate() + // expressions represent the interval in hours or days that you want to rotate your + // secret, for example rate(12 hours) or rate(10 days) . You can rotate a secret as + // often as every four hours. If you use a rate() expression, the rotation window + // starts at midnight. For a rate in hours, the default rotation window closes + // after one hour. For a rate in days, the default rotation window closes at the + // end of the day. You can set the Duration to change the rotation window. The + // rotation window must not extend into the next UTC day or into the next rotation + // window. You can use a cron() expression to create a rotation schedule that is + // more detailed than a rotation interval. For more information, including + // examples, see Schedule expressions in Secrets Manager rotation (https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_schedule.html) + // in the Secrets Manager Users Guide. For a cron expression that represents a + // schedule in hours, the default rotation window closes after one hour. For a cron + // expression that represents a schedule in days, the default rotation window + // closes at the end of the day. You can set the Duration to change the rotation + // window. The rotation window must not extend into the next UTC day or into the + // next rotation window. + ScheduleExpression *string + + noSmithyDocumentSerde } // A structure that contains the details about a secret. It does not include the -// encrypted SecretString and SecretBinary values. To get those values, use the -// GetSecretValue operation. +// encrypted SecretString and SecretBinary values. To get those values, use +// GetSecretValue (https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html) +// . type SecretListEntry struct { - // The Amazon Resource Name (ARN) of the secret. For more information about ARNs in - // Secrets Manager, see Policy Resources - // (https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#iam-resources) - // in the AWS Secrets Manager User Guide. + // The Amazon Resource Name (ARN) of the secret. ARN *string // The date and time when a secret was created. @@ -46,43 +151,50 @@ type SecretListEntry struct { // The date and time the deletion of the secret occurred. Not present on active // secrets. The secret can be recovered until the number of days in the recovery // window has passed, as specified in the RecoveryWindowInDays parameter of the - // DeleteSecret operation. + // DeleteSecret (https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_DeleteSecret.html) + // operation. DeletedDate *time.Time // The user-provided description of the secret. Description *string - // The ARN or alias of the AWS KMS customer master key (CMK) used to encrypt the - // SecretString and SecretBinary fields in each version of the secret. If you don't - // provide a key, then Secrets Manager defaults to encrypting the secret fields - // with the default KMS CMK, the key named awssecretsmanager, for this account. + // The ARN of the KMS key that Secrets Manager uses to encrypt the secret value. + // If the secret is encrypted with the Amazon Web Services managed key + // aws/secretsmanager , this field is omitted. KmsKeyId *string - // The last date that this secret was accessed. This value is truncated to midnight - // of the date and therefore shows only the date, not the time. + // The date that the secret was last accessed in the Region. This field is omitted + // if the secret has never been retrieved in the Region. LastAccessedDate *time.Time // The last date and time that this secret was modified in any way. LastChangedDate *time.Time - // The last date and time that the rotation process for this secret was invoked. + // The most recent date and time that the Secrets Manager rotation process was + // successfully completed. This value is null if the secret hasn't ever rotated. LastRotatedDate *time.Time - // The friendly name of the secret. You can use forward slashes in the name to - // represent a path hierarchy. For example, /prod/databases/dbserver1 could - // represent the secret for a server named dbserver1 in the folder databases in the - // folder prod. + // The friendly name of the secret. Name *string + // The next rotation is scheduled to occur on or before this date. If the secret + // isn't configured for rotation or rotation has been disabled, Secrets Manager + // returns null. + NextRotationDate *time.Time + // Returns the name of the service that created the secret. OwningService *string + // The Region where Secrets Manager originated the secret. + PrimaryRegion *string + // Indicates whether automatic, scheduled rotation is enabled for this secret. - RotationEnabled bool + RotationEnabled *bool - // The ARN of an AWS Lambda function invoked by Secrets Manager to rotate and - // expire the secret either automatically per the schedule or manually by a call to - // RotateSecret. + // The ARN of an Amazon Web Services Lambda function invoked by Secrets Manager to + // rotate and expire the secret either automatically per the schedule or manually + // by a call to RotateSecret (https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_RotateSecret.html) + // . RotationLambdaARN *string // A structure that defines the rotation configuration for the secret. @@ -96,8 +208,43 @@ type SecretListEntry struct { SecretVersionsToStages map[string][]string // The list of user-defined tags associated with the secret. To add tags to a - // secret, use TagResource. To remove tags, use UntagResource. + // secret, use TagResource (https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_TagResource.html) + // . To remove tags, use UntagResource (https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_UntagResource.html) + // . Tags []Tag + + noSmithyDocumentSerde +} + +// A structure that contains the secret value and other details for a secret. +type SecretValueEntry struct { + + // The Amazon Resource Name (ARN) of the secret. + ARN *string + + // The date the secret was created. + CreatedDate *time.Time + + // The friendly name of the secret. + Name *string + + // The decrypted secret value, if the secret value was originally provided as + // binary data in the form of a byte array. The parameter represents the binary + // data as a base64-encoded (https://tools.ietf.org/html/rfc4648#section-4) string. + SecretBinary []byte + + // The decrypted secret value, if the secret value was originally provided as a + // string or through the Secrets Manager console. + SecretString *string + + // The unique version identifier of this version of the secret. + VersionId *string + + // A list of all of the staging labels currently attached to this version of the + // secret. + VersionStages []string + + noSmithyDocumentSerde } // A structure that contains information about one version of a secret. @@ -106,6 +253,9 @@ type SecretVersionsListEntry struct { // The date and time this version of the secret was created. CreatedDate *time.Time + // The KMS keys used to encrypt the secret version. + KmsKeyIds []string + // The date that this version of the secret was last accessed. Note that the // resolution of this field is at the date level and does not include the time. LastAccessedDate *time.Time @@ -116,6 +266,8 @@ type SecretVersionsListEntry struct { // An array of staging labels that are currently associated with this version of // the secret. VersionStages []string + + noSmithyDocumentSerde } // A structure that contains information about a tag. @@ -126,6 +278,8 @@ type Tag struct { // The string value associated with the key of the tag. Value *string + + noSmithyDocumentSerde } // Displays errors that occurred during validation of the resource policy. @@ -137,4 +291,8 @@ type ValidationErrorsEntry struct { // Displays error messages if validation encounters problems during validation of // the resource policy. ErrorMessage *string + + noSmithyDocumentSerde } + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/validators.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/validators.go index 344d39f6..90159c6c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/validators.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/validators.go @@ -209,6 +209,46 @@ func (m *validateOpPutSecretValue) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpRemoveRegionsFromReplication struct { +} + +func (*validateOpRemoveRegionsFromReplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRemoveRegionsFromReplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RemoveRegionsFromReplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRemoveRegionsFromReplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpReplicateSecretToRegions struct { +} + +func (*validateOpReplicateSecretToRegions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpReplicateSecretToRegions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ReplicateSecretToRegionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpReplicateSecretToRegionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpRestoreSecret struct { } @@ -249,6 +289,26 @@ func (m *validateOpRotateSecret) HandleInitialize(ctx context.Context, in middle return next.HandleInitialize(ctx, in) } +type validateOpStopReplicationToReplica struct { +} + +func (*validateOpStopReplicationToReplica) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStopReplicationToReplica) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StopReplicationToReplicaInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStopReplicationToReplicaInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpTagResource struct { } @@ -389,6 +449,14 @@ func addOpPutSecretValueValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutSecretValue{}, middleware.After) } +func addOpRemoveRegionsFromReplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRemoveRegionsFromReplication{}, middleware.After) +} + +func addOpReplicateSecretToRegionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpReplicateSecretToRegions{}, middleware.After) +} + func addOpRestoreSecretValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRestoreSecret{}, middleware.After) } @@ -397,6 +465,10 @@ func addOpRotateSecretValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRotateSecret{}, middleware.After) } +func addOpStopReplicationToReplicaValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStopReplicationToReplica{}, middleware.After) +} + func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } @@ -570,6 +642,42 @@ func validateOpPutSecretValueInput(v *PutSecretValueInput) error { } } +func validateOpRemoveRegionsFromReplicationInput(v *RemoveRegionsFromReplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RemoveRegionsFromReplicationInput"} + if v.SecretId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SecretId")) + } + if v.RemoveReplicaRegions == nil { + invalidParams.Add(smithy.NewErrParamRequired("RemoveReplicaRegions")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpReplicateSecretToRegionsInput(v *ReplicateSecretToRegionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ReplicateSecretToRegionsInput"} + if v.SecretId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SecretId")) + } + if v.AddReplicaRegions == nil { + invalidParams.Add(smithy.NewErrParamRequired("AddReplicaRegions")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpRestoreSecretInput(v *RestoreSecretInput) error { if v == nil { return nil @@ -600,6 +708,21 @@ func validateOpRotateSecretInput(v *RotateSecretInput) error { } } +func validateOpStopReplicationToReplicaInput(v *StopReplicationToReplicaInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StopReplicationToReplicaInput"} + if v.SecretId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SecretId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/CHANGELOG.md new file mode 100644 index 00000000..0238ce1f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/CHANGELOG.md @@ -0,0 +1,454 @@ +# v1.44.7 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.44.6 (2023-12-20) + +* No change notes available for this release. + +# v1.44.5 (2023-12-08) + +* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. + +# v1.44.4 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.44.3 (2023-12-06) + +* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. + +# v1.44.2 (2023-12-01) + +* **Bug Fix**: Correct wrapping of errors in authentication workflow. +* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.44.1 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.44.0 (2023-11-29) + +* **Feature**: Expose Options() accessor on service clients. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.43.3 (2023-11-28.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.43.2 (2023-11-28) + +* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction. + +# v1.43.1 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.43.0 (2023-11-16) + +* **Feature**: This release introduces the ability to filter automation execution steps which have parent steps. In addition, runbook variable information is returned by GetAutomationExecution and parent step information is returned by the DescribeAutomationStepExecutions API. + +# v1.42.2 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.42.1 (2023-11-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.42.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.41.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.40.0 (2023-10-24) + +* **Feature**: **BREAKFIX**: Correct nullability and default value representation of various input fields across a large number of services. Calling code that references one or more of the affected fields will need to update usage accordingly. See [2162](https://github.com/aws/aws-sdk-go-v2/issues/2162). + +# v1.39.0 (2023-10-20) + +* **Feature**: This release introduces a new API: DeleteOpsItem. This allows deletion of an OpsItem. + +# v1.38.2 (2023-10-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.38.1 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.38.0 (2023-09-25) + +* **Feature**: This release updates the enum values for ResourceType in SSM DescribeInstanceInformation input and ConnectionStatus in GetConnectionStatus output. + +# v1.37.5 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.37.4 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.37.3 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.37.2 (2023-08-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.37.1 (2023-08-01) + +* No change notes available for this release. + +# v1.37.0 (2023-07-31) + +* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.36.9 (2023-07-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.36.8 (2023-07-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.36.7 (2023-06-27) + +* **Documentation**: Systems Manager doc-only update for June 2023. + +# v1.36.6 (2023-06-15) + +* No change notes available for this release. + +# v1.36.5 (2023-06-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.36.4 (2023-05-04) + +* No change notes available for this release. + +# v1.36.3 (2023-04-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.36.2 (2023-04-10) + +* No change notes available for this release. + +# v1.36.1 (2023-04-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.36.0 (2023-03-22) + +* **Feature**: This Patch Manager release supports creating, updating, and deleting Patch Baselines for AmazonLinux2023, AlmaLinux. + +# v1.35.7 (2023-03-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.35.6 (2023-03-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.35.5 (2023-02-22) + +* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes. +* **Documentation**: Document only update for Feb 2023 + +# v1.35.4 (2023-02-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.35.3 (2023-02-15) + +* **Announcement**: When receiving an error response in restJson-based services, an incorrect error type may have been returned based on the content of the response. This has been fixed via PR #2012 tracked in issue #1910. +* **Bug Fix**: Correct error type parsing for restJson services. + +# v1.35.2 (2023-02-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.35.1 (2023-01-23) + +* No change notes available for this release. + +# v1.35.0 (2023-01-05) + +* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401). + +# v1.34.0 (2023-01-04) + +* **Feature**: Adding support for QuickSetup Document Type in Systems Manager + +# v1.33.4 (2022-12-21) + +* **Documentation**: Doc-only updates for December 2022. + +# v1.33.3 (2022-12-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.33.2 (2022-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.33.1 (2022-11-22) + +* No change notes available for this release. + +# v1.33.0 (2022-11-16) + +* **Feature**: This release adds support for cross account access in CreateOpsItem, UpdateOpsItem and GetOpsItem. It introduces new APIs to setup resource policies for SSM resources: PutResourcePolicy, GetResourcePolicies and DeleteResourcePolicy. + +# v1.32.1 (2022-11-10) + +* No change notes available for this release. + +# v1.32.0 (2022-11-07) + +* **Feature**: This release includes support for applying a CloudWatch alarm to multi account multi region Systems Manager Automation + +# v1.31.3 (2022-10-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.31.2 (2022-10-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.31.1 (2022-10-20) + +* No change notes available for this release. + +# v1.31.0 (2022-10-13) + +* **Feature**: Support of AmazonLinux2022 by Patch Manager + +# v1.30.0 (2022-09-26) + +* **Feature**: This release includes support for applying a CloudWatch alarm to Systems Manager capabilities like Automation, Run Command, State Manager, and Maintenance Windows. + +# v1.29.0 (2022-09-23) + +* **Feature**: This release adds new SSM document types ConformancePackTemplate and CloudFormation + +# v1.28.1 (2022-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.0 (2022-09-14) + +* **Feature**: Fixed a bug in the API client generation which caused some operation parameters to be incorrectly generated as value types instead of pointer types. The service API always required these affected parameters to be nilable. This fixes the SDK client to match the expectations of the the service API. +* **Feature**: This release adds support for Systems Manager State Manager Association tagging. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.13 (2022-09-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.12 (2022-08-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.11 (2022-08-30) + +* No change notes available for this release. + +# v1.27.10 (2022-08-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.9 (2022-08-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.8 (2022-08-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.7 (2022-08-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.6 (2022-08-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.5 (2022-07-27) + +* **Documentation**: Adding doc updates for OpsCenter support in Service Setting actions. + +# v1.27.4 (2022-07-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.3 (2022-06-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.2 (2022-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.1 (2022-05-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.0 (2022-05-04) + +* **Feature**: This release adds the TargetMaps parameter in SSM State Manager API. + +# v1.26.0 (2022-04-29) + +* **Feature**: Update the StartChangeRequestExecution, adding TargetMaps to the Runbook parameter + +# v1.25.1 (2022-04-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.0 (2022-04-19) + +* **Feature**: Added offset support for specifying the number of days to wait after the date and time specified by a CRON expression when creating SSM association. + +# v1.24.1 (2022-03-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.0 (2022-03-25) + +* **Feature**: This Patch Manager release supports creating, updating, and deleting Patch Baselines for Rocky Linux OS. + +# v1.23.1 (2022-03-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.0 (2022-03-23) + +* **Feature**: Update AddTagsToResource, ListTagsForResource, and RemoveTagsFromResource APIs to reflect the support for tagging Automation resources. Includes other minor documentation updates. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.22.0 (2022-03-08) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.0 (2022-02-24) + +* **Feature**: API client updated +* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.0 (2022-01-14) + +* **Feature**: Updated API models +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.0 (2022-01-07) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.0 (2021-12-21) + +* **Feature**: API Paginators now support specifying the initial starting token, and support stopping on empty string tokens. +* **Feature**: Updated to latest service endpoints + +# v1.17.1 (2021-12-02) + +* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514)) +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.0 (2021-11-30) + +* **Feature**: API client updated + +# v1.16.0 (2021-11-19) + +* **Feature**: API client updated +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.0 (2021-11-12) + +* **Feature**: Service clients now support custom endpoints that have an initial URI path defined. +* **Feature**: Waiters now have a `WaitForOutput` method, which can be used to retrieve the output of the successful wait operation. Thank you to [Andrew Haines](https://github.com/haines) for contributing this feature. + +# v1.14.0 (2021-11-06) + +* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.0 (2021-10-21) + +* **Feature**: Updated to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.0 (2021-10-11) + +* **Feature**: API client updated +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.0 (2021-09-24) + +* **Feature**: API client updated + +# v1.10.1 (2021-09-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.0 (2021-08-27) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.1 (2021-08-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.0 (2021-08-12) + +* **Feature**: API client updated + +# v1.8.1 (2021-08-04) + +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.0 (2021-07-15) + +* **Feature**: Updated service model to latest version. +* **Documentation**: Updated service model to latest revision. +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.7.0 (2021-06-25) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.2 (2021-06-04) + +* **Documentation**: Updated service client to latest API model. + +# v1.6.1 (2021-05-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.0 (2021-05-14) + +* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. +* **Feature**: Updated to latest service API model. +* **Dependency Update**: Updated to the latest SDK module versions + diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_client.go index b7c9748e..973f468d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_client.go @@ -5,16 +5,23 @@ package ssm import ( "context" cryptorand "crypto/rand" + "fmt" "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/retry" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" smithy "github.com/aws/smithy-go" + smithydocument "github.com/aws/smithy-go/document" "github.com/aws/smithy-go/logging" "github.com/aws/smithy-go/middleware" smithyrand "github.com/aws/smithy-go/rand" smithyhttp "github.com/aws/smithy-go/transport/http" + "net" "net/http" "time" ) @@ -22,8 +29,8 @@ import ( const ServiceID = "SSM" const ServiceAPIVersion = "2014-11-06" -// Client provides the API client to make operations call for Amazon Simple Systems -// Manager (SSM). +// Client provides the API client to make operations call for Amazon Simple +// Systems Manager (SSM). type Client struct { options Options } @@ -36,102 +43,61 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveDefaultLogger(&options) + setResolvedDefaultsMode(&options) + resolveRetryer(&options) resolveHTTPClient(&options) resolveHTTPSignerV4(&options) - resolveDefaultEndpointConfiguration(&options) - resolveIdempotencyTokenProvider(&options) + resolveEndpointResolverV2(&options) + + resolveAuthSchemeResolver(&options) + for _, fn := range optFns { fn(&options) } - client := &Client{ - options: options, - } - - return client -} - -type Options struct { - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - APIOptions []func(*middleware.Stack) error - - // Configures the events that will be sent to the configured logger. - ClientLogMode aws.ClientLogMode - - // The credentials object to use when signing requests. - Credentials aws.CredentialsProvider - - // The endpoint options to be used when attempting to resolve an endpoint. - EndpointOptions EndpointResolverOptions - - // The service endpoint resolver. - EndpointResolver EndpointResolver - - // Signature Version 4 (SigV4) Signer - HTTPSignerV4 HTTPSignerV4 - - // Provides idempotency tokens values that will be automatically populated into - // idempotent API operations. - IdempotencyTokenProvider IdempotencyTokenProvider + finalizeRetryMaxAttempts(&options) - // The logger writer interface to write logging messages to. - Logger logging.Logger + ignoreAnonymousAuth(&options) - // The region to send requests to. (Required) - Region string + wrapWithAnonymousAuth(&options) - // Retryer guides how HTTP requests should be retried in case of recoverable - // failures. When nil the API client will use a default retryer. - Retryer aws.Retryer + resolveAuthSchemes(&options) - // The HTTP client to invoke API calls with. Defaults to client's default HTTP - // implementation if nil. - HTTPClient HTTPClient -} - -// WithAPIOptions returns a functional option for setting the Client's APIOptions -// option. -func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { - return func(o *Options) { - o.APIOptions = append(o.APIOptions, optFns...) + client := &Client{ + options: options, } -} -// WithEndpointResolver returns a functional option for setting the Client's -// EndpointResolver option. -func WithEndpointResolver(v EndpointResolver) func(*Options) { - return func(o *Options) { - o.EndpointResolver = v - } + return client } -type HTTPClient interface { - Do(*http.Request) (*http.Response, error) +// Options returns a copy of the client configuration. +// +// Callers SHOULD NOT perform mutations on any inner structures within client +// config. Config overrides should instead be made on a per-operation basis through +// functional options. +func (c *Client) Options() Options { + return c.options.Copy() } -// Copy creates a clone where the APIOptions list is deep copied. -func (o Options) Copy() Options { - to := o - to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) - copy(to.APIOptions, o.APIOptions) - return to -} func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { ctx = middleware.ClearStackValues(ctx) stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) options := c.options.Copy() + for _, fn := range optFns { fn(&options) } + finalizeOperationRetryMaxAttempts(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + for _, fn := range stackFns { if err := fn(stack, options); err != nil { return nil, metadata, err @@ -156,6 +122,89 @@ func (c *Client) invokeOperation(ctx context.Context, opID string, params interf return result, metadata, err } +type operationInputKey struct{} + +func setOperationInput(ctx context.Context, input interface{}) context.Context { + return middleware.WithStackValue(ctx, operationInputKey{}, input) +} + +func getOperationInput(ctx context.Context) interface{} { + return middleware.GetStackValue(ctx, operationInputKey{}) +} + +type setOperationInputMiddleware struct { +} + +func (*setOperationInputMiddleware) ID() string { + return "setOperationInput" +} + +func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + ctx = setOperationInput(ctx, in.Parameters) + return next.HandleSerialize(ctx, in) +} + +func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %w", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %v", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %v", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{}, "ResolveEndpointV2", middleware.After); err != nil { + return fmt.Errorf("add Signing: %w", err) + } + return nil +} +func resolveAuthSchemeResolver(options *Options) { + if options.AuthSchemeResolver == nil { + options.AuthSchemeResolver = &defaultAuthSchemeResolver{} + } +} + +func resolveAuthSchemes(options *Options) { + if options.AuthSchemes == nil { + options.AuthSchemes = []smithyhttp.AuthScheme{ + internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ + Signer: options.HTTPSignerV4, + Logger: options.Logger, + LogSigning: options.ClientLogMode.IsSigning(), + }), + } + } +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +type legacyEndpointContextSetter struct { + LegacyResolver EndpointResolver +} + +func (*legacyEndpointContextSetter) ID() string { + return "legacyEndpointContextSetter" +} + +func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.LegacyResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) + } + + return next.HandleInitialize(ctx, in) + +} +func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { + return stack.Initialize.Add(&legacyEndpointContextSetter{ + LegacyResolver: o.EndpointResolver, + }, middleware.Before) +} + func resolveDefaultLogger(o *Options) { if o.Logger != nil { return @@ -167,33 +216,110 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { return middleware.AddSetLoggerMiddleware(stack, o.Logger) } +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + // NewFromConfig returns a new client from the provided config. func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ - Region: cfg.Region, - HTTPClient: cfg.HTTPClient, - Credentials: cfg.Credentials, - APIOptions: cfg.APIOptions, - Logger: cfg.Logger, - ClientLogMode: cfg.ClientLogMode, + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + AppID: cfg.AppID, } resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) return New(opts, optFns...) } func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + if o.HTTPClient != nil { - return + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) } - o.HTTPClient = awshttp.NewBuildableClient() + + o.HTTPClient = buildable } func resolveRetryer(o *Options) { if o.Retryer != nil { return } - o.Retryer = retry.NewStandard() + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } } func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { @@ -203,24 +329,52 @@ func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { o.Retryer = cfg.Retryer() } -func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { - if cfg.EndpointResolver == nil { +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttempts(o *Options) { + if o.RetryMaxAttempts == 0 { return } - o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, NewDefaultEndpointResolver()) + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) } -func addClientUserAgent(stack *middleware.Stack) error { - return awsmiddleware.AddRequestUserAgentMiddleware(stack) +func finalizeOperationRetryMaxAttempts(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) } -func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { - mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ - CredentialsProvider: o.Credentials, - Signer: o.HTTPSignerV4, - LogSigning: o.ClientLogMode.IsSigning(), - }) - return stack.Finalize.Add(mw, middleware.After) +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) +} + +func addClientUserAgent(stack *middleware.Stack, options Options) error { + if err := awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "ssm", goModuleVersion)(stack); err != nil { + return err + } + + if len(options.AppID) > 0 { + return awsmiddleware.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID)(stack) + } + + return nil } type HTTPSignerV4 interface { @@ -256,6 +410,36 @@ func addRetryMiddlewares(stack *middleware.Stack, o Options) error { return retry.AddRetryMiddlewares(stack, mo) } +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + // IdempotencyTokenProvider interface for providing idempotency token type IdempotencyTokenProvider interface { GetIdempotencyToken() (string, error) @@ -277,3 +461,32 @@ func addRequestResponseLogging(stack *middleware.Stack, o Options) error { LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), }, middleware.After) } + +type disableHTTPSMiddleware struct { + DisableHTTPS bool +} + +func (*disableHTTPSMiddleware) ID() string { + return "disableHTTPS" +} + +func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { + req.URL.Scheme = "http" + } + + return next.HandleFinalize(ctx, in) +} + +func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { + return stack.Finalize.Insert(&disableHTTPSMiddleware{ + DisableHTTPS: o.EndpointOptions.DisableHTTPS, + }, "ResolveEndpointV2", middleware.After) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_AddTagsToResource.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_AddTagsToResource.go index 648ef247..e1b972cf 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_AddTagsToResource.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_AddTagsToResource.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -12,28 +13,35 @@ import ( ) // Adds or overwrites one or more tags for the specified resource. Tags are -// metadata that you can assign to your documents, managed instances, maintenance -// windows, Parameter Store parameters, and patch baselines. Tags enable you to -// categorize your resources in different ways, for example, by purpose, owner, or -// environment. Each tag consists of a key and an optional value, both of which you -// define. For example, you could define a set of tags for your account's managed -// instances that helps you track each instance's owner and stack level. For -// example: Key=Owner and Value=DbAdmin, SysAdmin, or Dev. Or Key=Stack and -// Value=Production, Pre-Production, or Test. Each resource can have a maximum of -// 50 tags. We recommend that you devise a set of tag keys that meets your needs -// for each resource type. Using a consistent set of tag keys makes it easier for -// you to manage your resources. You can search and filter the resources based on -// the tags you add. Tags don't have any semantic meaning to and are interpreted +// metadata that you can assign to your automations, documents, managed nodes, +// maintenance windows, Parameter Store parameters, and patch baselines. Tags +// enable you to categorize your resources in different ways, for example, by +// purpose, owner, or environment. Each tag consists of a key and an optional +// value, both of which you define. For example, you could define a set of tags for +// your account's managed nodes that helps you track each node's owner and stack +// level. For example: +// - Key=Owner,Value=DbAdmin +// - Key=Owner,Value=SysAdmin +// - Key=Owner,Value=Dev +// - Key=Stack,Value=Production +// - Key=Stack,Value=Pre-Production +// - Key=Stack,Value=Test +// +// Most resources can have a maximum of 50 tags. Automations can have a maximum of +// 5 tags. We recommend that you devise a set of tag keys that meets your needs for +// each resource type. Using a consistent set of tag keys makes it easier for you +// to manage your resources. You can search and filter the resources based on the +// tags you add. Tags don't have any semantic meaning to and are interpreted // strictly as a string of characters. For more information about using tags with -// EC2 instances, see Tagging your Amazon EC2 resources -// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) in the -// Amazon EC2 User Guide. +// Amazon Elastic Compute Cloud (Amazon EC2) instances, see Tagging your Amazon +// EC2 resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) +// in the Amazon EC2 User Guide. func (c *Client) AddTagsToResource(ctx context.Context, params *AddTagsToResourceInput, optFns ...func(*Options)) (*AddTagsToResourceOutput, error) { if params == nil { params = &AddTagsToResourceInput{} } - result, metadata, err := c.invokeOperation(ctx, "AddTagsToResource", params, optFns, addOperationAddTagsToResourceMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "AddTagsToResource", params, optFns, c.addOperationAddTagsToResourceMiddlewares) if err != nil { return nil, err } @@ -46,37 +54,51 @@ func (c *Client) AddTagsToResource(ctx context.Context, params *AddTagsToResourc type AddTagsToResourceInput struct { // The resource ID you want to tag. Use the ID of the resource. Here are some - // examples: ManagedInstance: mi-012345abcde MaintenanceWindow: mw-012345abcde - // PatchBaseline: pb-012345abcde For the Document and Parameter values, use the - // name of the resource. The ManagedInstance type for this API action is only for - // on-premises managed instances. You must specify the name of the managed instance - // in the following format: mi-ID_number. For example, mi-1a2b3c4d5e6f. + // examples: MaintenanceWindow : mw-012345abcde PatchBaseline : pb-012345abcde + // Automation : example-c160-4567-8519-012345abcde OpsMetadata object: ResourceID + // for tagging is created from the Amazon Resource Name (ARN) for the object. + // Specifically, ResourceID is created from the strings that come after the word + // opsmetadata in the ARN. For example, an OpsMetadata object with an ARN of + // arn:aws:ssm:us-east-2:1234567890:opsmetadata/aws/ssm/MyGroup/appmanager has a + // ResourceID of either aws/ssm/MyGroup/appmanager or /aws/ssm/MyGroup/appmanager . + // For the Document and Parameter values, use the name of the resource. If you're + // tagging a shared document, you must use the full ARN of the document. + // ManagedInstance : mi-012345abcde The ManagedInstance type for this API + // operation is only for on-premises managed nodes. You must specify the name of + // the managed node in the following format: mi-ID_number . For example, + // mi-1a2b3c4d5e6f . // // This member is required. ResourceId *string // Specifies the type of resource you are tagging. The ManagedInstance type for - // this API action is for on-premises managed instances. You must specify the name - // of the managed instance in the following format: mi-ID_number. For example, - // mi-1a2b3c4d5e6f. + // this API operation is for on-premises managed nodes. You must specify the name + // of the managed node in the following format: mi-ID_number . For example, + // mi-1a2b3c4d5e6f . // // This member is required. ResourceType types.ResourceTypeForTagging - // One or more tags. The value parameter is required, but if you don't want the tag - // to have a value, specify the parameter with no value, and we set the value to an - // empty string. Do not enter personally identifiable information in this field. + // One or more tags. The value parameter is required. Don't enter personally + // identifiable information in this field. // // This member is required. Tags []types.Tag + + noSmithyDocumentSerde } type AddTagsToResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationAddTagsToResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationAddTagsToResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpAddTagsToResource{}, middleware.After) if err != nil { return err @@ -85,6 +107,13 @@ func addOperationAddTagsToResourceMiddlewares(stack *middleware.Stack, options O if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "AddTagsToResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -103,16 +132,13 @@ func addOperationAddTagsToResourceMiddlewares(stack *middleware.Stack, options O if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -121,12 +147,18 @@ func addOperationAddTagsToResourceMiddlewares(stack *middleware.Stack, options O if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpAddTagsToResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddTagsToResource(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -136,6 +168,9 @@ func addOperationAddTagsToResourceMiddlewares(stack *middleware.Stack, options O if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -143,7 +178,6 @@ func newServiceMetadataMiddleware_opAddTagsToResource(region string) *awsmiddlew return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "AddTagsToResource", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_AssociateOpsItemRelatedItem.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_AssociateOpsItemRelatedItem.go new file mode 100644 index 00000000..90104d79 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_AssociateOpsItemRelatedItem.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssm + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Associates a related item to a Systems Manager OpsCenter OpsItem. For example, +// you can associate an Incident Manager incident or analysis with an OpsItem. +// Incident Manager and OpsCenter are capabilities of Amazon Web Services Systems +// Manager. +func (c *Client) AssociateOpsItemRelatedItem(ctx context.Context, params *AssociateOpsItemRelatedItemInput, optFns ...func(*Options)) (*AssociateOpsItemRelatedItemOutput, error) { + if params == nil { + params = &AssociateOpsItemRelatedItemInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AssociateOpsItemRelatedItem", params, optFns, c.addOperationAssociateOpsItemRelatedItemMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AssociateOpsItemRelatedItemOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AssociateOpsItemRelatedItemInput struct { + + // The type of association that you want to create between an OpsItem and a + // resource. OpsCenter supports IsParentOf and RelatesTo association types. + // + // This member is required. + AssociationType *string + + // The ID of the OpsItem to which you want to associate a resource as a related + // item. + // + // This member is required. + OpsItemId *string + + // The type of resource that you want to associate with an OpsItem. OpsCenter + // supports the following types: AWS::SSMIncidents::IncidentRecord : an Incident + // Manager incident. AWS::SSM::Document : a Systems Manager (SSM) document. + // + // This member is required. + ResourceType *string + + // The Amazon Resource Name (ARN) of the Amazon Web Services resource that you + // want to associate with the OpsItem. + // + // This member is required. + ResourceUri *string + + noSmithyDocumentSerde +} + +type AssociateOpsItemRelatedItemOutput struct { + + // The association ID. + AssociationId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAssociateOpsItemRelatedItemMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssociateOpsItemRelatedItem{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssociateOpsItemRelatedItem{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateOpsItemRelatedItem"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpAssociateOpsItemRelatedItemValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateOpsItemRelatedItem(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opAssociateOpsItemRelatedItem(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "AssociateOpsItemRelatedItem", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CancelCommand.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CancelCommand.go index 1c7b1bf9..278ec729 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CancelCommand.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CancelCommand.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" @@ -18,7 +19,7 @@ func (c *Client) CancelCommand(ctx context.Context, params *CancelCommandInput, params = &CancelCommandInput{} } - result, metadata, err := c.invokeOperation(ctx, "CancelCommand", params, optFns, addOperationCancelCommandMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "CancelCommand", params, optFns, c.addOperationCancelCommandMiddlewares) if err != nil { return nil, err } @@ -28,7 +29,6 @@ func (c *Client) CancelCommand(ctx context.Context, params *CancelCommandInput, return out, nil } -// type CancelCommandInput struct { // The ID of the command you want to cancel. @@ -36,20 +36,27 @@ type CancelCommandInput struct { // This member is required. CommandId *string - // (Optional) A list of instance IDs on which you want to cancel the command. If - // not provided, the command is canceled on every instance on which it was + // (Optional) A list of managed node IDs on which you want to cancel the command. + // If not provided, the command is canceled on every node on which it was // requested. InstanceIds []string + + noSmithyDocumentSerde } -// Whether or not the command was successfully canceled. There is no guarantee that -// a request can be canceled. +// Whether or not the command was successfully canceled. There is no guarantee +// that a request can be canceled. type CancelCommandOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationCancelCommandMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationCancelCommandMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpCancelCommand{}, middleware.After) if err != nil { return err @@ -58,6 +65,13 @@ func addOperationCancelCommandMiddlewares(stack *middleware.Stack, options Optio if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "CancelCommand"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -76,16 +90,13 @@ func addOperationCancelCommandMiddlewares(stack *middleware.Stack, options Optio if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -94,12 +105,18 @@ func addOperationCancelCommandMiddlewares(stack *middleware.Stack, options Optio if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpCancelCommandValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelCommand(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -109,6 +126,9 @@ func addOperationCancelCommandMiddlewares(stack *middleware.Stack, options Optio if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -116,7 +136,6 @@ func newServiceMetadataMiddleware_opCancelCommand(region string) *awsmiddleware. return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "CancelCommand", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CancelMaintenanceWindowExecution.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CancelMaintenanceWindowExecution.go index aaed3cc2..0b887cbf 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CancelMaintenanceWindowExecution.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CancelMaintenanceWindowExecution.go @@ -4,21 +4,22 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Stops a maintenance window execution that is already in progress and cancels any -// tasks in the window that have not already starting running. (Tasks already in -// progress will continue to completion.) +// Stops a maintenance window execution that is already in progress and cancels +// any tasks in the window that haven't already starting running. Tasks already in +// progress will continue to completion. func (c *Client) CancelMaintenanceWindowExecution(ctx context.Context, params *CancelMaintenanceWindowExecutionInput, optFns ...func(*Options)) (*CancelMaintenanceWindowExecutionOutput, error) { if params == nil { params = &CancelMaintenanceWindowExecutionInput{} } - result, metadata, err := c.invokeOperation(ctx, "CancelMaintenanceWindowExecution", params, optFns, addOperationCancelMaintenanceWindowExecutionMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "CancelMaintenanceWindowExecution", params, optFns, c.addOperationCancelMaintenanceWindowExecutionMiddlewares) if err != nil { return nil, err } @@ -34,6 +35,8 @@ type CancelMaintenanceWindowExecutionInput struct { // // This member is required. WindowExecutionId *string + + noSmithyDocumentSerde } type CancelMaintenanceWindowExecutionOutput struct { @@ -43,9 +46,14 @@ type CancelMaintenanceWindowExecutionOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationCancelMaintenanceWindowExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationCancelMaintenanceWindowExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpCancelMaintenanceWindowExecution{}, middleware.After) if err != nil { return err @@ -54,6 +62,13 @@ func addOperationCancelMaintenanceWindowExecutionMiddlewares(stack *middleware.S if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "CancelMaintenanceWindowExecution"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -72,16 +87,13 @@ func addOperationCancelMaintenanceWindowExecutionMiddlewares(stack *middleware.S if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -90,12 +102,18 @@ func addOperationCancelMaintenanceWindowExecutionMiddlewares(stack *middleware.S if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpCancelMaintenanceWindowExecutionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelMaintenanceWindowExecution(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -105,6 +123,9 @@ func addOperationCancelMaintenanceWindowExecutionMiddlewares(stack *middleware.S if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -112,7 +133,6 @@ func newServiceMetadataMiddleware_opCancelMaintenanceWindowExecution(region stri return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "CancelMaintenanceWindowExecution", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateActivation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateActivation.go index 66cecca0..9aad0ee4 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateActivation.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateActivation.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -13,22 +14,22 @@ import ( ) // Generates an activation code and activation ID you can use to register your -// on-premises server or virtual machine (VM) with Systems Manager. Registering -// these machines with Systems Manager makes it possible to manage them using -// Systems Manager capabilities. You use the activation code and ID when installing -// SSM Agent on machines in your hybrid environment. For more information about -// requirements for managing on-premises instances and VMs using Systems Manager, -// see Setting up AWS Systems Manager for hybrid environments -// (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-managedinstances.html) -// in the AWS Systems Manager User Guide. On-premises servers or VMs that are -// registered with Systems Manager and EC2 instances that you manage with Systems -// Manager are all called managed instances. +// on-premises servers, edge devices, or virtual machine (VM) with Amazon Web +// Services Systems Manager. Registering these machines with Systems Manager makes +// it possible to manage them using Systems Manager capabilities. You use the +// activation code and ID when installing SSM Agent on machines in your hybrid +// environment. For more information about requirements for managing on-premises +// machines using Systems Manager, see Setting up Amazon Web Services Systems +// Manager for hybrid environments (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-managedinstances.html) +// in the Amazon Web Services Systems Manager User Guide. Amazon Elastic Compute +// Cloud (Amazon EC2) instances, edge devices, and on-premises servers and VMs that +// are configured for Systems Manager are all called managed nodes. func (c *Client) CreateActivation(ctx context.Context, params *CreateActivationInput, optFns ...func(*Options)) (*CreateActivationOutput, error) { if params == nil { params = &CreateActivationInput{} } - result, metadata, err := c.invokeOperation(ctx, "CreateActivation", params, optFns, addOperationCreateActivationMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "CreateActivation", params, optFns, c.addOperationCreateActivationMiddlewares) if err != nil { return nil, err } @@ -40,57 +41,59 @@ func (c *Client) CreateActivation(ctx context.Context, params *CreateActivationI type CreateActivationInput struct { - // The Amazon Identity and Access Management (IAM) role that you want to assign to - // the managed instance. This IAM role must provide AssumeRole permissions for the - // Systems Manager service principal ssm.amazonaws.com. For more information, see - // Create an IAM service role for a hybrid environment - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-service-role.html) - // in the AWS Systems Manager User Guide. + // The name of the Identity and Access Management (IAM) role that you want to + // assign to the managed node. This IAM role must provide AssumeRole permissions + // for the Amazon Web Services Systems Manager service principal ssm.amazonaws.com + // . For more information, see Create an IAM service role for a hybrid environment (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-service-role.html) + // in the Amazon Web Services Systems Manager User Guide. You can't specify an IAM + // service-linked role for this parameter. You must create a unique role. // // This member is required. IamRole *string - // The name of the registered, managed instance as it will appear in the Systems - // Manager console or when you use the AWS command line tools to list Systems - // Manager resources. Do not enter personally identifiable information in this - // field. + // The name of the registered, managed node as it will appear in the Amazon Web + // Services Systems Manager console or when you use the Amazon Web Services command + // line tools to list Systems Manager resources. Don't enter personally + // identifiable information in this field. DefaultInstanceName *string // A user-defined description of the resource that you want to register with - // Systems Manager. Do not enter personally identifiable information in this field. + // Systems Manager. Don't enter personally identifiable information in this field. Description *string - // The date by which this activation request should expire. The default value is 24 + // The date by which this activation request should expire, in timestamp format, + // such as "2021-07-07T00:00:00". You can specify a date up to 30 days in advance. + // If you don't provide an expiration date, the activation code expires in 24 // hours. ExpirationDate *time.Time - // Specify the maximum number of managed instances you want to register. The - // default value is 1 instance. - RegistrationLimit int32 + // Specify the maximum number of managed nodes you want to register. The default + // value is 1 . + RegistrationLimit *int32 - // Optional metadata that you assign to a resource. Tags enable you to categorize a - // resource in different ways, such as by purpose, owner, or environment. For + // Reserved for internal use. + RegistrationMetadata []types.RegistrationMetadataItem + + // Optional metadata that you assign to a resource. Tags enable you to categorize + // a resource in different ways, such as by purpose, owner, or environment. For // example, you might want to tag an activation to identify which servers or // virtual machines (VMs) in your on-premises environment you intend to activate. - // In this case, you could specify the following key name/value pairs: - // - // * - // Key=OS,Value=Windows - // - // * Key=Environment,Value=Production - // - // When you install SSM - // Agent on your on-premises servers and VMs, you specify an activation ID and - // code. When you specify the activation ID and code, tags assigned to the - // activation are automatically applied to the on-premises servers or VMs. You - // can't add tags to or delete tags from an existing activation. You can tag your - // on-premises servers and VMs after they connect to Systems Manager for the first - // time and are assigned a managed instance ID. This means they are listed in the - // AWS Systems Manager console with an ID that is prefixed with "mi-". For - // information about how to add tags to your managed instances, see - // AddTagsToResource. For information about how to remove tags from your managed - // instances, see RemoveTagsFromResource. + // In this case, you could specify the following key-value pairs: + // - Key=OS,Value=Windows + // - Key=Environment,Value=Production + // When you install SSM Agent on your on-premises servers and VMs, you specify an + // activation ID and code. When you specify the activation ID and code, tags + // assigned to the activation are automatically applied to the on-premises servers + // or VMs. You can't add tags to or delete tags from an existing activation. You + // can tag your on-premises servers, edge devices, and VMs after they connect to + // Systems Manager for the first time and are assigned a managed node ID. This + // means they are listed in the Amazon Web Services Systems Manager console with an + // ID that is prefixed with "mi-". For information about how to add tags to your + // managed nodes, see AddTagsToResource . For information about how to remove tags + // from your managed nodes, see RemoveTagsFromResource . Tags []types.Tag + + noSmithyDocumentSerde } type CreateActivationOutput struct { @@ -105,9 +108,14 @@ type CreateActivationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationCreateActivationMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationCreateActivationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateActivation{}, middleware.After) if err != nil { return err @@ -116,6 +124,13 @@ func addOperationCreateActivationMiddlewares(stack *middleware.Stack, options Op if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateActivation"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -134,16 +149,13 @@ func addOperationCreateActivationMiddlewares(stack *middleware.Stack, options Op if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -152,12 +164,18 @@ func addOperationCreateActivationMiddlewares(stack *middleware.Stack, options Op if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpCreateActivationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateActivation(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -167,6 +185,9 @@ func addOperationCreateActivationMiddlewares(stack *middleware.Stack, options Op if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -174,7 +195,6 @@ func newServiceMetadataMiddleware_opCreateActivation(region string) *awsmiddlewa return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "CreateActivation", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateAssociation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateAssociation.go index acd5b7d6..4468b485 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateAssociation.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateAssociation.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -12,22 +13,23 @@ import ( ) // A State Manager association defines the state that you want to maintain on your -// instances. For example, an association can specify that anti-virus software must -// be installed and running on your instances, or that certain ports must be -// closed. For static targets, the association specifies a schedule for when the -// configuration is reapplied. For dynamic targets, such as an AWS Resource Group -// or an AWS Autoscaling Group, State Manager applies the configuration when new -// instances are added to the group. The association also specifies actions to take -// when applying the configuration. For example, an association for anti-virus -// software might run once a day. If the software is not installed, then State -// Manager installs it. If the software is installed, but the service is not +// managed nodes. For example, an association can specify that anti-virus software +// must be installed and running on your managed nodes, or that certain ports must +// be closed. For static targets, the association specifies a schedule for when the +// configuration is reapplied. For dynamic targets, such as an Amazon Web Services +// resource group or an Amazon Web Services autoscaling group, State Manager, a +// capability of Amazon Web Services Systems Manager applies the configuration when +// new managed nodes are added to the group. The association also specifies actions +// to take when applying the configuration. For example, an association for +// anti-virus software might run once a day. If the software isn't installed, then +// State Manager installs it. If the software is installed, but the service isn't // running, then the association might instruct State Manager to start the service. func (c *Client) CreateAssociation(ctx context.Context, params *CreateAssociationInput, optFns ...func(*Options)) (*CreateAssociationOutput, error) { if params == nil { params = &CreateAssociationInput{} } - result, metadata, err := c.invokeOperation(ctx, "CreateAssociation", params, optFns, addOperationCreateAssociationMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "CreateAssociation", params, optFns, c.addOperationCreateAssociationMiddlewares) if err != nil { return nil, err } @@ -39,56 +41,77 @@ func (c *Client) CreateAssociation(ctx context.Context, params *CreateAssociatio type CreateAssociationInput struct { - // The name of the SSM document that contains the configuration information for the - // instance. You can specify Command or Automation documents. You can specify - // AWS-predefined documents, documents you created, or a document that is shared - // with you from another account. For SSM documents that are shared with you from - // other AWS accounts, you must specify the complete SSM document ARN, in the + // The name of the SSM Command document or Automation runbook that contains the + // configuration information for the managed node. You can specify Amazon Web + // Services-predefined documents, documents you created, or a document that is + // shared with you from another Amazon Web Services account. For Systems Manager + // documents (SSM documents) that are shared with you from other Amazon Web + // Services accounts, you must specify the complete SSM document ARN, in the // following format: arn:partition:ssm:region:account-id:document/document-name // For example: arn:aws:ssm:us-east-2:12345678912:document/My-Shared-Document For - // AWS-predefined documents and SSM documents you created in your account, you only - // need to specify the document name. For example, AWS-ApplyPatchBaseline or - // My-Document. + // Amazon Web Services-predefined documents and SSM documents you created in your + // account, you only need to specify the document name. For example, + // AWS-ApplyPatchBaseline or My-Document . // // This member is required. Name *string - // By default, when you create a new associations, the system runs it immediately + // The details for the CloudWatch alarm you want to apply to an automation or + // command. + AlarmConfiguration *types.AlarmConfiguration + + // By default, when you create a new association, the system runs it immediately // after it is created and then according to the schedule you specified. Specify // this option if you don't want an association to run immediately after you create - // it. This parameter is not supported for rate expressions. + // it. This parameter isn't supported for rate expressions. ApplyOnlyAtCronInterval bool // Specify a descriptive name for the association. AssociationName *string - // Specify the target for the association. This target is required for associations - // that use an Automation document and target resources by using rate controls. + // Choose the parameter that will define how your automation will branch out. This + // target is required for associations that use an Automation runbook and target + // resources by using rate controls. Automation is a capability of Amazon Web + // Services Systems Manager. AutomationTargetParameterName *string + // The names or Amazon Resource Names (ARNs) of the Change Calendar type documents + // you want to gate your associations under. The associations only run when that + // change calendar is open. For more information, see Amazon Web Services Systems + // Manager Change Calendar (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-change-calendar) + // . + CalendarNames []string + // The severity level to assign to the association. ComplianceSeverity types.AssociationComplianceSeverity - // The document version you want to associate with the target(s). Can be a specific - // version or the default version. + // The document version you want to associate with the target(s). Can be a + // specific version or the default version. State Manager doesn't support running + // associations that use a new version of a document if that document is shared + // from another account. State Manager always runs the default version of a + // document if shared from another account, even though the Systems Manager console + // shows that a new version was processed. If you want to run an association using + // a new version of a document shared form another account, you must set the + // document version to default . DocumentVersion *string - // The instance ID. InstanceId has been deprecated. To specify an instance ID for - // an association, use the Targets parameter. Requests that include the parameter - // InstanceID with SSM documents that use schema version 2.0 or later will fail. In - // addition, if you use the parameter InstanceId, you cannot use the parameters - // AssociationName, DocumentVersion, MaxErrors, MaxConcurrency, OutputLocation, or - // ScheduleExpression. To use these parameters, you must use the Targets parameter. + // The managed node ID. InstanceId has been deprecated. To specify a managed node + // ID for an association, use the Targets parameter. Requests that include the + // parameter InstanceID with Systems Manager documents (SSM documents) that use + // schema version 2.0 or later will fail. In addition, if you use the parameter + // InstanceId , you can't use the parameters AssociationName , DocumentVersion , + // MaxErrors , MaxConcurrency , OutputLocation , or ScheduleExpression . To use + // these parameters, you must use the Targets parameter. InstanceId *string // The maximum number of targets allowed to run the association at the same time. // You can specify a number, for example 10, or a percentage of the target set, for // example 10%. The default value is 100%, which means all targets run the - // association at the same time. If a new instance starts and attempts to run an - // association while Systems Manager is running MaxConcurrency associations, the - // association is allowed to run. During the next association interval, the new - // instance will process its association within the limit specified for - // MaxConcurrency. + // association at the same time. If a new managed node starts and attempts to run + // an association while Systems Manager is running MaxConcurrency associations, + // the association is allowed to run. During the next association interval, the new + // managed node will process its association within the limit specified for + // MaxConcurrency . MaxConcurrency *string // The number of errors that are allowed before the system stops sending requests @@ -97,15 +120,16 @@ type CreateAssociationInput struct { // 10%. If you specify 3, for example, the system stops sending requests when the // fourth error is received. If you specify 0, then the system stops sending // requests after the first error is returned. If you run an association on 50 - // instances and set MaxError to 10%, then the system stops sending the request - // when the sixth error is received. Executions that are already running an - // association when MaxErrors is reached are allowed to complete, but some of these - // executions may fail as well. If you need to ensure that there won't be more than - // max-errors failed executions, set MaxConcurrency to 1 so that executions proceed - // one at a time. + // managed nodes and set MaxError to 10%, then the system stops sending the + // request when the sixth error is received. Executions that are already running an + // association when MaxErrors is reached are allowed to complete, but some of + // these executions may fail as well. If you need to ensure that there won't be + // more than max-errors failed executions, set MaxConcurrency to 1 so that + // executions proceed one at a time. MaxErrors *string - // An S3 bucket where you want to store the output details of the request. + // An Amazon Simple Storage Service (Amazon S3) bucket where you want to store the + // output details of the request. OutputLocation *types.InstanceAssociationOutputLocation // The parameters for the runtime configuration of the document. @@ -114,29 +138,53 @@ type CreateAssociationInput struct { // A cron expression when the association will be applied to the target(s). ScheduleExpression *string - // The mode for generating association compliance. You can specify AUTO or MANUAL. + // Number of days to wait after the scheduled day to run an association. For + // example, if you specified a cron schedule of cron(0 0 ? * THU#2 *) , you could + // specify an offset of 3 to run the association each Sunday after the second + // Thursday of the month. For more information about cron schedules for + // associations, see Reference: Cron and rate expressions for Systems Manager (https://docs.aws.amazon.com/systems-manager/latest/userguide/reference-cron-and-rate-expressions.html) + // in the Amazon Web Services Systems Manager User Guide. To use offsets, you must + // specify the ApplyOnlyAtCronInterval parameter. This option tells the system not + // to run an association immediately after you create it. + ScheduleOffset *int32 + + // The mode for generating association compliance. You can specify AUTO or MANUAL . // In AUTO mode, the system uses the status of the association execution to // determine the compliance status. If the association execution runs successfully, - // then the association is COMPLIANT. If the association execution doesn't run - // successfully, the association is NON-COMPLIANT. In MANUAL mode, you must specify - // the AssociationId as a parameter for the PutComplianceItems API action. In this - // case, compliance data is not managed by State Manager. It is managed by your - // direct call to the PutComplianceItems API action. By default, all associations - // use AUTO mode. + // then the association is COMPLIANT . If the association execution doesn't run + // successfully, the association is NON-COMPLIANT . In MANUAL mode, you must + // specify the AssociationId as a parameter for the PutComplianceItems API + // operation. In this case, compliance data isn't managed by State Manager. It is + // managed by your direct call to the PutComplianceItems API operation. By + // default, all associations use AUTO mode. SyncCompliance types.AssociationSyncCompliance - // A location is a combination of AWS Regions and AWS accounts where you want to - // run the association. Use this action to create an association in multiple - // Regions and multiple accounts. + // Adds or overwrites one or more tags for a State Manager association. Tags are + // metadata that you can assign to your Amazon Web Services resources. Tags enable + // you to categorize your resources in different ways, for example, by purpose, + // owner, or environment. Each tag consists of a key and an optional value, both of + // which you define. + Tags []types.Tag + + // A location is a combination of Amazon Web Services Regions and Amazon Web + // Services accounts where you want to run the association. Use this action to + // create an association in multiple Regions and multiple accounts. TargetLocations []types.TargetLocation - // The targets for the association. You can target instances by using tags, AWS - // Resource Groups, all instances in an AWS account, or individual instance IDs. - // For more information about choosing targets for an association, see Using - // targets and rate controls with State Manager associations - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-state-manager-targets-and-rate-controls.html) - // in the AWS Systems Manager User Guide. + // A key-value mapping of document parameters to target resources. Both Targets + // and TargetMaps can't be specified together. + TargetMaps []map[string][]string + + // The targets for the association. You can target managed nodes by using tags, + // Amazon Web Services resource groups, all managed nodes in an Amazon Web Services + // account, or individual managed node IDs. You can target all managed nodes in an + // Amazon Web Services account by specifying the InstanceIds key with a value of * + // . For more information about choosing targets for an association, see Using + // targets and rate controls with State Manager associations (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-state-manager-targets-and-rate-controls.html) + // in the Amazon Web Services Systems Manager User Guide. Targets []types.Target + + noSmithyDocumentSerde } type CreateAssociationOutput struct { @@ -146,9 +194,14 @@ type CreateAssociationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationCreateAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationCreateAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateAssociation{}, middleware.After) if err != nil { return err @@ -157,6 +210,13 @@ func addOperationCreateAssociationMiddlewares(stack *middleware.Stack, options O if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateAssociation"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -175,16 +235,13 @@ func addOperationCreateAssociationMiddlewares(stack *middleware.Stack, options O if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -193,12 +250,18 @@ func addOperationCreateAssociationMiddlewares(stack *middleware.Stack, options O if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpCreateAssociationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAssociation(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -208,6 +271,9 @@ func addOperationCreateAssociationMiddlewares(stack *middleware.Stack, options O if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -215,7 +281,6 @@ func newServiceMetadataMiddleware_opCreateAssociation(region string) *awsmiddlew return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "CreateAssociation", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateAssociationBatch.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateAssociationBatch.go index fb85c9ae..9d42a187 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateAssociationBatch.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateAssociationBatch.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -11,18 +12,19 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Associates the specified Systems Manager document with the specified instances -// or targets. When you associate a document with one or more instances using -// instance IDs or tags, SSM Agent running on the instance processes the document -// and configures the instance as specified. If you associate a document with an -// instance that already has an associated document, the system returns the +// Associates the specified Amazon Web Services Systems Manager document (SSM +// document) with the specified managed nodes or targets. When you associate a +// document with one or more managed nodes using IDs or tags, Amazon Web Services +// Systems Manager Agent (SSM Agent) running on the managed node processes the +// document and configures the node as specified. If you associate a document with +// a managed node that already has an associated document, the system returns the // AssociationAlreadyExists exception. func (c *Client) CreateAssociationBatch(ctx context.Context, params *CreateAssociationBatchInput, optFns ...func(*Options)) (*CreateAssociationBatchOutput, error) { if params == nil { params = &CreateAssociationBatchInput{} } - result, metadata, err := c.invokeOperation(ctx, "CreateAssociationBatch", params, optFns, addOperationCreateAssociationBatchMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "CreateAssociationBatch", params, optFns, c.addOperationCreateAssociationBatchMiddlewares) if err != nil { return nil, err } @@ -38,6 +40,8 @@ type CreateAssociationBatchInput struct { // // This member is required. Entries []types.CreateAssociationBatchRequestEntry + + noSmithyDocumentSerde } type CreateAssociationBatchOutput struct { @@ -50,9 +54,14 @@ type CreateAssociationBatchOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationCreateAssociationBatchMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationCreateAssociationBatchMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateAssociationBatch{}, middleware.After) if err != nil { return err @@ -61,6 +70,13 @@ func addOperationCreateAssociationBatchMiddlewares(stack *middleware.Stack, opti if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateAssociationBatch"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -79,16 +95,13 @@ func addOperationCreateAssociationBatchMiddlewares(stack *middleware.Stack, opti if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -97,12 +110,18 @@ func addOperationCreateAssociationBatchMiddlewares(stack *middleware.Stack, opti if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpCreateAssociationBatchValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAssociationBatch(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -112,6 +131,9 @@ func addOperationCreateAssociationBatchMiddlewares(stack *middleware.Stack, opti if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -119,7 +141,6 @@ func newServiceMetadataMiddleware_opCreateAssociationBatch(region string) *awsmi return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "CreateAssociationBatch", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateDocument.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateDocument.go index eb72230a..ef56324e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateDocument.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateDocument.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -11,18 +12,17 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a Systems Manager (SSM) document. An SSM document defines the actions -// that Systems Manager performs on your managed instances. For more information -// about SSM documents, including information about supported schemas, features, -// and syntax, see AWS Systems Manager Documents -// (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-ssm-docs.html) -// in the AWS Systems Manager User Guide. +// Creates a Amazon Web Services Systems Manager (SSM document). An SSM document +// defines the actions that Systems Manager performs on your managed nodes. For +// more information about SSM documents, including information about supported +// schemas, features, and syntax, see Amazon Web Services Systems Manager Documents (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-ssm-docs.html) +// in the Amazon Web Services Systems Manager User Guide. func (c *Client) CreateDocument(ctx context.Context, params *CreateDocumentInput, optFns ...func(*Options)) (*CreateDocumentOutput, error) { if params == nil { params = &CreateDocumentInput{} } - result, metadata, err := c.invokeOperation(ctx, "CreateDocument", params, optFns, addOperationCreateDocumentMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "CreateDocument", params, optFns, c.addOperationCreateDocumentMiddlewares) if err != nil { return nil, err } @@ -34,100 +34,96 @@ func (c *Client) CreateDocument(ctx context.Context, params *CreateDocumentInput type CreateDocumentInput struct { - // The content for the new SSM document in JSON or YAML format. We recommend - // storing the contents for your new document in an external JSON or YAML file and - // referencing the file in a command. For examples, see the following topics in the - // AWS Systems Manager User Guide. - // - // * Create an SSM document (AWS API) - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/create-ssm-document-api.html) - // - // * - // Create an SSM document (AWS CLI) - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/create-ssm-document-cli.html) - // - // * - // Create an SSM document (API) - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/create-ssm-document-api.html) + // The content for the new SSM document in JSON or YAML format. The content of the + // document must not exceed 64KB. This quota also includes the content specified + // for input parameters at runtime. We recommend storing the contents for your new + // document in an external JSON or YAML file and referencing the file in a command. + // For examples, see the following topics in the Amazon Web Services Systems + // Manager User Guide. + // - Create an SSM document (Amazon Web Services API) (https://docs.aws.amazon.com/systems-manager/latest/userguide/create-ssm-document-api.html) + // - Create an SSM document (Amazon Web Services CLI) (https://docs.aws.amazon.com/systems-manager/latest/userguide/create-ssm-document-cli.html) + // - Create an SSM document (API) (https://docs.aws.amazon.com/systems-manager/latest/userguide/create-ssm-document-api.html) // // This member is required. Content *string - // A name for the Systems Manager document. You can't use the following strings as - // document name prefixes. These are reserved by AWS for use as document name - // prefixes: - // - // * aws- - // - // * amazon - // - // * amzn + // A name for the SSM document. You can't use the following strings as document + // name prefixes. These are reserved by Amazon Web Services for use as document + // name prefixes: + // - aws + // - amazon + // - amzn // // This member is required. Name *string - // A list of key and value pairs that describe attachments to a version of a - // document. + // A list of key-value pairs that describe attachments to a version of a document. Attachments []types.AttachmentsSource + // An optional field where you can specify a friendly name for the SSM document. + // This value can differ for each version of the document. You can update this + // value at a later time using the UpdateDocument operation. + DisplayName *string + // Specify the document format for the request. The document format can be JSON, // YAML, or TEXT. JSON is the default format. DocumentFormat types.DocumentFormat - // The type of document to create. + // The type of document to create. The DeploymentStrategy document type is an + // internal-use-only document type reserved for AppConfig. DocumentType types.DocumentType // A list of SSM documents required by a document. This parameter is used - // exclusively by AWS AppConfig. When a user creates an AppConfig configuration in - // an SSM document, the user must also specify a required document for validation + // exclusively by AppConfig. When a user creates an AppConfig configuration in an + // SSM document, the user must also specify a required document for validation // purposes. In this case, an ApplicationConfiguration document requires an // ApplicationConfigurationSchema document for validation purposes. For more - // information, see AWS AppConfig - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/appconfig.html) in - // the AWS Systems Manager User Guide. + // information, see What is AppConfig? (https://docs.aws.amazon.com/appconfig/latest/userguide/what-is-appconfig.html) + // in the AppConfig User Guide. Requires []types.DocumentRequires - // Optional metadata that you assign to a resource. Tags enable you to categorize a - // resource in different ways, such as by purpose, owner, or environment. For + // Optional metadata that you assign to a resource. Tags enable you to categorize + // a resource in different ways, such as by purpose, owner, or environment. For // example, you might want to tag an SSM document to identify the types of targets // or the environment where it will run. In this case, you could specify the - // following key name/value pairs: - // - // * Key=OS,Value=Windows - // - // * - // Key=Environment,Value=Production - // - // To add tags to an existing SSM document, use - // the AddTagsToResource action. + // following key-value pairs: + // - Key=OS,Value=Windows + // - Key=Environment,Value=Production + // To add tags to an existing SSM document, use the AddTagsToResource operation. Tags []types.Tag // Specify a target type to define the kinds of resources the document can run on. // For example, to run a document on EC2 instances, specify the following value: - // /AWS::EC2::Instance. If you specify a value of '/' the document can run on all + // /AWS::EC2::Instance . If you specify a value of '/' the document can run on all // types of resources. If you don't specify a value, the document can't run on any - // resources. For a list of valid resource types, see AWS resource and property - // types reference - // (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) - // in the AWS CloudFormation User Guide. + // resources. For a list of valid resource types, see Amazon Web Services resource + // and property types reference (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) + // in the CloudFormation User Guide. TargetType *string // An optional field specifying the version of the artifact you are creating with - // the document. For example, "Release 12, Update 6". This value is unique across - // all versions of a document, and cannot be changed. + // the document. For example, Release12.1 . This value is unique across all + // versions of a document, and can't be changed. VersionName *string + + noSmithyDocumentSerde } type CreateDocumentOutput struct { - // Information about the Systems Manager document. + // Information about the SSM document. DocumentDescription *types.DocumentDescription // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationCreateDocumentMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationCreateDocumentMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateDocument{}, middleware.After) if err != nil { return err @@ -136,6 +132,13 @@ func addOperationCreateDocumentMiddlewares(stack *middleware.Stack, options Opti if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateDocument"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -154,16 +157,13 @@ func addOperationCreateDocumentMiddlewares(stack *middleware.Stack, options Opti if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -172,12 +172,18 @@ func addOperationCreateDocumentMiddlewares(stack *middleware.Stack, options Opti if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpCreateDocumentValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDocument(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -187,6 +193,9 @@ func addOperationCreateDocumentMiddlewares(stack *middleware.Stack, options Opti if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -194,7 +203,6 @@ func newServiceMetadataMiddleware_opCreateDocument(region string) *awsmiddleware return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "CreateDocument", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateMaintenanceWindow.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateMaintenanceWindow.go index ef1536e5..ba9b5296 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateMaintenanceWindow.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateMaintenanceWindow.go @@ -15,7 +15,7 @@ import ( // Creates a new maintenance window. The value you specify for Duration determines // the specific end time for the maintenance window based on the time it begins. No // maintenance window tasks are permitted to start after the resulting endtime -// minus the number of hours you specify for Cutoff. For example, if the +// minus the number of hours you specify for Cutoff . For example, if the // maintenance window starts at 3 PM, the duration is three hours, and the value // you specify for Cutoff is one hour, no maintenance window tasks can start after // 5 PM. @@ -24,7 +24,7 @@ func (c *Client) CreateMaintenanceWindow(ctx context.Context, params *CreateMain params = &CreateMaintenanceWindowInput{} } - result, metadata, err := c.invokeOperation(ctx, "CreateMaintenanceWindow", params, optFns, addOperationCreateMaintenanceWindowMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "CreateMaintenanceWindow", params, optFns, c.addOperationCreateMaintenanceWindowMiddlewares) if err != nil { return nil, err } @@ -36,9 +36,9 @@ func (c *Client) CreateMaintenanceWindow(ctx context.Context, params *CreateMain type CreateMaintenanceWindowInput struct { - // Enables a maintenance window task to run on managed instances, even if you have - // not registered those instances as targets. If enabled, then you must specify the - // unregistered instances (by instance ID) when you register a task with the + // Enables a maintenance window task to run on managed nodes, even if you haven't + // registered those nodes as targets. If enabled, then you must specify the + // unregistered managed nodes (by node ID) when you register a task with the // maintenance window. If you don't enable this option, then you must specify // previously-registered targets when you register a task with the maintenance // window. @@ -46,8 +46,8 @@ type CreateMaintenanceWindowInput struct { // This member is required. AllowUnassociatedTargets bool - // The number of hours before the end of the maintenance window that Systems - // Manager stops scheduling new tasks for execution. + // The number of hours before the end of the maintenance window that Amazon Web + // Services Systems Manager stops scheduling new tasks for execution. // // This member is required. Cutoff int32 @@ -55,7 +55,7 @@ type CreateMaintenanceWindowInput struct { // The duration of the maintenance window in hours. // // This member is required. - Duration int32 + Duration *int32 // The name of the maintenance window. // @@ -75,16 +75,16 @@ type CreateMaintenanceWindowInput struct { Description *string // The date and time, in ISO-8601 Extended format, for when you want the - // maintenance window to become inactive. EndDate allows you to set a date and time - // in the future when the maintenance window will no longer run. + // maintenance window to become inactive. EndDate allows you to set a date and + // time in the future when the maintenance window will no longer run. EndDate *string - // The number of days to wait after the date and time specified by a CRON + // The number of days to wait after the date and time specified by a cron // expression before running the maintenance window. For example, the following // cron expression schedules a maintenance window to run on the third Tuesday of - // every month at 11:30 PM. cron(30 23 ? * TUE#3 *) If the schedule offset is 2, + // every month at 11:30 PM. cron(30 23 ? * TUE#3 *) If the schedule offset is 2 , // the maintenance window won't run until two days later. - ScheduleOffset int32 + ScheduleOffset *int32 // The time zone that the scheduled maintenance window executions are based on, in // Internet Assigned Numbers Authority (IANA) format. For example: @@ -93,27 +93,23 @@ type CreateMaintenanceWindowInput struct { ScheduleTimezone *string // The date and time, in ISO-8601 Extended format, for when you want the - // maintenance window to become active. StartDate allows you to delay activation of - // the maintenance window until the specified future date. + // maintenance window to become active. StartDate allows you to delay activation + // of the maintenance window until the specified future date. StartDate *string - // Optional metadata that you assign to a resource. Tags enable you to categorize a - // resource in different ways, such as by purpose, owner, or environment. For + // Optional metadata that you assign to a resource. Tags enable you to categorize + // a resource in different ways, such as by purpose, owner, or environment. For // example, you might want to tag a maintenance window to identify the type of // tasks it will run, the types of targets, and the environment it will run in. In - // this case, you could specify the following key name/value pairs: - // - // * - // Key=TaskType,Value=AgentUpdate - // - // * Key=OS,Value=Windows - // - // * - // Key=Environment,Value=Production - // - // To add tags to an existing maintenance window, - // use the AddTagsToResource action. + // this case, you could specify the following key-value pairs: + // - Key=TaskType,Value=AgentUpdate + // - Key=OS,Value=Windows + // - Key=Environment,Value=Production + // To add tags to an existing maintenance window, use the AddTagsToResource + // operation. Tags []types.Tag + + noSmithyDocumentSerde } type CreateMaintenanceWindowOutput struct { @@ -123,9 +119,14 @@ type CreateMaintenanceWindowOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationCreateMaintenanceWindowMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationCreateMaintenanceWindowMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateMaintenanceWindow{}, middleware.After) if err != nil { return err @@ -134,6 +135,13 @@ func addOperationCreateMaintenanceWindowMiddlewares(stack *middleware.Stack, opt if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateMaintenanceWindow"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -152,16 +160,13 @@ func addOperationCreateMaintenanceWindowMiddlewares(stack *middleware.Stack, opt if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -170,6 +175,9 @@ func addOperationCreateMaintenanceWindowMiddlewares(stack *middleware.Stack, opt if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addIdempotencyToken_opCreateMaintenanceWindowMiddleware(stack, options); err != nil { return err } @@ -179,6 +187,9 @@ func addOperationCreateMaintenanceWindowMiddlewares(stack *middleware.Stack, opt if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateMaintenanceWindow(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -188,6 +199,9 @@ func addOperationCreateMaintenanceWindowMiddlewares(stack *middleware.Stack, opt if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -228,7 +242,6 @@ func newServiceMetadataMiddleware_opCreateMaintenanceWindow(region string) *awsm return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "CreateMaintenanceWindow", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateOpsItem.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateOpsItem.go index 0ef93aee..cd081f91 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateOpsItem.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateOpsItem.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -12,22 +13,21 @@ import ( "time" ) -// Creates a new OpsItem. You must have permission in AWS Identity and Access -// Management (IAM) to create a new OpsItem. For more information, see Getting -// started with OpsCenter -// (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-getting-started.html) -// in the AWS Systems Manager User Guide. Operations engineers and IT professionals -// use OpsCenter to view, investigate, and remediate operational issues impacting -// the performance and health of their AWS resources. For more information, see AWS -// Systems Manager OpsCenter -// (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter.html) in -// the AWS Systems Manager User Guide. +// Creates a new OpsItem. You must have permission in Identity and Access +// Management (IAM) to create a new OpsItem. For more information, see Set up +// OpsCenter (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-setup.html) +// in the Amazon Web Services Systems Manager User Guide. Operations engineers and +// IT professionals use Amazon Web Services Systems Manager OpsCenter to view, +// investigate, and remediate operational issues impacting the performance and +// health of their Amazon Web Services resources. For more information, see Amazon +// Web Services Systems Manager OpsCenter (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter.html) +// in the Amazon Web Services Systems Manager User Guide. func (c *Client) CreateOpsItem(ctx context.Context, params *CreateOpsItemInput, optFns ...func(*Options)) (*CreateOpsItemOutput, error) { if params == nil { params = &CreateOpsItemInput{} } - result, metadata, err := c.invokeOperation(ctx, "CreateOpsItem", params, optFns, addOperationCreateOpsItemMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "CreateOpsItem", params, optFns, c.addOperationCreateOpsItemMiddlewares) if err != nil { return nil, err } @@ -39,13 +39,15 @@ func (c *Client) CreateOpsItem(ctx context.Context, params *CreateOpsItemInput, type CreateOpsItemInput struct { - // Information about the OpsItem. + // User-defined text that contains information about the OpsItem, in Markdown + // format. Provide enough information so that users viewing this OpsItem for the + // first time understand the issue. // // This member is required. Description *string // The origin of the OpsItem, such as Amazon EC2 or Systems Manager. The source - // name can't contain the following strings: aws, amazon, and amzn. + // name can't contain the following strings: aws , amazon , and amzn . // // This member is required. Source *string @@ -56,50 +58,62 @@ type CreateOpsItemInput struct { // This member is required. Title *string + // The target Amazon Web Services account where you want to create an OpsItem. To + // make this call, your account must be configured to work with OpsItems across + // accounts. For more information, see Set up OpsCenter (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-setup.html) + // in the Amazon Web Services Systems Manager User Guide. + AccountId *string + // The time a runbook workflow ended. Currently reported only for the OpsItem type - // /aws/changerequest. + // /aws/changerequest . ActualEndTime *time.Time // The time a runbook workflow started. Currently reported only for the OpsItem - // type /aws/changerequest. + // type /aws/changerequest . ActualStartTime *time.Time // Specify a category to assign to an OpsItem. Category *string - // The Amazon Resource Name (ARN) of an SNS topic where notifications are sent when - // this OpsItem is edited or changed. + // The Amazon Resource Name (ARN) of an SNS topic where notifications are sent + // when this OpsItem is edited or changed. Notifications []types.OpsItemNotification - // Operational data is custom data that provides useful reference details about the - // OpsItem. For example, you can specify log files, error strings, license keys, - // troubleshooting tips, or other relevant data. You enter operational data as - // key-value pairs. The key has a maximum length of 128 characters. The value has a - // maximum size of 20 KB. Operational data keys can't begin with the following: - // amazon, aws, amzn, ssm, /amazon, /aws, /amzn, /ssm. You can choose to make the - // data searchable by other users in the account or you can restrict search access. - // Searchable data means that all users with access to the OpsItem Overview page - // (as provided by the DescribeOpsItems API action) can view and search on the - // specified data. Operational data that is not searchable is only viewable by - // users who have access to the OpsItem (as provided by the GetOpsItem API action). - // Use the /aws/resources key in OperationalData to specify a related resource in - // the request. Use the /aws/automations key in OperationalData to associate an - // Automation runbook with the OpsItem. To view AWS CLI example commands that use - // these keys, see Creating OpsItems manually - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-creating-OpsItems.html#OpsCenter-manually-create-OpsItems) - // in the AWS Systems Manager User Guide. + // Operational data is custom data that provides useful reference details about + // the OpsItem. For example, you can specify log files, error strings, license + // keys, troubleshooting tips, or other relevant data. You enter operational data + // as key-value pairs. The key has a maximum length of 128 characters. The value + // has a maximum size of 20 KB. Operational data keys can't begin with the + // following: amazon , aws , amzn , ssm , /amazon , /aws , /amzn , /ssm . You can + // choose to make the data searchable by other users in the account or you can + // restrict search access. Searchable data means that all users with access to the + // OpsItem Overview page (as provided by the DescribeOpsItems API operation) can + // view and search on the specified data. Operational data that isn't searchable is + // only viewable by users who have access to the OpsItem (as provided by the + // GetOpsItem API operation). Use the /aws/resources key in OperationalData to + // specify a related resource in the request. Use the /aws/automations key in + // OperationalData to associate an Automation runbook with the OpsItem. To view + // Amazon Web Services CLI example commands that use these keys, see Creating + // OpsItems manually (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-manually-create-OpsItems.html) + // in the Amazon Web Services Systems Manager User Guide. OperationalData map[string]types.OpsItemDataValue - // The type of OpsItem to create. Currently, the only valid values are - // /aws/changerequest and /aws/issue. + // The type of OpsItem to create. Systems Manager supports the following types of + // OpsItems: + // - /aws/issue This type of OpsItem is used for default OpsItems created by + // OpsCenter. + // - /aws/changerequest This type of OpsItem is used by Change Manager for + // reviewing and approving or rejecting change requests. + // - /aws/insight This type of OpsItem is used by OpsCenter for aggregating and + // reporting on duplicate OpsItems. OpsItemType *string // The time specified in a change request for a runbook workflow to end. Currently - // supported only for the OpsItem type /aws/changerequest. + // supported only for the OpsItem type /aws/changerequest . PlannedEndTime *time.Time // The time specified in a change request for a runbook workflow to start. - // Currently supported only for the OpsItem type /aws/changerequest. + // Currently supported only for the OpsItem type /aws/changerequest . PlannedStartTime *time.Time // The importance of this OpsItem in relation to other OpsItems in the system. @@ -113,26 +127,34 @@ type CreateOpsItemInput struct { // Specify a severity to assign to an OpsItem. Severity *string - // Optional metadata that you assign to a resource. You can restrict access to - // OpsItems by using an inline IAM policy that specifies tags. For more - // information, see Getting started with OpsCenter - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-getting-started.html#OpsCenter-getting-started-user-permissions) - // in the AWS Systems Manager User Guide. Tags use a key-value pair. For example: - // Key=Department,Value=Finance To add tags to an existing OpsItem, use the - // AddTagsToResource action. + // Optional metadata that you assign to a resource. Tags use a key-value pair. For + // example: Key=Department,Value=Finance To add tags to a new OpsItem, a user must + // have IAM permissions for both the ssm:CreateOpsItems operation and the + // ssm:AddTagsToResource operation. To add tags to an existing OpsItem, use the + // AddTagsToResource operation. Tags []types.Tag + + noSmithyDocumentSerde } type CreateOpsItemOutput struct { + // The OpsItem Amazon Resource Name (ARN). + OpsItemArn *string + // The ID of the OpsItem. OpsItemId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationCreateOpsItemMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationCreateOpsItemMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateOpsItem{}, middleware.After) if err != nil { return err @@ -141,6 +163,13 @@ func addOperationCreateOpsItemMiddlewares(stack *middleware.Stack, options Optio if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateOpsItem"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -159,16 +188,13 @@ func addOperationCreateOpsItemMiddlewares(stack *middleware.Stack, options Optio if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -177,12 +203,18 @@ func addOperationCreateOpsItemMiddlewares(stack *middleware.Stack, options Optio if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpCreateOpsItemValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateOpsItem(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -192,6 +224,9 @@ func addOperationCreateOpsItemMiddlewares(stack *middleware.Stack, options Optio if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -199,7 +234,6 @@ func newServiceMetadataMiddleware_opCreateOpsItem(region string) *awsmiddleware. return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "CreateOpsItem", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateOpsMetadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateOpsMetadata.go index 2a5d2b45..dc87bc24 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateOpsMetadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateOpsMetadata.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -11,15 +12,15 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// If you create a new application in Application Manager, Systems Manager calls -// this API action to specify information about the new application, including the -// application type. +// If you create a new application in Application Manager, Amazon Web Services +// Systems Manager calls this API operation to specify information about the new +// application, including the application type. func (c *Client) CreateOpsMetadata(ctx context.Context, params *CreateOpsMetadataInput, optFns ...func(*Options)) (*CreateOpsMetadataOutput, error) { if params == nil { params = &CreateOpsMetadataInput{} } - result, metadata, err := c.invokeOperation(ctx, "CreateOpsMetadata", params, optFns, addOperationCreateOpsMetadataMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "CreateOpsMetadata", params, optFns, c.addOperationCreateOpsMetadataMiddlewares) if err != nil { return nil, err } @@ -38,6 +39,18 @@ type CreateOpsMetadataInput struct { // Metadata for a new Application Manager application. Metadata map[string]types.MetadataValue + + // Optional metadata that you assign to a resource. You can specify a maximum of + // five tags for an OpsMetadata object. Tags enable you to categorize a resource in + // different ways, such as by purpose, owner, or environment. For example, you + // might want to tag an OpsMetadata object to identify an environment or target + // Amazon Web Services Region. In this case, you could specify the following + // key-value pairs: + // - Key=Environment,Value=Production + // - Key=Region,Value=us-east-2 + Tags []types.Tag + + noSmithyDocumentSerde } type CreateOpsMetadataOutput struct { @@ -48,9 +61,14 @@ type CreateOpsMetadataOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationCreateOpsMetadataMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationCreateOpsMetadataMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateOpsMetadata{}, middleware.After) if err != nil { return err @@ -59,6 +77,13 @@ func addOperationCreateOpsMetadataMiddlewares(stack *middleware.Stack, options O if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateOpsMetadata"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -77,16 +102,13 @@ func addOperationCreateOpsMetadataMiddlewares(stack *middleware.Stack, options O if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -95,12 +117,18 @@ func addOperationCreateOpsMetadataMiddlewares(stack *middleware.Stack, options O if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpCreateOpsMetadataValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateOpsMetadata(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -110,6 +138,9 @@ func addOperationCreateOpsMetadataMiddlewares(stack *middleware.Stack, options O if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -117,7 +148,6 @@ func newServiceMetadataMiddleware_opCreateOpsMetadata(region string) *awsmiddlew return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "CreateOpsMetadata", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreatePatchBaseline.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreatePatchBaseline.go index e2befb8f..d1f8cc0e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreatePatchBaseline.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreatePatchBaseline.go @@ -12,15 +12,14 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a patch baseline. For information about valid key and value pairs in -// PatchFilters for each supported operating system type, see PatchFilter -// (http://docs.aws.amazon.com/systems-manager/latest/APIReference/API_PatchFilter.html). +// Creates a patch baseline. For information about valid key-value pairs in +// PatchFilters for each supported operating system type, see PatchFilter . func (c *Client) CreatePatchBaseline(ctx context.Context, params *CreatePatchBaselineInput, optFns ...func(*Options)) (*CreatePatchBaselineOutput, error) { if params == nil { params = &CreatePatchBaselineInput{} } - result, metadata, err := c.invokeOperation(ctx, "CreatePatchBaseline", params, optFns, addOperationCreatePatchBaselineMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "CreatePatchBaseline", params, optFns, c.addOperationCreatePatchBaselineMiddlewares) if err != nil { return nil, err } @@ -42,20 +41,19 @@ type CreatePatchBaselineInput struct { // A list of explicitly approved patches for the baseline. For information about // accepted formats for lists of approved patches and rejected patches, see About - // package name formats for approved and rejected patch lists - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html) - // in the AWS Systems Manager User Guide. + // package name formats for approved and rejected patch lists (https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html) + // in the Amazon Web Services Systems Manager User Guide. ApprovedPatches []string - // Defines the compliance level for approved patches. This means that if an - // approved patch is reported as missing, this is the severity of the compliance - // violation. The default value is UNSPECIFIED. + // Defines the compliance level for approved patches. When an approved patch is + // reported as missing, this value describes the severity of the compliance + // violation. The default value is UNSPECIFIED . ApprovedPatchesComplianceLevel types.PatchComplianceLevel // Indicates whether the list of approved patches includes non-security updates - // that should be applied to the instances. The default value is 'false'. Applies - // to Linux instances only. - ApprovedPatchesEnableNonSecurity bool + // that should be applied to the managed nodes. The default value is false . + // Applies to Linux managed nodes only. + ApprovedPatchesEnableNonSecurity *bool // User-provided idempotency token. ClientToken *string @@ -66,50 +64,45 @@ type CreatePatchBaselineInput struct { // A set of global filters used to include patches in the baseline. GlobalFilters *types.PatchFilterGroup - // Defines the operating system the patch baseline applies to. The Default value is - // WINDOWS. + // Defines the operating system the patch baseline applies to. The default value + // is WINDOWS . OperatingSystem types.OperatingSystem // A list of explicitly rejected patches for the baseline. For information about // accepted formats for lists of approved patches and rejected patches, see About - // package name formats for approved and rejected patch lists - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html) - // in the AWS Systems Manager User Guide. + // package name formats for approved and rejected patch lists (https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html) + // in the Amazon Web Services Systems Manager User Guide. RejectedPatches []string // The action for Patch Manager to take on patches included in the RejectedPackages // list. - // - // * ALLOW_AS_DEPENDENCY: A package in the Rejected patches list is - // installed only if it is a dependency of another package. It is considered - // compliant with the patch baseline, and its status is reported as InstalledOther. - // This is the default action if no option is specified. - // - // * BLOCK: Packages in the - // RejectedPatches list, and packages that include them as dependencies, are not - // installed under any circumstances. If a package was installed before it was - // added to the Rejected patches list, it is considered non-compliant with the - // patch baseline, and its status is reported as InstalledRejected. + // - ALLOW_AS_DEPENDENCY : A package in the Rejected patches list is installed + // only if it is a dependency of another package. It is considered compliant with + // the patch baseline, and its status is reported as InstalledOther . This is the + // default action if no option is specified. + // - BLOCK : Packages in the RejectedPatches list, and packages that include them + // as dependencies, aren't installed under any circumstances. If a package was + // installed before it was added to the Rejected patches list, it is considered + // non-compliant with the patch baseline, and its status is reported as + // InstalledRejected . RejectedPatchesAction types.PatchAction - // Information about the patches to use to update the instances, including target - // operating systems and source repositories. Applies to Linux instances only. + // Information about the patches to use to update the managed nodes, including + // target operating systems and source repositories. Applies to Linux managed nodes + // only. Sources []types.PatchSource - // Optional metadata that you assign to a resource. Tags enable you to categorize a - // resource in different ways, such as by purpose, owner, or environment. For + // Optional metadata that you assign to a resource. Tags enable you to categorize + // a resource in different ways, such as by purpose, owner, or environment. For // example, you might want to tag a patch baseline to identify the severity level // of patches it specifies and the operating system family it applies to. In this - // case, you could specify the following key name/value pairs: - // - // * - // Key=PatchSeverity,Value=Critical - // - // * Key=OS,Value=Windows - // - // To add tags to an - // existing patch baseline, use the AddTagsToResource action. + // case, you could specify the following key-value pairs: + // - Key=PatchSeverity,Value=Critical + // - Key=OS,Value=Windows + // To add tags to an existing patch baseline, use the AddTagsToResource operation. Tags []types.Tag + + noSmithyDocumentSerde } type CreatePatchBaselineOutput struct { @@ -119,9 +112,14 @@ type CreatePatchBaselineOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationCreatePatchBaselineMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationCreatePatchBaselineMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreatePatchBaseline{}, middleware.After) if err != nil { return err @@ -130,6 +128,13 @@ func addOperationCreatePatchBaselineMiddlewares(stack *middleware.Stack, options if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreatePatchBaseline"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -148,16 +153,13 @@ func addOperationCreatePatchBaselineMiddlewares(stack *middleware.Stack, options if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -166,6 +168,9 @@ func addOperationCreatePatchBaselineMiddlewares(stack *middleware.Stack, options if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addIdempotencyToken_opCreatePatchBaselineMiddleware(stack, options); err != nil { return err } @@ -175,6 +180,9 @@ func addOperationCreatePatchBaselineMiddlewares(stack *middleware.Stack, options if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreatePatchBaseline(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -184,6 +192,9 @@ func addOperationCreatePatchBaselineMiddlewares(stack *middleware.Stack, options if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -224,7 +235,6 @@ func newServiceMetadataMiddleware_opCreatePatchBaseline(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "CreatePatchBaseline", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateResourceDataSync.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateResourceDataSync.go index 04cc33af..69343cec 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateResourceDataSync.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_CreateResourceDataSync.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -12,33 +13,33 @@ import ( ) // A resource data sync helps you view data from multiple sources in a single -// location. Systems Manager offers two types of resource data sync: -// SyncToDestination and SyncFromSource. You can configure Systems Manager +// location. Amazon Web Services Systems Manager offers two types of resource data +// sync: SyncToDestination and SyncFromSource . You can configure Systems Manager // Inventory to use the SyncToDestination type to synchronize Inventory data from -// multiple AWS Regions to a single S3 bucket. For more information, see -// Configuring Resource Data Sync for Inventory -// (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-inventory-datasync.html) -// in the AWS Systems Manager User Guide. You can configure Systems Manager -// Explorer to use the SyncFromSource type to synchronize operational work items -// (OpsItems) and operational data (OpsData) from multiple AWS Regions to a single -// S3 bucket. This type can synchronize OpsItems and OpsData from multiple AWS -// accounts and Regions or EntireOrganization by using AWS Organizations. For more +// multiple Amazon Web Services Regions to a single Amazon Simple Storage Service +// (Amazon S3) bucket. For more information, see Configuring resource data sync +// for Inventory (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-inventory-datasync.html) +// in the Amazon Web Services Systems Manager User Guide. You can configure Systems +// Manager Explorer to use the SyncFromSource type to synchronize operational work +// items (OpsItems) and operational data (OpsData) from multiple Amazon Web +// Services Regions to a single Amazon S3 bucket. This type can synchronize +// OpsItems and OpsData from multiple Amazon Web Services accounts and Amazon Web +// Services Regions or EntireOrganization by using Organizations. For more // information, see Setting up Systems Manager Explorer to display data from -// multiple accounts and Regions -// (https://docs.aws.amazon.com/systems-manager/latest/userguide/Explorer-resource-data-sync.html) -// in the AWS Systems Manager User Guide. A resource data sync is an asynchronous -// operation that returns immediately. After a successful initial sync is -// completed, the system continuously syncs data. To check the status of a sync, -// use the ListResourceDataSync. By default, data is not encrypted in Amazon S3. We -// strongly recommend that you enable encryption in Amazon S3 to ensure secure data -// storage. We also recommend that you secure access to the Amazon S3 bucket by -// creating a restrictive bucket policy. +// multiple accounts and Regions (https://docs.aws.amazon.com/systems-manager/latest/userguide/Explorer-resource-data-sync.html) +// in the Amazon Web Services Systems Manager User Guide. A resource data sync is +// an asynchronous operation that returns immediately. After a successful initial +// sync is completed, the system continuously syncs data. To check the status of a +// sync, use the ListResourceDataSync . By default, data isn't encrypted in Amazon +// S3. We strongly recommend that you enable encryption in Amazon S3 to ensure +// secure data storage. We also recommend that you secure access to the Amazon S3 +// bucket by creating a restrictive bucket policy. func (c *Client) CreateResourceDataSync(ctx context.Context, params *CreateResourceDataSyncInput, optFns ...func(*Options)) (*CreateResourceDataSyncOutput, error) { if params == nil { params = &CreateResourceDataSyncInput{} } - result, metadata, err := c.invokeOperation(ctx, "CreateResourceDataSync", params, optFns, addOperationCreateResourceDataSyncMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "CreateResourceDataSync", params, optFns, c.addOperationCreateResourceDataSyncMiddlewares) if err != nil { return nil, err } @@ -64,21 +65,28 @@ type CreateResourceDataSyncInput struct { SyncSource *types.ResourceDataSyncSource // Specify SyncToDestination to create a resource data sync that synchronizes data - // to an S3 bucket for Inventory. If you specify SyncToDestination, you must - // provide a value for S3Destination. Specify SyncFromSource to synchronize data - // from a single account and multiple Regions, or multiple AWS accounts and - // Regions, as listed in AWS Organizations for Explorer. If you specify - // SyncFromSource, you must provide a value for SyncSource. The default value is - // SyncToDestination. + // to an S3 bucket for Inventory. If you specify SyncToDestination , you must + // provide a value for S3Destination . Specify SyncFromSource to synchronize data + // from a single account and multiple Regions, or multiple Amazon Web Services + // accounts and Amazon Web Services Regions, as listed in Organizations for + // Explorer. If you specify SyncFromSource , you must provide a value for + // SyncSource . The default value is SyncToDestination . SyncType *string + + noSmithyDocumentSerde } type CreateResourceDataSyncOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationCreateResourceDataSyncMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationCreateResourceDataSyncMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateResourceDataSync{}, middleware.After) if err != nil { return err @@ -87,6 +95,13 @@ func addOperationCreateResourceDataSyncMiddlewares(stack *middleware.Stack, opti if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateResourceDataSync"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -105,16 +120,13 @@ func addOperationCreateResourceDataSyncMiddlewares(stack *middleware.Stack, opti if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -123,12 +135,18 @@ func addOperationCreateResourceDataSyncMiddlewares(stack *middleware.Stack, opti if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpCreateResourceDataSyncValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateResourceDataSync(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -138,6 +156,9 @@ func addOperationCreateResourceDataSyncMiddlewares(stack *middleware.Stack, opti if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -145,7 +166,6 @@ func newServiceMetadataMiddleware_opCreateResourceDataSync(region string) *awsmi return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "CreateResourceDataSync", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteActivation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteActivation.go index 68fe6f4c..1f5d44d2 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteActivation.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteActivation.go @@ -4,22 +4,23 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes an activation. You are not required to delete an activation. If you +// Deletes an activation. You aren't required to delete an activation. If you // delete an activation, you can no longer use it to register additional managed -// instances. Deleting an activation does not de-register managed instances. You -// must manually de-register managed instances. +// nodes. Deleting an activation doesn't de-register managed nodes. You must +// manually de-register managed nodes. func (c *Client) DeleteActivation(ctx context.Context, params *DeleteActivationInput, optFns ...func(*Options)) (*DeleteActivationOutput, error) { if params == nil { params = &DeleteActivationInput{} } - result, metadata, err := c.invokeOperation(ctx, "DeleteActivation", params, optFns, addOperationDeleteActivationMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DeleteActivation", params, optFns, c.addOperationDeleteActivationMiddlewares) if err != nil { return nil, err } @@ -35,14 +36,21 @@ type DeleteActivationInput struct { // // This member is required. ActivationId *string + + noSmithyDocumentSerde } type DeleteActivationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDeleteActivationMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDeleteActivationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteActivation{}, middleware.After) if err != nil { return err @@ -51,6 +59,13 @@ func addOperationDeleteActivationMiddlewares(stack *middleware.Stack, options Op if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteActivation"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -69,16 +84,13 @@ func addOperationDeleteActivationMiddlewares(stack *middleware.Stack, options Op if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -87,12 +99,18 @@ func addOperationDeleteActivationMiddlewares(stack *middleware.Stack, options Op if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDeleteActivationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteActivation(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -102,6 +120,9 @@ func addOperationDeleteActivationMiddlewares(stack *middleware.Stack, options Op if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -109,7 +130,6 @@ func newServiceMetadataMiddleware_opDeleteActivation(region string) *awsmiddlewa return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DeleteActivation", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteAssociation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteAssociation.go index 47ac8402..5309e986 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteAssociation.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteAssociation.go @@ -4,23 +4,26 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Disassociates the specified Systems Manager document from the specified -// instance. When you disassociate a document from an instance, it does not change -// the configuration of the instance. To change the configuration state of an -// instance after you disassociate a document, you must create a new document with -// the desired configuration and associate it with the instance. +// Disassociates the specified Amazon Web Services Systems Manager document (SSM +// document) from the specified managed node. If you created the association by +// using the Targets parameter, then you must delete the association by using the +// association ID. When you disassociate a document from a managed node, it doesn't +// change the configuration of the node. To change the configuration state of a +// managed node after you disassociate a document, you must create a new document +// with the desired configuration and associate it with the node. func (c *Client) DeleteAssociation(ctx context.Context, params *DeleteAssociationInput, optFns ...func(*Options)) (*DeleteAssociationOutput, error) { if params == nil { params = &DeleteAssociationInput{} } - result, metadata, err := c.invokeOperation(ctx, "DeleteAssociation", params, optFns, addOperationDeleteAssociationMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DeleteAssociation", params, optFns, c.addOperationDeleteAssociationMiddlewares) if err != nil { return nil, err } @@ -35,19 +38,32 @@ type DeleteAssociationInput struct { // The association ID that you want to delete. AssociationId *string - // The ID of the instance. + // The managed node ID. InstanceId has been deprecated. To specify a managed node + // ID for an association, use the Targets parameter. Requests that include the + // parameter InstanceID with Systems Manager documents (SSM documents) that use + // schema version 2.0 or later will fail. In addition, if you use the parameter + // InstanceId , you can't use the parameters AssociationName , DocumentVersion , + // MaxErrors , MaxConcurrency , OutputLocation , or ScheduleExpression . To use + // these parameters, you must use the Targets parameter. InstanceId *string - // The name of the Systems Manager document. + // The name of the SSM document. Name *string + + noSmithyDocumentSerde } type DeleteAssociationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDeleteAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDeleteAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteAssociation{}, middleware.After) if err != nil { return err @@ -56,6 +72,13 @@ func addOperationDeleteAssociationMiddlewares(stack *middleware.Stack, options O if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteAssociation"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -74,16 +97,13 @@ func addOperationDeleteAssociationMiddlewares(stack *middleware.Stack, options O if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -92,9 +112,15 @@ func addOperationDeleteAssociationMiddlewares(stack *middleware.Stack, options O if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAssociation(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -104,6 +130,9 @@ func addOperationDeleteAssociationMiddlewares(stack *middleware.Stack, options O if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -111,7 +140,6 @@ func newServiceMetadataMiddleware_opDeleteAssociation(region string) *awsmiddlew return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DeleteAssociation", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteDocument.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteDocument.go index 9d586bb8..22c5089b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteDocument.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteDocument.go @@ -4,22 +4,23 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes the Systems Manager document and all instance associations to the -// document. Before you delete the document, we recommend that you use -// DeleteAssociation to disassociate all instances that are associated with the -// document. +// Deletes the Amazon Web Services Systems Manager document (SSM document) and all +// managed node associations to the document. Before you delete the document, we +// recommend that you use DeleteAssociation to disassociate all managed nodes that +// are associated with the document. func (c *Client) DeleteDocument(ctx context.Context, params *DeleteDocumentInput, optFns ...func(*Options)) (*DeleteDocumentOutput, error) { if params == nil { params = &DeleteDocumentInput{} } - result, metadata, err := c.invokeOperation(ctx, "DeleteDocument", params, optFns, addOperationDeleteDocumentMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DeleteDocument", params, optFns, c.addOperationDeleteDocumentMiddlewares) if err != nil { return nil, err } @@ -42,21 +43,28 @@ type DeleteDocumentInput struct { // Some SSM document types require that you specify a Force flag before you can // delete the document. For example, you must specify a Force flag to delete a - // document of type ApplicationConfigurationSchema. You can restrict access to the - // Force flag in an AWS Identity and Access Management (IAM) policy. + // document of type ApplicationConfigurationSchema . You can restrict access to the + // Force flag in an Identity and Access Management (IAM) policy. Force bool // The version name of the document that you want to delete. If not provided, all // versions of the document are deleted. VersionName *string + + noSmithyDocumentSerde } type DeleteDocumentOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDeleteDocumentMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDeleteDocumentMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteDocument{}, middleware.After) if err != nil { return err @@ -65,6 +73,13 @@ func addOperationDeleteDocumentMiddlewares(stack *middleware.Stack, options Opti if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteDocument"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -83,16 +98,13 @@ func addOperationDeleteDocumentMiddlewares(stack *middleware.Stack, options Opti if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -101,12 +113,18 @@ func addOperationDeleteDocumentMiddlewares(stack *middleware.Stack, options Opti if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDeleteDocumentValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDocument(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -116,6 +134,9 @@ func addOperationDeleteDocumentMiddlewares(stack *middleware.Stack, options Opti if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -123,7 +144,6 @@ func newServiceMetadataMiddleware_opDeleteDocument(region string) *awsmiddleware return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DeleteDocument", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteInventory.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteInventory.go index a6d6d50c..af8a0108 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteInventory.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteInventory.go @@ -20,7 +20,7 @@ func (c *Client) DeleteInventory(ctx context.Context, params *DeleteInventoryInp params = &DeleteInventoryInput{} } - result, metadata, err := c.invokeOperation(ctx, "DeleteInventory", params, optFns, addOperationDeleteInventoryMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DeleteInventory", params, optFns, c.addOperationDeleteInventoryMiddlewares) if err != nil { return nil, err } @@ -53,24 +53,25 @@ type DeleteInventoryInput struct { // associated with the custom inventory type. Choose one of the following options: // DisableSchema: If you choose this option, the system ignores all inventory data // for the specified version, and any earlier versions. To enable this schema - // again, you must call the PutInventory action for a version greater than the + // again, you must call the PutInventory operation for a version greater than the // disabled version. DeleteSchema: This option deletes the specified custom type // from the Inventory service. You can recreate the schema later, if you want. SchemaDeleteOption types.InventorySchemaDeleteOption + + noSmithyDocumentSerde } type DeleteInventoryOutput struct { - // Every DeleteInventory action is assigned a unique ID. This option returns a + // Every DeleteInventory operation is assigned a unique ID. This option returns a // unique ID. You can use this ID to query the status of a delete operation. This // option is useful for ensuring that a delete operation has completed before you - // begin other actions. + // begin other operations. DeletionId *string // A summary of the delete operation. For more information about this summary, see - // Deleting custom inventory - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-inventory-custom.html#sysman-inventory-delete-summary) - // in the AWS Systems Manager User Guide. + // Deleting custom inventory (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-inventory-custom.html#sysman-inventory-delete-summary) + // in the Amazon Web Services Systems Manager User Guide. DeletionSummary *types.InventoryDeletionSummary // The name of the inventory data type specified in the request. @@ -78,9 +79,14 @@ type DeleteInventoryOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDeleteInventoryMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDeleteInventoryMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteInventory{}, middleware.After) if err != nil { return err @@ -89,6 +95,13 @@ func addOperationDeleteInventoryMiddlewares(stack *middleware.Stack, options Opt if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteInventory"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -107,16 +120,13 @@ func addOperationDeleteInventoryMiddlewares(stack *middleware.Stack, options Opt if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -125,6 +135,9 @@ func addOperationDeleteInventoryMiddlewares(stack *middleware.Stack, options Opt if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addIdempotencyToken_opDeleteInventoryMiddleware(stack, options); err != nil { return err } @@ -134,6 +147,9 @@ func addOperationDeleteInventoryMiddlewares(stack *middleware.Stack, options Opt if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteInventory(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -143,6 +159,9 @@ func addOperationDeleteInventoryMiddlewares(stack *middleware.Stack, options Opt if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -183,7 +202,6 @@ func newServiceMetadataMiddleware_opDeleteInventory(region string) *awsmiddlewar return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DeleteInventory", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteMaintenanceWindow.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteMaintenanceWindow.go index dccdf0f6..bc6c70aa 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteMaintenanceWindow.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteMaintenanceWindow.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" @@ -16,7 +17,7 @@ func (c *Client) DeleteMaintenanceWindow(ctx context.Context, params *DeleteMain params = &DeleteMaintenanceWindowInput{} } - result, metadata, err := c.invokeOperation(ctx, "DeleteMaintenanceWindow", params, optFns, addOperationDeleteMaintenanceWindowMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DeleteMaintenanceWindow", params, optFns, c.addOperationDeleteMaintenanceWindowMiddlewares) if err != nil { return nil, err } @@ -32,6 +33,8 @@ type DeleteMaintenanceWindowInput struct { // // This member is required. WindowId *string + + noSmithyDocumentSerde } type DeleteMaintenanceWindowOutput struct { @@ -41,9 +44,14 @@ type DeleteMaintenanceWindowOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDeleteMaintenanceWindowMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDeleteMaintenanceWindowMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteMaintenanceWindow{}, middleware.After) if err != nil { return err @@ -52,6 +60,13 @@ func addOperationDeleteMaintenanceWindowMiddlewares(stack *middleware.Stack, opt if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteMaintenanceWindow"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -70,16 +85,13 @@ func addOperationDeleteMaintenanceWindowMiddlewares(stack *middleware.Stack, opt if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -88,12 +100,18 @@ func addOperationDeleteMaintenanceWindowMiddlewares(stack *middleware.Stack, opt if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDeleteMaintenanceWindowValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteMaintenanceWindow(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -103,6 +121,9 @@ func addOperationDeleteMaintenanceWindowMiddlewares(stack *middleware.Stack, opt if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -110,7 +131,6 @@ func newServiceMetadataMiddleware_opDeleteMaintenanceWindow(region string) *awsm return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DeleteMaintenanceWindow", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteOpsItem.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteOpsItem.go new file mode 100644 index 00000000..173debc5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteOpsItem.go @@ -0,0 +1,149 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssm + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Delete an OpsItem. You must have permission in Identity and Access Management +// (IAM) to delete an OpsItem. Note the following important information about this +// operation. +// - Deleting an OpsItem is irreversible. You can't restore a deleted OpsItem. +// - This operation uses an eventual consistency model, which means the system +// can take a few minutes to complete this operation. If you delete an OpsItem and +// immediately call, for example, GetOpsItem , the deleted OpsItem might still +// appear in the response. +// - This operation is idempotent. The system doesn't throw an exception if you +// repeatedly call this operation for the same OpsItem. If the first call is +// successful, all additional calls return the same successful response as the +// first call. +// - This operation doesn't support cross-account calls. A delegated +// administrator or management account can't delete OpsItems in other accounts, +// even if OpsCenter has been set up for cross-account administration. For more +// information about cross-account administration, see Setting up OpsCenter to +// centrally manage OpsItems across accounts (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-setting-up-cross-account.html) +// in the Systems Manager User Guide. +func (c *Client) DeleteOpsItem(ctx context.Context, params *DeleteOpsItemInput, optFns ...func(*Options)) (*DeleteOpsItemOutput, error) { + if params == nil { + params = &DeleteOpsItemInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteOpsItem", params, optFns, c.addOperationDeleteOpsItemMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteOpsItemOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteOpsItemInput struct { + + // The ID of the OpsItem that you want to delete. + // + // This member is required. + OpsItemId *string + + noSmithyDocumentSerde +} + +type DeleteOpsItemOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteOpsItemMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteOpsItem{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteOpsItem{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteOpsItem"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteOpsItemValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteOpsItem(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteOpsItem(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteOpsItem", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteOpsMetadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteOpsMetadata.go index 6bdfd99e..04e28268 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteOpsMetadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteOpsMetadata.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" @@ -16,7 +17,7 @@ func (c *Client) DeleteOpsMetadata(ctx context.Context, params *DeleteOpsMetadat params = &DeleteOpsMetadataInput{} } - result, metadata, err := c.invokeOperation(ctx, "DeleteOpsMetadata", params, optFns, addOperationDeleteOpsMetadataMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DeleteOpsMetadata", params, optFns, c.addOperationDeleteOpsMetadataMiddlewares) if err != nil { return nil, err } @@ -32,14 +33,21 @@ type DeleteOpsMetadataInput struct { // // This member is required. OpsMetadataArn *string + + noSmithyDocumentSerde } type DeleteOpsMetadataOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDeleteOpsMetadataMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDeleteOpsMetadataMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteOpsMetadata{}, middleware.After) if err != nil { return err @@ -48,6 +56,13 @@ func addOperationDeleteOpsMetadataMiddlewares(stack *middleware.Stack, options O if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteOpsMetadata"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -66,16 +81,13 @@ func addOperationDeleteOpsMetadataMiddlewares(stack *middleware.Stack, options O if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -84,12 +96,18 @@ func addOperationDeleteOpsMetadataMiddlewares(stack *middleware.Stack, options O if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDeleteOpsMetadataValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteOpsMetadata(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -99,6 +117,9 @@ func addOperationDeleteOpsMetadataMiddlewares(stack *middleware.Stack, options O if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -106,7 +127,6 @@ func newServiceMetadataMiddleware_opDeleteOpsMetadata(region string) *awsmiddlew return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DeleteOpsMetadata", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteParameter.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteParameter.go index 08a4cf08..066e055d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteParameter.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteParameter.go @@ -4,19 +4,21 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Delete a parameter from the system. +// Delete a parameter from the system. After deleting a parameter, wait for at +// least 30 seconds to create a parameter with the same name. func (c *Client) DeleteParameter(ctx context.Context, params *DeleteParameterInput, optFns ...func(*Options)) (*DeleteParameterOutput, error) { if params == nil { params = &DeleteParameterInput{} } - result, metadata, err := c.invokeOperation(ctx, "DeleteParameter", params, optFns, addOperationDeleteParameterMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DeleteParameter", params, optFns, c.addOperationDeleteParameterMiddlewares) if err != nil { return nil, err } @@ -32,14 +34,21 @@ type DeleteParameterInput struct { // // This member is required. Name *string + + noSmithyDocumentSerde } type DeleteParameterOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDeleteParameterMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDeleteParameterMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteParameter{}, middleware.After) if err != nil { return err @@ -48,6 +57,13 @@ func addOperationDeleteParameterMiddlewares(stack *middleware.Stack, options Opt if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteParameter"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -66,16 +82,13 @@ func addOperationDeleteParameterMiddlewares(stack *middleware.Stack, options Opt if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -84,12 +97,18 @@ func addOperationDeleteParameterMiddlewares(stack *middleware.Stack, options Opt if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDeleteParameterValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteParameter(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -99,6 +118,9 @@ func addOperationDeleteParameterMiddlewares(stack *middleware.Stack, options Opt if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -106,7 +128,6 @@ func newServiceMetadataMiddleware_opDeleteParameter(region string) *awsmiddlewar return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DeleteParameter", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteParameters.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteParameters.go index 929fe18c..ce6c9da3 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteParameters.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteParameters.go @@ -4,19 +4,21 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Delete a list of parameters. +// Delete a list of parameters. After deleting a parameter, wait for at least 30 +// seconds to create a parameter with the same name. func (c *Client) DeleteParameters(ctx context.Context, params *DeleteParametersInput, optFns ...func(*Options)) (*DeleteParametersOutput, error) { if params == nil { params = &DeleteParametersInput{} } - result, metadata, err := c.invokeOperation(ctx, "DeleteParameters", params, optFns, addOperationDeleteParametersMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DeleteParameters", params, optFns, c.addOperationDeleteParametersMiddlewares) if err != nil { return nil, err } @@ -28,10 +30,13 @@ func (c *Client) DeleteParameters(ctx context.Context, params *DeleteParametersI type DeleteParametersInput struct { - // The names of the parameters to delete. + // The names of the parameters to delete. After deleting a parameter, wait for at + // least 30 seconds to create a parameter with the same name. // // This member is required. Names []string + + noSmithyDocumentSerde } type DeleteParametersOutput struct { @@ -39,15 +44,20 @@ type DeleteParametersOutput struct { // The names of the deleted parameters. DeletedParameters []string - // The names of parameters that weren't deleted because the parameters are not + // The names of parameters that weren't deleted because the parameters aren't // valid. InvalidParameters []string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDeleteParametersMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDeleteParametersMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteParameters{}, middleware.After) if err != nil { return err @@ -56,6 +66,13 @@ func addOperationDeleteParametersMiddlewares(stack *middleware.Stack, options Op if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteParameters"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -74,16 +91,13 @@ func addOperationDeleteParametersMiddlewares(stack *middleware.Stack, options Op if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -92,12 +106,18 @@ func addOperationDeleteParametersMiddlewares(stack *middleware.Stack, options Op if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDeleteParametersValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteParameters(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -107,6 +127,9 @@ func addOperationDeleteParametersMiddlewares(stack *middleware.Stack, options Op if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -114,7 +137,6 @@ func newServiceMetadataMiddleware_opDeleteParameters(region string) *awsmiddlewa return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DeleteParameters", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeletePatchBaseline.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeletePatchBaseline.go index a5dc83d0..7320e697 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeletePatchBaseline.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeletePatchBaseline.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" @@ -16,7 +17,7 @@ func (c *Client) DeletePatchBaseline(ctx context.Context, params *DeletePatchBas params = &DeletePatchBaselineInput{} } - result, metadata, err := c.invokeOperation(ctx, "DeletePatchBaseline", params, optFns, addOperationDeletePatchBaselineMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DeletePatchBaseline", params, optFns, c.addOperationDeletePatchBaselineMiddlewares) if err != nil { return nil, err } @@ -32,6 +33,8 @@ type DeletePatchBaselineInput struct { // // This member is required. BaselineId *string + + noSmithyDocumentSerde } type DeletePatchBaselineOutput struct { @@ -41,9 +44,14 @@ type DeletePatchBaselineOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDeletePatchBaselineMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDeletePatchBaselineMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeletePatchBaseline{}, middleware.After) if err != nil { return err @@ -52,6 +60,13 @@ func addOperationDeletePatchBaselineMiddlewares(stack *middleware.Stack, options if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeletePatchBaseline"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -70,16 +85,13 @@ func addOperationDeletePatchBaselineMiddlewares(stack *middleware.Stack, options if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -88,12 +100,18 @@ func addOperationDeletePatchBaselineMiddlewares(stack *middleware.Stack, options if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDeletePatchBaselineValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePatchBaseline(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -103,6 +121,9 @@ func addOperationDeletePatchBaselineMiddlewares(stack *middleware.Stack, options if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -110,7 +131,6 @@ func newServiceMetadataMiddleware_opDeletePatchBaseline(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DeletePatchBaseline", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteResourceDataSync.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteResourceDataSync.go index 0f61d0bd..a2584fa0 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteResourceDataSync.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteResourceDataSync.go @@ -4,21 +4,22 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes a Resource Data Sync configuration. After the configuration is deleted, -// changes to data on managed instances are no longer synced to or from the target. -// Deleting a sync configuration does not delete data. +// Deletes a resource data sync configuration. After the configuration is deleted, +// changes to data on managed nodes are no longer synced to or from the target. +// Deleting a sync configuration doesn't delete data. func (c *Client) DeleteResourceDataSync(ctx context.Context, params *DeleteResourceDataSyncInput, optFns ...func(*Options)) (*DeleteResourceDataSyncOutput, error) { if params == nil { params = &DeleteResourceDataSyncInput{} } - result, metadata, err := c.invokeOperation(ctx, "DeleteResourceDataSync", params, optFns, addOperationDeleteResourceDataSyncMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DeleteResourceDataSync", params, optFns, c.addOperationDeleteResourceDataSyncMiddlewares) if err != nil { return nil, err } @@ -37,14 +38,21 @@ type DeleteResourceDataSyncInput struct { // Specify the type of resource data sync to delete. SyncType *string + + noSmithyDocumentSerde } type DeleteResourceDataSyncOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDeleteResourceDataSyncMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDeleteResourceDataSyncMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteResourceDataSync{}, middleware.After) if err != nil { return err @@ -53,6 +61,13 @@ func addOperationDeleteResourceDataSyncMiddlewares(stack *middleware.Stack, opti if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteResourceDataSync"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -71,16 +86,13 @@ func addOperationDeleteResourceDataSyncMiddlewares(stack *middleware.Stack, opti if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -89,12 +101,18 @@ func addOperationDeleteResourceDataSyncMiddlewares(stack *middleware.Stack, opti if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDeleteResourceDataSyncValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteResourceDataSync(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -104,6 +122,9 @@ func addOperationDeleteResourceDataSyncMiddlewares(stack *middleware.Stack, opti if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -111,7 +132,6 @@ func newServiceMetadataMiddleware_opDeleteResourceDataSync(region string) *awsmi return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DeleteResourceDataSync", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteResourcePolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteResourcePolicy.go new file mode 100644 index 00000000..c290f837 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeleteResourcePolicy.go @@ -0,0 +1,148 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssm + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a Systems Manager resource policy. A resource policy helps you to +// define the IAM entity (for example, an Amazon Web Services account) that can +// manage your Systems Manager resources. Currently, OpsItemGroup is the only +// resource that supports Systems Manager resource policies. The resource policy +// for OpsItemGroup enables Amazon Web Services accounts to view and interact with +// OpsCenter operational work items (OpsItems). +func (c *Client) DeleteResourcePolicy(ctx context.Context, params *DeleteResourcePolicyInput, optFns ...func(*Options)) (*DeleteResourcePolicyOutput, error) { + if params == nil { + params = &DeleteResourcePolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteResourcePolicy", params, optFns, c.addOperationDeleteResourcePolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteResourcePolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteResourcePolicyInput struct { + + // ID of the current policy version. The hash helps to prevent multiple calls from + // attempting to overwrite a policy. + // + // This member is required. + PolicyHash *string + + // The policy ID. + // + // This member is required. + PolicyId *string + + // Amazon Resource Name (ARN) of the resource to which the policies are attached. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type DeleteResourcePolicyOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteResourcePolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteResourcePolicy{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteResourcePolicy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteResourcePolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteResourcePolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteResourcePolicy", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeregisterManagedInstance.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeregisterManagedInstance.go index 0facc1c9..8c199abc 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeregisterManagedInstance.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeregisterManagedInstance.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" @@ -11,14 +12,14 @@ import ( ) // Removes the server or virtual machine from the list of registered servers. You -// can reregister the instance again at any time. If you don't plan to use Run -// Command on the server, we suggest uninstalling SSM Agent first. +// can reregister the node again at any time. If you don't plan to use Run Command +// on the server, we suggest uninstalling SSM Agent first. func (c *Client) DeregisterManagedInstance(ctx context.Context, params *DeregisterManagedInstanceInput, optFns ...func(*Options)) (*DeregisterManagedInstanceOutput, error) { if params == nil { params = &DeregisterManagedInstanceInput{} } - result, metadata, err := c.invokeOperation(ctx, "DeregisterManagedInstance", params, optFns, addOperationDeregisterManagedInstanceMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DeregisterManagedInstance", params, optFns, c.addOperationDeregisterManagedInstanceMiddlewares) if err != nil { return nil, err } @@ -30,19 +31,26 @@ func (c *Client) DeregisterManagedInstance(ctx context.Context, params *Deregist type DeregisterManagedInstanceInput struct { - // The ID assigned to the managed instance when you registered it using the - // activation process. + // The ID assigned to the managed node when you registered it using the activation + // process. // // This member is required. InstanceId *string + + noSmithyDocumentSerde } type DeregisterManagedInstanceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDeregisterManagedInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDeregisterManagedInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeregisterManagedInstance{}, middleware.After) if err != nil { return err @@ -51,6 +59,13 @@ func addOperationDeregisterManagedInstanceMiddlewares(stack *middleware.Stack, o if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeregisterManagedInstance"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -69,16 +84,13 @@ func addOperationDeregisterManagedInstanceMiddlewares(stack *middleware.Stack, o if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -87,12 +99,18 @@ func addOperationDeregisterManagedInstanceMiddlewares(stack *middleware.Stack, o if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDeregisterManagedInstanceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterManagedInstance(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -102,6 +120,9 @@ func addOperationDeregisterManagedInstanceMiddlewares(stack *middleware.Stack, o if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -109,7 +130,6 @@ func newServiceMetadataMiddleware_opDeregisterManagedInstance(region string) *aw return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DeregisterManagedInstance", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeregisterPatchBaselineForPatchGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeregisterPatchBaselineForPatchGroup.go index 5ad47dec..4e2fadca 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeregisterPatchBaselineForPatchGroup.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeregisterPatchBaselineForPatchGroup.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" @@ -16,7 +17,7 @@ func (c *Client) DeregisterPatchBaselineForPatchGroup(ctx context.Context, param params = &DeregisterPatchBaselineForPatchGroupInput{} } - result, metadata, err := c.invokeOperation(ctx, "DeregisterPatchBaselineForPatchGroup", params, optFns, addOperationDeregisterPatchBaselineForPatchGroupMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DeregisterPatchBaselineForPatchGroup", params, optFns, c.addOperationDeregisterPatchBaselineForPatchGroupMiddlewares) if err != nil { return nil, err } @@ -37,6 +38,8 @@ type DeregisterPatchBaselineForPatchGroupInput struct { // // This member is required. PatchGroup *string + + noSmithyDocumentSerde } type DeregisterPatchBaselineForPatchGroupOutput struct { @@ -49,9 +52,14 @@ type DeregisterPatchBaselineForPatchGroupOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDeregisterPatchBaselineForPatchGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDeregisterPatchBaselineForPatchGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeregisterPatchBaselineForPatchGroup{}, middleware.After) if err != nil { return err @@ -60,6 +68,13 @@ func addOperationDeregisterPatchBaselineForPatchGroupMiddlewares(stack *middlewa if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeregisterPatchBaselineForPatchGroup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -78,16 +93,13 @@ func addOperationDeregisterPatchBaselineForPatchGroupMiddlewares(stack *middlewa if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -96,12 +108,18 @@ func addOperationDeregisterPatchBaselineForPatchGroupMiddlewares(stack *middlewa if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDeregisterPatchBaselineForPatchGroupValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterPatchBaselineForPatchGroup(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -111,6 +129,9 @@ func addOperationDeregisterPatchBaselineForPatchGroupMiddlewares(stack *middlewa if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -118,7 +139,6 @@ func newServiceMetadataMiddleware_opDeregisterPatchBaselineForPatchGroup(region return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DeregisterPatchBaselineForPatchGroup", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeregisterTargetFromMaintenanceWindow.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeregisterTargetFromMaintenanceWindow.go index 11af8bf3..e2b33cf6 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeregisterTargetFromMaintenanceWindow.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeregisterTargetFromMaintenanceWindow.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" @@ -16,7 +17,7 @@ func (c *Client) DeregisterTargetFromMaintenanceWindow(ctx context.Context, para params = &DeregisterTargetFromMaintenanceWindowInput{} } - result, metadata, err := c.invokeOperation(ctx, "DeregisterTargetFromMaintenanceWindow", params, optFns, addOperationDeregisterTargetFromMaintenanceWindowMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DeregisterTargetFromMaintenanceWindow", params, optFns, c.addOperationDeregisterTargetFromMaintenanceWindowMiddlewares) if err != nil { return nil, err } @@ -39,9 +40,11 @@ type DeregisterTargetFromMaintenanceWindowInput struct { WindowTargetId *string // The system checks if the target is being referenced by a task. If the target is - // being referenced, the system returns an error and does not deregister the target + // being referenced, the system returns an error and doesn't deregister the target // from the maintenance window. - Safe bool + Safe *bool + + noSmithyDocumentSerde } type DeregisterTargetFromMaintenanceWindowOutput struct { @@ -54,9 +57,14 @@ type DeregisterTargetFromMaintenanceWindowOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDeregisterTargetFromMaintenanceWindowMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDeregisterTargetFromMaintenanceWindowMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeregisterTargetFromMaintenanceWindow{}, middleware.After) if err != nil { return err @@ -65,6 +73,13 @@ func addOperationDeregisterTargetFromMaintenanceWindowMiddlewares(stack *middlew if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeregisterTargetFromMaintenanceWindow"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -83,16 +98,13 @@ func addOperationDeregisterTargetFromMaintenanceWindowMiddlewares(stack *middlew if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -101,12 +113,18 @@ func addOperationDeregisterTargetFromMaintenanceWindowMiddlewares(stack *middlew if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDeregisterTargetFromMaintenanceWindowValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterTargetFromMaintenanceWindow(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -116,6 +134,9 @@ func addOperationDeregisterTargetFromMaintenanceWindowMiddlewares(stack *middlew if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -123,7 +144,6 @@ func newServiceMetadataMiddleware_opDeregisterTargetFromMaintenanceWindow(region return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DeregisterTargetFromMaintenanceWindow", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeregisterTaskFromMaintenanceWindow.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeregisterTaskFromMaintenanceWindow.go index 4c771502..8aa5233b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeregisterTaskFromMaintenanceWindow.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DeregisterTaskFromMaintenanceWindow.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" @@ -16,7 +17,7 @@ func (c *Client) DeregisterTaskFromMaintenanceWindow(ctx context.Context, params params = &DeregisterTaskFromMaintenanceWindowInput{} } - result, metadata, err := c.invokeOperation(ctx, "DeregisterTaskFromMaintenanceWindow", params, optFns, addOperationDeregisterTaskFromMaintenanceWindowMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DeregisterTaskFromMaintenanceWindow", params, optFns, c.addOperationDeregisterTaskFromMaintenanceWindowMiddlewares) if err != nil { return nil, err } @@ -37,6 +38,8 @@ type DeregisterTaskFromMaintenanceWindowInput struct { // // This member is required. WindowTaskId *string + + noSmithyDocumentSerde } type DeregisterTaskFromMaintenanceWindowOutput struct { @@ -49,9 +52,14 @@ type DeregisterTaskFromMaintenanceWindowOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDeregisterTaskFromMaintenanceWindowMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDeregisterTaskFromMaintenanceWindowMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeregisterTaskFromMaintenanceWindow{}, middleware.After) if err != nil { return err @@ -60,6 +68,13 @@ func addOperationDeregisterTaskFromMaintenanceWindowMiddlewares(stack *middlewar if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeregisterTaskFromMaintenanceWindow"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -78,16 +93,13 @@ func addOperationDeregisterTaskFromMaintenanceWindowMiddlewares(stack *middlewar if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -96,12 +108,18 @@ func addOperationDeregisterTaskFromMaintenanceWindowMiddlewares(stack *middlewar if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDeregisterTaskFromMaintenanceWindowValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterTaskFromMaintenanceWindow(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -111,6 +129,9 @@ func addOperationDeregisterTaskFromMaintenanceWindowMiddlewares(stack *middlewar if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -118,7 +139,6 @@ func newServiceMetadataMiddleware_opDeregisterTaskFromMaintenanceWindow(region s return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DeregisterTaskFromMaintenanceWindow", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeActivations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeActivations.go index 85776c39..f844c5fb 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeActivations.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeActivations.go @@ -12,15 +12,16 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Describes details about the activation, such as the date and time the activation -// was created, its expiration date, the IAM role assigned to the instances in the -// activation, and the number of instances registered by using this activation. +// Describes details about the activation, such as the date and time the +// activation was created, its expiration date, the Identity and Access Management +// (IAM) role assigned to the managed nodes in the activation, and the number of +// nodes registered by using this activation. func (c *Client) DescribeActivations(ctx context.Context, params *DescribeActivationsInput, optFns ...func(*Options)) (*DescribeActivationsOutput, error) { if params == nil { params = &DescribeActivationsInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeActivations", params, optFns, addOperationDescribeActivationsMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeActivations", params, optFns, c.addOperationDescribeActivationsMiddlewares) if err != nil { return nil, err } @@ -37,15 +38,17 @@ type DescribeActivationsInput struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // A token to start the list. Use this token to get the next set of results. NextToken *string + + noSmithyDocumentSerde } type DescribeActivationsOutput struct { - // A list of activations for your AWS account. + // A list of activations for your Amazon Web Services account. ActivationList []types.Activation // The token for the next set of items to return. Use this token to get the next @@ -54,9 +57,14 @@ type DescribeActivationsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeActivationsMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeActivationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeActivations{}, middleware.After) if err != nil { return err @@ -65,6 +73,13 @@ func addOperationDescribeActivationsMiddlewares(stack *middleware.Stack, options if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeActivations"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -83,16 +98,13 @@ func addOperationDescribeActivationsMiddlewares(stack *middleware.Stack, options if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -101,9 +113,15 @@ func addOperationDescribeActivationsMiddlewares(stack *middleware.Stack, options if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeActivations(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -113,11 +131,14 @@ func addOperationDescribeActivationsMiddlewares(stack *middleware.Stack, options if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } -// DescribeActivationsAPIClient is a client that implements the DescribeActivations -// operation. +// DescribeActivationsAPIClient is a client that implements the +// DescribeActivations operation. type DescribeActivationsAPIClient interface { DescribeActivations(context.Context, *DescribeActivationsInput, ...func(*Options)) (*DescribeActivationsOutput, error) } @@ -147,30 +168,31 @@ type DescribeActivationsPaginator struct { // NewDescribeActivationsPaginator returns a new DescribeActivationsPaginator func NewDescribeActivationsPaginator(client DescribeActivationsAPIClient, params *DescribeActivationsInput, optFns ...func(*DescribeActivationsPaginatorOptions)) *DescribeActivationsPaginator { + if params == nil { + params = &DescribeActivationsInput{} + } + options := DescribeActivationsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &DescribeActivationsInput{} - } - return &DescribeActivationsPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeActivationsPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeActivations page. @@ -182,7 +204,11 @@ func (p *DescribeActivationsPaginator) NextPage(ctx context.Context, optFns ...f params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeActivations(ctx, ¶ms, optFns...) if err != nil { @@ -193,7 +219,10 @@ func (p *DescribeActivationsPaginator) NextPage(ctx context.Context, optFns ...f prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -204,7 +233,6 @@ func newServiceMetadataMiddleware_opDescribeActivations(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribeActivations", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAssociation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAssociation.go index d5f1c572..16a63ed1 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAssociation.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAssociation.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -11,17 +12,15 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Describes the association for the specified target or instance. If you created -// the association by using the Targets parameter, then you must retrieve the -// association by using the association ID. If you created the association by -// specifying an instance ID and a Systems Manager document, then you retrieve the -// association by specifying the document name and the instance ID. +// Describes the association for the specified target or managed node. If you +// created the association by using the Targets parameter, then you must retrieve +// the association by using the association ID. func (c *Client) DescribeAssociation(ctx context.Context, params *DescribeAssociationInput, optFns ...func(*Options)) (*DescribeAssociationOutput, error) { if params == nil { params = &DescribeAssociationInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeAssociation", params, optFns, addOperationDescribeAssociationMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeAssociation", params, optFns, c.addOperationDescribeAssociationMiddlewares) if err != nil { return nil, err } @@ -38,15 +37,17 @@ type DescribeAssociationInput struct { // Specify the association version to retrieve. To view the latest version, either // specify $LATEST for this parameter, or omit this parameter. To view a list of - // all associations for an instance, use ListAssociations. To get a list of - // versions for a specific association, use ListAssociationVersions. + // all associations for a managed node, use ListAssociations . To get a list of + // versions for a specific association, use ListAssociationVersions . AssociationVersion *string - // The instance ID. + // The managed node ID. InstanceId *string - // The name of the Systems Manager document. + // The name of the SSM document. Name *string + + noSmithyDocumentSerde } type DescribeAssociationOutput struct { @@ -56,9 +57,14 @@ type DescribeAssociationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAssociation{}, middleware.After) if err != nil { return err @@ -67,6 +73,13 @@ func addOperationDescribeAssociationMiddlewares(stack *middleware.Stack, options if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeAssociation"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -85,16 +98,13 @@ func addOperationDescribeAssociationMiddlewares(stack *middleware.Stack, options if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -103,9 +113,15 @@ func addOperationDescribeAssociationMiddlewares(stack *middleware.Stack, options if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAssociation(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -115,6 +131,9 @@ func addOperationDescribeAssociationMiddlewares(stack *middleware.Stack, options if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -122,7 +141,6 @@ func newServiceMetadataMiddleware_opDescribeAssociation(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribeAssociation", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAssociationExecutionTargets.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAssociationExecutionTargets.go index 94fdde58..620edf4a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAssociationExecutionTargets.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAssociationExecutionTargets.go @@ -12,14 +12,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Use this API action to view information about a specific execution of a specific -// association. +// Views information about a specific execution of a specific association. func (c *Client) DescribeAssociationExecutionTargets(ctx context.Context, params *DescribeAssociationExecutionTargetsInput, optFns ...func(*Options)) (*DescribeAssociationExecutionTargetsOutput, error) { if params == nil { params = &DescribeAssociationExecutionTargetsInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeAssociationExecutionTargets", params, optFns, addOperationDescribeAssociationExecutionTargetsMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeAssociationExecutionTargets", params, optFns, c.addOperationDescribeAssociationExecutionTargetsMiddlewares) if err != nil { return nil, err } @@ -48,10 +47,12 @@ type DescribeAssociationExecutionTargetsInput struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // A token to start the list. Use this token to get the next set of results. NextToken *string + + noSmithyDocumentSerde } type DescribeAssociationExecutionTargetsOutput struct { @@ -65,9 +66,14 @@ type DescribeAssociationExecutionTargetsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeAssociationExecutionTargetsMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeAssociationExecutionTargetsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAssociationExecutionTargets{}, middleware.After) if err != nil { return err @@ -76,6 +82,13 @@ func addOperationDescribeAssociationExecutionTargetsMiddlewares(stack *middlewar if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeAssociationExecutionTargets"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -94,16 +107,13 @@ func addOperationDescribeAssociationExecutionTargetsMiddlewares(stack *middlewar if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -112,12 +122,18 @@ func addOperationDescribeAssociationExecutionTargetsMiddlewares(stack *middlewar if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDescribeAssociationExecutionTargetsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAssociationExecutionTargets(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -127,6 +143,9 @@ func addOperationDescribeAssociationExecutionTargetsMiddlewares(stack *middlewar if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -138,8 +157,8 @@ type DescribeAssociationExecutionTargetsAPIClient interface { var _ DescribeAssociationExecutionTargetsAPIClient = (*Client)(nil) -// DescribeAssociationExecutionTargetsPaginatorOptions is the paginator options for -// DescribeAssociationExecutionTargets +// DescribeAssociationExecutionTargetsPaginatorOptions is the paginator options +// for DescribeAssociationExecutionTargets type DescribeAssociationExecutionTargetsPaginatorOptions struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. @@ -163,30 +182,31 @@ type DescribeAssociationExecutionTargetsPaginator struct { // NewDescribeAssociationExecutionTargetsPaginator returns a new // DescribeAssociationExecutionTargetsPaginator func NewDescribeAssociationExecutionTargetsPaginator(client DescribeAssociationExecutionTargetsAPIClient, params *DescribeAssociationExecutionTargetsInput, optFns ...func(*DescribeAssociationExecutionTargetsPaginatorOptions)) *DescribeAssociationExecutionTargetsPaginator { + if params == nil { + params = &DescribeAssociationExecutionTargetsInput{} + } + options := DescribeAssociationExecutionTargetsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &DescribeAssociationExecutionTargetsInput{} - } - return &DescribeAssociationExecutionTargetsPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeAssociationExecutionTargetsPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeAssociationExecutionTargets page. @@ -198,7 +218,11 @@ func (p *DescribeAssociationExecutionTargetsPaginator) NextPage(ctx context.Cont params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeAssociationExecutionTargets(ctx, ¶ms, optFns...) if err != nil { @@ -209,7 +233,10 @@ func (p *DescribeAssociationExecutionTargetsPaginator) NextPage(ctx context.Cont prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -220,7 +247,6 @@ func newServiceMetadataMiddleware_opDescribeAssociationExecutionTargets(region s return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribeAssociationExecutionTargets", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAssociationExecutions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAssociationExecutions.go index 6f143465..9cf86d17 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAssociationExecutions.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAssociationExecutions.go @@ -12,13 +12,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Use this API action to view all executions for a specific association ID. +// Views all executions for a specific association ID. func (c *Client) DescribeAssociationExecutions(ctx context.Context, params *DescribeAssociationExecutionsInput, optFns ...func(*Options)) (*DescribeAssociationExecutionsOutput, error) { if params == nil { params = &DescribeAssociationExecutionsInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeAssociationExecutions", params, optFns, addOperationDescribeAssociationExecutionsMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeAssociationExecutions", params, optFns, c.addOperationDescribeAssociationExecutionsMiddlewares) if err != nil { return nil, err } @@ -41,10 +41,12 @@ type DescribeAssociationExecutionsInput struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // A token to start the list. Use this token to get the next set of results. NextToken *string + + noSmithyDocumentSerde } type DescribeAssociationExecutionsOutput struct { @@ -58,9 +60,14 @@ type DescribeAssociationExecutionsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeAssociationExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeAssociationExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAssociationExecutions{}, middleware.After) if err != nil { return err @@ -69,6 +76,13 @@ func addOperationDescribeAssociationExecutionsMiddlewares(stack *middleware.Stac if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeAssociationExecutions"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -87,16 +101,13 @@ func addOperationDescribeAssociationExecutionsMiddlewares(stack *middleware.Stac if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -105,12 +116,18 @@ func addOperationDescribeAssociationExecutionsMiddlewares(stack *middleware.Stac if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDescribeAssociationExecutionsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAssociationExecutions(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -120,6 +137,9 @@ func addOperationDescribeAssociationExecutionsMiddlewares(stack *middleware.Stac if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -156,30 +176,31 @@ type DescribeAssociationExecutionsPaginator struct { // NewDescribeAssociationExecutionsPaginator returns a new // DescribeAssociationExecutionsPaginator func NewDescribeAssociationExecutionsPaginator(client DescribeAssociationExecutionsAPIClient, params *DescribeAssociationExecutionsInput, optFns ...func(*DescribeAssociationExecutionsPaginatorOptions)) *DescribeAssociationExecutionsPaginator { + if params == nil { + params = &DescribeAssociationExecutionsInput{} + } + options := DescribeAssociationExecutionsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &DescribeAssociationExecutionsInput{} - } - return &DescribeAssociationExecutionsPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeAssociationExecutionsPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeAssociationExecutions page. @@ -191,7 +212,11 @@ func (p *DescribeAssociationExecutionsPaginator) NextPage(ctx context.Context, o params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeAssociationExecutions(ctx, ¶ms, optFns...) if err != nil { @@ -202,7 +227,10 @@ func (p *DescribeAssociationExecutionsPaginator) NextPage(ctx context.Context, o prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -213,7 +241,6 @@ func newServiceMetadataMiddleware_opDescribeAssociationExecutions(region string) return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribeAssociationExecutions", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAutomationExecutions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAutomationExecutions.go index a3f47670..c40bc79c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAutomationExecutions.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAutomationExecutions.go @@ -18,7 +18,7 @@ func (c *Client) DescribeAutomationExecutions(ctx context.Context, params *Descr params = &DescribeAutomationExecutionsInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeAutomationExecutions", params, optFns, addOperationDescribeAutomationExecutionsMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeAutomationExecutions", params, optFns, c.addOperationDescribeAutomationExecutionsMiddlewares) if err != nil { return nil, err } @@ -35,11 +35,13 @@ type DescribeAutomationExecutionsInput struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string + + noSmithyDocumentSerde } type DescribeAutomationExecutionsOutput struct { @@ -54,9 +56,14 @@ type DescribeAutomationExecutionsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeAutomationExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeAutomationExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAutomationExecutions{}, middleware.After) if err != nil { return err @@ -65,6 +72,13 @@ func addOperationDescribeAutomationExecutionsMiddlewares(stack *middleware.Stack if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeAutomationExecutions"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -83,16 +97,13 @@ func addOperationDescribeAutomationExecutionsMiddlewares(stack *middleware.Stack if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -101,12 +112,18 @@ func addOperationDescribeAutomationExecutionsMiddlewares(stack *middleware.Stack if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDescribeAutomationExecutionsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAutomationExecutions(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -116,6 +133,9 @@ func addOperationDescribeAutomationExecutionsMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -152,30 +172,31 @@ type DescribeAutomationExecutionsPaginator struct { // NewDescribeAutomationExecutionsPaginator returns a new // DescribeAutomationExecutionsPaginator func NewDescribeAutomationExecutionsPaginator(client DescribeAutomationExecutionsAPIClient, params *DescribeAutomationExecutionsInput, optFns ...func(*DescribeAutomationExecutionsPaginatorOptions)) *DescribeAutomationExecutionsPaginator { + if params == nil { + params = &DescribeAutomationExecutionsInput{} + } + options := DescribeAutomationExecutionsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &DescribeAutomationExecutionsInput{} - } - return &DescribeAutomationExecutionsPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeAutomationExecutionsPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeAutomationExecutions page. @@ -187,7 +208,11 @@ func (p *DescribeAutomationExecutionsPaginator) NextPage(ctx context.Context, op params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeAutomationExecutions(ctx, ¶ms, optFns...) if err != nil { @@ -198,7 +223,10 @@ func (p *DescribeAutomationExecutionsPaginator) NextPage(ctx context.Context, op prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -209,7 +237,6 @@ func newServiceMetadataMiddleware_opDescribeAutomationExecutions(region string) return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribeAutomationExecutions", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAutomationStepExecutions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAutomationStepExecutions.go index f15ef774..dac34018 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAutomationStepExecutions.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAutomationStepExecutions.go @@ -19,7 +19,7 @@ func (c *Client) DescribeAutomationStepExecutions(ctx context.Context, params *D params = &DescribeAutomationStepExecutionsInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeAutomationStepExecutions", params, optFns, addOperationDescribeAutomationStepExecutionsMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeAutomationStepExecutions", params, optFns, c.addOperationDescribeAutomationStepExecutionsMiddlewares) if err != nil { return nil, err } @@ -42,15 +42,17 @@ type DescribeAutomationStepExecutionsInput struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string - // A boolean that indicates whether to list step executions in reverse order by - // start time. The default value is false. - ReverseOrder bool + // Indicates whether to list step executions in reverse order by start time. The + // default value is 'false'. + ReverseOrder *bool + + noSmithyDocumentSerde } type DescribeAutomationStepExecutionsOutput struct { @@ -65,9 +67,14 @@ type DescribeAutomationStepExecutionsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeAutomationStepExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeAutomationStepExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAutomationStepExecutions{}, middleware.After) if err != nil { return err @@ -76,6 +83,13 @@ func addOperationDescribeAutomationStepExecutionsMiddlewares(stack *middleware.S if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeAutomationStepExecutions"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -94,16 +108,13 @@ func addOperationDescribeAutomationStepExecutionsMiddlewares(stack *middleware.S if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -112,12 +123,18 @@ func addOperationDescribeAutomationStepExecutionsMiddlewares(stack *middleware.S if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDescribeAutomationStepExecutionsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAutomationStepExecutions(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -127,6 +144,9 @@ func addOperationDescribeAutomationStepExecutionsMiddlewares(stack *middleware.S if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -163,30 +183,31 @@ type DescribeAutomationStepExecutionsPaginator struct { // NewDescribeAutomationStepExecutionsPaginator returns a new // DescribeAutomationStepExecutionsPaginator func NewDescribeAutomationStepExecutionsPaginator(client DescribeAutomationStepExecutionsAPIClient, params *DescribeAutomationStepExecutionsInput, optFns ...func(*DescribeAutomationStepExecutionsPaginatorOptions)) *DescribeAutomationStepExecutionsPaginator { + if params == nil { + params = &DescribeAutomationStepExecutionsInput{} + } + options := DescribeAutomationStepExecutionsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &DescribeAutomationStepExecutionsInput{} - } - return &DescribeAutomationStepExecutionsPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeAutomationStepExecutionsPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeAutomationStepExecutions page. @@ -198,7 +219,11 @@ func (p *DescribeAutomationStepExecutionsPaginator) NextPage(ctx context.Context params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeAutomationStepExecutions(ctx, ¶ms, optFns...) if err != nil { @@ -209,7 +234,10 @@ func (p *DescribeAutomationStepExecutionsPaginator) NextPage(ctx context.Context prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -220,7 +248,6 @@ func newServiceMetadataMiddleware_opDescribeAutomationStepExecutions(region stri return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribeAutomationStepExecutions", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAvailablePatches.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAvailablePatches.go index 026e24e5..cd57e0ca 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAvailablePatches.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeAvailablePatches.go @@ -18,7 +18,7 @@ func (c *Client) DescribeAvailablePatches(ctx context.Context, params *DescribeA params = &DescribeAvailablePatchesInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeAvailablePatches", params, optFns, addOperationDescribeAvailablePatchesMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeAvailablePatches", params, optFns, c.addOperationDescribeAvailablePatchesMiddlewares) if err != nil { return nil, err } @@ -30,15 +30,45 @@ func (c *Client) DescribeAvailablePatches(ctx context.Context, params *DescribeA type DescribeAvailablePatchesInput struct { - // Filters used to scope down the returned patches. + // Each element in the array is a structure containing a key-value pair. Windows + // Server Supported keys for Windows Server managed node patches include the + // following: + // - PATCH_SET Sample values: OS | APPLICATION + // - PRODUCT Sample values: WindowsServer2012 | Office 2010 | + // MicrosoftDefenderAntivirus + // - PRODUCT_FAMILY Sample values: Windows | Office + // - MSRC_SEVERITY Sample values: ServicePacks | Important | Moderate + // - CLASSIFICATION Sample values: ServicePacks | SecurityUpdates | + // DefinitionUpdates + // - PATCH_ID Sample values: KB123456 | KB4516046 + // Linux When specifying filters for Linux patches, you must specify a key-pair + // for PRODUCT . For example, using the Command Line Interface (CLI), the following + // command fails: aws ssm describe-available-patches --filters + // Key=CVE_ID,Values=CVE-2018-3615 However, the following command succeeds: aws + // ssm describe-available-patches --filters Key=PRODUCT,Values=AmazonLinux2018.03 + // Key=CVE_ID,Values=CVE-2018-3615 Supported keys for Linux managed node patches + // include the following: + // - PRODUCT Sample values: AmazonLinux2018.03 | AmazonLinux2.0 + // - NAME Sample values: kernel-headers | samba-python | php + // - SEVERITY Sample values: Critical | Important | Medium | Low + // - EPOCH Sample values: 0 | 1 + // - VERSION Sample values: 78.6.1 | 4.10.16 + // - RELEASE Sample values: 9.56.amzn1 | 1.amzn2 + // - ARCH Sample values: i686 | x86_64 + // - REPOSITORY Sample values: Core | Updates + // - ADVISORY_ID Sample values: ALAS-2018-1058 | ALAS2-2021-1594 + // - CVE_ID Sample values: CVE-2018-3615 | CVE-2020-1472 + // - BUGZILLA_ID Sample values: 1463241 Filters []types.PatchOrchestratorFilter // The maximum number of patches to return (per page). - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string + + noSmithyDocumentSerde } type DescribeAvailablePatchesOutput struct { @@ -52,9 +82,14 @@ type DescribeAvailablePatchesOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeAvailablePatchesMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeAvailablePatchesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAvailablePatches{}, middleware.After) if err != nil { return err @@ -63,6 +98,13 @@ func addOperationDescribeAvailablePatchesMiddlewares(stack *middleware.Stack, op if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeAvailablePatches"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -81,16 +123,13 @@ func addOperationDescribeAvailablePatchesMiddlewares(stack *middleware.Stack, op if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -99,9 +138,15 @@ func addOperationDescribeAvailablePatchesMiddlewares(stack *middleware.Stack, op if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAvailablePatches(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -111,6 +156,9 @@ func addOperationDescribeAvailablePatchesMiddlewares(stack *middleware.Stack, op if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -145,30 +193,31 @@ type DescribeAvailablePatchesPaginator struct { // NewDescribeAvailablePatchesPaginator returns a new // DescribeAvailablePatchesPaginator func NewDescribeAvailablePatchesPaginator(client DescribeAvailablePatchesAPIClient, params *DescribeAvailablePatchesInput, optFns ...func(*DescribeAvailablePatchesPaginatorOptions)) *DescribeAvailablePatchesPaginator { + if params == nil { + params = &DescribeAvailablePatchesInput{} + } + options := DescribeAvailablePatchesPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &DescribeAvailablePatchesInput{} - } - return &DescribeAvailablePatchesPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeAvailablePatchesPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeAvailablePatches page. @@ -180,7 +229,11 @@ func (p *DescribeAvailablePatchesPaginator) NextPage(ctx context.Context, optFns params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeAvailablePatches(ctx, ¶ms, optFns...) if err != nil { @@ -191,7 +244,10 @@ func (p *DescribeAvailablePatchesPaginator) NextPage(ctx context.Context, optFns prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -202,7 +258,6 @@ func newServiceMetadataMiddleware_opDescribeAvailablePatches(region string) *aws return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribeAvailablePatches", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeDocument.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeDocument.go index aff1eeb6..e5239069 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeDocument.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeDocument.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -11,13 +12,14 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Describes the specified Systems Manager document. +// Describes the specified Amazon Web Services Systems Manager document (SSM +// document). func (c *Client) DescribeDocument(ctx context.Context, params *DescribeDocumentInput, optFns ...func(*Options)) (*DescribeDocumentOutput, error) { if params == nil { params = &DescribeDocumentInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeDocument", params, optFns, addOperationDescribeDocumentMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeDocument", params, optFns, c.addOperationDescribeDocumentMiddlewares) if err != nil { return nil, err } @@ -29,7 +31,7 @@ func (c *Client) DescribeDocument(ctx context.Context, params *DescribeDocumentI type DescribeDocumentInput struct { - // The name of the Systems Manager document. + // The name of the SSM document. // // This member is required. Name *string @@ -40,20 +42,27 @@ type DescribeDocumentInput struct { // An optional field specifying the version of the artifact associated with the // document. For example, "Release 12, Update 6". This value is unique across all - // versions of a document, and cannot be changed. + // versions of a document, and can't be changed. VersionName *string + + noSmithyDocumentSerde } type DescribeDocumentOutput struct { - // Information about the Systems Manager document. + // Information about the SSM document. Document *types.DocumentDescription // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeDocumentMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeDocumentMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeDocument{}, middleware.After) if err != nil { return err @@ -62,6 +71,13 @@ func addOperationDescribeDocumentMiddlewares(stack *middleware.Stack, options Op if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDocument"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -80,16 +96,13 @@ func addOperationDescribeDocumentMiddlewares(stack *middleware.Stack, options Op if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -98,12 +111,18 @@ func addOperationDescribeDocumentMiddlewares(stack *middleware.Stack, options Op if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDescribeDocumentValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDocument(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -113,6 +132,9 @@ func addOperationDescribeDocumentMiddlewares(stack *middleware.Stack, options Op if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -120,7 +142,6 @@ func newServiceMetadataMiddleware_opDescribeDocument(region string) *awsmiddlewa return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribeDocument", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeDocumentPermission.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeDocumentPermission.go index 5c474de5..f3f11a38 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeDocumentPermission.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeDocumentPermission.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -11,15 +12,16 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Describes the permissions for a Systems Manager document. If you created the -// document, you are the owner. If a document is shared, it can either be shared -// privately (by specifying a user's AWS account ID) or publicly (All). +// Describes the permissions for a Amazon Web Services Systems Manager document +// (SSM document). If you created the document, you are the owner. If a document is +// shared, it can either be shared privately (by specifying a user's Amazon Web +// Services account ID) or publicly (All). func (c *Client) DescribeDocumentPermission(ctx context.Context, params *DescribeDocumentPermissionInput, optFns ...func(*Options)) (*DescribeDocumentPermissionOutput, error) { if params == nil { params = &DescribeDocumentPermissionInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeDocumentPermission", params, optFns, addOperationDescribeDocumentPermissionMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeDocumentPermission", params, optFns, c.addOperationDescribeDocumentPermissionMiddlewares) if err != nil { return nil, err } @@ -40,23 +42,42 @@ type DescribeDocumentPermissionInput struct { // // This member is required. PermissionType types.DocumentPermissionType + + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + MaxResults *int32 + + // The token for the next set of items to return. (You received this token from a + // previous call.) + NextToken *string + + noSmithyDocumentSerde } type DescribeDocumentPermissionOutput struct { // The account IDs that have permission to use this document. The ID can be either - // an AWS account or All. + // an Amazon Web Services account or All. AccountIds []string - // A list of AWS accounts where the current document is shared and the version - // shared with each account. + // A list of Amazon Web Services accounts where the current document is shared and + // the version shared with each account. AccountSharingInfoList []types.AccountSharingInfo + // The token for the next set of items to return. Use this token to get the next + // set of results. + NextToken *string + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeDocumentPermissionMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeDocumentPermissionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeDocumentPermission{}, middleware.After) if err != nil { return err @@ -65,6 +86,13 @@ func addOperationDescribeDocumentPermissionMiddlewares(stack *middleware.Stack, if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDocumentPermission"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -83,16 +111,13 @@ func addOperationDescribeDocumentPermissionMiddlewares(stack *middleware.Stack, if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -101,12 +126,18 @@ func addOperationDescribeDocumentPermissionMiddlewares(stack *middleware.Stack, if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDescribeDocumentPermissionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDocumentPermission(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -116,6 +147,9 @@ func addOperationDescribeDocumentPermissionMiddlewares(stack *middleware.Stack, if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -123,7 +157,6 @@ func newServiceMetadataMiddleware_opDescribeDocumentPermission(region string) *a return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribeDocumentPermission", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeEffectiveInstanceAssociations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeEffectiveInstanceAssociations.go index 1a074bf4..c84ee26f 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeEffectiveInstanceAssociations.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeEffectiveInstanceAssociations.go @@ -12,13 +12,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// All associations for the instance(s). +// All associations for the managed node(s). func (c *Client) DescribeEffectiveInstanceAssociations(ctx context.Context, params *DescribeEffectiveInstanceAssociationsInput, optFns ...func(*Options)) (*DescribeEffectiveInstanceAssociationsOutput, error) { if params == nil { params = &DescribeEffectiveInstanceAssociationsInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeEffectiveInstanceAssociations", params, optFns, addOperationDescribeEffectiveInstanceAssociationsMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeEffectiveInstanceAssociations", params, optFns, c.addOperationDescribeEffectiveInstanceAssociationsMiddlewares) if err != nil { return nil, err } @@ -30,23 +30,25 @@ func (c *Client) DescribeEffectiveInstanceAssociations(ctx context.Context, para type DescribeEffectiveInstanceAssociationsInput struct { - // The instance ID for which you want to view all associations. + // The managed node ID for which you want to view all associations. // // This member is required. InstanceId *string // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string + + noSmithyDocumentSerde } type DescribeEffectiveInstanceAssociationsOutput struct { - // The associations for the requested instance. + // The associations for the requested managed node. Associations []types.InstanceAssociation // The token to use when requesting the next set of items. If there are no @@ -55,9 +57,14 @@ type DescribeEffectiveInstanceAssociationsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeEffectiveInstanceAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeEffectiveInstanceAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeEffectiveInstanceAssociations{}, middleware.After) if err != nil { return err @@ -66,6 +73,13 @@ func addOperationDescribeEffectiveInstanceAssociationsMiddlewares(stack *middlew if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeEffectiveInstanceAssociations"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -84,16 +98,13 @@ func addOperationDescribeEffectiveInstanceAssociationsMiddlewares(stack *middlew if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -102,12 +113,18 @@ func addOperationDescribeEffectiveInstanceAssociationsMiddlewares(stack *middlew if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDescribeEffectiveInstanceAssociationsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeEffectiveInstanceAssociations(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -117,6 +134,9 @@ func addOperationDescribeEffectiveInstanceAssociationsMiddlewares(stack *middlew if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -153,30 +173,31 @@ type DescribeEffectiveInstanceAssociationsPaginator struct { // NewDescribeEffectiveInstanceAssociationsPaginator returns a new // DescribeEffectiveInstanceAssociationsPaginator func NewDescribeEffectiveInstanceAssociationsPaginator(client DescribeEffectiveInstanceAssociationsAPIClient, params *DescribeEffectiveInstanceAssociationsInput, optFns ...func(*DescribeEffectiveInstanceAssociationsPaginatorOptions)) *DescribeEffectiveInstanceAssociationsPaginator { + if params == nil { + params = &DescribeEffectiveInstanceAssociationsInput{} + } + options := DescribeEffectiveInstanceAssociationsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &DescribeEffectiveInstanceAssociationsInput{} - } - return &DescribeEffectiveInstanceAssociationsPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeEffectiveInstanceAssociationsPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeEffectiveInstanceAssociations page. @@ -188,7 +209,11 @@ func (p *DescribeEffectiveInstanceAssociationsPaginator) NextPage(ctx context.Co params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeEffectiveInstanceAssociations(ctx, ¶ms, optFns...) if err != nil { @@ -199,7 +224,10 @@ func (p *DescribeEffectiveInstanceAssociationsPaginator) NextPage(ctx context.Co prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -210,7 +238,6 @@ func newServiceMetadataMiddleware_opDescribeEffectiveInstanceAssociations(region return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribeEffectiveInstanceAssociations", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeEffectivePatchesForPatchBaseline.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeEffectivePatchesForPatchBaseline.go index 5109501c..72dd9330 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeEffectivePatchesForPatchBaseline.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeEffectivePatchesForPatchBaseline.go @@ -13,14 +13,13 @@ import ( ) // Retrieves the current effective patches (the patch and the approval state) for -// the specified patch baseline. Note that this API applies only to Windows patch -// baselines. +// the specified patch baseline. Applies to patch baselines for Windows only. func (c *Client) DescribeEffectivePatchesForPatchBaseline(ctx context.Context, params *DescribeEffectivePatchesForPatchBaselineInput, optFns ...func(*Options)) (*DescribeEffectivePatchesForPatchBaselineOutput, error) { if params == nil { params = &DescribeEffectivePatchesForPatchBaselineInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeEffectivePatchesForPatchBaseline", params, optFns, addOperationDescribeEffectivePatchesForPatchBaselineMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeEffectivePatchesForPatchBaseline", params, optFns, c.addOperationDescribeEffectivePatchesForPatchBaselineMiddlewares) if err != nil { return nil, err } @@ -38,11 +37,13 @@ type DescribeEffectivePatchesForPatchBaselineInput struct { BaselineId *string // The maximum number of patches to return (per page). - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string + + noSmithyDocumentSerde } type DescribeEffectivePatchesForPatchBaselineOutput struct { @@ -56,9 +57,14 @@ type DescribeEffectivePatchesForPatchBaselineOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeEffectivePatchesForPatchBaselineMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeEffectivePatchesForPatchBaselineMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeEffectivePatchesForPatchBaseline{}, middleware.After) if err != nil { return err @@ -67,6 +73,13 @@ func addOperationDescribeEffectivePatchesForPatchBaselineMiddlewares(stack *midd if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeEffectivePatchesForPatchBaseline"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -85,16 +98,13 @@ func addOperationDescribeEffectivePatchesForPatchBaselineMiddlewares(stack *midd if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -103,12 +113,18 @@ func addOperationDescribeEffectivePatchesForPatchBaselineMiddlewares(stack *midd if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDescribeEffectivePatchesForPatchBaselineValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeEffectivePatchesForPatchBaseline(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -118,6 +134,9 @@ func addOperationDescribeEffectivePatchesForPatchBaselineMiddlewares(stack *midd if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -153,30 +172,31 @@ type DescribeEffectivePatchesForPatchBaselinePaginator struct { // NewDescribeEffectivePatchesForPatchBaselinePaginator returns a new // DescribeEffectivePatchesForPatchBaselinePaginator func NewDescribeEffectivePatchesForPatchBaselinePaginator(client DescribeEffectivePatchesForPatchBaselineAPIClient, params *DescribeEffectivePatchesForPatchBaselineInput, optFns ...func(*DescribeEffectivePatchesForPatchBaselinePaginatorOptions)) *DescribeEffectivePatchesForPatchBaselinePaginator { + if params == nil { + params = &DescribeEffectivePatchesForPatchBaselineInput{} + } + options := DescribeEffectivePatchesForPatchBaselinePaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &DescribeEffectivePatchesForPatchBaselineInput{} - } - return &DescribeEffectivePatchesForPatchBaselinePaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeEffectivePatchesForPatchBaselinePaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeEffectivePatchesForPatchBaseline page. @@ -188,7 +208,11 @@ func (p *DescribeEffectivePatchesForPatchBaselinePaginator) NextPage(ctx context params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeEffectivePatchesForPatchBaseline(ctx, ¶ms, optFns...) if err != nil { @@ -199,7 +223,10 @@ func (p *DescribeEffectivePatchesForPatchBaselinePaginator) NextPage(ctx context prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -210,7 +237,6 @@ func newServiceMetadataMiddleware_opDescribeEffectivePatchesForPatchBaseline(reg return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribeEffectivePatchesForPatchBaseline", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInstanceAssociationsStatus.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInstanceAssociationsStatus.go index d5bda7a9..4f437bbe 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInstanceAssociationsStatus.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInstanceAssociationsStatus.go @@ -12,13 +12,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// The status of the associations for the instance(s). +// The status of the associations for the managed node(s). func (c *Client) DescribeInstanceAssociationsStatus(ctx context.Context, params *DescribeInstanceAssociationsStatusInput, optFns ...func(*Options)) (*DescribeInstanceAssociationsStatusOutput, error) { if params == nil { params = &DescribeInstanceAssociationsStatusInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeInstanceAssociationsStatus", params, optFns, addOperationDescribeInstanceAssociationsStatusMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeInstanceAssociationsStatus", params, optFns, c.addOperationDescribeInstanceAssociationsStatusMiddlewares) if err != nil { return nil, err } @@ -30,18 +30,20 @@ func (c *Client) DescribeInstanceAssociationsStatus(ctx context.Context, params type DescribeInstanceAssociationsStatusInput struct { - // The instance IDs for which you want association status information. + // The managed node IDs for which you want association status information. // // This member is required. InstanceId *string // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string + + noSmithyDocumentSerde } type DescribeInstanceAssociationsStatusOutput struct { @@ -55,9 +57,14 @@ type DescribeInstanceAssociationsStatusOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeInstanceAssociationsStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeInstanceAssociationsStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeInstanceAssociationsStatus{}, middleware.After) if err != nil { return err @@ -66,6 +73,13 @@ func addOperationDescribeInstanceAssociationsStatusMiddlewares(stack *middleware if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeInstanceAssociationsStatus"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -84,16 +98,13 @@ func addOperationDescribeInstanceAssociationsStatusMiddlewares(stack *middleware if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -102,12 +113,18 @@ func addOperationDescribeInstanceAssociationsStatusMiddlewares(stack *middleware if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDescribeInstanceAssociationsStatusValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInstanceAssociationsStatus(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -117,6 +134,9 @@ func addOperationDescribeInstanceAssociationsStatusMiddlewares(stack *middleware if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -153,30 +173,31 @@ type DescribeInstanceAssociationsStatusPaginator struct { // NewDescribeInstanceAssociationsStatusPaginator returns a new // DescribeInstanceAssociationsStatusPaginator func NewDescribeInstanceAssociationsStatusPaginator(client DescribeInstanceAssociationsStatusAPIClient, params *DescribeInstanceAssociationsStatusInput, optFns ...func(*DescribeInstanceAssociationsStatusPaginatorOptions)) *DescribeInstanceAssociationsStatusPaginator { + if params == nil { + params = &DescribeInstanceAssociationsStatusInput{} + } + options := DescribeInstanceAssociationsStatusPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &DescribeInstanceAssociationsStatusInput{} - } - return &DescribeInstanceAssociationsStatusPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeInstanceAssociationsStatusPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeInstanceAssociationsStatus page. @@ -188,7 +209,11 @@ func (p *DescribeInstanceAssociationsStatusPaginator) NextPage(ctx context.Conte params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeInstanceAssociationsStatus(ctx, ¶ms, optFns...) if err != nil { @@ -199,7 +224,10 @@ func (p *DescribeInstanceAssociationsStatusPaginator) NextPage(ctx context.Conte prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -210,7 +238,6 @@ func newServiceMetadataMiddleware_opDescribeInstanceAssociationsStatus(region st return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribeInstanceAssociationsStatus", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInstanceInformation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInstanceInformation.go index 21f49336..b133f5ad 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInstanceInformation.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInstanceInformation.go @@ -12,21 +12,22 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Describes one or more of your instances, including information about the -// operating system platform, the version of SSM Agent installed on the instance, -// instance status, and so on. If you specify one or more instance IDs, it returns -// information for those instances. If you do not specify instance IDs, it returns -// information for all your instances. If you specify an instance ID that is not -// valid or an instance that you do not own, you receive an error. The IamRole -// field for this API action is the Amazon Identity and Access Management (IAM) -// role assigned to on-premises instances. This call does not return the IAM role -// for EC2 instances. +// Provides information about one or more of your managed nodes, including the +// operating system platform, SSM Agent version, association status, and IP +// address. This operation does not return information for nodes that are either +// Stopped or Terminated. If you specify one or more node IDs, the operation +// returns information for those managed nodes. If you don't specify node IDs, it +// returns information for all your managed nodes. If you specify a node ID that +// isn't valid or a node that you don't own, you receive an error. The IamRole +// field returned for this API operation is the Identity and Access Management +// (IAM) role assigned to on-premises managed nodes. This operation does not return +// the IAM role for EC2 instances. func (c *Client) DescribeInstanceInformation(ctx context.Context, params *DescribeInstanceInformationInput, optFns ...func(*Options)) (*DescribeInstanceInformationOutput, error) { if params == nil { params = &DescribeInstanceInformationInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeInstanceInformation", params, optFns, addOperationDescribeInstanceInformationMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeInstanceInformation", params, optFns, c.addOperationDescribeInstanceInformationMiddlewares) if err != nil { return nil, err } @@ -38,29 +39,33 @@ func (c *Client) DescribeInstanceInformation(ctx context.Context, params *Descri type DescribeInstanceInformationInput struct { - // One or more filters. Use a filter to return a more specific list of instances. - // You can filter based on tags applied to EC2 instances. Use this Filters data - // type instead of InstanceInformationFilterList, which is deprecated. + // One or more filters. Use a filter to return a more specific list of managed + // nodes. You can filter based on tags applied to your managed nodes. Tag filters + // can't be combined with other filter types. Use this Filters data type instead + // of InstanceInformationFilterList , which is deprecated. Filters []types.InstanceInformationStringFilter // This is a legacy method. We recommend that you don't use this method. Instead, - // use the Filters data type. Filters enables you to return instance information by - // filtering based on tags applied to managed instances. Attempting to use + // use the Filters data type. Filters enables you to return node information by + // filtering based on tags applied to managed nodes. Attempting to use // InstanceInformationFilterList and Filters leads to an exception error. InstanceInformationFilterList []types.InstanceInformationFilter // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + // The default value is 10 items. + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string + + noSmithyDocumentSerde } type DescribeInstanceInformationOutput struct { - // The instance information list. + // The managed node information list. InstanceInformationList []types.InstanceInformation // The token to use when requesting the next set of items. If there are no @@ -69,9 +74,14 @@ type DescribeInstanceInformationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeInstanceInformationMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeInstanceInformationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeInstanceInformation{}, middleware.After) if err != nil { return err @@ -80,6 +90,13 @@ func addOperationDescribeInstanceInformationMiddlewares(stack *middleware.Stack, if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeInstanceInformation"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -98,16 +115,13 @@ func addOperationDescribeInstanceInformationMiddlewares(stack *middleware.Stack, if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -116,12 +130,18 @@ func addOperationDescribeInstanceInformationMiddlewares(stack *middleware.Stack, if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDescribeInstanceInformationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInstanceInformation(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -131,6 +151,9 @@ func addOperationDescribeInstanceInformationMiddlewares(stack *middleware.Stack, if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -147,6 +170,7 @@ var _ DescribeInstanceInformationAPIClient = (*Client)(nil) type DescribeInstanceInformationPaginatorOptions struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. + // The default value is 10 items. Limit int32 // Set to true if pagination should stop if the service returns a pagination token @@ -167,30 +191,31 @@ type DescribeInstanceInformationPaginator struct { // NewDescribeInstanceInformationPaginator returns a new // DescribeInstanceInformationPaginator func NewDescribeInstanceInformationPaginator(client DescribeInstanceInformationAPIClient, params *DescribeInstanceInformationInput, optFns ...func(*DescribeInstanceInformationPaginatorOptions)) *DescribeInstanceInformationPaginator { + if params == nil { + params = &DescribeInstanceInformationInput{} + } + options := DescribeInstanceInformationPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &DescribeInstanceInformationInput{} - } - return &DescribeInstanceInformationPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeInstanceInformationPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeInstanceInformation page. @@ -202,7 +227,11 @@ func (p *DescribeInstanceInformationPaginator) NextPage(ctx context.Context, opt params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeInstanceInformation(ctx, ¶ms, optFns...) if err != nil { @@ -213,7 +242,10 @@ func (p *DescribeInstanceInformationPaginator) NextPage(ctx context.Context, opt prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -224,7 +256,6 @@ func newServiceMetadataMiddleware_opDescribeInstanceInformation(region string) * return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribeInstanceInformation", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInstancePatchStates.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInstancePatchStates.go index 4fbcdbe0..4c5d69c9 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInstancePatchStates.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInstancePatchStates.go @@ -12,13 +12,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Retrieves the high-level patch state of one or more instances. +// Retrieves the high-level patch state of one or more managed nodes. func (c *Client) DescribeInstancePatchStates(ctx context.Context, params *DescribeInstancePatchStatesInput, optFns ...func(*Options)) (*DescribeInstancePatchStatesOutput, error) { if params == nil { params = &DescribeInstancePatchStatesInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeInstancePatchStates", params, optFns, addOperationDescribeInstancePatchStatesMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeInstancePatchStates", params, optFns, c.addOperationDescribeInstancePatchStatesMiddlewares) if err != nil { return nil, err } @@ -30,22 +30,25 @@ func (c *Client) DescribeInstancePatchStates(ctx context.Context, params *Descri type DescribeInstancePatchStatesInput struct { - // The ID of the instance whose patch state information should be retrieved. + // The ID of the managed node for which patch state information should be + // retrieved. // // This member is required. InstanceIds []string - // The maximum number of instances to return (per page). - MaxResults int32 + // The maximum number of managed nodes to return (per page). + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string + + noSmithyDocumentSerde } type DescribeInstancePatchStatesOutput struct { - // The high-level patch state for the requested instances. + // The high-level patch state for the requested managed nodes. InstancePatchStates []types.InstancePatchState // The token to use when requesting the next set of items. If there are no @@ -54,9 +57,14 @@ type DescribeInstancePatchStatesOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeInstancePatchStatesMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeInstancePatchStatesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeInstancePatchStates{}, middleware.After) if err != nil { return err @@ -65,6 +73,13 @@ func addOperationDescribeInstancePatchStatesMiddlewares(stack *middleware.Stack, if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeInstancePatchStates"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -83,16 +98,13 @@ func addOperationDescribeInstancePatchStatesMiddlewares(stack *middleware.Stack, if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -101,12 +113,18 @@ func addOperationDescribeInstancePatchStatesMiddlewares(stack *middleware.Stack, if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDescribeInstancePatchStatesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInstancePatchStates(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -116,6 +134,9 @@ func addOperationDescribeInstancePatchStatesMiddlewares(stack *middleware.Stack, if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -130,7 +151,7 @@ var _ DescribeInstancePatchStatesAPIClient = (*Client)(nil) // DescribeInstancePatchStatesPaginatorOptions is the paginator options for // DescribeInstancePatchStates type DescribeInstancePatchStatesPaginatorOptions struct { - // The maximum number of instances to return (per page). + // The maximum number of managed nodes to return (per page). Limit int32 // Set to true if pagination should stop if the service returns a pagination token @@ -151,30 +172,31 @@ type DescribeInstancePatchStatesPaginator struct { // NewDescribeInstancePatchStatesPaginator returns a new // DescribeInstancePatchStatesPaginator func NewDescribeInstancePatchStatesPaginator(client DescribeInstancePatchStatesAPIClient, params *DescribeInstancePatchStatesInput, optFns ...func(*DescribeInstancePatchStatesPaginatorOptions)) *DescribeInstancePatchStatesPaginator { + if params == nil { + params = &DescribeInstancePatchStatesInput{} + } + options := DescribeInstancePatchStatesPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &DescribeInstancePatchStatesInput{} - } - return &DescribeInstancePatchStatesPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeInstancePatchStatesPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeInstancePatchStates page. @@ -186,7 +208,11 @@ func (p *DescribeInstancePatchStatesPaginator) NextPage(ctx context.Context, opt params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeInstancePatchStates(ctx, ¶ms, optFns...) if err != nil { @@ -197,7 +223,10 @@ func (p *DescribeInstancePatchStatesPaginator) NextPage(ctx context.Context, opt prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -208,7 +237,6 @@ func newServiceMetadataMiddleware_opDescribeInstancePatchStates(region string) * return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribeInstancePatchStates", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInstancePatchStatesForPatchGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInstancePatchStatesForPatchGroup.go index 4790a717..48bcb332 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInstancePatchStatesForPatchGroup.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInstancePatchStatesForPatchGroup.go @@ -12,14 +12,14 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Retrieves the high-level patch state for the instances in the specified patch -// group. +// Retrieves the high-level patch state for the managed nodes in the specified +// patch group. func (c *Client) DescribeInstancePatchStatesForPatchGroup(ctx context.Context, params *DescribeInstancePatchStatesForPatchGroupInput, optFns ...func(*Options)) (*DescribeInstancePatchStatesForPatchGroupOutput, error) { if params == nil { params = &DescribeInstancePatchStatesForPatchGroupInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeInstancePatchStatesForPatchGroup", params, optFns, addOperationDescribeInstancePatchStatesForPatchGroupMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeInstancePatchStatesForPatchGroup", params, optFns, c.addOperationDescribeInstancePatchStatesForPatchGroupMiddlewares) if err != nil { return nil, err } @@ -37,22 +37,25 @@ type DescribeInstancePatchStatesForPatchGroupInput struct { // This member is required. PatchGroup *string - // Each entry in the array is a structure containing: Key (string between 1 and 200 - // characters) Values (array containing a single string) Type (string "Equal", - // "NotEqual", "LessThan", "GreaterThan") + // Each entry in the array is a structure containing: + // - Key (string between 1 and 200 characters) + // - Values (array containing a single string) + // - Type (string "Equal", "NotEqual", "LessThan", "GreaterThan") Filters []types.InstancePatchStateFilter // The maximum number of patches to return (per page). - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string + + noSmithyDocumentSerde } type DescribeInstancePatchStatesForPatchGroupOutput struct { - // The high-level patch state for the requested instances. + // The high-level patch state for the requested managed nodes. InstancePatchStates []types.InstancePatchState // The token to use when requesting the next set of items. If there are no @@ -61,9 +64,14 @@ type DescribeInstancePatchStatesForPatchGroupOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeInstancePatchStatesForPatchGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeInstancePatchStatesForPatchGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeInstancePatchStatesForPatchGroup{}, middleware.After) if err != nil { return err @@ -72,6 +80,13 @@ func addOperationDescribeInstancePatchStatesForPatchGroupMiddlewares(stack *midd if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeInstancePatchStatesForPatchGroup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -90,16 +105,13 @@ func addOperationDescribeInstancePatchStatesForPatchGroupMiddlewares(stack *midd if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -108,12 +120,18 @@ func addOperationDescribeInstancePatchStatesForPatchGroupMiddlewares(stack *midd if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDescribeInstancePatchStatesForPatchGroupValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInstancePatchStatesForPatchGroup(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -123,6 +141,9 @@ func addOperationDescribeInstancePatchStatesForPatchGroupMiddlewares(stack *midd if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -158,30 +179,31 @@ type DescribeInstancePatchStatesForPatchGroupPaginator struct { // NewDescribeInstancePatchStatesForPatchGroupPaginator returns a new // DescribeInstancePatchStatesForPatchGroupPaginator func NewDescribeInstancePatchStatesForPatchGroupPaginator(client DescribeInstancePatchStatesForPatchGroupAPIClient, params *DescribeInstancePatchStatesForPatchGroupInput, optFns ...func(*DescribeInstancePatchStatesForPatchGroupPaginatorOptions)) *DescribeInstancePatchStatesForPatchGroupPaginator { + if params == nil { + params = &DescribeInstancePatchStatesForPatchGroupInput{} + } + options := DescribeInstancePatchStatesForPatchGroupPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &DescribeInstancePatchStatesForPatchGroupInput{} - } - return &DescribeInstancePatchStatesForPatchGroupPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeInstancePatchStatesForPatchGroupPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeInstancePatchStatesForPatchGroup page. @@ -193,7 +215,11 @@ func (p *DescribeInstancePatchStatesForPatchGroupPaginator) NextPage(ctx context params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeInstancePatchStatesForPatchGroup(ctx, ¶ms, optFns...) if err != nil { @@ -204,7 +230,10 @@ func (p *DescribeInstancePatchStatesForPatchGroupPaginator) NextPage(ctx context prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -215,7 +244,6 @@ func newServiceMetadataMiddleware_opDescribeInstancePatchStatesForPatchGroup(reg return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribeInstancePatchStatesForPatchGroup", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInstancePatches.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInstancePatches.go index d432cc54..045aade1 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInstancePatches.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInstancePatches.go @@ -12,14 +12,14 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Retrieves information about the patches on the specified instance and their -// state relative to the patch baseline being used for the instance. +// Retrieves information about the patches on the specified managed node and their +// state relative to the patch baseline being used for the node. func (c *Client) DescribeInstancePatches(ctx context.Context, params *DescribeInstancePatchesInput, optFns ...func(*Options)) (*DescribeInstancePatchesOutput, error) { if params == nil { params = &DescribeInstancePatchesInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeInstancePatches", params, optFns, addOperationDescribeInstancePatchesMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeInstancePatches", params, optFns, c.addOperationDescribeInstancePatchesMiddlewares) if err != nil { return nil, err } @@ -31,22 +31,29 @@ func (c *Client) DescribeInstancePatches(ctx context.Context, params *DescribeIn type DescribeInstancePatchesInput struct { - // The ID of the instance whose patch state information should be retrieved. + // The ID of the managed node whose patch state information should be retrieved. // // This member is required. InstanceId *string - // An array of structures. Each entry in the array is a structure containing a Key, - // Value combination. Valid values for Key are Classification | KBId | Severity | - // State. + // Each element in the array is a structure containing a key-value pair. Supported + // keys for DescribeInstancePatches include the following: + // - Classification Sample values: Security | SecurityUpdates + // - KBId Sample values: KB4480056 | java-1.7.0-openjdk.x86_64 + // - Severity Sample values: Important | Medium | Low + // - State Sample values: Installed | InstalledOther | InstalledPendingReboot For + // lists of all State values, see Understanding patch compliance state values (https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-compliance-states.html) + // in the Amazon Web Services Systems Manager User Guide. Filters []types.PatchOrchestratorFilter // The maximum number of patches to return (per page). - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string + + noSmithyDocumentSerde } type DescribeInstancePatchesOutput struct { @@ -55,16 +62,26 @@ type DescribeInstancePatchesOutput struct { // additional items to return, the string is empty. NextToken *string - // Each entry in the array is a structure containing: Title (string) KBId (string) - // Classification (string) Severity (string) State (string, such as "INSTALLED" or - // "FAILED") InstalledTime (DateTime) InstalledBy (string) + // Each entry in the array is a structure containing: + // - Title (string) + // - KBId (string) + // - Classification (string) + // - Severity (string) + // - State (string, such as "INSTALLED" or "FAILED") + // - InstalledTime (DateTime) + // - InstalledBy (string) Patches []types.PatchComplianceData // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeInstancePatchesMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeInstancePatchesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeInstancePatches{}, middleware.After) if err != nil { return err @@ -73,6 +90,13 @@ func addOperationDescribeInstancePatchesMiddlewares(stack *middleware.Stack, opt if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeInstancePatches"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -91,16 +115,13 @@ func addOperationDescribeInstancePatchesMiddlewares(stack *middleware.Stack, opt if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -109,12 +130,18 @@ func addOperationDescribeInstancePatchesMiddlewares(stack *middleware.Stack, opt if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDescribeInstancePatchesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInstancePatches(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -124,6 +151,9 @@ func addOperationDescribeInstancePatchesMiddlewares(stack *middleware.Stack, opt if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -158,30 +188,31 @@ type DescribeInstancePatchesPaginator struct { // NewDescribeInstancePatchesPaginator returns a new // DescribeInstancePatchesPaginator func NewDescribeInstancePatchesPaginator(client DescribeInstancePatchesAPIClient, params *DescribeInstancePatchesInput, optFns ...func(*DescribeInstancePatchesPaginatorOptions)) *DescribeInstancePatchesPaginator { + if params == nil { + params = &DescribeInstancePatchesInput{} + } + options := DescribeInstancePatchesPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &DescribeInstancePatchesInput{} - } - return &DescribeInstancePatchesPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeInstancePatchesPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeInstancePatches page. @@ -193,7 +224,11 @@ func (p *DescribeInstancePatchesPaginator) NextPage(ctx context.Context, optFns params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeInstancePatches(ctx, ¶ms, optFns...) if err != nil { @@ -204,7 +239,10 @@ func (p *DescribeInstancePatchesPaginator) NextPage(ctx context.Context, optFns prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -215,7 +253,6 @@ func newServiceMetadataMiddleware_opDescribeInstancePatches(region string) *awsm return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribeInstancePatches", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInventoryDeletions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInventoryDeletions.go index 7e973095..06982c26 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInventoryDeletions.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeInventoryDeletions.go @@ -18,7 +18,7 @@ func (c *Client) DescribeInventoryDeletions(ctx context.Context, params *Describ params = &DescribeInventoryDeletionsInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeInventoryDeletions", params, optFns, addOperationDescribeInventoryDeletionsMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeInventoryDeletions", params, optFns, c.addOperationDescribeInventoryDeletionsMiddlewares) if err != nil { return nil, err } @@ -31,15 +31,17 @@ func (c *Client) DescribeInventoryDeletions(ctx context.Context, params *Describ type DescribeInventoryDeletionsInput struct { // Specify the delete inventory ID for which you want information. This ID was - // returned by the DeleteInventory action. + // returned by the DeleteInventory operation. DeletionId *string // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // A token to start the list. Use this token to get the next set of results. NextToken *string + + noSmithyDocumentSerde } type DescribeInventoryDeletionsOutput struct { @@ -53,9 +55,14 @@ type DescribeInventoryDeletionsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeInventoryDeletionsMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeInventoryDeletionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeInventoryDeletions{}, middleware.After) if err != nil { return err @@ -64,6 +71,13 @@ func addOperationDescribeInventoryDeletionsMiddlewares(stack *middleware.Stack, if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeInventoryDeletions"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -82,16 +96,13 @@ func addOperationDescribeInventoryDeletionsMiddlewares(stack *middleware.Stack, if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -100,9 +111,15 @@ func addOperationDescribeInventoryDeletionsMiddlewares(stack *middleware.Stack, if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInventoryDeletions(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -112,6 +129,9 @@ func addOperationDescribeInventoryDeletionsMiddlewares(stack *middleware.Stack, if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -148,30 +168,31 @@ type DescribeInventoryDeletionsPaginator struct { // NewDescribeInventoryDeletionsPaginator returns a new // DescribeInventoryDeletionsPaginator func NewDescribeInventoryDeletionsPaginator(client DescribeInventoryDeletionsAPIClient, params *DescribeInventoryDeletionsInput, optFns ...func(*DescribeInventoryDeletionsPaginatorOptions)) *DescribeInventoryDeletionsPaginator { + if params == nil { + params = &DescribeInventoryDeletionsInput{} + } + options := DescribeInventoryDeletionsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &DescribeInventoryDeletionsInput{} - } - return &DescribeInventoryDeletionsPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeInventoryDeletionsPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeInventoryDeletions page. @@ -183,7 +204,11 @@ func (p *DescribeInventoryDeletionsPaginator) NextPage(ctx context.Context, optF params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeInventoryDeletions(ctx, ¶ms, optFns...) if err != nil { @@ -194,7 +219,10 @@ func (p *DescribeInventoryDeletionsPaginator) NextPage(ctx context.Context, optF prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -205,7 +233,6 @@ func newServiceMetadataMiddleware_opDescribeInventoryDeletions(region string) *a return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribeInventoryDeletions", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowExecutionTaskInvocations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowExecutionTaskInvocations.go index 5ece26f3..7adfd3c1 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowExecutionTaskInvocations.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowExecutionTaskInvocations.go @@ -19,7 +19,7 @@ func (c *Client) DescribeMaintenanceWindowExecutionTaskInvocations(ctx context.C params = &DescribeMaintenanceWindowExecutionTaskInvocationsInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeMaintenanceWindowExecutionTaskInvocations", params, optFns, addOperationDescribeMaintenanceWindowExecutionTaskInvocationsMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeMaintenanceWindowExecutionTaskInvocations", params, optFns, c.addOperationDescribeMaintenanceWindowExecutionTaskInvocationsMiddlewares) if err != nil { return nil, err } @@ -42,18 +42,20 @@ type DescribeMaintenanceWindowExecutionTaskInvocationsInput struct { // This member is required. WindowExecutionId *string - // Optional filters used to scope down the returned task invocations. The supported - // filter key is STATUS with the corresponding values PENDING, IN_PROGRESS, - // SUCCESS, FAILED, TIMED_OUT, CANCELLING, and CANCELLED. + // Optional filters used to scope down the returned task invocations. The + // supported filter key is STATUS with the corresponding values PENDING , + // IN_PROGRESS , SUCCESS , FAILED , TIMED_OUT , CANCELLING , and CANCELLED . Filters []types.MaintenanceWindowFilter // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string + + noSmithyDocumentSerde } type DescribeMaintenanceWindowExecutionTaskInvocationsOutput struct { @@ -67,9 +69,14 @@ type DescribeMaintenanceWindowExecutionTaskInvocationsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeMaintenanceWindowExecutionTaskInvocationsMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeMaintenanceWindowExecutionTaskInvocationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeMaintenanceWindowExecutionTaskInvocations{}, middleware.After) if err != nil { return err @@ -78,6 +85,13 @@ func addOperationDescribeMaintenanceWindowExecutionTaskInvocationsMiddlewares(st if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeMaintenanceWindowExecutionTaskInvocations"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -96,16 +110,13 @@ func addOperationDescribeMaintenanceWindowExecutionTaskInvocationsMiddlewares(st if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -114,12 +125,18 @@ func addOperationDescribeMaintenanceWindowExecutionTaskInvocationsMiddlewares(st if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDescribeMaintenanceWindowExecutionTaskInvocationsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMaintenanceWindowExecutionTaskInvocations(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -129,6 +146,9 @@ func addOperationDescribeMaintenanceWindowExecutionTaskInvocationsMiddlewares(st if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -165,30 +185,31 @@ type DescribeMaintenanceWindowExecutionTaskInvocationsPaginator struct { // NewDescribeMaintenanceWindowExecutionTaskInvocationsPaginator returns a new // DescribeMaintenanceWindowExecutionTaskInvocationsPaginator func NewDescribeMaintenanceWindowExecutionTaskInvocationsPaginator(client DescribeMaintenanceWindowExecutionTaskInvocationsAPIClient, params *DescribeMaintenanceWindowExecutionTaskInvocationsInput, optFns ...func(*DescribeMaintenanceWindowExecutionTaskInvocationsPaginatorOptions)) *DescribeMaintenanceWindowExecutionTaskInvocationsPaginator { + if params == nil { + params = &DescribeMaintenanceWindowExecutionTaskInvocationsInput{} + } + options := DescribeMaintenanceWindowExecutionTaskInvocationsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &DescribeMaintenanceWindowExecutionTaskInvocationsInput{} - } - return &DescribeMaintenanceWindowExecutionTaskInvocationsPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeMaintenanceWindowExecutionTaskInvocationsPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeMaintenanceWindowExecutionTaskInvocations @@ -201,7 +222,11 @@ func (p *DescribeMaintenanceWindowExecutionTaskInvocationsPaginator) NextPage(ct params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeMaintenanceWindowExecutionTaskInvocations(ctx, ¶ms, optFns...) if err != nil { @@ -212,7 +237,10 @@ func (p *DescribeMaintenanceWindowExecutionTaskInvocationsPaginator) NextPage(ct prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -223,7 +251,6 @@ func newServiceMetadataMiddleware_opDescribeMaintenanceWindowExecutionTaskInvoca return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribeMaintenanceWindowExecutionTaskInvocations", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowExecutionTasks.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowExecutionTasks.go index b5aa3f75..b3983b32 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowExecutionTasks.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowExecutionTasks.go @@ -18,7 +18,7 @@ func (c *Client) DescribeMaintenanceWindowExecutionTasks(ctx context.Context, pa params = &DescribeMaintenanceWindowExecutionTasksInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeMaintenanceWindowExecutionTasks", params, optFns, addOperationDescribeMaintenanceWindowExecutionTasksMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeMaintenanceWindowExecutionTasks", params, optFns, c.addOperationDescribeMaintenanceWindowExecutionTasksMiddlewares) if err != nil { return nil, err } @@ -36,18 +36,20 @@ type DescribeMaintenanceWindowExecutionTasksInput struct { // This member is required. WindowExecutionId *string - // Optional filters used to scope down the returned tasks. The supported filter key - // is STATUS with the corresponding values PENDING, IN_PROGRESS, SUCCESS, FAILED, - // TIMED_OUT, CANCELLING, and CANCELLED. + // Optional filters used to scope down the returned tasks. The supported filter + // key is STATUS with the corresponding values PENDING , IN_PROGRESS , SUCCESS , + // FAILED , TIMED_OUT , CANCELLING , and CANCELLED . Filters []types.MaintenanceWindowFilter // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string + + noSmithyDocumentSerde } type DescribeMaintenanceWindowExecutionTasksOutput struct { @@ -61,9 +63,14 @@ type DescribeMaintenanceWindowExecutionTasksOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeMaintenanceWindowExecutionTasksMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeMaintenanceWindowExecutionTasksMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeMaintenanceWindowExecutionTasks{}, middleware.After) if err != nil { return err @@ -72,6 +79,13 @@ func addOperationDescribeMaintenanceWindowExecutionTasksMiddlewares(stack *middl if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeMaintenanceWindowExecutionTasks"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -90,16 +104,13 @@ func addOperationDescribeMaintenanceWindowExecutionTasksMiddlewares(stack *middl if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -108,12 +119,18 @@ func addOperationDescribeMaintenanceWindowExecutionTasksMiddlewares(stack *middl if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDescribeMaintenanceWindowExecutionTasksValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMaintenanceWindowExecutionTasks(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -123,19 +140,22 @@ func addOperationDescribeMaintenanceWindowExecutionTasksMiddlewares(stack *middl if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } -// DescribeMaintenanceWindowExecutionTasksAPIClient is a client that implements the -// DescribeMaintenanceWindowExecutionTasks operation. +// DescribeMaintenanceWindowExecutionTasksAPIClient is a client that implements +// the DescribeMaintenanceWindowExecutionTasks operation. type DescribeMaintenanceWindowExecutionTasksAPIClient interface { DescribeMaintenanceWindowExecutionTasks(context.Context, *DescribeMaintenanceWindowExecutionTasksInput, ...func(*Options)) (*DescribeMaintenanceWindowExecutionTasksOutput, error) } var _ DescribeMaintenanceWindowExecutionTasksAPIClient = (*Client)(nil) -// DescribeMaintenanceWindowExecutionTasksPaginatorOptions is the paginator options -// for DescribeMaintenanceWindowExecutionTasks +// DescribeMaintenanceWindowExecutionTasksPaginatorOptions is the paginator +// options for DescribeMaintenanceWindowExecutionTasks type DescribeMaintenanceWindowExecutionTasksPaginatorOptions struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. @@ -159,30 +179,31 @@ type DescribeMaintenanceWindowExecutionTasksPaginator struct { // NewDescribeMaintenanceWindowExecutionTasksPaginator returns a new // DescribeMaintenanceWindowExecutionTasksPaginator func NewDescribeMaintenanceWindowExecutionTasksPaginator(client DescribeMaintenanceWindowExecutionTasksAPIClient, params *DescribeMaintenanceWindowExecutionTasksInput, optFns ...func(*DescribeMaintenanceWindowExecutionTasksPaginatorOptions)) *DescribeMaintenanceWindowExecutionTasksPaginator { + if params == nil { + params = &DescribeMaintenanceWindowExecutionTasksInput{} + } + options := DescribeMaintenanceWindowExecutionTasksPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &DescribeMaintenanceWindowExecutionTasksInput{} - } - return &DescribeMaintenanceWindowExecutionTasksPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeMaintenanceWindowExecutionTasksPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeMaintenanceWindowExecutionTasks page. @@ -194,7 +215,11 @@ func (p *DescribeMaintenanceWindowExecutionTasksPaginator) NextPage(ctx context. params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeMaintenanceWindowExecutionTasks(ctx, ¶ms, optFns...) if err != nil { @@ -205,7 +230,10 @@ func (p *DescribeMaintenanceWindowExecutionTasksPaginator) NextPage(ctx context. prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -216,7 +244,6 @@ func newServiceMetadataMiddleware_opDescribeMaintenanceWindowExecutionTasks(regi return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribeMaintenanceWindowExecutionTasks", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowExecutions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowExecutions.go index 715b7bbc..d3da2f1c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowExecutions.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowExecutions.go @@ -20,7 +20,7 @@ func (c *Client) DescribeMaintenanceWindowExecutions(ctx context.Context, params params = &DescribeMaintenanceWindowExecutionsInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeMaintenanceWindowExecutions", params, optFns, addOperationDescribeMaintenanceWindowExecutionsMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeMaintenanceWindowExecutions", params, optFns, c.addOperationDescribeMaintenanceWindowExecutionsMiddlewares) if err != nil { return nil, err } @@ -37,19 +37,23 @@ type DescribeMaintenanceWindowExecutionsInput struct { // This member is required. WindowId *string - // Each entry in the array is a structure containing: Key (string, between 1 and - // 128 characters) Values (array of strings, each string is between 1 and 256 - // characters) The supported Keys are ExecutedBefore and ExecutedAfter with the - // value being a date/time string such as 2016-11-04T05:00:00Z. + // Each entry in the array is a structure containing: + // - Key. A string between 1 and 128 characters. Supported keys include + // ExecutedBefore and ExecutedAfter . + // - Values. An array of strings, each between 1 and 256 characters. Supported + // values are date/time strings in a valid ISO 8601 date/time format, such as + // 2021-11-04T05:00:00Z . Filters []types.MaintenanceWindowFilter // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string + + noSmithyDocumentSerde } type DescribeMaintenanceWindowExecutionsOutput struct { @@ -63,9 +67,14 @@ type DescribeMaintenanceWindowExecutionsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeMaintenanceWindowExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeMaintenanceWindowExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeMaintenanceWindowExecutions{}, middleware.After) if err != nil { return err @@ -74,6 +83,13 @@ func addOperationDescribeMaintenanceWindowExecutionsMiddlewares(stack *middlewar if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeMaintenanceWindowExecutions"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -92,16 +108,13 @@ func addOperationDescribeMaintenanceWindowExecutionsMiddlewares(stack *middlewar if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -110,12 +123,18 @@ func addOperationDescribeMaintenanceWindowExecutionsMiddlewares(stack *middlewar if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDescribeMaintenanceWindowExecutionsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMaintenanceWindowExecutions(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -125,6 +144,9 @@ func addOperationDescribeMaintenanceWindowExecutionsMiddlewares(stack *middlewar if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -136,8 +158,8 @@ type DescribeMaintenanceWindowExecutionsAPIClient interface { var _ DescribeMaintenanceWindowExecutionsAPIClient = (*Client)(nil) -// DescribeMaintenanceWindowExecutionsPaginatorOptions is the paginator options for -// DescribeMaintenanceWindowExecutions +// DescribeMaintenanceWindowExecutionsPaginatorOptions is the paginator options +// for DescribeMaintenanceWindowExecutions type DescribeMaintenanceWindowExecutionsPaginatorOptions struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. @@ -161,30 +183,31 @@ type DescribeMaintenanceWindowExecutionsPaginator struct { // NewDescribeMaintenanceWindowExecutionsPaginator returns a new // DescribeMaintenanceWindowExecutionsPaginator func NewDescribeMaintenanceWindowExecutionsPaginator(client DescribeMaintenanceWindowExecutionsAPIClient, params *DescribeMaintenanceWindowExecutionsInput, optFns ...func(*DescribeMaintenanceWindowExecutionsPaginatorOptions)) *DescribeMaintenanceWindowExecutionsPaginator { + if params == nil { + params = &DescribeMaintenanceWindowExecutionsInput{} + } + options := DescribeMaintenanceWindowExecutionsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &DescribeMaintenanceWindowExecutionsInput{} - } - return &DescribeMaintenanceWindowExecutionsPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeMaintenanceWindowExecutionsPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeMaintenanceWindowExecutions page. @@ -196,7 +219,11 @@ func (p *DescribeMaintenanceWindowExecutionsPaginator) NextPage(ctx context.Cont params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeMaintenanceWindowExecutions(ctx, ¶ms, optFns...) if err != nil { @@ -207,7 +234,10 @@ func (p *DescribeMaintenanceWindowExecutionsPaginator) NextPage(ctx context.Cont prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -218,7 +248,6 @@ func newServiceMetadataMiddleware_opDescribeMaintenanceWindowExecutions(region s return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribeMaintenanceWindowExecutions", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowSchedule.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowSchedule.go index 18c12031..942a9c2f 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowSchedule.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowSchedule.go @@ -18,7 +18,7 @@ func (c *Client) DescribeMaintenanceWindowSchedule(ctx context.Context, params * params = &DescribeMaintenanceWindowScheduleInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeMaintenanceWindowSchedule", params, optFns, addOperationDescribeMaintenanceWindowScheduleMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeMaintenanceWindowSchedule", params, optFns, c.addOperationDescribeMaintenanceWindowScheduleMiddlewares) if err != nil { return nil, err } @@ -37,21 +37,23 @@ type DescribeMaintenanceWindowScheduleInput struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string // The type of resource you want to retrieve information about. For example, - // "INSTANCE". + // INSTANCE . ResourceType types.MaintenanceWindowResourceType - // The instance ID or key/value pair to retrieve information about. + // The managed node ID or key-value pair to retrieve information about. Targets []types.Target // The ID of the maintenance window to retrieve information about. WindowId *string + + noSmithyDocumentSerde } type DescribeMaintenanceWindowScheduleOutput struct { @@ -60,15 +62,20 @@ type DescribeMaintenanceWindowScheduleOutput struct { // call.) NextToken *string - // Information about maintenance window executions scheduled for the specified time - // range. + // Information about maintenance window executions scheduled for the specified + // time range. ScheduledWindowExecutions []types.ScheduledWindowExecution // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeMaintenanceWindowScheduleMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeMaintenanceWindowScheduleMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeMaintenanceWindowSchedule{}, middleware.After) if err != nil { return err @@ -77,6 +84,13 @@ func addOperationDescribeMaintenanceWindowScheduleMiddlewares(stack *middleware. if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeMaintenanceWindowSchedule"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -95,16 +109,13 @@ func addOperationDescribeMaintenanceWindowScheduleMiddlewares(stack *middleware. if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -113,9 +124,15 @@ func addOperationDescribeMaintenanceWindowScheduleMiddlewares(stack *middleware. if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMaintenanceWindowSchedule(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -125,6 +142,9 @@ func addOperationDescribeMaintenanceWindowScheduleMiddlewares(stack *middleware. if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -161,30 +181,31 @@ type DescribeMaintenanceWindowSchedulePaginator struct { // NewDescribeMaintenanceWindowSchedulePaginator returns a new // DescribeMaintenanceWindowSchedulePaginator func NewDescribeMaintenanceWindowSchedulePaginator(client DescribeMaintenanceWindowScheduleAPIClient, params *DescribeMaintenanceWindowScheduleInput, optFns ...func(*DescribeMaintenanceWindowSchedulePaginatorOptions)) *DescribeMaintenanceWindowSchedulePaginator { + if params == nil { + params = &DescribeMaintenanceWindowScheduleInput{} + } + options := DescribeMaintenanceWindowSchedulePaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &DescribeMaintenanceWindowScheduleInput{} - } - return &DescribeMaintenanceWindowSchedulePaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeMaintenanceWindowSchedulePaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeMaintenanceWindowSchedule page. @@ -196,7 +217,11 @@ func (p *DescribeMaintenanceWindowSchedulePaginator) NextPage(ctx context.Contex params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeMaintenanceWindowSchedule(ctx, ¶ms, optFns...) if err != nil { @@ -207,7 +232,10 @@ func (p *DescribeMaintenanceWindowSchedulePaginator) NextPage(ctx context.Contex prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -218,7 +246,6 @@ func newServiceMetadataMiddleware_opDescribeMaintenanceWindowSchedule(region str return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribeMaintenanceWindowSchedule", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowTargets.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowTargets.go index 2c170257..922c3705 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowTargets.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowTargets.go @@ -18,7 +18,7 @@ func (c *Client) DescribeMaintenanceWindowTargets(ctx context.Context, params *D params = &DescribeMaintenanceWindowTargetsInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeMaintenanceWindowTargets", params, optFns, addOperationDescribeMaintenanceWindowTargetsMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeMaintenanceWindowTargets", params, optFns, c.addOperationDescribeMaintenanceWindowTargetsMiddlewares) if err != nil { return nil, err } @@ -36,17 +36,19 @@ type DescribeMaintenanceWindowTargetsInput struct { WindowId *string // Optional filters that can be used to narrow down the scope of the returned - // window targets. The supported filter keys are Type, WindowTargetId and - // OwnerInformation. + // window targets. The supported filter keys are Type , WindowTargetId , and + // OwnerInformation . Filters []types.MaintenanceWindowFilter // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string + + noSmithyDocumentSerde } type DescribeMaintenanceWindowTargetsOutput struct { @@ -60,9 +62,14 @@ type DescribeMaintenanceWindowTargetsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeMaintenanceWindowTargetsMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeMaintenanceWindowTargetsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeMaintenanceWindowTargets{}, middleware.After) if err != nil { return err @@ -71,6 +78,13 @@ func addOperationDescribeMaintenanceWindowTargetsMiddlewares(stack *middleware.S if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeMaintenanceWindowTargets"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -89,16 +103,13 @@ func addOperationDescribeMaintenanceWindowTargetsMiddlewares(stack *middleware.S if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -107,12 +118,18 @@ func addOperationDescribeMaintenanceWindowTargetsMiddlewares(stack *middleware.S if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDescribeMaintenanceWindowTargetsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMaintenanceWindowTargets(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -122,6 +139,9 @@ func addOperationDescribeMaintenanceWindowTargetsMiddlewares(stack *middleware.S if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -158,30 +178,31 @@ type DescribeMaintenanceWindowTargetsPaginator struct { // NewDescribeMaintenanceWindowTargetsPaginator returns a new // DescribeMaintenanceWindowTargetsPaginator func NewDescribeMaintenanceWindowTargetsPaginator(client DescribeMaintenanceWindowTargetsAPIClient, params *DescribeMaintenanceWindowTargetsInput, optFns ...func(*DescribeMaintenanceWindowTargetsPaginatorOptions)) *DescribeMaintenanceWindowTargetsPaginator { + if params == nil { + params = &DescribeMaintenanceWindowTargetsInput{} + } + options := DescribeMaintenanceWindowTargetsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &DescribeMaintenanceWindowTargetsInput{} - } - return &DescribeMaintenanceWindowTargetsPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeMaintenanceWindowTargetsPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeMaintenanceWindowTargets page. @@ -193,7 +214,11 @@ func (p *DescribeMaintenanceWindowTargetsPaginator) NextPage(ctx context.Context params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeMaintenanceWindowTargets(ctx, ¶ms, optFns...) if err != nil { @@ -204,7 +229,10 @@ func (p *DescribeMaintenanceWindowTargetsPaginator) NextPage(ctx context.Context prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -215,7 +243,6 @@ func newServiceMetadataMiddleware_opDescribeMaintenanceWindowTargets(region stri return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribeMaintenanceWindowTargets", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowTasks.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowTasks.go index 4428998c..e4824249 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowTasks.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowTasks.go @@ -13,16 +13,16 @@ import ( ) // Lists the tasks in a maintenance window. For maintenance window tasks without a -// specified target, you cannot supply values for --max-errors and -// --max-concurrency. Instead, the system inserts a placeholder value of 1, which -// may be reported in the response to this command. These values do not affect the -// running of your task and can be ignored. +// specified target, you can't supply values for --max-errors and --max-concurrency +// . Instead, the system inserts a placeholder value of 1 , which may be reported +// in the response to this command. These values don't affect the running of your +// task and can be ignored. func (c *Client) DescribeMaintenanceWindowTasks(ctx context.Context, params *DescribeMaintenanceWindowTasksInput, optFns ...func(*Options)) (*DescribeMaintenanceWindowTasksOutput, error) { if params == nil { params = &DescribeMaintenanceWindowTasksInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeMaintenanceWindowTasks", params, optFns, addOperationDescribeMaintenanceWindowTasksMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeMaintenanceWindowTasks", params, optFns, c.addOperationDescribeMaintenanceWindowTasksMiddlewares) if err != nil { return nil, err } @@ -40,16 +40,18 @@ type DescribeMaintenanceWindowTasksInput struct { WindowId *string // Optional filters used to narrow down the scope of the returned tasks. The - // supported filter keys are WindowTaskId, TaskArn, Priority, and TaskType. + // supported filter keys are WindowTaskId , TaskArn , Priority , and TaskType . Filters []types.MaintenanceWindowFilter // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string + + noSmithyDocumentSerde } type DescribeMaintenanceWindowTasksOutput struct { @@ -63,9 +65,14 @@ type DescribeMaintenanceWindowTasksOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeMaintenanceWindowTasksMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeMaintenanceWindowTasksMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeMaintenanceWindowTasks{}, middleware.After) if err != nil { return err @@ -74,6 +81,13 @@ func addOperationDescribeMaintenanceWindowTasksMiddlewares(stack *middleware.Sta if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeMaintenanceWindowTasks"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -92,16 +106,13 @@ func addOperationDescribeMaintenanceWindowTasksMiddlewares(stack *middleware.Sta if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -110,12 +121,18 @@ func addOperationDescribeMaintenanceWindowTasksMiddlewares(stack *middleware.Sta if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDescribeMaintenanceWindowTasksValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMaintenanceWindowTasks(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -125,6 +142,9 @@ func addOperationDescribeMaintenanceWindowTasksMiddlewares(stack *middleware.Sta if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -161,30 +181,31 @@ type DescribeMaintenanceWindowTasksPaginator struct { // NewDescribeMaintenanceWindowTasksPaginator returns a new // DescribeMaintenanceWindowTasksPaginator func NewDescribeMaintenanceWindowTasksPaginator(client DescribeMaintenanceWindowTasksAPIClient, params *DescribeMaintenanceWindowTasksInput, optFns ...func(*DescribeMaintenanceWindowTasksPaginatorOptions)) *DescribeMaintenanceWindowTasksPaginator { + if params == nil { + params = &DescribeMaintenanceWindowTasksInput{} + } + options := DescribeMaintenanceWindowTasksPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &DescribeMaintenanceWindowTasksInput{} - } - return &DescribeMaintenanceWindowTasksPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeMaintenanceWindowTasksPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeMaintenanceWindowTasks page. @@ -196,7 +217,11 @@ func (p *DescribeMaintenanceWindowTasksPaginator) NextPage(ctx context.Context, params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeMaintenanceWindowTasks(ctx, ¶ms, optFns...) if err != nil { @@ -207,7 +232,10 @@ func (p *DescribeMaintenanceWindowTasksPaginator) NextPage(ctx context.Context, prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -218,7 +246,6 @@ func newServiceMetadataMiddleware_opDescribeMaintenanceWindowTasks(region string return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribeMaintenanceWindowTasks", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindows.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindows.go index 6ab00444..b8929059 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindows.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindows.go @@ -12,13 +12,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Retrieves the maintenance windows in an AWS account. +// Retrieves the maintenance windows in an Amazon Web Services account. func (c *Client) DescribeMaintenanceWindows(ctx context.Context, params *DescribeMaintenanceWindowsInput, optFns ...func(*Options)) (*DescribeMaintenanceWindowsOutput, error) { if params == nil { params = &DescribeMaintenanceWindowsInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeMaintenanceWindows", params, optFns, addOperationDescribeMaintenanceWindowsMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeMaintenanceWindows", params, optFns, c.addOperationDescribeMaintenanceWindowsMiddlewares) if err != nil { return nil, err } @@ -31,16 +31,19 @@ func (c *Client) DescribeMaintenanceWindows(ctx context.Context, params *Describ type DescribeMaintenanceWindowsInput struct { // Optional filters used to narrow down the scope of the returned maintenance - // windows. Supported filter keys are Name and Enabled. + // windows. Supported filter keys are Name and Enabled . For example, + // Name=MyMaintenanceWindow and Enabled=True . Filters []types.MaintenanceWindowFilter // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string + + noSmithyDocumentSerde } type DescribeMaintenanceWindowsOutput struct { @@ -54,9 +57,14 @@ type DescribeMaintenanceWindowsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeMaintenanceWindowsMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeMaintenanceWindowsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeMaintenanceWindows{}, middleware.After) if err != nil { return err @@ -65,6 +73,13 @@ func addOperationDescribeMaintenanceWindowsMiddlewares(stack *middleware.Stack, if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeMaintenanceWindows"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -83,16 +98,13 @@ func addOperationDescribeMaintenanceWindowsMiddlewares(stack *middleware.Stack, if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -101,9 +113,15 @@ func addOperationDescribeMaintenanceWindowsMiddlewares(stack *middleware.Stack, if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMaintenanceWindows(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -113,6 +131,9 @@ func addOperationDescribeMaintenanceWindowsMiddlewares(stack *middleware.Stack, if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -149,30 +170,31 @@ type DescribeMaintenanceWindowsPaginator struct { // NewDescribeMaintenanceWindowsPaginator returns a new // DescribeMaintenanceWindowsPaginator func NewDescribeMaintenanceWindowsPaginator(client DescribeMaintenanceWindowsAPIClient, params *DescribeMaintenanceWindowsInput, optFns ...func(*DescribeMaintenanceWindowsPaginatorOptions)) *DescribeMaintenanceWindowsPaginator { + if params == nil { + params = &DescribeMaintenanceWindowsInput{} + } + options := DescribeMaintenanceWindowsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &DescribeMaintenanceWindowsInput{} - } - return &DescribeMaintenanceWindowsPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeMaintenanceWindowsPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeMaintenanceWindows page. @@ -184,7 +206,11 @@ func (p *DescribeMaintenanceWindowsPaginator) NextPage(ctx context.Context, optF params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeMaintenanceWindows(ctx, ¶ms, optFns...) if err != nil { @@ -195,7 +221,10 @@ func (p *DescribeMaintenanceWindowsPaginator) NextPage(ctx context.Context, optF prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -206,7 +235,6 @@ func newServiceMetadataMiddleware_opDescribeMaintenanceWindows(region string) *a return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribeMaintenanceWindows", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowsForTarget.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowsForTarget.go index b1bf0a25..aabf1a53 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowsForTarget.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeMaintenanceWindowsForTarget.go @@ -12,14 +12,14 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Retrieves information about the maintenance window targets or tasks that an -// instance is associated with. +// Retrieves information about the maintenance window targets or tasks that a +// managed node is associated with. func (c *Client) DescribeMaintenanceWindowsForTarget(ctx context.Context, params *DescribeMaintenanceWindowsForTargetInput, optFns ...func(*Options)) (*DescribeMaintenanceWindowsForTargetOutput, error) { if params == nil { params = &DescribeMaintenanceWindowsForTargetInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeMaintenanceWindowsForTarget", params, optFns, addOperationDescribeMaintenanceWindowsForTargetMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeMaintenanceWindowsForTarget", params, optFns, c.addOperationDescribeMaintenanceWindowsForTargetMiddlewares) if err != nil { return nil, err } @@ -32,23 +32,25 @@ func (c *Client) DescribeMaintenanceWindowsForTarget(ctx context.Context, params type DescribeMaintenanceWindowsForTargetInput struct { // The type of resource you want to retrieve information about. For example, - // "INSTANCE". + // INSTANCE . // // This member is required. ResourceType types.MaintenanceWindowResourceType - // The instance ID or key/value pair to retrieve information about. + // The managed node ID or key-value pair to retrieve information about. // // This member is required. Targets []types.Target // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string + + noSmithyDocumentSerde } type DescribeMaintenanceWindowsForTargetOutput struct { @@ -57,15 +59,20 @@ type DescribeMaintenanceWindowsForTargetOutput struct { // call.) NextToken *string - // Information about the maintenance window targets and tasks an instance is + // Information about the maintenance window targets and tasks a managed node is // associated with. WindowIdentities []types.MaintenanceWindowIdentityForTarget // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeMaintenanceWindowsForTargetMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeMaintenanceWindowsForTargetMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeMaintenanceWindowsForTarget{}, middleware.After) if err != nil { return err @@ -74,6 +81,13 @@ func addOperationDescribeMaintenanceWindowsForTargetMiddlewares(stack *middlewar if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeMaintenanceWindowsForTarget"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -92,16 +106,13 @@ func addOperationDescribeMaintenanceWindowsForTargetMiddlewares(stack *middlewar if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -110,12 +121,18 @@ func addOperationDescribeMaintenanceWindowsForTargetMiddlewares(stack *middlewar if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDescribeMaintenanceWindowsForTargetValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMaintenanceWindowsForTarget(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -125,6 +142,9 @@ func addOperationDescribeMaintenanceWindowsForTargetMiddlewares(stack *middlewar if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -136,8 +156,8 @@ type DescribeMaintenanceWindowsForTargetAPIClient interface { var _ DescribeMaintenanceWindowsForTargetAPIClient = (*Client)(nil) -// DescribeMaintenanceWindowsForTargetPaginatorOptions is the paginator options for -// DescribeMaintenanceWindowsForTarget +// DescribeMaintenanceWindowsForTargetPaginatorOptions is the paginator options +// for DescribeMaintenanceWindowsForTarget type DescribeMaintenanceWindowsForTargetPaginatorOptions struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. @@ -161,30 +181,31 @@ type DescribeMaintenanceWindowsForTargetPaginator struct { // NewDescribeMaintenanceWindowsForTargetPaginator returns a new // DescribeMaintenanceWindowsForTargetPaginator func NewDescribeMaintenanceWindowsForTargetPaginator(client DescribeMaintenanceWindowsForTargetAPIClient, params *DescribeMaintenanceWindowsForTargetInput, optFns ...func(*DescribeMaintenanceWindowsForTargetPaginatorOptions)) *DescribeMaintenanceWindowsForTargetPaginator { + if params == nil { + params = &DescribeMaintenanceWindowsForTargetInput{} + } + options := DescribeMaintenanceWindowsForTargetPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &DescribeMaintenanceWindowsForTargetInput{} - } - return &DescribeMaintenanceWindowsForTargetPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeMaintenanceWindowsForTargetPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeMaintenanceWindowsForTarget page. @@ -196,7 +217,11 @@ func (p *DescribeMaintenanceWindowsForTargetPaginator) NextPage(ctx context.Cont params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeMaintenanceWindowsForTarget(ctx, ¶ms, optFns...) if err != nil { @@ -207,7 +232,10 @@ func (p *DescribeMaintenanceWindowsForTargetPaginator) NextPage(ctx context.Cont prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -218,7 +246,6 @@ func newServiceMetadataMiddleware_opDescribeMaintenanceWindowsForTarget(region s return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribeMaintenanceWindowsForTarget", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeOpsItems.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeOpsItems.go index 1bc5434e..a1c4f7ce 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeOpsItems.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeOpsItems.go @@ -12,22 +12,21 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Query a set of OpsItems. You must have permission in AWS Identity and Access -// Management (IAM) to query a list of OpsItems. For more information, see Getting -// started with OpsCenter -// (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-getting-started.html) -// in the AWS Systems Manager User Guide. Operations engineers and IT professionals -// use OpsCenter to view, investigate, and remediate operational issues impacting -// the performance and health of their AWS resources. For more information, see AWS -// Systems Manager OpsCenter -// (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter.html) in -// the AWS Systems Manager User Guide. +// Query a set of OpsItems. You must have permission in Identity and Access +// Management (IAM) to query a list of OpsItems. For more information, see Set up +// OpsCenter (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-setup.html) +// in the Amazon Web Services Systems Manager User Guide. Operations engineers and +// IT professionals use Amazon Web Services Systems Manager OpsCenter to view, +// investigate, and remediate operational issues impacting the performance and +// health of their Amazon Web Services resources. For more information, see +// OpsCenter (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter.html) +// in the Amazon Web Services Systems Manager User Guide. func (c *Client) DescribeOpsItems(ctx context.Context, params *DescribeOpsItemsInput, optFns ...func(*Options)) (*DescribeOpsItemsOutput, error) { if params == nil { params = &DescribeOpsItemsInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeOpsItems", params, optFns, addOperationDescribeOpsItemsMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeOpsItems", params, optFns, c.addOperationDescribeOpsItemsMiddlewares) if err != nil { return nil, err } @@ -47,45 +46,28 @@ type DescribeOpsItemsInput struct { NextToken *string // One or more filters to limit the response. - // - // * Key: CreatedTime Operations: - // GreaterThan, LessThan - // - // * Key: LastModifiedBy Operations: Contains, Equals - // - // * - // Key: LastModifiedTime Operations: GreaterThan, LessThan - // - // * Key: Priority - // Operations: Equals - // - // * Key: Source Operations: Contains, Equals - // - // * Key: Status - // Operations: Equals - // - // * Key: Title Operations: Contains - // - // * Key: OperationalData* - // Operations: Equals - // - // * Key: OperationalDataKey Operations: Equals - // - // * Key: - // OperationalDataValue Operations: Equals, Contains - // - // * Key: OpsItemId Operations: - // Equals - // - // * Key: ResourceId Operations: Contains - // - // * Key: AutomationId Operations: - // Equals - // - // *If you filter the response by using the OperationalData operator, - // specify a key-value pair by using the following JSON format: - // {"key":"key_name","value":"a_value"} + // - Key: CreatedTime Operations: GreaterThan, LessThan + // - Key: LastModifiedBy Operations: Contains, Equals + // - Key: LastModifiedTime Operations: GreaterThan, LessThan + // - Key: Priority Operations: Equals + // - Key: Source Operations: Contains, Equals + // - Key: Status Operations: Equals + // - Key: Title* Operations: Equals,Contains + // - Key: OperationalData** Operations: Equals + // - Key: OperationalDataKey Operations: Equals + // - Key: OperationalDataValue Operations: Equals, Contains + // - Key: OpsItemId Operations: Equals + // - Key: ResourceId Operations: Contains + // - Key: AutomationId Operations: Equals + // - Key: AccountId Operations: Equals + // *The Equals operator for Title matches the first 100 characters. If you specify + // more than 100 characters, they system returns an error that the filter value + // exceeds the length limit. **If you filter the response by using the + // OperationalData operator, specify a key-value pair by using the following JSON + // format: {"key":"key_name","value":"a_value"} OpsItemFilters []types.OpsItemFilter + + noSmithyDocumentSerde } type DescribeOpsItemsOutput struct { @@ -99,9 +81,14 @@ type DescribeOpsItemsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeOpsItemsMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeOpsItemsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeOpsItems{}, middleware.After) if err != nil { return err @@ -110,6 +97,13 @@ func addOperationDescribeOpsItemsMiddlewares(stack *middleware.Stack, options Op if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeOpsItems"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -128,16 +122,13 @@ func addOperationDescribeOpsItemsMiddlewares(stack *middleware.Stack, options Op if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -146,12 +137,18 @@ func addOperationDescribeOpsItemsMiddlewares(stack *middleware.Stack, options Op if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDescribeOpsItemsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeOpsItems(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -161,6 +158,9 @@ func addOperationDescribeOpsItemsMiddlewares(stack *middleware.Stack, options Op if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -194,6 +194,10 @@ type DescribeOpsItemsPaginator struct { // NewDescribeOpsItemsPaginator returns a new DescribeOpsItemsPaginator func NewDescribeOpsItemsPaginator(client DescribeOpsItemsAPIClient, params *DescribeOpsItemsInput, optFns ...func(*DescribeOpsItemsPaginatorOptions)) *DescribeOpsItemsPaginator { + if params == nil { + params = &DescribeOpsItemsInput{} + } + options := DescribeOpsItemsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults @@ -203,21 +207,18 @@ func NewDescribeOpsItemsPaginator(client DescribeOpsItemsAPIClient, params *Desc fn(&options) } - if params == nil { - params = &DescribeOpsItemsInput{} - } - return &DescribeOpsItemsPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeOpsItemsPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeOpsItems page. @@ -244,7 +245,10 @@ func (p *DescribeOpsItemsPaginator) NextPage(ctx context.Context, optFns ...func prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -255,7 +259,6 @@ func newServiceMetadataMiddleware_opDescribeOpsItems(region string) *awsmiddlewa return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribeOpsItems", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeParameters.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeParameters.go index 45a73158..9da5680a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeParameters.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeParameters.go @@ -12,19 +12,23 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Get information about a parameter. Request results are returned on a best-effort -// basis. If you specify MaxResults in the request, the response includes -// information up to the limit specified. The number of items returned, however, -// can be between zero and the value of MaxResults. If the service reaches an -// internal limit while processing the results, it stops the operation and returns -// the matching values up to that point and a NextToken. You can specify the -// NextToken in a subsequent call to get the next set of results. +// Get information about a parameter. Request results are returned on a +// best-effort basis. If you specify MaxResults in the request, the response +// includes information up to the limit specified. The number of items returned, +// however, can be between zero and the value of MaxResults . If the service +// reaches an internal limit while processing the results, it stops the operation +// and returns the matching values up to that point and a NextToken . You can +// specify the NextToken in a subsequent call to get the next set of results. If +// you change the KMS key alias for the KMS key used to encrypt a parameter, then +// you must also update the key alias the parameter uses to reference KMS. +// Otherwise, DescribeParameters retrieves whatever the original key alias was +// referencing. func (c *Client) DescribeParameters(ctx context.Context, params *DescribeParametersInput, optFns ...func(*Options)) (*DescribeParametersOutput, error) { if params == nil { params = &DescribeParametersInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeParameters", params, optFns, addOperationDescribeParametersMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeParameters", params, optFns, c.addOperationDescribeParametersMiddlewares) if err != nil { return nil, err } @@ -36,12 +40,12 @@ func (c *Client) DescribeParameters(ctx context.Context, params *DescribeParamet type DescribeParametersInput struct { - // This data type is deprecated. Instead, use ParameterFilters. + // This data type is deprecated. Instead, use ParameterFilters . Filters []types.ParametersFilter // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) @@ -49,6 +53,8 @@ type DescribeParametersInput struct { // Filters to limit the request results. ParameterFilters []types.ParameterStringFilter + + noSmithyDocumentSerde } type DescribeParametersOutput struct { @@ -61,9 +67,14 @@ type DescribeParametersOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeParametersMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeParametersMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeParameters{}, middleware.After) if err != nil { return err @@ -72,6 +83,13 @@ func addOperationDescribeParametersMiddlewares(stack *middleware.Stack, options if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeParameters"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -90,16 +108,13 @@ func addOperationDescribeParametersMiddlewares(stack *middleware.Stack, options if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -108,12 +123,18 @@ func addOperationDescribeParametersMiddlewares(stack *middleware.Stack, options if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDescribeParametersValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeParameters(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -123,6 +144,9 @@ func addOperationDescribeParametersMiddlewares(stack *middleware.Stack, options if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -157,30 +181,31 @@ type DescribeParametersPaginator struct { // NewDescribeParametersPaginator returns a new DescribeParametersPaginator func NewDescribeParametersPaginator(client DescribeParametersAPIClient, params *DescribeParametersInput, optFns ...func(*DescribeParametersPaginatorOptions)) *DescribeParametersPaginator { + if params == nil { + params = &DescribeParametersInput{} + } + options := DescribeParametersPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &DescribeParametersInput{} - } - return &DescribeParametersPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeParametersPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeParameters page. @@ -192,7 +217,11 @@ func (p *DescribeParametersPaginator) NextPage(ctx context.Context, optFns ...fu params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeParameters(ctx, ¶ms, optFns...) if err != nil { @@ -203,7 +232,10 @@ func (p *DescribeParametersPaginator) NextPage(ctx context.Context, optFns ...fu prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -214,7 +246,6 @@ func newServiceMetadataMiddleware_opDescribeParameters(region string) *awsmiddle return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribeParameters", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribePatchBaselines.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribePatchBaselines.go index 7f0ca821..089dd367 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribePatchBaselines.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribePatchBaselines.go @@ -12,13 +12,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the patch baselines in your AWS account. +// Lists the patch baselines in your Amazon Web Services account. func (c *Client) DescribePatchBaselines(ctx context.Context, params *DescribePatchBaselinesInput, optFns ...func(*Options)) (*DescribePatchBaselinesOutput, error) { if params == nil { params = &DescribePatchBaselinesInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribePatchBaselines", params, optFns, addOperationDescribePatchBaselinesMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribePatchBaselines", params, optFns, c.addOperationDescribePatchBaselinesMiddlewares) if err != nil { return nil, err } @@ -30,17 +30,21 @@ func (c *Client) DescribePatchBaselines(ctx context.Context, params *DescribePat type DescribePatchBaselinesInput struct { - // Each element in the array is a structure containing: Key: (string, "NAME_PREFIX" - // or "OWNER") Value: (array of strings, exactly 1 entry, between 1 and 255 - // characters) + // Each element in the array is a structure containing a key-value pair. Supported + // keys for DescribePatchBaselines include the following: + // - NAME_PREFIX Sample values: AWS- | My- + // - OWNER Sample values: AWS | Self + // - OPERATING_SYSTEM Sample values: AMAZON_LINUX | SUSE | WINDOWS Filters []types.PatchOrchestratorFilter // The maximum number of patch baselines to return (per page). - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string + + noSmithyDocumentSerde } type DescribePatchBaselinesOutput struct { @@ -54,9 +58,14 @@ type DescribePatchBaselinesOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribePatchBaselinesMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribePatchBaselinesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribePatchBaselines{}, middleware.After) if err != nil { return err @@ -65,6 +74,13 @@ func addOperationDescribePatchBaselinesMiddlewares(stack *middleware.Stack, opti if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribePatchBaselines"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -83,16 +99,13 @@ func addOperationDescribePatchBaselinesMiddlewares(stack *middleware.Stack, opti if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -101,9 +114,15 @@ func addOperationDescribePatchBaselinesMiddlewares(stack *middleware.Stack, opti if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribePatchBaselines(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -113,6 +132,9 @@ func addOperationDescribePatchBaselinesMiddlewares(stack *middleware.Stack, opti if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -146,30 +168,31 @@ type DescribePatchBaselinesPaginator struct { // NewDescribePatchBaselinesPaginator returns a new DescribePatchBaselinesPaginator func NewDescribePatchBaselinesPaginator(client DescribePatchBaselinesAPIClient, params *DescribePatchBaselinesInput, optFns ...func(*DescribePatchBaselinesPaginatorOptions)) *DescribePatchBaselinesPaginator { + if params == nil { + params = &DescribePatchBaselinesInput{} + } + options := DescribePatchBaselinesPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &DescribePatchBaselinesInput{} - } - return &DescribePatchBaselinesPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribePatchBaselinesPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribePatchBaselines page. @@ -181,7 +204,11 @@ func (p *DescribePatchBaselinesPaginator) NextPage(ctx context.Context, optFns . params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribePatchBaselines(ctx, ¶ms, optFns...) if err != nil { @@ -192,7 +219,10 @@ func (p *DescribePatchBaselinesPaginator) NextPage(ctx context.Context, optFns . prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -203,7 +233,6 @@ func newServiceMetadataMiddleware_opDescribePatchBaselines(region string) *awsmi return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribePatchBaselines", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribePatchGroupState.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribePatchGroupState.go index be4550a4..80b1615b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribePatchGroupState.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribePatchGroupState.go @@ -4,19 +4,21 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns high-level aggregated patch compliance state for a patch group. +// Returns high-level aggregated patch compliance state information for a patch +// group. func (c *Client) DescribePatchGroupState(ctx context.Context, params *DescribePatchGroupStateInput, optFns ...func(*Options)) (*DescribePatchGroupStateOutput, error) { if params == nil { params = &DescribePatchGroupStateInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribePatchGroupState", params, optFns, addOperationDescribePatchGroupStateMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribePatchGroupState", params, optFns, c.addOperationDescribePatchGroupStateMiddlewares) if err != nil { return nil, err } @@ -32,51 +34,77 @@ type DescribePatchGroupStateInput struct { // // This member is required. PatchGroup *string + + noSmithyDocumentSerde } type DescribePatchGroupStateOutput struct { - // The number of instances in the patch group. + // The number of managed nodes in the patch group. Instances int32 - // The number of instances with patches from the patch baseline that failed to + // The number of managed nodes where patches that are specified as Critical for + // compliance reporting in the patch baseline aren't installed. These patches might + // be missing, have failed installation, were rejected, or were installed but + // awaiting a required managed node reboot. The status of these managed nodes is + // NON_COMPLIANT . + InstancesWithCriticalNonCompliantPatches *int32 + + // The number of managed nodes with patches from the patch baseline that failed to // install. InstancesWithFailedPatches int32 - // The number of instances with patches installed that aren't defined in the patch - // baseline. + // The number of managed nodes with patches installed that aren't defined in the + // patch baseline. InstancesWithInstalledOtherPatches int32 - // The number of instances with installed patches. + // The number of managed nodes with installed patches. InstancesWithInstalledPatches int32 - // The number of instances with patches installed by Patch Manager that have not - // been rebooted after the patch installation. The status of these instances is - // NON_COMPLIANT. - InstancesWithInstalledPendingRebootPatches int32 + // The number of managed nodes with patches installed by Patch Manager that + // haven't been rebooted after the patch installation. The status of these managed + // nodes is NON_COMPLIANT . + InstancesWithInstalledPendingRebootPatches *int32 - // The number of instances with patches installed that are specified in a - // RejectedPatches list. Patches with a status of INSTALLED_REJECTED were typically - // installed before they were added to a RejectedPatches list. If - // ALLOW_AS_DEPENDENCY is the specified option for RejectedPatchesAction, the value - // of InstancesWithInstalledRejectedPatches will always be 0 (zero). - InstancesWithInstalledRejectedPatches int32 + // The number of managed nodes with patches installed that are specified in a + // RejectedPatches list. Patches with a status of INSTALLED_REJECTED were + // typically installed before they were added to a RejectedPatches list. If + // ALLOW_AS_DEPENDENCY is the specified option for RejectedPatchesAction , the + // value of InstancesWithInstalledRejectedPatches will always be 0 (zero). + InstancesWithInstalledRejectedPatches *int32 - // The number of instances with missing patches from the patch baseline. + // The number of managed nodes with missing patches from the patch baseline. InstancesWithMissingPatches int32 - // The number of instances with patches that aren't applicable. + // The number of managed nodes with patches that aren't applicable. InstancesWithNotApplicablePatches int32 - // The number of instances with NotApplicable patches beyond the supported limit, - // which are not reported by name to Systems Manager Inventory. - InstancesWithUnreportedNotApplicablePatches int32 + // The number of managed nodes with patches installed that are specified as other + // than Critical or Security but aren't compliant with the patch baseline. The + // status of these managed nodes is NON_COMPLIANT . + InstancesWithOtherNonCompliantPatches *int32 + + // The number of managed nodes where patches that are specified as Security in a + // patch advisory aren't installed. These patches might be missing, have failed + // installation, were rejected, or were installed but awaiting a required managed + // node reboot. The status of these managed nodes is NON_COMPLIANT . + InstancesWithSecurityNonCompliantPatches *int32 + + // The number of managed nodes with NotApplicable patches beyond the supported + // limit, which aren't reported by name to Inventory. Inventory is a capability of + // Amazon Web Services Systems Manager. + InstancesWithUnreportedNotApplicablePatches *int32 // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribePatchGroupStateMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribePatchGroupStateMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribePatchGroupState{}, middleware.After) if err != nil { return err @@ -85,6 +113,13 @@ func addOperationDescribePatchGroupStateMiddlewares(stack *middleware.Stack, opt if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribePatchGroupState"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -103,16 +138,13 @@ func addOperationDescribePatchGroupStateMiddlewares(stack *middleware.Stack, opt if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -121,12 +153,18 @@ func addOperationDescribePatchGroupStateMiddlewares(stack *middleware.Stack, opt if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDescribePatchGroupStateValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribePatchGroupState(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -136,6 +174,9 @@ func addOperationDescribePatchGroupStateMiddlewares(stack *middleware.Stack, opt if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -143,7 +184,6 @@ func newServiceMetadataMiddleware_opDescribePatchGroupState(region string) *awsm return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribePatchGroupState", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribePatchGroups.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribePatchGroups.go index f2c4625e..fca09c57 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribePatchGroups.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribePatchGroups.go @@ -18,7 +18,7 @@ func (c *Client) DescribePatchGroups(ctx context.Context, params *DescribePatchG params = &DescribePatchGroupsInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribePatchGroups", params, optFns, addOperationDescribePatchGroupsMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribePatchGroups", params, optFns, c.addOperationDescribePatchGroupsMiddlewares) if err != nil { return nil, err } @@ -30,37 +30,28 @@ func (c *Client) DescribePatchGroups(ctx context.Context, params *DescribePatchG type DescribePatchGroupsInput struct { - // One or more filters. Use a filter to return a more specific list of results. For - // DescribePatchGroups,valid filter keys include the following: - // - // * NAME_PREFIX: The - // name of the patch group. Wildcards (*) are accepted. - // - // * OPERATING_SYSTEM: The - // supported operating system type to return results for. For valid operating - // system values, see GetDefaultPatchBaselineRequest$OperatingSystem in - // CreatePatchBaseline. Examples: - // - // * --filters - // Key=NAME_PREFIX,Values=MyPatchGroup* - // - // * --filters - // Key=OPERATING_SYSTEM,Values=AMAZON_LINUX_2 + // Each element in the array is a structure containing a key-value pair. Supported + // keys for DescribePatchGroups include the following: + // - NAME_PREFIX Sample values: AWS- | My- . + // - OPERATING_SYSTEM Sample values: AMAZON_LINUX | SUSE | WINDOWS Filters []types.PatchOrchestratorFilter // The maximum number of patch groups to return (per page). - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string + + noSmithyDocumentSerde } type DescribePatchGroupsOutput struct { - // Each entry in the array contains: PatchGroup: string (between 1 and 256 - // characters, Regex: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$) PatchBaselineIdentity: A - // PatchBaselineIdentity element. + // Each entry in the array contains: + // - PatchGroup : string (between 1 and 256 characters. Regex: + // ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$) + // - PatchBaselineIdentity : A PatchBaselineIdentity element. Mappings []types.PatchGroupPatchBaselineMapping // The token to use when requesting the next set of items. If there are no @@ -69,9 +60,14 @@ type DescribePatchGroupsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribePatchGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribePatchGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribePatchGroups{}, middleware.After) if err != nil { return err @@ -80,6 +76,13 @@ func addOperationDescribePatchGroupsMiddlewares(stack *middleware.Stack, options if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribePatchGroups"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -98,16 +101,13 @@ func addOperationDescribePatchGroupsMiddlewares(stack *middleware.Stack, options if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -116,9 +116,15 @@ func addOperationDescribePatchGroupsMiddlewares(stack *middleware.Stack, options if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribePatchGroups(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -128,11 +134,14 @@ func addOperationDescribePatchGroupsMiddlewares(stack *middleware.Stack, options if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } -// DescribePatchGroupsAPIClient is a client that implements the DescribePatchGroups -// operation. +// DescribePatchGroupsAPIClient is a client that implements the +// DescribePatchGroups operation. type DescribePatchGroupsAPIClient interface { DescribePatchGroups(context.Context, *DescribePatchGroupsInput, ...func(*Options)) (*DescribePatchGroupsOutput, error) } @@ -161,30 +170,31 @@ type DescribePatchGroupsPaginator struct { // NewDescribePatchGroupsPaginator returns a new DescribePatchGroupsPaginator func NewDescribePatchGroupsPaginator(client DescribePatchGroupsAPIClient, params *DescribePatchGroupsInput, optFns ...func(*DescribePatchGroupsPaginatorOptions)) *DescribePatchGroupsPaginator { + if params == nil { + params = &DescribePatchGroupsInput{} + } + options := DescribePatchGroupsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &DescribePatchGroupsInput{} - } - return &DescribePatchGroupsPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribePatchGroupsPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribePatchGroups page. @@ -196,7 +206,11 @@ func (p *DescribePatchGroupsPaginator) NextPage(ctx context.Context, optFns ...f params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribePatchGroups(ctx, ¶ms, optFns...) if err != nil { @@ -207,7 +221,10 @@ func (p *DescribePatchGroupsPaginator) NextPage(ctx context.Context, optFns ...f prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -218,7 +235,6 @@ func newServiceMetadataMiddleware_opDescribePatchGroups(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribePatchGroups", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribePatchProperties.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribePatchProperties.go index 7d3026f9..c2f74466 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribePatchProperties.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribePatchProperties.go @@ -14,24 +14,24 @@ import ( // Lists the properties of available patches organized by product, product family, // classification, severity, and other properties of available patches. You can use -// the reported properties in the filters you specify in requests for actions such -// as CreatePatchBaseline, UpdatePatchBaseline, DescribeAvailablePatches, and -// DescribePatchBaselines. The following section lists the properties that can be -// used in filters for each major operating system type: AMAZON_LINUX Valid -// properties: PRODUCT, CLASSIFICATION, SEVERITY AMAZON_LINUX_2 Valid properties: -// PRODUCT, CLASSIFICATION, SEVERITY CENTOS Valid properties: PRODUCT, -// CLASSIFICATION, SEVERITY DEBIAN Valid properties: PRODUCT, PRIORITY MACOS Valid -// properties: PRODUCT, CLASSIFICATION ORACLE_LINUX Valid properties: PRODUCT, -// CLASSIFICATION, SEVERITY REDHAT_ENTERPRISE_LINUX Valid properties: PRODUCT, -// CLASSIFICATION, SEVERITY SUSE Valid properties: PRODUCT, CLASSIFICATION, -// SEVERITY UBUNTU Valid properties: PRODUCT, PRIORITY WINDOWS Valid properties: -// PRODUCT, PRODUCT_FAMILY, CLASSIFICATION, MSRC_SEVERITY +// the reported properties in the filters you specify in requests for operations +// such as CreatePatchBaseline , UpdatePatchBaseline , DescribeAvailablePatches , +// and DescribePatchBaselines . The following section lists the properties that can +// be used in filters for each major operating system type: AMAZON_LINUX Valid +// properties: PRODUCT | CLASSIFICATION | SEVERITY AMAZON_LINUX_2 Valid +// properties: PRODUCT | CLASSIFICATION | SEVERITY CENTOS Valid properties: PRODUCT +// | CLASSIFICATION | SEVERITY DEBIAN Valid properties: PRODUCT | PRIORITY MACOS +// Valid properties: PRODUCT | CLASSIFICATION ORACLE_LINUX Valid properties: +// PRODUCT | CLASSIFICATION | SEVERITY REDHAT_ENTERPRISE_LINUX Valid properties: +// PRODUCT | CLASSIFICATION | SEVERITY SUSE Valid properties: PRODUCT | +// CLASSIFICATION | SEVERITY UBUNTU Valid properties: PRODUCT | PRIORITY WINDOWS +// Valid properties: PRODUCT | PRODUCT_FAMILY | CLASSIFICATION | MSRC_SEVERITY func (c *Client) DescribePatchProperties(ctx context.Context, params *DescribePatchPropertiesInput, optFns ...func(*Options)) (*DescribePatchPropertiesOutput, error) { if params == nil { params = &DescribePatchPropertiesInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribePatchProperties", params, optFns, addOperationDescribePatchPropertiesMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribePatchProperties", params, optFns, c.addOperationDescribePatchPropertiesMiddlewares) if err != nil { return nil, err } @@ -55,15 +55,18 @@ type DescribePatchPropertiesInput struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string // Indicates whether to list patches for the Windows operating system or for - // Microsoft applications. Not applicable for the Linux or macOS operating systems. + // applications released by Microsoft. Not applicable for the Linux or macOS + // operating systems. PatchSet types.PatchSet + + noSmithyDocumentSerde } type DescribePatchPropertiesOutput struct { @@ -77,9 +80,14 @@ type DescribePatchPropertiesOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribePatchPropertiesMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribePatchPropertiesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribePatchProperties{}, middleware.After) if err != nil { return err @@ -88,6 +96,13 @@ func addOperationDescribePatchPropertiesMiddlewares(stack *middleware.Stack, opt if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribePatchProperties"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -106,16 +121,13 @@ func addOperationDescribePatchPropertiesMiddlewares(stack *middleware.Stack, opt if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -124,12 +136,18 @@ func addOperationDescribePatchPropertiesMiddlewares(stack *middleware.Stack, opt if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDescribePatchPropertiesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribePatchProperties(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -139,6 +157,9 @@ func addOperationDescribePatchPropertiesMiddlewares(stack *middleware.Stack, opt if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -174,30 +195,31 @@ type DescribePatchPropertiesPaginator struct { // NewDescribePatchPropertiesPaginator returns a new // DescribePatchPropertiesPaginator func NewDescribePatchPropertiesPaginator(client DescribePatchPropertiesAPIClient, params *DescribePatchPropertiesInput, optFns ...func(*DescribePatchPropertiesPaginatorOptions)) *DescribePatchPropertiesPaginator { + if params == nil { + params = &DescribePatchPropertiesInput{} + } + options := DescribePatchPropertiesPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &DescribePatchPropertiesInput{} - } - return &DescribePatchPropertiesPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribePatchPropertiesPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribePatchProperties page. @@ -209,7 +231,11 @@ func (p *DescribePatchPropertiesPaginator) NextPage(ctx context.Context, optFns params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribePatchProperties(ctx, ¶ms, optFns...) if err != nil { @@ -220,7 +246,10 @@ func (p *DescribePatchPropertiesPaginator) NextPage(ctx context.Context, optFns prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -231,7 +260,6 @@ func newServiceMetadataMiddleware_opDescribePatchProperties(region string) *awsm return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribePatchProperties", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeSessions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeSessions.go index d4fc273f..cb3d1fc5 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeSessions.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DescribeSessions.go @@ -19,7 +19,7 @@ func (c *Client) DescribeSessions(ctx context.Context, params *DescribeSessionsI params = &DescribeSessionsInput{} } - result, metadata, err := c.invokeOperation(ctx, "DescribeSessions", params, optFns, addOperationDescribeSessionsMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DescribeSessions", params, optFns, c.addOperationDescribeSessionsMiddlewares) if err != nil { return nil, err } @@ -41,11 +41,13 @@ type DescribeSessionsInput struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string + + noSmithyDocumentSerde } type DescribeSessionsOutput struct { @@ -59,9 +61,14 @@ type DescribeSessionsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDescribeSessionsMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDescribeSessionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeSessions{}, middleware.After) if err != nil { return err @@ -70,6 +77,13 @@ func addOperationDescribeSessionsMiddlewares(stack *middleware.Stack, options Op if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeSessions"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -88,16 +102,13 @@ func addOperationDescribeSessionsMiddlewares(stack *middleware.Stack, options Op if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -106,12 +117,18 @@ func addOperationDescribeSessionsMiddlewares(stack *middleware.Stack, options Op if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDescribeSessionsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSessions(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -121,6 +138,9 @@ func addOperationDescribeSessionsMiddlewares(stack *middleware.Stack, options Op if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -154,30 +174,31 @@ type DescribeSessionsPaginator struct { // NewDescribeSessionsPaginator returns a new DescribeSessionsPaginator func NewDescribeSessionsPaginator(client DescribeSessionsAPIClient, params *DescribeSessionsInput, optFns ...func(*DescribeSessionsPaginatorOptions)) *DescribeSessionsPaginator { + if params == nil { + params = &DescribeSessionsInput{} + } + options := DescribeSessionsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &DescribeSessionsInput{} - } - return &DescribeSessionsPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeSessionsPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeSessions page. @@ -189,7 +210,11 @@ func (p *DescribeSessionsPaginator) NextPage(ctx context.Context, optFns ...func params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.DescribeSessions(ctx, ¶ms, optFns...) if err != nil { @@ -200,7 +225,10 @@ func (p *DescribeSessionsPaginator) NextPage(ctx context.Context, optFns ...func prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -211,7 +239,6 @@ func newServiceMetadataMiddleware_opDescribeSessions(region string) *awsmiddlewa return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "DescribeSessions", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DisassociateOpsItemRelatedItem.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DisassociateOpsItemRelatedItem.go new file mode 100644 index 00000000..7c32e8fe --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_DisassociateOpsItemRelatedItem.go @@ -0,0 +1,141 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssm + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the association between an OpsItem and a related item. For example, +// this API operation can delete an Incident Manager incident from an OpsItem. +// Incident Manager is a capability of Amazon Web Services Systems Manager. +func (c *Client) DisassociateOpsItemRelatedItem(ctx context.Context, params *DisassociateOpsItemRelatedItemInput, optFns ...func(*Options)) (*DisassociateOpsItemRelatedItemOutput, error) { + if params == nil { + params = &DisassociateOpsItemRelatedItemInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DisassociateOpsItemRelatedItem", params, optFns, c.addOperationDisassociateOpsItemRelatedItemMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DisassociateOpsItemRelatedItemOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DisassociateOpsItemRelatedItemInput struct { + + // The ID of the association for which you want to delete an association between + // the OpsItem and a related item. + // + // This member is required. + AssociationId *string + + // The ID of the OpsItem for which you want to delete an association between the + // OpsItem and a related item. + // + // This member is required. + OpsItemId *string + + noSmithyDocumentSerde +} + +type DisassociateOpsItemRelatedItemOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDisassociateOpsItemRelatedItemMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDisassociateOpsItemRelatedItem{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDisassociateOpsItemRelatedItem{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DisassociateOpsItemRelatedItem"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpDisassociateOpsItemRelatedItemValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateOpsItemRelatedItem(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDisassociateOpsItemRelatedItem(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DisassociateOpsItemRelatedItem", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetAutomationExecution.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetAutomationExecution.go index fb4cfa69..cc3a61bf 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetAutomationExecution.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetAutomationExecution.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -17,7 +18,7 @@ func (c *Client) GetAutomationExecution(ctx context.Context, params *GetAutomati params = &GetAutomationExecutionInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetAutomationExecution", params, optFns, addOperationGetAutomationExecutionMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetAutomationExecution", params, optFns, c.addOperationGetAutomationExecutionMiddlewares) if err != nil { return nil, err } @@ -31,10 +32,12 @@ type GetAutomationExecutionInput struct { // The unique identifier for an existing automation execution to examine. The // execution ID is returned by StartAutomationExecution when the execution of an - // Automation document is initiated. + // Automation runbook is initiated. // // This member is required. AutomationExecutionId *string + + noSmithyDocumentSerde } type GetAutomationExecutionOutput struct { @@ -44,9 +47,14 @@ type GetAutomationExecutionOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetAutomationExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetAutomationExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetAutomationExecution{}, middleware.After) if err != nil { return err @@ -55,6 +63,13 @@ func addOperationGetAutomationExecutionMiddlewares(stack *middleware.Stack, opti if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetAutomationExecution"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -73,16 +88,13 @@ func addOperationGetAutomationExecutionMiddlewares(stack *middleware.Stack, opti if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -91,12 +103,18 @@ func addOperationGetAutomationExecutionMiddlewares(stack *middleware.Stack, opti if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpGetAutomationExecutionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAutomationExecution(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -106,6 +124,9 @@ func addOperationGetAutomationExecutionMiddlewares(stack *middleware.Stack, opti if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -113,7 +134,6 @@ func newServiceMetadataMiddleware_opGetAutomationExecution(region string) *awsmi return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "GetAutomationExecution", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetCalendarState.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetCalendarState.go index 972ab2aa..11b1f04a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetCalendarState.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetCalendarState.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -11,24 +12,24 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Gets the state of the AWS Systems Manager Change Calendar at an optional, -// specified time. If you specify a time, GetCalendarState returns the state of the -// calendar at a specific time, and returns the next time that the Change Calendar -// state will transition. If you do not specify a time, GetCalendarState assumes -// the current time. Change Calendar entries have two possible states: OPEN or -// CLOSED. If you specify more than one calendar in a request, the command returns -// the status of OPEN only if all calendars in the request are open. If one or more -// calendars in the request are closed, the status returned is CLOSED. For more -// information about Systems Manager Change Calendar, see AWS Systems Manager -// Change Calendar -// (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-change-calendar.html) -// in the AWS Systems Manager User Guide. +// Gets the state of a Amazon Web Services Systems Manager change calendar at the +// current time or a specified time. If you specify a time, GetCalendarState +// returns the state of the calendar at that specific time, and returns the next +// time that the change calendar state will transition. If you don't specify a +// time, GetCalendarState uses the current time. Change Calendar entries have two +// possible states: OPEN or CLOSED . If you specify more than one calendar in a +// request, the command returns the status of OPEN only if all calendars in the +// request are open. If one or more calendars in the request are closed, the status +// returned is CLOSED . For more information about Change Calendar, a capability of +// Amazon Web Services Systems Manager, see Amazon Web Services Systems Manager +// Change Calendar (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-change-calendar.html) +// in the Amazon Web Services Systems Manager User Guide. func (c *Client) GetCalendarState(ctx context.Context, params *GetCalendarStateInput, optFns ...func(*Options)) (*GetCalendarStateOutput, error) { if params == nil { params = &GetCalendarStateInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetCalendarState", params, optFns, addOperationGetCalendarStateMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetCalendarState", params, optFns, c.addOperationGetCalendarStateMiddlewares) if err != nil { return nil, err } @@ -40,41 +41,49 @@ func (c *Client) GetCalendarState(ctx context.Context, params *GetCalendarStateI type GetCalendarStateInput struct { - // The names or Amazon Resource Names (ARNs) of the Systems Manager documents that - // represent the calendar entries for which you want to get the state. + // The names or Amazon Resource Names (ARNs) of the Systems Manager documents (SSM + // documents) that represent the calendar entries for which you want to get the + // state. // // This member is required. CalendarNames []string // (Optional) The specific time for which you want to get calendar state - // information, in ISO 8601 (https://en.wikipedia.org/wiki/ISO_8601) format. If you - // do not add AtTime, the current time is assumed. + // information, in ISO 8601 (https://en.wikipedia.org/wiki/ISO_8601) format. If + // you don't specify a value or AtTime , the current time is used. AtTime *string + + noSmithyDocumentSerde } type GetCalendarStateOutput struct { // The time, as an ISO 8601 (https://en.wikipedia.org/wiki/ISO_8601) string, that - // you specified in your command. If you did not specify a time, GetCalendarState + // you specified in your command. If you don't specify a time, GetCalendarState // uses the current time. AtTime *string // The time, as an ISO 8601 (https://en.wikipedia.org/wiki/ISO_8601) string, that - // the calendar state will change. If the current calendar state is OPEN, - // NextTransitionTime indicates when the calendar state changes to CLOSED, and + // the calendar state will change. If the current calendar state is OPEN , + // NextTransitionTime indicates when the calendar state changes to CLOSED , and // vice-versa. NextTransitionTime *string // The state of the calendar. An OPEN calendar indicates that actions are allowed - // to proceed, and a CLOSED calendar indicates that actions are not allowed to + // to proceed, and a CLOSED calendar indicates that actions aren't allowed to // proceed. State types.CalendarState // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetCalendarStateMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetCalendarStateMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetCalendarState{}, middleware.After) if err != nil { return err @@ -83,6 +92,13 @@ func addOperationGetCalendarStateMiddlewares(stack *middleware.Stack, options Op if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetCalendarState"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -101,16 +117,13 @@ func addOperationGetCalendarStateMiddlewares(stack *middleware.Stack, options Op if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -119,12 +132,18 @@ func addOperationGetCalendarStateMiddlewares(stack *middleware.Stack, options Op if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpGetCalendarStateValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCalendarState(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -134,6 +153,9 @@ func addOperationGetCalendarStateMiddlewares(stack *middleware.Stack, options Op if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -141,7 +163,6 @@ func newServiceMetadataMiddleware_opGetCalendarState(region string) *awsmiddlewa return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "GetCalendarState", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetCommandInvocation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetCommandInvocation.go index 35990ce7..05abba89 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetCommandInvocation.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetCommandInvocation.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "errors" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" @@ -17,13 +18,16 @@ import ( ) // Returns detailed information about command execution for an invocation or -// plugin. +// plugin. GetCommandInvocation only gives the execution status of a plugin in a +// document. To get the command execution status on a specific managed node, use +// ListCommandInvocations . To get the command execution status across managed +// nodes, use ListCommands . func (c *Client) GetCommandInvocation(ctx context.Context, params *GetCommandInvocationInput, optFns ...func(*Options)) (*GetCommandInvocationOutput, error) { if params == nil { params = &GetCommandInvocationInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetCommandInvocation", params, optFns, addOperationGetCommandInvocationMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetCommandInvocation", params, optFns, c.addOperationGetCommandInvocationMiddlewares) if err != nil { return nil, err } @@ -40,23 +44,32 @@ type GetCommandInvocationInput struct { // This member is required. CommandId *string - // (Required) The ID of the managed instance targeted by the command. A managed - // instance can be an EC2 instance or an instance in your hybrid environment that - // is configured for Systems Manager. + // (Required) The ID of the managed node targeted by the command. A managed node + // can be an Amazon Elastic Compute Cloud (Amazon EC2) instance, edge device, and + // on-premises server or VM in your hybrid environment that is configured for + // Amazon Web Services Systems Manager. // // This member is required. InstanceId *string - // (Optional) The name of the plugin for which you want detailed results. If the - // document contains only one plugin, the name can be omitted and the details will - // be returned. Plugin names are also referred to as step names in Systems Manager - // documents. + // The name of the step for which you want detailed results. If the document + // contains only one step, you can omit the name and details for that step. If the + // document contains more than one step, you must specify the name of the step for + // which you want to view details. Be sure to specify the name of the step, not the + // name of a plugin like aws:RunShellScript . To find the PluginName , check the + // document content and find the name of the step you want details for. + // Alternatively, use ListCommandInvocations with the CommandId and Details + // parameters. The PluginName is the Name attribute of the CommandPlugin object in + // the CommandPlugins list. PluginName *string + + noSmithyDocumentSerde } type GetCommandInvocationOutput struct { - // CloudWatch Logs information where Systems Manager sent the command output. + // Amazon CloudWatch Logs information where Systems Manager sent the command + // output. CloudWatchOutputConfig *types.CloudWatchOutputConfig // The parent command ID of the invocation plugin. @@ -65,124 +78,115 @@ type GetCommandInvocationOutput struct { // The comment text for the command. Comment *string - // The name of the document that was run. For example, AWS-RunShellScript. + // The name of the document that was run. For example, AWS-RunShellScript . DocumentName *string - // The SSM document version used in the request. + // The Systems Manager document (SSM document) version used in the request. DocumentVersion *string - // Duration since ExecutionStartDateTime. + // Duration since ExecutionStartDateTime . ExecutionElapsedTime *string - // The date and time the plugin was finished running. Date and time are written in - // ISO 8601 format. For example, June 7, 2017 is represented as 2017-06-7. The - // following sample AWS CLI command uses the InvokedAfter filter. aws ssm - // list-commands --filters key=InvokedAfter,value=2017-06-07T00:00:00Z If the - // plugin has not started to run, the string is empty. + // The date and time the plugin finished running. Date and time are written in ISO + // 8601 format. For example, June 7, 2017 is represented as 2017-06-7. The + // following sample Amazon Web Services CLI command uses the InvokedAfter filter. + // aws ssm list-commands --filters key=InvokedAfter,value=2017-06-07T00:00:00Z If + // the plugin hasn't started to run, the string is empty. ExecutionEndDateTime *string // The date and time the plugin started running. Date and time are written in ISO // 8601 format. For example, June 7, 2017 is represented as 2017-06-7. The - // following sample AWS CLI command uses the InvokedBefore filter. aws ssm - // list-commands --filters key=InvokedBefore,value=2017-06-07T00:00:00Z If the - // plugin has not started to run, the string is empty. + // following sample Amazon Web Services CLI command uses the InvokedBefore filter. + // aws ssm list-commands --filters key=InvokedBefore,value=2017-06-07T00:00:00Z If + // the plugin hasn't started to run, the string is empty. ExecutionStartDateTime *string - // The ID of the managed instance targeted by the command. A managed instance can - // be an EC2 instance or an instance in your hybrid environment that is configured - // for Systems Manager. + // The ID of the managed node targeted by the command. A managed node can be an + // Amazon Elastic Compute Cloud (Amazon EC2) instance, edge device, or on-premises + // server or VM in your hybrid environment that is configured for Amazon Web + // Services Systems Manager. InstanceId *string - // The name of the plugin for which you want detailed results. For example, - // aws:RunShellScript is a plugin. + // The name of the plugin, or step name, for which details are reported. For + // example, aws:RunShellScript is a plugin. PluginName *string - // The error level response code for the plugin script. If the response code is -1, - // then the command has not started running on the instance, or it was not received - // by the instance. + // The error level response code for the plugin script. If the response code is -1 + // , then the command hasn't started running on the managed node, or it wasn't + // received by the node. ResponseCode int32 - // The first 8,000 characters written by the plugin to stderr. If the command has - // not finished running, then this string is empty. + // The first 8,000 characters written by the plugin to stderr . If the command + // hasn't finished running, then this string is empty. StandardErrorContent *string - // The URL for the complete text written by the plugin to stderr. If the command - // has not finished running, then this string is empty. + // The URL for the complete text written by the plugin to stderr . If the command + // hasn't finished running, then this string is empty. StandardErrorUrl *string - // The first 24,000 characters written by the plugin to stdout. If the command has - // not finished running, if ExecutionStatus is neither Succeeded nor Failed, then - // this string is empty. + // The first 24,000 characters written by the plugin to stdout . If the command + // hasn't finished running, if ExecutionStatus is neither Succeeded nor Failed, + // then this string is empty. StandardOutputContent *string - // The URL for the complete text written by the plugin to stdout in Amazon S3. If - // an S3 bucket was not specified, then this string is empty. + // The URL for the complete text written by the plugin to stdout in Amazon Simple + // Storage Service (Amazon S3). If an S3 bucket wasn't specified, then this string + // is empty. StandardOutputUrl *string // The status of this invocation plugin. This status can be different than - // StatusDetails. + // StatusDetails . Status types.CommandInvocationStatus // A detailed status of the command execution for an invocation. StatusDetails // includes more information than Status because it includes states resulting from // error and concurrency control parameters. StatusDetails can show different - // results than Status. For more information about these statuses, see - // Understanding command statuses - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/monitor-commands.html) - // in the AWS Systems Manager User Guide. StatusDetails can be one of the following - // values: - // - // * Pending: The command has not been sent to the instance. - // - // * In - // Progress: The command has been sent to the instance but has not reached a - // terminal state. - // - // * Delayed: The system attempted to send the command to the - // target, but the target was not available. The instance might not be available - // because of network issues, because the instance was stopped, or for similar - // reasons. The system will try to send the command again. - // - // * Success: The command - // or plugin ran successfully. This is a terminal state. - // - // * Delivery Timed Out: The - // command was not delivered to the instance before the delivery timeout expired. - // Delivery timeouts do not count against the parent command's MaxErrors limit, but - // they do contribute to whether the parent command status is Success or - // Incomplete. This is a terminal state. - // - // * Execution Timed Out: The command - // started to run on the instance, but the execution was not complete before the - // timeout expired. Execution timeouts count against the MaxErrors limit of the - // parent command. This is a terminal state. - // - // * Failed: The command wasn't run - // successfully on the instance. For a plugin, this indicates that the result code - // was not zero. For a command invocation, this indicates that the result code for - // one or more plugins was not zero. Invocation failures count against the - // MaxErrors limit of the parent command. This is a terminal state. - // - // * Canceled: - // The command was terminated before it was completed. This is a terminal state. - // - // * - // Undeliverable: The command can't be delivered to the instance. The instance - // might not exist or might not be responding. Undeliverable invocations don't - // count against the parent command's MaxErrors limit and don't contribute to - // whether the parent command status is Success or Incomplete. This is a terminal - // state. - // - // * Terminated: The parent command exceeded its MaxErrors limit and - // subsequent command invocations were canceled by the system. This is a terminal - // state. + // results than Status . For more information about these statuses, see + // Understanding command statuses (https://docs.aws.amazon.com/systems-manager/latest/userguide/monitor-commands.html) + // in the Amazon Web Services Systems Manager User Guide. StatusDetails can be one + // of the following values: + // - Pending: The command hasn't been sent to the managed node. + // - In Progress: The command has been sent to the managed node but hasn't + // reached a terminal state. + // - Delayed: The system attempted to send the command to the target, but the + // target wasn't available. The managed node might not be available because of + // network issues, because the node was stopped, or for similar reasons. The system + // will try to send the command again. + // - Success: The command or plugin ran successfully. This is a terminal state. + // - Delivery Timed Out: The command wasn't delivered to the managed node before + // the delivery timeout expired. Delivery timeouts don't count against the parent + // command's MaxErrors limit, but they do contribute to whether the parent + // command status is Success or Incomplete. This is a terminal state. + // - Execution Timed Out: The command started to run on the managed node, but + // the execution wasn't complete before the timeout expired. Execution timeouts + // count against the MaxErrors limit of the parent command. This is a terminal + // state. + // - Failed: The command wasn't run successfully on the managed node. For a + // plugin, this indicates that the result code wasn't zero. For a command + // invocation, this indicates that the result code for one or more plugins wasn't + // zero. Invocation failures count against the MaxErrors limit of the parent + // command. This is a terminal state. + // - Cancelled: The command was terminated before it was completed. This is a + // terminal state. + // - Undeliverable: The command can't be delivered to the managed node. The node + // might not exist or might not be responding. Undeliverable invocations don't + // count against the parent command's MaxErrors limit and don't contribute to + // whether the parent command status is Success or Incomplete. This is a terminal + // state. + // - Terminated: The parent command exceeded its MaxErrors limit and subsequent + // command invocations were canceled by the system. This is a terminal state. StatusDetails *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetCommandInvocationMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetCommandInvocationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetCommandInvocation{}, middleware.After) if err != nil { return err @@ -191,6 +195,13 @@ func addOperationGetCommandInvocationMiddlewares(stack *middleware.Stack, option if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetCommandInvocation"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -209,16 +220,13 @@ func addOperationGetCommandInvocationMiddlewares(stack *middleware.Stack, option if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -227,12 +235,18 @@ func addOperationGetCommandInvocationMiddlewares(stack *middleware.Stack, option if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpGetCommandInvocationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCommandInvocation(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -242,6 +256,9 @@ func addOperationGetCommandInvocationMiddlewares(stack *middleware.Stack, option if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -266,9 +283,9 @@ type CommandExecutedWaiterOptions struct { // MinDelay must resolve to a value lesser than or equal to the MaxDelay. MinDelay time.Duration - // MaxDelay is the maximum amount of time to delay between retries. If unset or set - // to zero, CommandExecutedWaiter will use default max delay of 120 seconds. Note - // that MaxDelay must resolve to value greater than or equal to the MinDelay. + // MaxDelay is the maximum amount of time to delay between retries. If unset or + // set to zero, CommandExecutedWaiter will use default max delay of 120 seconds. + // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. MaxDelay time.Duration // LogWaitAttempts is used to enable logging for waiter retry attempts @@ -308,12 +325,21 @@ func NewCommandExecutedWaiter(client GetCommandInvocationAPIClient, optFns ...fu } } -// Wait calls the waiter function for CommandExecuted waiter. The maxWaitDur is the -// maximum wait duration the waiter will wait. The maxWaitDur is required and must -// be greater than zero. +// Wait calls the waiter function for CommandExecuted waiter. The maxWaitDur is +// the maximum wait duration the waiter will wait. The maxWaitDur is required and +// must be greater than zero. func (w *CommandExecutedWaiter) Wait(ctx context.Context, params *GetCommandInvocationInput, maxWaitDur time.Duration, optFns ...func(*CommandExecutedWaiterOptions)) error { + _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) + return err +} + +// WaitForOutput calls the waiter function for CommandExecuted waiter and returns +// the output of the successful operation. The maxWaitDur is the maximum wait +// duration the waiter will wait. The maxWaitDur is required and must be greater +// than zero. +func (w *CommandExecutedWaiter) WaitForOutput(ctx context.Context, params *GetCommandInvocationInput, maxWaitDur time.Duration, optFns ...func(*CommandExecutedWaiterOptions)) (*GetCommandInvocationOutput, error) { if maxWaitDur <= 0 { - return fmt.Errorf("maximum wait time for waiter must be greater than zero") + return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") } options := w.options @@ -326,7 +352,7 @@ func (w *CommandExecutedWaiter) Wait(ctx context.Context, params *GetCommandInvo } if options.MinDelay > options.MaxDelay { - return fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) + return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) } ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) @@ -354,10 +380,10 @@ func (w *CommandExecutedWaiter) Wait(ctx context.Context, params *GetCommandInvo retryable, err := options.Retryable(ctx, params, out, err) if err != nil { - return err + return nil, err } if !retryable { - return nil + return out, nil } remainingTime -= time.Since(start) @@ -370,16 +396,16 @@ func (w *CommandExecutedWaiter) Wait(ctx context.Context, params *GetCommandInvo attempt, options.MinDelay, options.MaxDelay, remainingTime, ) if err != nil { - return fmt.Errorf("error computing waiter delay, %w", err) + return nil, fmt.Errorf("error computing waiter delay, %w", err) } remainingTime -= delay // sleep for the delay amount before invoking a request if err := smithytime.SleepWithContext(ctx, delay); err != nil { - return fmt.Errorf("request cancelled while waiting, %w", err) + return nil, fmt.Errorf("request cancelled while waiting, %w", err) } } - return fmt.Errorf("exceeded max wait time for CommandExecuted waiter") + return nil, fmt.Errorf("exceeded max wait time for CommandExecuted waiter") } func commandExecutedStateRetryable(ctx context.Context, input *GetCommandInvocationInput, output *GetCommandInvocationOutput, err error) (bool, error) { @@ -520,6 +546,13 @@ func commandExecutedStateRetryable(ctx context.Context, input *GetCommandInvocat } } + if err != nil { + var errorType *types.InvocationDoesNotExist + if errors.As(err, &errorType) { + return true, nil + } + } + return true, nil } @@ -527,7 +560,6 @@ func newServiceMetadataMiddleware_opGetCommandInvocation(region string) *awsmidd return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "GetCommandInvocation", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetConnectionStatus.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetConnectionStatus.go index 7e71687e..60e562de 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetConnectionStatus.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetConnectionStatus.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -11,14 +12,14 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Retrieves the Session Manager connection status for an instance to determine +// Retrieves the Session Manager connection status for a managed node to determine // whether it is running and ready to receive Session Manager connections. func (c *Client) GetConnectionStatus(ctx context.Context, params *GetConnectionStatusInput, optFns ...func(*Options)) (*GetConnectionStatusOutput, error) { if params == nil { params = &GetConnectionStatusInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetConnectionStatus", params, optFns, addOperationGetConnectionStatusMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetConnectionStatus", params, optFns, c.addOperationGetConnectionStatusMiddlewares) if err != nil { return nil, err } @@ -30,26 +31,33 @@ func (c *Client) GetConnectionStatus(ctx context.Context, params *GetConnectionS type GetConnectionStatusInput struct { - // The ID of the instance. + // The managed node ID. // // This member is required. Target *string + + noSmithyDocumentSerde } type GetConnectionStatusOutput struct { - // The status of the connection to the instance. For example, 'Connected' or 'Not - // Connected'. + // The status of the connection to the managed node. For example, 'Connected' or + // 'Not Connected'. Status types.ConnectionStatus - // The ID of the instance to check connection status. + // The ID of the managed node to check connection status. Target *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetConnectionStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetConnectionStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetConnectionStatus{}, middleware.After) if err != nil { return err @@ -58,6 +66,13 @@ func addOperationGetConnectionStatusMiddlewares(stack *middleware.Stack, options if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetConnectionStatus"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -76,16 +91,13 @@ func addOperationGetConnectionStatusMiddlewares(stack *middleware.Stack, options if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -94,12 +106,18 @@ func addOperationGetConnectionStatusMiddlewares(stack *middleware.Stack, options if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpGetConnectionStatusValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetConnectionStatus(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -109,6 +127,9 @@ func addOperationGetConnectionStatusMiddlewares(stack *middleware.Stack, options if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -116,7 +137,6 @@ func newServiceMetadataMiddleware_opGetConnectionStatus(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "GetConnectionStatus", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetDefaultPatchBaseline.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetDefaultPatchBaseline.go index a1c249e2..753e8999 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetDefaultPatchBaseline.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetDefaultPatchBaseline.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -11,16 +12,16 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Retrieves the default patch baseline. Note that Systems Manager supports -// creating multiple default patch baselines. For example, you can create a default -// patch baseline for each operating system. If you do not specify an operating -// system value, the default patch baseline for Windows is returned. +// Retrieves the default patch baseline. Amazon Web Services Systems Manager +// supports creating multiple default patch baselines. For example, you can create +// a default patch baseline for each operating system. If you don't specify an +// operating system value, the default patch baseline for Windows is returned. func (c *Client) GetDefaultPatchBaseline(ctx context.Context, params *GetDefaultPatchBaselineInput, optFns ...func(*Options)) (*GetDefaultPatchBaselineOutput, error) { if params == nil { params = &GetDefaultPatchBaselineInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetDefaultPatchBaseline", params, optFns, addOperationGetDefaultPatchBaselineMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetDefaultPatchBaseline", params, optFns, c.addOperationGetDefaultPatchBaselineMiddlewares) if err != nil { return nil, err } @@ -34,6 +35,8 @@ type GetDefaultPatchBaselineInput struct { // Returns the default patch baseline for the specified operating system. OperatingSystem types.OperatingSystem + + noSmithyDocumentSerde } type GetDefaultPatchBaselineOutput struct { @@ -46,9 +49,14 @@ type GetDefaultPatchBaselineOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetDefaultPatchBaselineMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetDefaultPatchBaselineMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetDefaultPatchBaseline{}, middleware.After) if err != nil { return err @@ -57,6 +65,13 @@ func addOperationGetDefaultPatchBaselineMiddlewares(stack *middleware.Stack, opt if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetDefaultPatchBaseline"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -75,16 +90,13 @@ func addOperationGetDefaultPatchBaselineMiddlewares(stack *middleware.Stack, opt if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -93,9 +105,15 @@ func addOperationGetDefaultPatchBaselineMiddlewares(stack *middleware.Stack, opt if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDefaultPatchBaseline(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -105,6 +123,9 @@ func addOperationGetDefaultPatchBaselineMiddlewares(stack *middleware.Stack, opt if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -112,7 +133,6 @@ func newServiceMetadataMiddleware_opGetDefaultPatchBaseline(region string) *awsm return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "GetDefaultPatchBaseline", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetDeployablePatchSnapshotForInstance.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetDeployablePatchSnapshotForInstance.go index b24e5787..862b41dc 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetDeployablePatchSnapshotForInstance.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetDeployablePatchSnapshotForInstance.go @@ -4,20 +4,29 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Retrieves the current snapshot for the patch baseline the instance uses. This -// API is primarily used by the AWS-RunPatchBaseline Systems Manager document. +// Retrieves the current snapshot for the patch baseline the managed node uses. +// This API is primarily used by the AWS-RunPatchBaseline Systems Manager document +// (SSM document). If you run the command locally, such as with the Command Line +// Interface (CLI), the system attempts to use your local Amazon Web Services +// credentials and the operation fails. To avoid this, you can run the command in +// the Amazon Web Services Systems Manager console. Use Run Command, a capability +// of Amazon Web Services Systems Manager, with an SSM document that enables you to +// target a managed node with a script or command. For example, run the command +// using the AWS-RunShellScript document or the AWS-RunPowerShellScript document. func (c *Client) GetDeployablePatchSnapshotForInstance(ctx context.Context, params *GetDeployablePatchSnapshotForInstanceInput, optFns ...func(*Options)) (*GetDeployablePatchSnapshotForInstanceOutput, error) { if params == nil { params = &GetDeployablePatchSnapshotForInstanceInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetDeployablePatchSnapshotForInstance", params, optFns, addOperationGetDeployablePatchSnapshotForInstanceMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetDeployablePatchSnapshotForInstance", params, optFns, c.addOperationGetDeployablePatchSnapshotForInstanceMiddlewares) if err != nil { return nil, err } @@ -29,28 +38,34 @@ func (c *Client) GetDeployablePatchSnapshotForInstance(ctx context.Context, para type GetDeployablePatchSnapshotForInstanceInput struct { - // The ID of the instance for which the appropriate patch snapshot should be + // The ID of the managed node for which the appropriate patch snapshot should be // retrieved. // // This member is required. InstanceId *string - // The user-defined snapshot ID. + // The snapshot ID provided by the user when running AWS-RunPatchBaseline . // // This member is required. SnapshotId *string + + // Defines the basic information about a patch baseline override. + BaselineOverride *types.BaselineOverride + + noSmithyDocumentSerde } type GetDeployablePatchSnapshotForInstanceOutput struct { - // The ID of the instance. + // The managed node ID. InstanceId *string - // Returns the specific operating system (for example Windows Server 2012 or Amazon - // Linux 2015.09) on the instance for the specified patch snapshot. + // Returns the specific operating system (for example Windows Server 2012 or + // Amazon Linux 2015.09) on the managed node for the specified patch snapshot. Product *string - // A pre-signed Amazon S3 URL that can be used to download the patch snapshot. + // A pre-signed Amazon Simple Storage Service (Amazon S3) URL that can be used to + // download the patch snapshot. SnapshotDownloadUrl *string // The user-defined snapshot ID. @@ -58,9 +73,14 @@ type GetDeployablePatchSnapshotForInstanceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetDeployablePatchSnapshotForInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetDeployablePatchSnapshotForInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetDeployablePatchSnapshotForInstance{}, middleware.After) if err != nil { return err @@ -69,6 +89,13 @@ func addOperationGetDeployablePatchSnapshotForInstanceMiddlewares(stack *middlew if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetDeployablePatchSnapshotForInstance"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -87,16 +114,13 @@ func addOperationGetDeployablePatchSnapshotForInstanceMiddlewares(stack *middlew if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -105,12 +129,18 @@ func addOperationGetDeployablePatchSnapshotForInstanceMiddlewares(stack *middlew if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpGetDeployablePatchSnapshotForInstanceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDeployablePatchSnapshotForInstance(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -120,6 +150,9 @@ func addOperationGetDeployablePatchSnapshotForInstanceMiddlewares(stack *middlew if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -127,7 +160,6 @@ func newServiceMetadataMiddleware_opGetDeployablePatchSnapshotForInstance(region return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "GetDeployablePatchSnapshotForInstance", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetDocument.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetDocument.go index 32e32b90..9aa1641c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetDocument.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetDocument.go @@ -4,20 +4,23 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" + "time" ) -// Gets the contents of the specified Systems Manager document. +// Gets the contents of the specified Amazon Web Services Systems Manager document +// (SSM document). func (c *Client) GetDocument(ctx context.Context, params *GetDocumentInput, optFns ...func(*Options)) (*GetDocumentOutput, error) { if params == nil { params = &GetDocumentInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetDocument", params, optFns, addOperationGetDocumentMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetDocument", params, optFns, c.addOperationGetDocumentMiddlewares) if err != nil { return nil, err } @@ -29,7 +32,7 @@ func (c *Client) GetDocument(ctx context.Context, params *GetDocumentInput, optF type GetDocumentInput struct { - // The name of the Systems Manager document. + // The name of the SSM document. // // This member is required. Name *string @@ -45,6 +48,8 @@ type GetDocumentInput struct { // document. For example, "Release 12, Update 6". This value is unique across all // versions of a document and can't be changed. VersionName *string + + noSmithyDocumentSerde } type GetDocumentOutput struct { @@ -53,9 +58,16 @@ type GetDocumentOutput struct { // and so on. AttachmentsContent []types.AttachmentContent - // The contents of the Systems Manager document. + // The contents of the SSM document. Content *string + // The date the SSM document was created. + CreatedDate *time.Time + + // The friendly name of the SSM document. This value can differ for each version + // of the document. If you want to update this value, see UpdateDocument . + DisplayName *string + // The document format, either JSON or YAML. DocumentFormat types.DocumentFormat @@ -65,7 +77,7 @@ type GetDocumentOutput struct { // The document version. DocumentVersion *string - // The name of the Systems Manager document. + // The name of the SSM document. Name *string // A list of SSM documents required by a document. For example, an @@ -81,26 +93,31 @@ type GetDocumentOutput struct { // in review, or PENDING, at a time. ReviewStatus types.ReviewStatus - // The status of the Systems Manager document, such as Creating, Active, Updating, - // Failed, and Deleting. + // The status of the SSM document, such as Creating , Active , Updating , Failed , + // and Deleting . Status types.DocumentStatus - // A message returned by AWS Systems Manager that explains the Status value. For - // example, a Failed status might be explained by the StatusInformation message, - // "The specified S3 bucket does not exist. Verify that the URL of the S3 bucket is - // correct." + // A message returned by Amazon Web Services Systems Manager that explains the + // Status value. For example, a Failed status might be explained by the + // StatusInformation message, "The specified S3 bucket doesn't exist. Verify that + // the URL of the S3 bucket is correct." StatusInformation *string // The version of the artifact associated with the document. For example, "Release - // 12, Update 6". This value is unique across all versions of a document, and - // cannot be changed. + // 12, Update 6". This value is unique across all versions of a document, and can't + // be changed. VersionName *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetDocumentMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetDocumentMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetDocument{}, middleware.After) if err != nil { return err @@ -109,6 +126,13 @@ func addOperationGetDocumentMiddlewares(stack *middleware.Stack, options Options if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetDocument"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -127,16 +151,13 @@ func addOperationGetDocumentMiddlewares(stack *middleware.Stack, options Options if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -145,12 +166,18 @@ func addOperationGetDocumentMiddlewares(stack *middleware.Stack, options Options if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpGetDocumentValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDocument(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -160,6 +187,9 @@ func addOperationGetDocumentMiddlewares(stack *middleware.Stack, options Options if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -167,7 +197,6 @@ func newServiceMetadataMiddleware_opGetDocument(region string) *awsmiddleware.Re return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "GetDocument", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetInventory.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetInventory.go index dd6e26eb..a84b17dc 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetInventory.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetInventory.go @@ -12,13 +12,14 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Query inventory information. +// Query inventory information. This includes managed node status, such as Stopped +// or Terminated . func (c *Client) GetInventory(ctx context.Context, params *GetInventoryInput, optFns ...func(*Options)) (*GetInventoryOutput, error) { if params == nil { params = &GetInventoryInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetInventory", params, optFns, addOperationGetInventoryMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetInventory", params, optFns, c.addOperationGetInventoryMiddlewares) if err != nil { return nil, err } @@ -30,10 +31,10 @@ func (c *Client) GetInventory(ctx context.Context, params *GetInventoryInput, op type GetInventoryInput struct { - // Returns counts of inventory types based on one or more expressions. For example, - // if you aggregate by using an expression that uses the + // Returns counts of inventory types based on one or more expressions. For + // example, if you aggregate by using an expression that uses the // AWS:InstanceInformation.PlatformType type, you can see a count of how many - // Windows and Linux instances exist in your inventoried fleet. + // Windows and Linux managed nodes exist in your inventoried fleet. Aggregators []types.InventoryAggregator // One or more filters. Use a filter to return a more specific list of results. @@ -41,7 +42,7 @@ type GetInventoryInput struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) @@ -49,11 +50,13 @@ type GetInventoryInput struct { // The list of inventory item types to return. ResultAttributes []types.ResultAttribute + + noSmithyDocumentSerde } type GetInventoryOutput struct { - // Collection of inventory entities such as a collection of instance inventory. + // Collection of inventory entities such as a collection of managed node inventory. Entities []types.InventoryResultEntity // The token to use when requesting the next set of items. If there are no @@ -62,9 +65,14 @@ type GetInventoryOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetInventoryMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetInventoryMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetInventory{}, middleware.After) if err != nil { return err @@ -73,6 +81,13 @@ func addOperationGetInventoryMiddlewares(stack *middleware.Stack, options Option if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetInventory"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -91,16 +106,13 @@ func addOperationGetInventoryMiddlewares(stack *middleware.Stack, options Option if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -109,12 +121,18 @@ func addOperationGetInventoryMiddlewares(stack *middleware.Stack, options Option if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpGetInventoryValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetInventory(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -124,6 +142,9 @@ func addOperationGetInventoryMiddlewares(stack *middleware.Stack, options Option if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -156,30 +177,31 @@ type GetInventoryPaginator struct { // NewGetInventoryPaginator returns a new GetInventoryPaginator func NewGetInventoryPaginator(client GetInventoryAPIClient, params *GetInventoryInput, optFns ...func(*GetInventoryPaginatorOptions)) *GetInventoryPaginator { + if params == nil { + params = &GetInventoryInput{} + } + options := GetInventoryPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &GetInventoryInput{} - } - return &GetInventoryPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *GetInventoryPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next GetInventory page. @@ -191,7 +213,11 @@ func (p *GetInventoryPaginator) NextPage(ctx context.Context, optFns ...func(*Op params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.GetInventory(ctx, ¶ms, optFns...) if err != nil { @@ -202,7 +228,10 @@ func (p *GetInventoryPaginator) NextPage(ctx context.Context, optFns ...func(*Op prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -213,7 +242,6 @@ func newServiceMetadataMiddleware_opGetInventory(region string) *awsmiddleware.R return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "GetInventory", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetInventorySchema.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetInventorySchema.go index c25ff6b1..9d422bdc 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetInventorySchema.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetInventorySchema.go @@ -19,7 +19,7 @@ func (c *Client) GetInventorySchema(ctx context.Context, params *GetInventorySch params = &GetInventorySchemaInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetInventorySchema", params, optFns, addOperationGetInventorySchemaMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetInventorySchema", params, optFns, c.addOperationGetInventorySchemaMiddlewares) if err != nil { return nil, err } @@ -33,22 +33,24 @@ type GetInventorySchemaInput struct { // Returns inventory schemas that support aggregation. For example, this call // returns the AWS:InstanceInformation type, because it supports aggregation based - // on the PlatformName, PlatformType, and PlatformVersion attributes. + // on the PlatformName , PlatformType , and PlatformVersion attributes. Aggregator bool // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string // Returns the sub-type schema for a specified inventory type. - SubType bool + SubType *bool // The type of inventory item to return. TypeName *string + + noSmithyDocumentSerde } type GetInventorySchemaOutput struct { @@ -62,9 +64,14 @@ type GetInventorySchemaOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetInventorySchemaMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetInventorySchemaMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetInventorySchema{}, middleware.After) if err != nil { return err @@ -73,6 +80,13 @@ func addOperationGetInventorySchemaMiddlewares(stack *middleware.Stack, options if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetInventorySchema"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -91,16 +105,13 @@ func addOperationGetInventorySchemaMiddlewares(stack *middleware.Stack, options if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -109,9 +120,15 @@ func addOperationGetInventorySchemaMiddlewares(stack *middleware.Stack, options if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetInventorySchema(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -121,6 +138,9 @@ func addOperationGetInventorySchemaMiddlewares(stack *middleware.Stack, options if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -155,30 +175,31 @@ type GetInventorySchemaPaginator struct { // NewGetInventorySchemaPaginator returns a new GetInventorySchemaPaginator func NewGetInventorySchemaPaginator(client GetInventorySchemaAPIClient, params *GetInventorySchemaInput, optFns ...func(*GetInventorySchemaPaginatorOptions)) *GetInventorySchemaPaginator { + if params == nil { + params = &GetInventorySchemaInput{} + } + options := GetInventorySchemaPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &GetInventorySchemaInput{} - } - return &GetInventorySchemaPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *GetInventorySchemaPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next GetInventorySchema page. @@ -190,7 +211,11 @@ func (p *GetInventorySchemaPaginator) NextPage(ctx context.Context, optFns ...fu params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.GetInventorySchema(ctx, ¶ms, optFns...) if err != nil { @@ -201,7 +226,10 @@ func (p *GetInventorySchemaPaginator) NextPage(ctx context.Context, optFns ...fu prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -212,7 +240,6 @@ func newServiceMetadataMiddleware_opGetInventorySchema(region string) *awsmiddle return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "GetInventorySchema", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetMaintenanceWindow.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetMaintenanceWindow.go index 13313044..24750144 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetMaintenanceWindow.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetMaintenanceWindow.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" @@ -17,7 +18,7 @@ func (c *Client) GetMaintenanceWindow(ctx context.Context, params *GetMaintenanc params = &GetMaintenanceWindowInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetMaintenanceWindow", params, optFns, addOperationGetMaintenanceWindowMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetMaintenanceWindow", params, optFns, c.addOperationGetMaintenanceWindowMiddlewares) if err != nil { return nil, err } @@ -33,6 +34,8 @@ type GetMaintenanceWindowInput struct { // // This member is required. WindowId *string + + noSmithyDocumentSerde } type GetMaintenanceWindowOutput struct { @@ -44,21 +47,21 @@ type GetMaintenanceWindowOutput struct { // The date the maintenance window was created. CreatedDate *time.Time - // The number of hours before the end of the maintenance window that Systems - // Manager stops scheduling new tasks for execution. + // The number of hours before the end of the maintenance window that Amazon Web + // Services Systems Manager stops scheduling new tasks for execution. Cutoff int32 // The description of the maintenance window. Description *string // The duration of the maintenance window in hours. - Duration int32 + Duration *int32 // Indicates whether the maintenance window is enabled. Enabled bool // The date and time, in ISO-8601 Extended format, for when the maintenance window - // is scheduled to become inactive. The maintenance window will not run after this + // is scheduled to become inactive. The maintenance window won't run after this // specified time. EndDate *string @@ -75,9 +78,9 @@ type GetMaintenanceWindowOutput struct { // The schedule of the maintenance window in the form of a cron or rate expression. Schedule *string - // The number of days to wait to run a maintenance window after the scheduled CRON + // The number of days to wait to run a maintenance window after the scheduled cron // expression date and time. - ScheduleOffset int32 + ScheduleOffset *int32 // The time zone that the scheduled maintenance window executions are based on, in // Internet Assigned Numbers Authority (IANA) format. For example: @@ -86,7 +89,7 @@ type GetMaintenanceWindowOutput struct { ScheduleTimezone *string // The date and time, in ISO-8601 Extended format, for when the maintenance window - // is scheduled to become active. The maintenance window will not run before this + // is scheduled to become active. The maintenance window won't run before this // specified time. StartDate *string @@ -95,9 +98,14 @@ type GetMaintenanceWindowOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetMaintenanceWindowMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetMaintenanceWindowMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetMaintenanceWindow{}, middleware.After) if err != nil { return err @@ -106,6 +114,13 @@ func addOperationGetMaintenanceWindowMiddlewares(stack *middleware.Stack, option if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetMaintenanceWindow"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -124,16 +139,13 @@ func addOperationGetMaintenanceWindowMiddlewares(stack *middleware.Stack, option if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -142,12 +154,18 @@ func addOperationGetMaintenanceWindowMiddlewares(stack *middleware.Stack, option if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpGetMaintenanceWindowValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMaintenanceWindow(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -157,6 +175,9 @@ func addOperationGetMaintenanceWindowMiddlewares(stack *middleware.Stack, option if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -164,7 +185,6 @@ func newServiceMetadataMiddleware_opGetMaintenanceWindow(region string) *awsmidd return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "GetMaintenanceWindow", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetMaintenanceWindowExecution.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetMaintenanceWindowExecution.go index a893c2fe..9c46cf82 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetMaintenanceWindowExecution.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetMaintenanceWindowExecution.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -18,7 +19,7 @@ func (c *Client) GetMaintenanceWindowExecution(ctx context.Context, params *GetM params = &GetMaintenanceWindowExecutionInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetMaintenanceWindowExecution", params, optFns, addOperationGetMaintenanceWindowExecutionMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetMaintenanceWindowExecution", params, optFns, c.addOperationGetMaintenanceWindowExecutionMiddlewares) if err != nil { return nil, err } @@ -34,6 +35,8 @@ type GetMaintenanceWindowExecutionInput struct { // // This member is required. WindowExecutionId *string + + noSmithyDocumentSerde } type GetMaintenanceWindowExecutionOutput struct { @@ -47,7 +50,7 @@ type GetMaintenanceWindowExecutionOutput struct { // The status of the maintenance window execution. Status types.MaintenanceWindowExecutionStatus - // The details explaining the Status. Only available for certain status values. + // The details explaining the status. Not available for all status values. StatusDetails *string // The ID of the task executions from the maintenance window execution. @@ -58,9 +61,14 @@ type GetMaintenanceWindowExecutionOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetMaintenanceWindowExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetMaintenanceWindowExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetMaintenanceWindowExecution{}, middleware.After) if err != nil { return err @@ -69,6 +77,13 @@ func addOperationGetMaintenanceWindowExecutionMiddlewares(stack *middleware.Stac if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetMaintenanceWindowExecution"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -87,16 +102,13 @@ func addOperationGetMaintenanceWindowExecutionMiddlewares(stack *middleware.Stac if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -105,12 +117,18 @@ func addOperationGetMaintenanceWindowExecutionMiddlewares(stack *middleware.Stac if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpGetMaintenanceWindowExecutionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMaintenanceWindowExecution(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -120,6 +138,9 @@ func addOperationGetMaintenanceWindowExecutionMiddlewares(stack *middleware.Stac if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -127,7 +148,6 @@ func newServiceMetadataMiddleware_opGetMaintenanceWindowExecution(region string) return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "GetMaintenanceWindowExecution", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetMaintenanceWindowExecutionTask.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetMaintenanceWindowExecutionTask.go index d645f207..c7ffe975 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetMaintenanceWindowExecutionTask.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetMaintenanceWindowExecutionTask.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -19,7 +20,7 @@ func (c *Client) GetMaintenanceWindowExecutionTask(ctx context.Context, params * params = &GetMaintenanceWindowExecutionTaskInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetMaintenanceWindowExecutionTask", params, optFns, addOperationGetMaintenanceWindowExecutionTaskMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetMaintenanceWindowExecutionTask", params, optFns, c.addOperationGetMaintenanceWindowExecutionTaskMiddlewares) if err != nil { return nil, err } @@ -31,8 +32,8 @@ func (c *Client) GetMaintenanceWindowExecutionTask(ctx context.Context, params * type GetMaintenanceWindowExecutionTaskInput struct { - // The ID of the specific task execution in the maintenance window task that should - // be retrieved. + // The ID of the specific task execution in the maintenance window task that + // should be retrieved. // // This member is required. TaskId *string @@ -41,18 +42,24 @@ type GetMaintenanceWindowExecutionTaskInput struct { // // This member is required. WindowExecutionId *string + + noSmithyDocumentSerde } type GetMaintenanceWindowExecutionTaskOutput struct { + // The details for the CloudWatch alarm you applied to your maintenance window + // task. + AlarmConfiguration *types.AlarmConfiguration + // The time the task execution completed. EndTime *time.Time // The defined maximum number of task executions that could be run in parallel. MaxConcurrency *string - // The defined maximum number of task execution errors allowed before scheduling of - // the task execution would have been stopped. + // The defined maximum number of task execution errors allowed before scheduling + // of the task execution would have been stopped. MaxErrors *string // The priority of the task. @@ -67,10 +74,10 @@ type GetMaintenanceWindowExecutionTaskOutput struct { // The status of the task. Status types.MaintenanceWindowExecutionStatus - // The details explaining the Status. Only available for certain status values. + // The details explaining the status. Not available for all status values. StatusDetails *string - // The ARN of the task that ran. + // The Amazon Resource Name (ARN) of the task that ran. TaskArn *string // The ID of the specific task execution in the maintenance window task that was @@ -79,13 +86,17 @@ type GetMaintenanceWindowExecutionTaskOutput struct { // The parameters passed to the task when it was run. TaskParameters has been // deprecated. To specify parameters to pass to a task when it runs, instead use - // the Parameters option in the TaskInvocationParameters structure. For information - // about how Systems Manager handles these options for the supported maintenance - // window task types, see MaintenanceWindowTaskInvocationParameters. The map has - // the following format: Key: string, between 1 and 255 characters Value: an array - // of strings, each string is between 1 and 255 characters + // the Parameters option in the TaskInvocationParameters structure. For + // information about how Systems Manager handles these options for the supported + // maintenance window task types, see MaintenanceWindowTaskInvocationParameters . + // The map has the following format: + // - Key : string, between 1 and 255 characters + // - Value : an array of strings, each between 1 and 255 characters TaskParameters []map[string]types.MaintenanceWindowTaskParameterValueExpression + // The CloudWatch alarms that were invoked by the maintenance window task. + TriggeredAlarms []types.AlarmStateInformation + // The type of task that was run. Type types.MaintenanceWindowTaskType @@ -94,9 +105,14 @@ type GetMaintenanceWindowExecutionTaskOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetMaintenanceWindowExecutionTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetMaintenanceWindowExecutionTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetMaintenanceWindowExecutionTask{}, middleware.After) if err != nil { return err @@ -105,6 +121,13 @@ func addOperationGetMaintenanceWindowExecutionTaskMiddlewares(stack *middleware. if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetMaintenanceWindowExecutionTask"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -123,16 +146,13 @@ func addOperationGetMaintenanceWindowExecutionTaskMiddlewares(stack *middleware. if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -141,12 +161,18 @@ func addOperationGetMaintenanceWindowExecutionTaskMiddlewares(stack *middleware. if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpGetMaintenanceWindowExecutionTaskValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMaintenanceWindowExecutionTask(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -156,6 +182,9 @@ func addOperationGetMaintenanceWindowExecutionTaskMiddlewares(stack *middleware. if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -163,7 +192,6 @@ func newServiceMetadataMiddleware_opGetMaintenanceWindowExecutionTask(region str return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "GetMaintenanceWindowExecutionTask", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetMaintenanceWindowExecutionTaskInvocation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetMaintenanceWindowExecutionTaskInvocation.go index 932e1b7c..a1d96e40 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetMaintenanceWindowExecutionTaskInvocation.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetMaintenanceWindowExecutionTaskInvocation.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -18,7 +19,7 @@ func (c *Client) GetMaintenanceWindowExecutionTaskInvocation(ctx context.Context params = &GetMaintenanceWindowExecutionTaskInvocationInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetMaintenanceWindowExecutionTaskInvocation", params, optFns, addOperationGetMaintenanceWindowExecutionTaskInvocationMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetMaintenanceWindowExecutionTaskInvocation", params, optFns, c.addOperationGetMaintenanceWindowExecutionTaskInvocationMiddlewares) if err != nil { return nil, err } @@ -45,6 +46,8 @@ type GetMaintenanceWindowExecutionTaskInvocationInput struct { // // This member is required. WindowExecutionId *string + + noSmithyDocumentSerde } type GetMaintenanceWindowExecutionTaskInvocationOutput struct { @@ -58,8 +61,9 @@ type GetMaintenanceWindowExecutionTaskInvocationOutput struct { // The invocation ID. InvocationId *string - // User-provided value to be included in any CloudWatch events raised while running - // tasks for these targets in this maintenance window. + // User-provided value to be included in any Amazon CloudWatch Events or Amazon + // EventBridge events raised while running tasks for these targets in this + // maintenance window. OwnerInformation *string // The parameters used at the time that the task ran. @@ -71,15 +75,14 @@ type GetMaintenanceWindowExecutionTaskInvocationOutput struct { // The task status for an invocation. Status types.MaintenanceWindowExecutionStatus - // The details explaining the status. Details are only available for certain status - // values. + // The details explaining the status. Details are only available for certain + // status values. StatusDetails *string // The task execution ID. TaskExecutionId *string - // Retrieves the task type for a maintenance window. Task types include the - // following: LAMBDA, STEP_FUNCTIONS, AUTOMATION, RUN_COMMAND. + // Retrieves the task type for a maintenance window. TaskType types.MaintenanceWindowTaskType // The maintenance window execution ID. @@ -90,9 +93,14 @@ type GetMaintenanceWindowExecutionTaskInvocationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetMaintenanceWindowExecutionTaskInvocationMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetMaintenanceWindowExecutionTaskInvocationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetMaintenanceWindowExecutionTaskInvocation{}, middleware.After) if err != nil { return err @@ -101,6 +109,13 @@ func addOperationGetMaintenanceWindowExecutionTaskInvocationMiddlewares(stack *m if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetMaintenanceWindowExecutionTaskInvocation"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -119,16 +134,13 @@ func addOperationGetMaintenanceWindowExecutionTaskInvocationMiddlewares(stack *m if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -137,12 +149,18 @@ func addOperationGetMaintenanceWindowExecutionTaskInvocationMiddlewares(stack *m if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpGetMaintenanceWindowExecutionTaskInvocationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMaintenanceWindowExecutionTaskInvocation(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -152,6 +170,9 @@ func addOperationGetMaintenanceWindowExecutionTaskInvocationMiddlewares(stack *m if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -159,7 +180,6 @@ func newServiceMetadataMiddleware_opGetMaintenanceWindowExecutionTaskInvocation( return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "GetMaintenanceWindowExecutionTaskInvocation", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetMaintenanceWindowTask.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetMaintenanceWindowTask.go index da0b5f6c..12e5c11a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetMaintenanceWindowTask.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetMaintenanceWindowTask.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -11,17 +12,18 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the tasks in a maintenance window. For maintenance window tasks without a -// specified target, you cannot supply values for --max-errors and -// --max-concurrency. Instead, the system inserts a placeholder value of 1, which -// may be reported in the response to this command. These values do not affect the -// running of your task and can be ignored. +// Retrieves the details of a maintenance window task. For maintenance window +// tasks without a specified target, you can't supply values for --max-errors and +// --max-concurrency . Instead, the system inserts a placeholder value of 1 , which +// may be reported in the response to this command. These values don't affect the +// running of your task and can be ignored. To retrieve a list of tasks in a +// maintenance window, instead use the DescribeMaintenanceWindowTasks command. func (c *Client) GetMaintenanceWindowTask(ctx context.Context, params *GetMaintenanceWindowTaskInput, optFns ...func(*Options)) (*GetMaintenanceWindowTaskOutput, error) { if params == nil { params = &GetMaintenanceWindowTaskInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetMaintenanceWindowTask", params, optFns, addOperationGetMaintenanceWindowTaskMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetMaintenanceWindowTask", params, optFns, c.addOperationGetMaintenanceWindowTaskMiddlewares) if err != nil { return nil, err } @@ -42,32 +44,47 @@ type GetMaintenanceWindowTaskInput struct { // // This member is required. WindowTaskId *string + + noSmithyDocumentSerde } type GetMaintenanceWindowTaskOutput struct { + // The details for the CloudWatch alarm you applied to your maintenance window + // task. + AlarmConfiguration *types.AlarmConfiguration + + // The action to take on tasks when the maintenance window cutoff time is reached. + // CONTINUE_TASK means that tasks continue to run. For Automation, Lambda, Step + // Functions tasks, CANCEL_TASK means that currently running task invocations + // continue, but no new task invocations are started. For Run Command tasks, + // CANCEL_TASK means the system attempts to stop the task by sending a + // CancelCommand operation. + CutoffBehavior types.MaintenanceWindowTaskCutoffBehavior + // The retrieved task description. Description *string - // The location in Amazon S3 where the task results are logged. LoggingInfo has - // been deprecated. To specify an S3 bucket to contain logs, instead use the + // The location in Amazon Simple Storage Service (Amazon S3) where the task + // results are logged. LoggingInfo has been deprecated. To specify an Amazon + // Simple Storage Service (Amazon S3) bucket to contain logs, instead use the // OutputS3BucketName and OutputS3KeyPrefix options in the TaskInvocationParameters - // structure. For information about how Systems Manager handles these options for - // the supported maintenance window task types, see - // MaintenanceWindowTaskInvocationParameters. + // structure. For information about how Amazon Web Services Systems Manager handles + // these options for the supported maintenance window task types, see + // MaintenanceWindowTaskInvocationParameters . LoggingInfo *types.LoggingInfo // The maximum number of targets allowed to run this task in parallel. For - // maintenance window tasks without a target specified, you cannot supply a value - // for this option. Instead, the system inserts a placeholder value of 1, which may - // be reported in the response to this command. This value does not affect the + // maintenance window tasks without a target specified, you can't supply a value + // for this option. Instead, the system inserts a placeholder value of 1 , which + // may be reported in the response to this command. This value doesn't affect the // running of your task and can be ignored. MaxConcurrency *string // The maximum number of errors allowed before the task stops being scheduled. For - // maintenance window tasks without a target specified, you cannot supply a value - // for this option. Instead, the system inserts a placeholder value of 1, which may - // be reported in the response to this command. This value does not affect the + // maintenance window tasks without a target specified, you can't supply a value + // for this option. Instead, the system inserts a placeholder value of 1 , which + // may be reported in the response to this command. This value doesn't affect the // running of your task and can be ignored. MaxErrors *string @@ -78,15 +95,16 @@ type GetMaintenanceWindowTaskOutput struct { // priority. Tasks that have the same priority are scheduled in parallel. Priority int32 - // The ARN of the IAM service role to use to publish Amazon Simple Notification - // Service (Amazon SNS) notifications for maintenance window Run Command tasks. + // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) + // service role to use to publish Amazon Simple Notification Service (Amazon SNS) + // notifications for maintenance window Run Command tasks. ServiceRoleArn *string // The targets where the task should run. Targets []types.Target // The resource that the task used during execution. For RUN_COMMAND and AUTOMATION - // task types, the TaskArn is the Systems Manager Document name/ARN. For LAMBDA + // task types, the value of TaskArn is the SSM document name/ARN. For LAMBDA // tasks, the value is the function name/ARN. For STEP_FUNCTIONS tasks, the value // is the state machine ARN. TaskArn *string @@ -96,9 +114,9 @@ type GetMaintenanceWindowTaskOutput struct { // The parameters to pass to the task when it runs. TaskParameters has been // deprecated. To specify parameters to pass to a task when it runs, instead use - // the Parameters option in the TaskInvocationParameters structure. For information - // about how Systems Manager handles these options for the supported maintenance - // window task types, see MaintenanceWindowTaskInvocationParameters. + // the Parameters option in the TaskInvocationParameters structure. For + // information about how Systems Manager handles these options for the supported + // maintenance window task types, see MaintenanceWindowTaskInvocationParameters . TaskParameters map[string]types.MaintenanceWindowTaskParameterValueExpression // The type of task to run. @@ -112,9 +130,14 @@ type GetMaintenanceWindowTaskOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetMaintenanceWindowTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetMaintenanceWindowTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetMaintenanceWindowTask{}, middleware.After) if err != nil { return err @@ -123,6 +146,13 @@ func addOperationGetMaintenanceWindowTaskMiddlewares(stack *middleware.Stack, op if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetMaintenanceWindowTask"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -141,16 +171,13 @@ func addOperationGetMaintenanceWindowTaskMiddlewares(stack *middleware.Stack, op if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -159,12 +186,18 @@ func addOperationGetMaintenanceWindowTaskMiddlewares(stack *middleware.Stack, op if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpGetMaintenanceWindowTaskValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMaintenanceWindowTask(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -174,6 +207,9 @@ func addOperationGetMaintenanceWindowTaskMiddlewares(stack *middleware.Stack, op if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -181,7 +217,6 @@ func newServiceMetadataMiddleware_opGetMaintenanceWindowTask(region string) *aws return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "GetMaintenanceWindowTask", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetOpsItem.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetOpsItem.go index dc8909ae..dbb5ed74 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetOpsItem.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetOpsItem.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -12,21 +13,20 @@ import ( ) // Get information about an OpsItem by using the ID. You must have permission in -// AWS Identity and Access Management (IAM) to view information about an OpsItem. -// For more information, see Getting started with OpsCenter -// (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-getting-started.html) -// in the AWS Systems Manager User Guide. Operations engineers and IT professionals -// use OpsCenter to view, investigate, and remediate operational issues impacting -// the performance and health of their AWS resources. For more information, see AWS -// Systems Manager OpsCenter -// (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter.html) in -// the AWS Systems Manager User Guide. +// Identity and Access Management (IAM) to view information about an OpsItem. For +// more information, see Set up OpsCenter (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-setup.html) +// in the Amazon Web Services Systems Manager User Guide. Operations engineers and +// IT professionals use Amazon Web Services Systems Manager OpsCenter to view, +// investigate, and remediate operational issues impacting the performance and +// health of their Amazon Web Services resources. For more information, see +// OpsCenter (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter.html) +// in the Amazon Web Services Systems Manager User Guide. func (c *Client) GetOpsItem(ctx context.Context, params *GetOpsItemInput, optFns ...func(*Options)) (*GetOpsItemOutput, error) { if params == nil { params = &GetOpsItemInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetOpsItem", params, optFns, addOperationGetOpsItemMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetOpsItem", params, optFns, c.addOperationGetOpsItemMiddlewares) if err != nil { return nil, err } @@ -42,6 +42,11 @@ type GetOpsItemInput struct { // // This member is required. OpsItemId *string + + // The OpsItem Amazon Resource Name (ARN). + OpsItemArn *string + + noSmithyDocumentSerde } type GetOpsItemOutput struct { @@ -51,9 +56,14 @@ type GetOpsItemOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetOpsItemMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetOpsItemMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetOpsItem{}, middleware.After) if err != nil { return err @@ -62,6 +72,13 @@ func addOperationGetOpsItemMiddlewares(stack *middleware.Stack, options Options) if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetOpsItem"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -80,16 +97,13 @@ func addOperationGetOpsItemMiddlewares(stack *middleware.Stack, options Options) if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -98,12 +112,18 @@ func addOperationGetOpsItemMiddlewares(stack *middleware.Stack, options Options) if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpGetOpsItemValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetOpsItem(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -113,6 +133,9 @@ func addOperationGetOpsItemMiddlewares(stack *middleware.Stack, options Options) if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -120,7 +143,6 @@ func newServiceMetadataMiddleware_opGetOpsItem(region string) *awsmiddleware.Reg return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "GetOpsItem", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetOpsMetadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetOpsMetadata.go index d357f5a0..5a5f22a4 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetOpsMetadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetOpsMetadata.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -17,7 +18,7 @@ func (c *Client) GetOpsMetadata(ctx context.Context, params *GetOpsMetadataInput params = &GetOpsMetadataInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetOpsMetadata", params, optFns, addOperationGetOpsMetadataMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetOpsMetadata", params, optFns, c.addOperationGetOpsMetadataMiddlewares) if err != nil { return nil, err } @@ -36,10 +37,12 @@ type GetOpsMetadataInput struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // A token to start the list. Use this token to get the next set of results. NextToken *string + + noSmithyDocumentSerde } type GetOpsMetadataOutput struct { @@ -56,9 +59,14 @@ type GetOpsMetadataOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetOpsMetadataMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetOpsMetadataMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetOpsMetadata{}, middleware.After) if err != nil { return err @@ -67,6 +75,13 @@ func addOperationGetOpsMetadataMiddlewares(stack *middleware.Stack, options Opti if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetOpsMetadata"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -85,16 +100,13 @@ func addOperationGetOpsMetadataMiddlewares(stack *middleware.Stack, options Opti if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -103,12 +115,18 @@ func addOperationGetOpsMetadataMiddlewares(stack *middleware.Stack, options Opti if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpGetOpsMetadataValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetOpsMetadata(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -118,6 +136,9 @@ func addOperationGetOpsMetadataMiddlewares(stack *middleware.Stack, options Opti if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -125,7 +146,6 @@ func newServiceMetadataMiddleware_opGetOpsMetadata(region string) *awsmiddleware return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "GetOpsMetadata", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetOpsSummary.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetOpsSummary.go index e4014db2..60559038 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetOpsSummary.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetOpsSummary.go @@ -12,13 +12,17 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// View a summary of OpsItems based on specified filters and aggregators. +// View a summary of operations metadata (OpsData) based on specified filters and +// aggregators. OpsData can include information about Amazon Web Services Systems +// Manager OpsCenter operational workitems (OpsItems) as well as information about +// any Amazon Web Services resource or service configured to report OpsData to +// Amazon Web Services Systems Manager Explorer. func (c *Client) GetOpsSummary(ctx context.Context, params *GetOpsSummaryInput, optFns ...func(*Options)) (*GetOpsSummaryOutput, error) { if params == nil { params = &GetOpsSummaryInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetOpsSummary", params, optFns, addOperationGetOpsSummaryMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetOpsSummary", params, optFns, c.addOperationGetOpsSummaryMiddlewares) if err != nil { return nil, err } @@ -30,30 +34,32 @@ func (c *Client) GetOpsSummary(ctx context.Context, params *GetOpsSummaryInput, type GetOpsSummaryInput struct { - // Optional aggregators that return counts of OpsItems based on one or more + // Optional aggregators that return counts of OpsData based on one or more // expressions. Aggregators []types.OpsAggregator - // Optional filters used to scope down the returned OpsItems. + // Optional filters used to scope down the returned OpsData. Filters []types.OpsFilter // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // A token to start the list. Use this token to get the next set of results. NextToken *string - // The OpsItem data type to return. + // The OpsData data type to return. ResultAttributes []types.OpsResultAttribute // Specify the name of a resource data sync to get. SyncName *string + + noSmithyDocumentSerde } type GetOpsSummaryOutput struct { - // The list of aggregated and filtered OpsItems. + // The list of aggregated details and filtered OpsData. Entities []types.OpsEntity // The token for the next set of items to return. Use this token to get the next @@ -62,9 +68,14 @@ type GetOpsSummaryOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetOpsSummaryMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetOpsSummaryMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetOpsSummary{}, middleware.After) if err != nil { return err @@ -73,6 +84,13 @@ func addOperationGetOpsSummaryMiddlewares(stack *middleware.Stack, options Optio if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetOpsSummary"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -91,16 +109,13 @@ func addOperationGetOpsSummaryMiddlewares(stack *middleware.Stack, options Optio if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -109,12 +124,18 @@ func addOperationGetOpsSummaryMiddlewares(stack *middleware.Stack, options Optio if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpGetOpsSummaryValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetOpsSummary(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -124,6 +145,9 @@ func addOperationGetOpsSummaryMiddlewares(stack *middleware.Stack, options Optio if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -156,30 +180,31 @@ type GetOpsSummaryPaginator struct { // NewGetOpsSummaryPaginator returns a new GetOpsSummaryPaginator func NewGetOpsSummaryPaginator(client GetOpsSummaryAPIClient, params *GetOpsSummaryInput, optFns ...func(*GetOpsSummaryPaginatorOptions)) *GetOpsSummaryPaginator { + if params == nil { + params = &GetOpsSummaryInput{} + } + options := GetOpsSummaryPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &GetOpsSummaryInput{} - } - return &GetOpsSummaryPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *GetOpsSummaryPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next GetOpsSummary page. @@ -191,7 +216,11 @@ func (p *GetOpsSummaryPaginator) NextPage(ctx context.Context, optFns ...func(*O params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.GetOpsSummary(ctx, ¶ms, optFns...) if err != nil { @@ -202,7 +231,10 @@ func (p *GetOpsSummaryPaginator) NextPage(ctx context.Context, optFns ...func(*O prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -213,7 +245,6 @@ func newServiceMetadataMiddleware_opGetOpsSummary(region string) *awsmiddleware. return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "GetOpsSummary", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetParameter.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetParameter.go index 9c59a8d5..75aaa166 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetParameter.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetParameter.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -11,14 +12,15 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Get information about a parameter by using the parameter name. Don't confuse -// this API action with the GetParameters API action. +// Get information about a single parameter by specifying the parameter name. To +// get information about more than one parameter at a time, use the GetParameters +// operation. func (c *Client) GetParameter(ctx context.Context, params *GetParameterInput, optFns ...func(*Options)) (*GetParameterOutput, error) { if params == nil { params = &GetParameterInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetParameter", params, optFns, addOperationGetParameterMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetParameter", params, optFns, c.addOperationGetParameterMiddlewares) if err != nil { return nil, err } @@ -30,14 +32,18 @@ func (c *Client) GetParameter(ctx context.Context, params *GetParameterInput, op type GetParameterInput struct { - // The name of the parameter you want to query. + // The name of the parameter you want to query. To query by parameter label, use + // "Name": "name:label" . To query by parameter version, use "Name": "name:version" + // . // // This member is required. Name *string // Return decrypted values for secure string parameters. This flag is ignored for // String and StringList parameter types. - WithDecryption bool + WithDecryption *bool + + noSmithyDocumentSerde } type GetParameterOutput struct { @@ -47,9 +53,14 @@ type GetParameterOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetParameterMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetParameterMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetParameter{}, middleware.After) if err != nil { return err @@ -58,6 +69,13 @@ func addOperationGetParameterMiddlewares(stack *middleware.Stack, options Option if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetParameter"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -76,16 +94,13 @@ func addOperationGetParameterMiddlewares(stack *middleware.Stack, options Option if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -94,12 +109,18 @@ func addOperationGetParameterMiddlewares(stack *middleware.Stack, options Option if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpGetParameterValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetParameter(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -109,6 +130,9 @@ func addOperationGetParameterMiddlewares(stack *middleware.Stack, options Option if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -116,7 +140,6 @@ func newServiceMetadataMiddleware_opGetParameter(region string) *awsmiddleware.R return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "GetParameter", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetParameterHistory.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetParameterHistory.go index 78e8f813..cd99f0cd 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetParameterHistory.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetParameterHistory.go @@ -12,13 +12,16 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Retrieves the history of all changes to a parameter. +// Retrieves the history of all changes to a parameter. If you change the KMS key +// alias for the KMS key used to encrypt a parameter, then you must also update the +// key alias the parameter uses to reference KMS. Otherwise, GetParameterHistory +// retrieves whatever the original key alias was referencing. func (c *Client) GetParameterHistory(ctx context.Context, params *GetParameterHistoryInput, optFns ...func(*Options)) (*GetParameterHistoryOutput, error) { if params == nil { params = &GetParameterHistoryInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetParameterHistory", params, optFns, addOperationGetParameterHistoryMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetParameterHistory", params, optFns, c.addOperationGetParameterHistoryMiddlewares) if err != nil { return nil, err } @@ -37,7 +40,7 @@ type GetParameterHistoryInput struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) @@ -45,7 +48,9 @@ type GetParameterHistoryInput struct { // Return decrypted values for secure string parameters. This flag is ignored for // String and StringList parameter types. - WithDecryption bool + WithDecryption *bool + + noSmithyDocumentSerde } type GetParameterHistoryOutput struct { @@ -59,9 +64,14 @@ type GetParameterHistoryOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetParameterHistoryMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetParameterHistoryMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetParameterHistory{}, middleware.After) if err != nil { return err @@ -70,6 +80,13 @@ func addOperationGetParameterHistoryMiddlewares(stack *middleware.Stack, options if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetParameterHistory"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -88,16 +105,13 @@ func addOperationGetParameterHistoryMiddlewares(stack *middleware.Stack, options if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -106,12 +120,18 @@ func addOperationGetParameterHistoryMiddlewares(stack *middleware.Stack, options if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpGetParameterHistoryValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetParameterHistory(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -121,11 +141,14 @@ func addOperationGetParameterHistoryMiddlewares(stack *middleware.Stack, options if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } -// GetParameterHistoryAPIClient is a client that implements the GetParameterHistory -// operation. +// GetParameterHistoryAPIClient is a client that implements the +// GetParameterHistory operation. type GetParameterHistoryAPIClient interface { GetParameterHistory(context.Context, *GetParameterHistoryInput, ...func(*Options)) (*GetParameterHistoryOutput, error) } @@ -155,30 +178,31 @@ type GetParameterHistoryPaginator struct { // NewGetParameterHistoryPaginator returns a new GetParameterHistoryPaginator func NewGetParameterHistoryPaginator(client GetParameterHistoryAPIClient, params *GetParameterHistoryInput, optFns ...func(*GetParameterHistoryPaginatorOptions)) *GetParameterHistoryPaginator { + if params == nil { + params = &GetParameterHistoryInput{} + } + options := GetParameterHistoryPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &GetParameterHistoryInput{} - } - return &GetParameterHistoryPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *GetParameterHistoryPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next GetParameterHistory page. @@ -190,7 +214,11 @@ func (p *GetParameterHistoryPaginator) NextPage(ctx context.Context, optFns ...f params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.GetParameterHistory(ctx, ¶ms, optFns...) if err != nil { @@ -201,7 +229,10 @@ func (p *GetParameterHistoryPaginator) NextPage(ctx context.Context, optFns ...f prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -212,7 +243,6 @@ func newServiceMetadataMiddleware_opGetParameterHistory(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "GetParameterHistory", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetParameters.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetParameters.go index 3b25cf99..7fabdaf8 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetParameters.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetParameters.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -11,14 +12,15 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Get details of a parameter. Don't confuse this API action with the GetParameter -// API action. +// Get information about one or more parameters by specifying multiple parameter +// names. To get information about a single parameter, you can use the GetParameter +// operation instead. func (c *Client) GetParameters(ctx context.Context, params *GetParametersInput, optFns ...func(*Options)) (*GetParametersOutput, error) { if params == nil { params = &GetParametersInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetParameters", params, optFns, addOperationGetParametersMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetParameters", params, optFns, c.addOperationGetParametersMiddlewares) if err != nil { return nil, err } @@ -30,19 +32,23 @@ func (c *Client) GetParameters(ctx context.Context, params *GetParametersInput, type GetParametersInput struct { - // Names of the parameters for which you want to query information. + // Names of the parameters for which you want to query information. To query by + // parameter label, use "Name": "name:label" . To query by parameter version, use + // "Name": "name:version" . // // This member is required. Names []string // Return decrypted secure string value. Return decrypted values for secure string // parameters. This flag is ignored for String and StringList parameter types. - WithDecryption bool + WithDecryption *bool + + noSmithyDocumentSerde } type GetParametersOutput struct { - // A list of parameters that are not formatted correctly or do not run during an + // A list of parameters that aren't formatted correctly or don't run during an // execution. InvalidParameters []string @@ -51,9 +57,14 @@ type GetParametersOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetParametersMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetParametersMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetParameters{}, middleware.After) if err != nil { return err @@ -62,6 +73,13 @@ func addOperationGetParametersMiddlewares(stack *middleware.Stack, options Optio if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetParameters"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -80,16 +98,13 @@ func addOperationGetParametersMiddlewares(stack *middleware.Stack, options Optio if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -98,12 +113,18 @@ func addOperationGetParametersMiddlewares(stack *middleware.Stack, options Optio if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpGetParametersValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetParameters(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -113,6 +134,9 @@ func addOperationGetParametersMiddlewares(stack *middleware.Stack, options Optio if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -120,7 +144,6 @@ func newServiceMetadataMiddleware_opGetParameters(region string) *awsmiddleware. return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "GetParameters", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetParametersByPath.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetParametersByPath.go index ad7b71a4..50c44007 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetParametersByPath.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetParametersByPath.go @@ -16,16 +16,16 @@ import ( // Request results are returned on a best-effort basis. If you specify MaxResults // in the request, the response includes information up to the limit specified. The // number of items returned, however, can be between zero and the value of -// MaxResults. If the service reaches an internal limit while processing the +// MaxResults . If the service reaches an internal limit while processing the // results, it stops the operation and returns the matching values up to that point -// and a NextToken. You can specify the NextToken in a subsequent call to get the +// and a NextToken . You can specify the NextToken in a subsequent call to get the // next set of results. func (c *Client) GetParametersByPath(ctx context.Context, params *GetParametersByPathInput, optFns ...func(*Options)) (*GetParametersByPathOutput, error) { if params == nil { params = &GetParametersByPathInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetParametersByPath", params, optFns, addOperationGetParametersByPathMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetParametersByPath", params, optFns, c.addOperationGetParametersByPathMiddlewares) if err != nil { return nil, err } @@ -37,35 +37,40 @@ func (c *Client) GetParametersByPath(ctx context.Context, params *GetParametersB type GetParametersByPathInput struct { - // The hierarchy for the parameter. Hierarchies start with a forward slash (/) and - // end with the parameter name. A parameter name hierarchy can have a maximum of 15 - // levels. Here is an example of a hierarchy: - // /Finance/Prod/IAD/WinServ2016/license33 + // The hierarchy for the parameter. Hierarchies start with a forward slash (/). + // The hierarchy is the parameter name except the last part of the parameter. For + // the API call to succeed, the last part of the parameter name can't be in the + // path. A parameter name hierarchy can have a maximum of 15 levels. Here is an + // example of a hierarchy: /Finance/Prod/IAD/WinServ2016/license33 // // This member is required. Path *string // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // A token to start the list. Use this token to get the next set of results. NextToken *string - // Filters to limit the request results. For GetParametersByPath, the following - // filter Key names are supported: Type, KeyId, Label, and DataType. The following - // Key values are not supported for GetParametersByPath: tag, Name, Path, and Tier. + // Filters to limit the request results. The following Key values are supported + // for GetParametersByPath : Type , KeyId , and Label . The following Key values + // aren't supported for GetParametersByPath : tag , DataType , Name , Path , and + // Tier . ParameterFilters []types.ParameterStringFilter - // Retrieve all parameters within a hierarchy. If a user has access to a path, then - // the user can access all levels of that path. For example, if a user has - // permission to access path /a, then the user can also access /a/b. Even if a user - // has explicitly been denied access in IAM for parameter /a/b, they can still call - // the GetParametersByPath API action recursively for /a and view /a/b. - Recursive bool + // Retrieve all parameters within a hierarchy. If a user has access to a path, + // then the user can access all levels of that path. For example, if a user has + // permission to access path /a , then the user can also access /a/b . Even if a + // user has explicitly been denied access in IAM for parameter /a/b , they can + // still call the GetParametersByPath API operation recursively for /a and view + // /a/b . + Recursive *bool // Retrieve all parameters in a hierarchy with their value decrypted. - WithDecryption bool + WithDecryption *bool + + noSmithyDocumentSerde } type GetParametersByPathOutput struct { @@ -79,9 +84,14 @@ type GetParametersByPathOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetParametersByPathMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetParametersByPathMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetParametersByPath{}, middleware.After) if err != nil { return err @@ -90,6 +100,13 @@ func addOperationGetParametersByPathMiddlewares(stack *middleware.Stack, options if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetParametersByPath"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -108,16 +125,13 @@ func addOperationGetParametersByPathMiddlewares(stack *middleware.Stack, options if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -126,12 +140,18 @@ func addOperationGetParametersByPathMiddlewares(stack *middleware.Stack, options if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpGetParametersByPathValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetParametersByPath(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -141,11 +161,14 @@ func addOperationGetParametersByPathMiddlewares(stack *middleware.Stack, options if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } -// GetParametersByPathAPIClient is a client that implements the GetParametersByPath -// operation. +// GetParametersByPathAPIClient is a client that implements the +// GetParametersByPath operation. type GetParametersByPathAPIClient interface { GetParametersByPath(context.Context, *GetParametersByPathInput, ...func(*Options)) (*GetParametersByPathOutput, error) } @@ -175,30 +198,31 @@ type GetParametersByPathPaginator struct { // NewGetParametersByPathPaginator returns a new GetParametersByPathPaginator func NewGetParametersByPathPaginator(client GetParametersByPathAPIClient, params *GetParametersByPathInput, optFns ...func(*GetParametersByPathPaginatorOptions)) *GetParametersByPathPaginator { + if params == nil { + params = &GetParametersByPathInput{} + } + options := GetParametersByPathPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &GetParametersByPathInput{} - } - return &GetParametersByPathPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *GetParametersByPathPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next GetParametersByPath page. @@ -210,7 +234,11 @@ func (p *GetParametersByPathPaginator) NextPage(ctx context.Context, optFns ...f params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.GetParametersByPath(ctx, ¶ms, optFns...) if err != nil { @@ -221,7 +249,10 @@ func (p *GetParametersByPathPaginator) NextPage(ctx context.Context, optFns ...f prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -232,7 +263,6 @@ func newServiceMetadataMiddleware_opGetParametersByPath(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "GetParametersByPath", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetPatchBaseline.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetPatchBaseline.go index 45f7596d..667c52cb 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetPatchBaseline.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetPatchBaseline.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -18,7 +19,7 @@ func (c *Client) GetPatchBaseline(ctx context.Context, params *GetPatchBaselineI params = &GetPatchBaselineInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetPatchBaseline", params, optFns, addOperationGetPatchBaselineMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetPatchBaseline", params, optFns, c.addOperationGetPatchBaselineMiddlewares) if err != nil { return nil, err } @@ -30,10 +31,17 @@ func (c *Client) GetPatchBaseline(ctx context.Context, params *GetPatchBaselineI type GetPatchBaselineInput struct { - // The ID of the patch baseline to retrieve. + // The ID of the patch baseline to retrieve. To retrieve information about an + // Amazon Web Services managed patch baseline, specify the full Amazon Resource + // Name (ARN) of the baseline. For example, for the baseline + // AWS-AmazonLinuxDefaultPatchBaseline , specify + // arn:aws:ssm:us-east-2:733109147000:patchbaseline/pb-0e392de35e7c563b7 instead of + // pb-0e392de35e7c563b7 . // // This member is required. BaselineId *string + + noSmithyDocumentSerde } type GetPatchBaselineOutput struct { @@ -49,9 +57,9 @@ type GetPatchBaselineOutput struct { ApprovedPatchesComplianceLevel types.PatchComplianceLevel // Indicates whether the list of approved patches includes non-security updates - // that should be applied to the instances. The default value is 'false'. Applies - // to Linux instances only. - ApprovedPatchesEnableNonSecurity bool + // that should be applied to the managed nodes. The default value is false . + // Applies to Linux managed nodes only. + ApprovedPatchesEnableNonSecurity *bool // The ID of the retrieved patch baseline. BaselineId *string @@ -85,15 +93,21 @@ type GetPatchBaselineOutput struct { // entirely along with packages that include it as a dependency. RejectedPatchesAction types.PatchAction - // Information about the patches to use to update the instances, including target - // operating systems and source repositories. Applies to Linux instances only. + // Information about the patches to use to update the managed nodes, including + // target operating systems and source repositories. Applies to Linux managed nodes + // only. Sources []types.PatchSource // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetPatchBaselineMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetPatchBaselineMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetPatchBaseline{}, middleware.After) if err != nil { return err @@ -102,6 +116,13 @@ func addOperationGetPatchBaselineMiddlewares(stack *middleware.Stack, options Op if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetPatchBaseline"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -120,16 +141,13 @@ func addOperationGetPatchBaselineMiddlewares(stack *middleware.Stack, options Op if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -138,12 +156,18 @@ func addOperationGetPatchBaselineMiddlewares(stack *middleware.Stack, options Op if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpGetPatchBaselineValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPatchBaseline(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -153,6 +177,9 @@ func addOperationGetPatchBaselineMiddlewares(stack *middleware.Stack, options Op if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -160,7 +187,6 @@ func newServiceMetadataMiddleware_opGetPatchBaseline(region string) *awsmiddlewa return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "GetPatchBaseline", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetPatchBaselineForPatchGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetPatchBaselineForPatchGroup.go index 45e691fc..e78f1685 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetPatchBaselineForPatchGroup.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetPatchBaselineForPatchGroup.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -17,7 +18,7 @@ func (c *Client) GetPatchBaselineForPatchGroup(ctx context.Context, params *GetP params = &GetPatchBaselineForPatchGroupInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetPatchBaselineForPatchGroup", params, optFns, addOperationGetPatchBaselineForPatchGroupMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetPatchBaselineForPatchGroup", params, optFns, c.addOperationGetPatchBaselineForPatchGroupMiddlewares) if err != nil { return nil, err } @@ -34,9 +35,11 @@ type GetPatchBaselineForPatchGroupInput struct { // This member is required. PatchGroup *string - // Returns he operating system rule specified for patch groups using the patch + // Returns the operating system rule specified for patch groups using the patch // baseline. OperatingSystem types.OperatingSystem + + noSmithyDocumentSerde } type GetPatchBaselineForPatchGroupOutput struct { @@ -52,9 +55,14 @@ type GetPatchBaselineForPatchGroupOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetPatchBaselineForPatchGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetPatchBaselineForPatchGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetPatchBaselineForPatchGroup{}, middleware.After) if err != nil { return err @@ -63,6 +71,13 @@ func addOperationGetPatchBaselineForPatchGroupMiddlewares(stack *middleware.Stac if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetPatchBaselineForPatchGroup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -81,16 +96,13 @@ func addOperationGetPatchBaselineForPatchGroupMiddlewares(stack *middleware.Stac if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -99,12 +111,18 @@ func addOperationGetPatchBaselineForPatchGroupMiddlewares(stack *middleware.Stac if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpGetPatchBaselineForPatchGroupValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPatchBaselineForPatchGroup(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -114,6 +132,9 @@ func addOperationGetPatchBaselineForPatchGroupMiddlewares(stack *middleware.Stac if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -121,7 +142,6 @@ func newServiceMetadataMiddleware_opGetPatchBaselineForPatchGroup(region string) return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "GetPatchBaselineForPatchGroup", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetResourcePolicies.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetResourcePolicies.go new file mode 100644 index 00000000..aead9276 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetResourcePolicies.go @@ -0,0 +1,240 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssm + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/ssm/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns an array of the Policy object. +func (c *Client) GetResourcePolicies(ctx context.Context, params *GetResourcePoliciesInput, optFns ...func(*Options)) (*GetResourcePoliciesOutput, error) { + if params == nil { + params = &GetResourcePoliciesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetResourcePolicies", params, optFns, c.addOperationGetResourcePoliciesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetResourcePoliciesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetResourcePoliciesInput struct { + + // Amazon Resource Name (ARN) of the resource to which the policies are attached. + // + // This member is required. + ResourceArn *string + + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + MaxResults *int32 + + // A token to start the list. Use this token to get the next set of results. + NextToken *string + + noSmithyDocumentSerde +} + +type GetResourcePoliciesOutput struct { + + // The token for the next set of items to return. Use this token to get the next + // set of results. + NextToken *string + + // An array of the Policy object. + Policies []types.GetResourcePoliciesResponseEntry + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetResourcePoliciesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetResourcePolicies{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetResourcePolicies{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetResourcePolicies"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpGetResourcePoliciesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetResourcePolicies(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// GetResourcePoliciesAPIClient is a client that implements the +// GetResourcePolicies operation. +type GetResourcePoliciesAPIClient interface { + GetResourcePolicies(context.Context, *GetResourcePoliciesInput, ...func(*Options)) (*GetResourcePoliciesOutput, error) +} + +var _ GetResourcePoliciesAPIClient = (*Client)(nil) + +// GetResourcePoliciesPaginatorOptions is the paginator options for +// GetResourcePolicies +type GetResourcePoliciesPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// GetResourcePoliciesPaginator is a paginator for GetResourcePolicies +type GetResourcePoliciesPaginator struct { + options GetResourcePoliciesPaginatorOptions + client GetResourcePoliciesAPIClient + params *GetResourcePoliciesInput + nextToken *string + firstPage bool +} + +// NewGetResourcePoliciesPaginator returns a new GetResourcePoliciesPaginator +func NewGetResourcePoliciesPaginator(client GetResourcePoliciesAPIClient, params *GetResourcePoliciesInput, optFns ...func(*GetResourcePoliciesPaginatorOptions)) *GetResourcePoliciesPaginator { + if params == nil { + params = &GetResourcePoliciesInput{} + } + + options := GetResourcePoliciesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &GetResourcePoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetResourcePoliciesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next GetResourcePolicies page. +func (p *GetResourcePoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetResourcePoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.GetResourcePolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opGetResourcePolicies(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetResourcePolicies", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetServiceSetting.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetServiceSetting.go index 31379d8e..3f8ec2db 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetServiceSetting.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_GetServiceSetting.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -11,25 +12,26 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// ServiceSetting is an account-level setting for an AWS service. This setting -// defines how a user interacts with or uses a service or a feature of a service. -// For example, if an AWS service charges money to the account based on feature or -// service usage, then the AWS service team might create a default setting of -// "false". This means the user can't use this feature unless they change the -// setting to "true" and intentionally opt in for a paid feature. Services map a -// SettingId object to a setting value. AWS services teams define the default value -// for a SettingId. You can't create a new SettingId, but you can overwrite the -// default value if you have the ssm:UpdateServiceSetting permission for the -// setting. Use the UpdateServiceSetting API action to change the default setting. -// Or use the ResetServiceSetting to change the value back to the original value -// defined by the AWS service team. Query the current service setting for the -// account. +// ServiceSetting is an account-level setting for an Amazon Web Services service. +// This setting defines how a user interacts with or uses a service or a feature of +// a service. For example, if an Amazon Web Services service charges money to the +// account based on feature or service usage, then the Amazon Web Services service +// team might create a default setting of false . This means the user can't use +// this feature unless they change the setting to true and intentionally opt in +// for a paid feature. Services map a SettingId object to a setting value. Amazon +// Web Services services teams define the default value for a SettingId . You can't +// create a new SettingId , but you can overwrite the default value if you have the +// ssm:UpdateServiceSetting permission for the setting. Use the +// UpdateServiceSetting API operation to change the default setting. Or use the +// ResetServiceSetting to change the value back to the original value defined by +// the Amazon Web Services service team. Query the current service setting for the +// Amazon Web Services account. func (c *Client) GetServiceSetting(ctx context.Context, params *GetServiceSettingInput, optFns ...func(*Options)) (*GetServiceSettingOutput, error) { if params == nil { params = &GetServiceSettingInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetServiceSetting", params, optFns, addOperationGetServiceSettingMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetServiceSetting", params, optFns, c.addOperationGetServiceSettingMiddlewares) if err != nil { return nil, err } @@ -39,19 +41,27 @@ func (c *Client) GetServiceSetting(ctx context.Context, params *GetServiceSettin return out, nil } -// The request body of the GetServiceSetting API action. +// The request body of the GetServiceSetting API operation. type GetServiceSettingInput struct { - // The ID of the service setting to get. The setting ID can be - // /ssm/parameter-store/default-parameter-tier, - // /ssm/parameter-store/high-throughput-enabled, or - // /ssm/managed-instance/activation-tier. + // The ID of the service setting to get. The setting ID can be one of the + // following. + // - /ssm/managed-instance/default-ec2-instance-management-role + // - /ssm/automation/customer-script-log-destination + // - /ssm/automation/customer-script-log-group-name + // - /ssm/documents/console/public-sharing-permission + // - /ssm/managed-instance/activation-tier + // - /ssm/opsinsights/opscenter + // - /ssm/parameter-store/default-parameter-tier + // - /ssm/parameter-store/high-throughput-enabled // // This member is required. SettingId *string + + noSmithyDocumentSerde } -// The query result body of the GetServiceSetting API action. +// The query result body of the GetServiceSetting API operation. type GetServiceSettingOutput struct { // The query result of the current service setting. @@ -59,9 +69,14 @@ type GetServiceSettingOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetServiceSettingMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetServiceSettingMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetServiceSetting{}, middleware.After) if err != nil { return err @@ -70,6 +85,13 @@ func addOperationGetServiceSettingMiddlewares(stack *middleware.Stack, options O if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetServiceSetting"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -88,16 +110,13 @@ func addOperationGetServiceSettingMiddlewares(stack *middleware.Stack, options O if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -106,12 +125,18 @@ func addOperationGetServiceSettingMiddlewares(stack *middleware.Stack, options O if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpGetServiceSettingValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetServiceSetting(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -121,6 +146,9 @@ func addOperationGetServiceSettingMiddlewares(stack *middleware.Stack, options O if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -128,7 +156,6 @@ func newServiceMetadataMiddleware_opGetServiceSetting(region string) *awsmiddlew return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "GetServiceSetting", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_LabelParameterVersion.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_LabelParameterVersion.go index 4d962c30..32a9c5a2 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_LabelParameterVersion.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_LabelParameterVersion.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" @@ -11,45 +12,31 @@ import ( ) // A parameter label is a user-defined alias to help you manage different versions -// of a parameter. When you modify a parameter, Systems Manager automatically saves -// a new version and increments the version number by one. A label can help you -// remember the purpose of a parameter when there are multiple versions. Parameter -// labels have the following requirements and restrictions. -// -// * A version of a -// parameter can have a maximum of 10 labels. -// -// * You can't attach the same label to -// different versions of the same parameter. For example, if version 1 has the -// label Production, then you can't attach Production to version 2. -// -// * You can move -// a label from one version of a parameter to another. -// -// * You can't create a label -// when you create a new parameter. You must attach a label to a specific version -// of a parameter. -// -// * You can't delete a parameter label. If you no longer want to -// use a parameter label, then you must move it to a different version of a -// parameter. -// -// * A label can have a maximum of 100 characters. -// -// * Labels can -// contain letters (case sensitive), numbers, periods (.), hyphens (-), or -// underscores (_). -// -// * Labels can't begin with a number, "aws," or "ssm" (not case -// sensitive). If a label fails to meet these requirements, then the label is not -// associated with a parameter and the system displays it in the list of -// InvalidLabels. +// of a parameter. When you modify a parameter, Amazon Web Services Systems Manager +// automatically saves a new version and increments the version number by one. A +// label can help you remember the purpose of a parameter when there are multiple +// versions. Parameter labels have the following requirements and restrictions. +// - A version of a parameter can have a maximum of 10 labels. +// - You can't attach the same label to different versions of the same +// parameter. For example, if version 1 has the label Production, then you can't +// attach Production to version 2. +// - You can move a label from one version of a parameter to another. +// - You can't create a label when you create a new parameter. You must attach a +// label to a specific version of a parameter. +// - If you no longer want to use a parameter label, then you can either delete +// it or move it to a different version of a parameter. +// - A label can have a maximum of 100 characters. +// - Labels can contain letters (case sensitive), numbers, periods (.), hyphens +// (-), or underscores (_). +// - Labels can't begin with a number, " aws " or " ssm " (not case sensitive). +// If a label fails to meet these requirements, then the label isn't associated +// with a parameter and the system displays it in the list of InvalidLabels. func (c *Client) LabelParameterVersion(ctx context.Context, params *LabelParameterVersionInput, optFns ...func(*Options)) (*LabelParameterVersionOutput, error) { if params == nil { params = &LabelParameterVersionInput{} } - result, metadata, err := c.invokeOperation(ctx, "LabelParameterVersion", params, optFns, addOperationLabelParameterVersionMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "LabelParameterVersion", params, optFns, c.addOperationLabelParameterVersionMiddlewares) if err != nil { return nil, err } @@ -74,15 +61,16 @@ type LabelParameterVersionInput struct { // The specific version of the parameter on which you want to attach one or more // labels. If no version is specified, the system attaches the label to the latest // version. - ParameterVersion int64 + ParameterVersion *int64 + + noSmithyDocumentSerde } type LabelParameterVersionOutput struct { - // The label does not meet the requirements. For information about parameter label - // requirements, see Labeling parameters - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-labels.html) - // in the AWS Systems Manager User Guide. + // The label doesn't meet the requirements. For information about parameter label + // requirements, see Labeling parameters (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-labels.html) + // in the Amazon Web Services Systems Manager User Guide. InvalidLabels []string // The version of the parameter that has been labeled. @@ -90,9 +78,14 @@ type LabelParameterVersionOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationLabelParameterVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationLabelParameterVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpLabelParameterVersion{}, middleware.After) if err != nil { return err @@ -101,6 +94,13 @@ func addOperationLabelParameterVersionMiddlewares(stack *middleware.Stack, optio if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "LabelParameterVersion"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -119,16 +119,13 @@ func addOperationLabelParameterVersionMiddlewares(stack *middleware.Stack, optio if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -137,12 +134,18 @@ func addOperationLabelParameterVersionMiddlewares(stack *middleware.Stack, optio if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpLabelParameterVersionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opLabelParameterVersion(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -152,6 +155,9 @@ func addOperationLabelParameterVersionMiddlewares(stack *middleware.Stack, optio if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -159,7 +165,6 @@ func newServiceMetadataMiddleware_opLabelParameterVersion(region string) *awsmid return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "LabelParameterVersion", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListAssociationVersions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListAssociationVersions.go index d8de4d0f..4ab028ef 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListAssociationVersions.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListAssociationVersions.go @@ -18,7 +18,7 @@ func (c *Client) ListAssociationVersions(ctx context.Context, params *ListAssoci params = &ListAssociationVersionsInput{} } - result, metadata, err := c.invokeOperation(ctx, "ListAssociationVersions", params, optFns, addOperationListAssociationVersionsMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "ListAssociationVersions", params, optFns, c.addOperationListAssociationVersionsMiddlewares) if err != nil { return nil, err } @@ -37,10 +37,12 @@ type ListAssociationVersionsInput struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // A token to start the list. Use this token to get the next set of results. NextToken *string + + noSmithyDocumentSerde } type ListAssociationVersionsOutput struct { @@ -55,9 +57,14 @@ type ListAssociationVersionsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationListAssociationVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationListAssociationVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpListAssociationVersions{}, middleware.After) if err != nil { return err @@ -66,6 +73,13 @@ func addOperationListAssociationVersionsMiddlewares(stack *middleware.Stack, opt if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListAssociationVersions"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -84,16 +98,13 @@ func addOperationListAssociationVersionsMiddlewares(stack *middleware.Stack, opt if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -102,12 +113,18 @@ func addOperationListAssociationVersionsMiddlewares(stack *middleware.Stack, opt if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpListAssociationVersionsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAssociationVersions(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -117,6 +134,9 @@ func addOperationListAssociationVersionsMiddlewares(stack *middleware.Stack, opt if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -152,30 +172,31 @@ type ListAssociationVersionsPaginator struct { // NewListAssociationVersionsPaginator returns a new // ListAssociationVersionsPaginator func NewListAssociationVersionsPaginator(client ListAssociationVersionsAPIClient, params *ListAssociationVersionsInput, optFns ...func(*ListAssociationVersionsPaginatorOptions)) *ListAssociationVersionsPaginator { + if params == nil { + params = &ListAssociationVersionsInput{} + } + options := ListAssociationVersionsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &ListAssociationVersionsInput{} - } - return &ListAssociationVersionsPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListAssociationVersionsPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListAssociationVersions page. @@ -187,7 +208,11 @@ func (p *ListAssociationVersionsPaginator) NextPage(ctx context.Context, optFns params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListAssociationVersions(ctx, ¶ms, optFns...) if err != nil { @@ -198,7 +223,10 @@ func (p *ListAssociationVersionsPaginator) NextPage(ctx context.Context, optFns prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -209,7 +237,6 @@ func newServiceMetadataMiddleware_opListAssociationVersions(region string) *awsm return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "ListAssociationVersions", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListAssociations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListAssociations.go index 7c737e2b..e9224d67 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListAssociations.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListAssociations.go @@ -12,15 +12,16 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns all State Manager associations in the current AWS account and Region. -// You can limit the results to a specific State Manager association document or -// instance by specifying a filter. +// Returns all State Manager associations in the current Amazon Web Services +// account and Amazon Web Services Region. You can limit the results to a specific +// State Manager association document or managed node by specifying a filter. State +// Manager is a capability of Amazon Web Services Systems Manager. func (c *Client) ListAssociations(ctx context.Context, params *ListAssociationsInput, optFns ...func(*Options)) (*ListAssociationsOutput, error) { if params == nil { params = &ListAssociationsInput{} } - result, metadata, err := c.invokeOperation(ctx, "ListAssociations", params, optFns, addOperationListAssociationsMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "ListAssociations", params, optFns, c.addOperationListAssociationsMiddlewares) if err != nil { return nil, err } @@ -35,17 +36,19 @@ type ListAssociationsInput struct { // One or more filters. Use a filter to return a more specific list of results. // Filtering associations using the InstanceID attribute only returns legacy // associations created using the InstanceID attribute. Associations targeting the - // instance that are part of the Target Attributes ResourceGroup or Tags are not - // returned. + // managed node that are part of the Target Attributes ResourceGroup or Tags + // aren't returned. AssociationFilterList []types.AssociationFilter // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string + + noSmithyDocumentSerde } type ListAssociationsOutput struct { @@ -59,9 +62,14 @@ type ListAssociationsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationListAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationListAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpListAssociations{}, middleware.After) if err != nil { return err @@ -70,6 +78,13 @@ func addOperationListAssociationsMiddlewares(stack *middleware.Stack, options Op if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListAssociations"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -88,16 +103,13 @@ func addOperationListAssociationsMiddlewares(stack *middleware.Stack, options Op if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -106,12 +118,18 @@ func addOperationListAssociationsMiddlewares(stack *middleware.Stack, options Op if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpListAssociationsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAssociations(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -121,6 +139,9 @@ func addOperationListAssociationsMiddlewares(stack *middleware.Stack, options Op if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -154,30 +175,31 @@ type ListAssociationsPaginator struct { // NewListAssociationsPaginator returns a new ListAssociationsPaginator func NewListAssociationsPaginator(client ListAssociationsAPIClient, params *ListAssociationsInput, optFns ...func(*ListAssociationsPaginatorOptions)) *ListAssociationsPaginator { + if params == nil { + params = &ListAssociationsInput{} + } + options := ListAssociationsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &ListAssociationsInput{} - } - return &ListAssociationsPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListAssociationsPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListAssociations page. @@ -189,7 +211,11 @@ func (p *ListAssociationsPaginator) NextPage(ctx context.Context, optFns ...func params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListAssociations(ctx, ¶ms, optFns...) if err != nil { @@ -200,7 +226,10 @@ func (p *ListAssociationsPaginator) NextPage(ctx context.Context, optFns ...func prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -211,7 +240,6 @@ func newServiceMetadataMiddleware_opListAssociations(region string) *awsmiddlewa return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "ListAssociations", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListCommandInvocations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListCommandInvocations.go index 2e9c5afe..26d062db 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListCommandInvocations.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListCommandInvocations.go @@ -12,17 +12,17 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// An invocation is copy of a command sent to a specific instance. A command can -// apply to one or more instances. A command invocation applies to one instance. -// For example, if a user runs SendCommand against three instances, then a command -// invocation is created for each requested instance ID. ListCommandInvocations -// provide status about command execution. +// An invocation is copy of a command sent to a specific managed node. A command +// can apply to one or more managed nodes. A command invocation applies to one +// managed node. For example, if a user runs SendCommand against three managed +// nodes, then a command invocation is created for each requested managed node ID. +// ListCommandInvocations provide status about command execution. func (c *Client) ListCommandInvocations(ctx context.Context, params *ListCommandInvocationsInput, optFns ...func(*Options)) (*ListCommandInvocationsOutput, error) { if params == nil { params = &ListCommandInvocationsInput{} } - result, metadata, err := c.invokeOperation(ctx, "ListCommandInvocations", params, optFns, addOperationListCommandInvocationsMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "ListCommandInvocations", params, optFns, c.addOperationListCommandInvocationsMiddlewares) if err != nil { return nil, err } @@ -38,24 +38,26 @@ type ListCommandInvocationsInput struct { CommandId *string // (Optional) If set this returns the response of the command executions and any - // command output. By default this is set to False. + // command output. The default value is false . Details bool // (Optional) One or more filters. Use a filter to return a more specific list of // results. Filters []types.CommandFilter - // (Optional) The command execution details for a specific instance ID. + // (Optional) The command execution details for a specific managed node ID. InstanceId *string // (Optional) The maximum number of items to return for this call. The call also // returns a token that you can specify in a subsequent call to get the next set of // results. - MaxResults int32 + MaxResults *int32 // (Optional) The token for the next set of items to return. (You received this // token from a previous call.) NextToken *string + + noSmithyDocumentSerde } type ListCommandInvocationsOutput struct { @@ -69,9 +71,14 @@ type ListCommandInvocationsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationListCommandInvocationsMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationListCommandInvocationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpListCommandInvocations{}, middleware.After) if err != nil { return err @@ -80,6 +87,13 @@ func addOperationListCommandInvocationsMiddlewares(stack *middleware.Stack, opti if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListCommandInvocations"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -98,16 +112,13 @@ func addOperationListCommandInvocationsMiddlewares(stack *middleware.Stack, opti if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -116,12 +127,18 @@ func addOperationListCommandInvocationsMiddlewares(stack *middleware.Stack, opti if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpListCommandInvocationsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCommandInvocations(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -131,6 +148,9 @@ func addOperationListCommandInvocationsMiddlewares(stack *middleware.Stack, opti if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -166,30 +186,31 @@ type ListCommandInvocationsPaginator struct { // NewListCommandInvocationsPaginator returns a new ListCommandInvocationsPaginator func NewListCommandInvocationsPaginator(client ListCommandInvocationsAPIClient, params *ListCommandInvocationsInput, optFns ...func(*ListCommandInvocationsPaginatorOptions)) *ListCommandInvocationsPaginator { + if params == nil { + params = &ListCommandInvocationsInput{} + } + options := ListCommandInvocationsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &ListCommandInvocationsInput{} - } - return &ListCommandInvocationsPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListCommandInvocationsPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListCommandInvocations page. @@ -201,7 +222,11 @@ func (p *ListCommandInvocationsPaginator) NextPage(ctx context.Context, optFns . params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListCommandInvocations(ctx, ¶ms, optFns...) if err != nil { @@ -212,7 +237,10 @@ func (p *ListCommandInvocationsPaginator) NextPage(ctx context.Context, optFns . prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -223,7 +251,6 @@ func newServiceMetadataMiddleware_opListCommandInvocations(region string) *awsmi return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "ListCommandInvocations", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListCommands.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListCommands.go index 67ae7278..78af4046 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListCommands.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListCommands.go @@ -12,13 +12,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the commands requested by users of the AWS account. +// Lists the commands requested by users of the Amazon Web Services account. func (c *Client) ListCommands(ctx context.Context, params *ListCommandsInput, optFns ...func(*Options)) (*ListCommandsOutput, error) { if params == nil { params = &ListCommandsInput{} } - result, metadata, err := c.invokeOperation(ctx, "ListCommands", params, optFns, addOperationListCommandsMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "ListCommands", params, optFns, c.addOperationListCommandsMiddlewares) if err != nil { return nil, err } @@ -37,19 +37,21 @@ type ListCommandsInput struct { // results. Filters []types.CommandFilter - // (Optional) Lists commands issued against this instance ID. You can't specify an - // instance ID in the same command that you specify Status = Pending. This is - // because the command has not reached the instance yet. + // (Optional) Lists commands issued against this managed node ID. You can't + // specify a managed node ID in the same command that you specify Status = Pending + // . This is because the command hasn't reached the managed node yet. InstanceId *string // (Optional) The maximum number of items to return for this call. The call also // returns a token that you can specify in a subsequent call to get the next set of // results. - MaxResults int32 + MaxResults *int32 // (Optional) The token for the next set of items to return. (You received this // token from a previous call.) NextToken *string + + noSmithyDocumentSerde } type ListCommandsOutput struct { @@ -63,9 +65,14 @@ type ListCommandsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationListCommandsMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationListCommandsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpListCommands{}, middleware.After) if err != nil { return err @@ -74,6 +81,13 @@ func addOperationListCommandsMiddlewares(stack *middleware.Stack, options Option if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListCommands"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -92,16 +106,13 @@ func addOperationListCommandsMiddlewares(stack *middleware.Stack, options Option if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -110,12 +121,18 @@ func addOperationListCommandsMiddlewares(stack *middleware.Stack, options Option if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpListCommandsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCommands(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -125,6 +142,9 @@ func addOperationListCommandsMiddlewares(stack *middleware.Stack, options Option if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -158,30 +178,31 @@ type ListCommandsPaginator struct { // NewListCommandsPaginator returns a new ListCommandsPaginator func NewListCommandsPaginator(client ListCommandsAPIClient, params *ListCommandsInput, optFns ...func(*ListCommandsPaginatorOptions)) *ListCommandsPaginator { + if params == nil { + params = &ListCommandsInput{} + } + options := ListCommandsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &ListCommandsInput{} - } - return &ListCommandsPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListCommandsPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListCommands page. @@ -193,7 +214,11 @@ func (p *ListCommandsPaginator) NextPage(ctx context.Context, optFns ...func(*Op params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListCommands(ctx, ¶ms, optFns...) if err != nil { @@ -204,7 +229,10 @@ func (p *ListCommandsPaginator) NextPage(ctx context.Context, optFns ...func(*Op prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -215,7 +243,6 @@ func newServiceMetadataMiddleware_opListCommands(region string) *awsmiddleware.R return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "ListCommands", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListComplianceItems.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListComplianceItems.go index b0a5e1af..c0daf817 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListComplianceItems.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListComplianceItems.go @@ -12,7 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// For a specified resource ID, this API action returns a list of compliance +// For a specified resource ID, this API operation returns a list of compliance // statuses for different resource types. Currently, you can only specify one // resource ID per call. List results depend on the criteria specified in the // filter. @@ -21,7 +21,7 @@ func (c *Client) ListComplianceItems(ctx context.Context, params *ListCompliance params = &ListComplianceItemsInput{} } - result, metadata, err := c.invokeOperation(ctx, "ListComplianceItems", params, optFns, addOperationListComplianceItemsMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "ListComplianceItems", params, optFns, c.addOperationListComplianceItemsMiddlewares) if err != nil { return nil, err } @@ -39,7 +39,7 @@ type ListComplianceItemsInput struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // A token to start the list. Use this token to get the next set of results. NextToken *string @@ -49,8 +49,10 @@ type ListComplianceItemsInput struct { ResourceIds []string // The type of resource from which to get compliance information. Currently, the - // only supported resource type is ManagedInstance. + // only supported resource type is ManagedInstance . ResourceTypes []string + + noSmithyDocumentSerde } type ListComplianceItemsOutput struct { @@ -64,9 +66,14 @@ type ListComplianceItemsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationListComplianceItemsMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationListComplianceItemsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpListComplianceItems{}, middleware.After) if err != nil { return err @@ -75,6 +82,13 @@ func addOperationListComplianceItemsMiddlewares(stack *middleware.Stack, options if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListComplianceItems"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -93,16 +107,13 @@ func addOperationListComplianceItemsMiddlewares(stack *middleware.Stack, options if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -111,9 +122,15 @@ func addOperationListComplianceItemsMiddlewares(stack *middleware.Stack, options if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListComplianceItems(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -123,11 +140,14 @@ func addOperationListComplianceItemsMiddlewares(stack *middleware.Stack, options if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } -// ListComplianceItemsAPIClient is a client that implements the ListComplianceItems -// operation. +// ListComplianceItemsAPIClient is a client that implements the +// ListComplianceItems operation. type ListComplianceItemsAPIClient interface { ListComplianceItems(context.Context, *ListComplianceItemsInput, ...func(*Options)) (*ListComplianceItemsOutput, error) } @@ -157,30 +177,31 @@ type ListComplianceItemsPaginator struct { // NewListComplianceItemsPaginator returns a new ListComplianceItemsPaginator func NewListComplianceItemsPaginator(client ListComplianceItemsAPIClient, params *ListComplianceItemsInput, optFns ...func(*ListComplianceItemsPaginatorOptions)) *ListComplianceItemsPaginator { + if params == nil { + params = &ListComplianceItemsInput{} + } + options := ListComplianceItemsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &ListComplianceItemsInput{} - } - return &ListComplianceItemsPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListComplianceItemsPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListComplianceItems page. @@ -192,7 +213,11 @@ func (p *ListComplianceItemsPaginator) NextPage(ctx context.Context, optFns ...f params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListComplianceItems(ctx, ¶ms, optFns...) if err != nil { @@ -203,7 +228,10 @@ func (p *ListComplianceItemsPaginator) NextPage(ctx context.Context, optFns ...f prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -214,7 +242,6 @@ func newServiceMetadataMiddleware_opListComplianceItems(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "ListComplianceItems", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListComplianceSummaries.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListComplianceSummaries.go index 53979204..c302842e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListComplianceSummaries.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListComplianceSummaries.go @@ -21,7 +21,7 @@ func (c *Client) ListComplianceSummaries(ctx context.Context, params *ListCompli params = &ListComplianceSummariesInput{} } - result, metadata, err := c.invokeOperation(ctx, "ListComplianceSummaries", params, optFns, addOperationListComplianceSummariesMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "ListComplianceSummaries", params, optFns, c.addOperationListComplianceSummariesMiddlewares) if err != nil { return nil, err } @@ -40,10 +40,12 @@ type ListComplianceSummariesInput struct { // The maximum number of items to return for this call. Currently, you can specify // null or 50. The call also returns a token that you can specify in a subsequent // call to get the next set of results. - MaxResults int32 + MaxResults *int32 // A token to start the list. Use this token to get the next set of results. NextToken *string + + noSmithyDocumentSerde } type ListComplianceSummariesOutput struct { @@ -59,9 +61,14 @@ type ListComplianceSummariesOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationListComplianceSummariesMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationListComplianceSummariesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpListComplianceSummaries{}, middleware.After) if err != nil { return err @@ -70,6 +77,13 @@ func addOperationListComplianceSummariesMiddlewares(stack *middleware.Stack, opt if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListComplianceSummaries"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -88,16 +102,13 @@ func addOperationListComplianceSummariesMiddlewares(stack *middleware.Stack, opt if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -106,9 +117,15 @@ func addOperationListComplianceSummariesMiddlewares(stack *middleware.Stack, opt if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListComplianceSummaries(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -118,6 +135,9 @@ func addOperationListComplianceSummariesMiddlewares(stack *middleware.Stack, opt if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -154,30 +174,31 @@ type ListComplianceSummariesPaginator struct { // NewListComplianceSummariesPaginator returns a new // ListComplianceSummariesPaginator func NewListComplianceSummariesPaginator(client ListComplianceSummariesAPIClient, params *ListComplianceSummariesInput, optFns ...func(*ListComplianceSummariesPaginatorOptions)) *ListComplianceSummariesPaginator { + if params == nil { + params = &ListComplianceSummariesInput{} + } + options := ListComplianceSummariesPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &ListComplianceSummariesInput{} - } - return &ListComplianceSummariesPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListComplianceSummariesPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListComplianceSummaries page. @@ -189,7 +210,11 @@ func (p *ListComplianceSummariesPaginator) NextPage(ctx context.Context, optFns params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListComplianceSummaries(ctx, ¶ms, optFns...) if err != nil { @@ -200,7 +225,10 @@ func (p *ListComplianceSummariesPaginator) NextPage(ctx context.Context, optFns prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -211,7 +239,6 @@ func newServiceMetadataMiddleware_opListComplianceSummaries(region string) *awsm return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "ListComplianceSummaries", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListDocumentMetadataHistory.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListDocumentMetadataHistory.go index e327fdae..75303eb3 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListDocumentMetadataHistory.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListDocumentMetadataHistory.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -11,13 +12,14 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Information about approval reviews for a version of an SSM document. +// Information about approval reviews for a version of a change template in Change +// Manager. func (c *Client) ListDocumentMetadataHistory(ctx context.Context, params *ListDocumentMetadataHistoryInput, optFns ...func(*Options)) (*ListDocumentMetadataHistoryOutput, error) { if params == nil { params = &ListDocumentMetadataHistoryInput{} } - result, metadata, err := c.invokeOperation(ctx, "ListDocumentMetadataHistory", params, optFns, addOperationListDocumentMetadataHistoryMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "ListDocumentMetadataHistory", params, optFns, c.addOperationListDocumentMetadataHistoryMiddlewares) if err != nil { return nil, err } @@ -30,40 +32,43 @@ func (c *Client) ListDocumentMetadataHistory(ctx context.Context, params *ListDo type ListDocumentMetadataHistoryInput struct { // The type of data for which details are being requested. Currently, the only - // supported value is DocumentReviews. + // supported value is DocumentReviews . // // This member is required. Metadata types.DocumentMetadataEnum - // The name of the document. + // The name of the change template. // // This member is required. Name *string - // The version of the document. + // The version of the change template. DocumentVersion *string // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string + + noSmithyDocumentSerde } type ListDocumentMetadataHistoryOutput struct { - // The user ID of the person in the organization who requested the document review. + // The user ID of the person in the organization who requested the review of the + // change template. Author *string - // The version of the document. + // The version of the change template. DocumentVersion *string - // Information about the response to the document approval request. + // Information about the response to the change template approval request. Metadata *types.DocumentMetadataResponseInfo - // The name of the document. + // The name of the change template. Name *string // The maximum number of items to return for this call. The call also returns a @@ -72,9 +77,14 @@ type ListDocumentMetadataHistoryOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationListDocumentMetadataHistoryMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationListDocumentMetadataHistoryMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpListDocumentMetadataHistory{}, middleware.After) if err != nil { return err @@ -83,6 +93,13 @@ func addOperationListDocumentMetadataHistoryMiddlewares(stack *middleware.Stack, if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListDocumentMetadataHistory"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -101,16 +118,13 @@ func addOperationListDocumentMetadataHistoryMiddlewares(stack *middleware.Stack, if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -119,12 +133,18 @@ func addOperationListDocumentMetadataHistoryMiddlewares(stack *middleware.Stack, if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpListDocumentMetadataHistoryValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDocumentMetadataHistory(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -134,6 +154,9 @@ func addOperationListDocumentMetadataHistoryMiddlewares(stack *middleware.Stack, if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -141,7 +164,6 @@ func newServiceMetadataMiddleware_opListDocumentMetadataHistory(region string) * return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "ListDocumentMetadataHistory", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListDocumentVersions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListDocumentVersions.go index 8dca950d..72afe4fc 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListDocumentVersions.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListDocumentVersions.go @@ -18,7 +18,7 @@ func (c *Client) ListDocumentVersions(ctx context.Context, params *ListDocumentV params = &ListDocumentVersionsInput{} } - result, metadata, err := c.invokeOperation(ctx, "ListDocumentVersions", params, optFns, addOperationListDocumentVersionsMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "ListDocumentVersions", params, optFns, c.addOperationListDocumentVersionsMiddlewares) if err != nil { return nil, err } @@ -37,11 +37,13 @@ type ListDocumentVersionsInput struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string + + noSmithyDocumentSerde } type ListDocumentVersionsOutput struct { @@ -55,9 +57,14 @@ type ListDocumentVersionsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationListDocumentVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationListDocumentVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpListDocumentVersions{}, middleware.After) if err != nil { return err @@ -66,6 +73,13 @@ func addOperationListDocumentVersionsMiddlewares(stack *middleware.Stack, option if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListDocumentVersions"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -84,16 +98,13 @@ func addOperationListDocumentVersionsMiddlewares(stack *middleware.Stack, option if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -102,12 +113,18 @@ func addOperationListDocumentVersionsMiddlewares(stack *middleware.Stack, option if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpListDocumentVersionsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDocumentVersions(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -117,6 +134,9 @@ func addOperationListDocumentVersionsMiddlewares(stack *middleware.Stack, option if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -151,30 +171,31 @@ type ListDocumentVersionsPaginator struct { // NewListDocumentVersionsPaginator returns a new ListDocumentVersionsPaginator func NewListDocumentVersionsPaginator(client ListDocumentVersionsAPIClient, params *ListDocumentVersionsInput, optFns ...func(*ListDocumentVersionsPaginatorOptions)) *ListDocumentVersionsPaginator { + if params == nil { + params = &ListDocumentVersionsInput{} + } + options := ListDocumentVersionsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &ListDocumentVersionsInput{} - } - return &ListDocumentVersionsPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListDocumentVersionsPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListDocumentVersions page. @@ -186,7 +207,11 @@ func (p *ListDocumentVersionsPaginator) NextPage(ctx context.Context, optFns ... params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListDocumentVersions(ctx, ¶ms, optFns...) if err != nil { @@ -197,7 +222,10 @@ func (p *ListDocumentVersionsPaginator) NextPage(ctx context.Context, optFns ... prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -208,7 +236,6 @@ func newServiceMetadataMiddleware_opListDocumentVersions(region string) *awsmidd return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "ListDocumentVersions", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListDocuments.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListDocuments.go index 76e4f774..0d137fe6 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListDocuments.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListDocuments.go @@ -12,14 +12,15 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns all Systems Manager (SSM) documents in the current AWS account and -// Region. You can limit the results of this request by using a filter. +// Returns all Systems Manager (SSM) documents in the current Amazon Web Services +// account and Amazon Web Services Region. You can limit the results of this +// request by using a filter. func (c *Client) ListDocuments(ctx context.Context, params *ListDocumentsInput, optFns ...func(*Options)) (*ListDocumentsOutput, error) { if params == nil { params = &ListDocumentsInput{} } - result, metadata, err := c.invokeOperation(ctx, "ListDocuments", params, optFns, addOperationListDocumentsMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "ListDocuments", params, optFns, c.addOperationListDocumentsMiddlewares) if err != nil { return nil, err } @@ -31,29 +32,33 @@ func (c *Client) ListDocuments(ctx context.Context, params *ListDocumentsInput, type ListDocumentsInput struct { - // This data type is deprecated. Instead, use Filters. + // This data type is deprecated. Instead, use Filters . DocumentFilterList []types.DocumentFilter // One or more DocumentKeyValuesFilter objects. Use a filter to return a more // specific list of results. For keys, you can specify one or more key-value pair - // tags that have been applied to a document. Other valid keys include Owner, Name, - // PlatformTypes, DocumentType, and TargetType. For example, to return documents - // you own use Key=Owner,Values=Self. To specify a custom key-value pair, use the - // format Key=tag:tagName,Values=valueName. + // tags that have been applied to a document. Other valid keys include Owner , Name + // , PlatformTypes , DocumentType , and TargetType . For example, to return + // documents you own use Key=Owner,Values=Self . To specify a custom key-value + // pair, use the format Key=tag:tagName,Values=valueName . This API operation only + // supports filtering documents by using a single tag key and one or more tag + // values. For example: Key=tag:tagName,Values=valueName1,valueName2 Filters []types.DocumentKeyValuesFilter // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string + + noSmithyDocumentSerde } type ListDocumentsOutput struct { - // The names of the Systems Manager documents. + // The names of the SSM documents. DocumentIdentifiers []types.DocumentIdentifier // The token to use when requesting the next set of items. If there are no @@ -62,9 +67,14 @@ type ListDocumentsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationListDocumentsMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationListDocumentsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpListDocuments{}, middleware.After) if err != nil { return err @@ -73,6 +83,13 @@ func addOperationListDocumentsMiddlewares(stack *middleware.Stack, options Optio if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListDocuments"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -91,16 +108,13 @@ func addOperationListDocumentsMiddlewares(stack *middleware.Stack, options Optio if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -109,12 +123,18 @@ func addOperationListDocumentsMiddlewares(stack *middleware.Stack, options Optio if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpListDocumentsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDocuments(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -124,6 +144,9 @@ func addOperationListDocumentsMiddlewares(stack *middleware.Stack, options Optio if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -156,30 +179,31 @@ type ListDocumentsPaginator struct { // NewListDocumentsPaginator returns a new ListDocumentsPaginator func NewListDocumentsPaginator(client ListDocumentsAPIClient, params *ListDocumentsInput, optFns ...func(*ListDocumentsPaginatorOptions)) *ListDocumentsPaginator { + if params == nil { + params = &ListDocumentsInput{} + } + options := ListDocumentsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &ListDocumentsInput{} - } - return &ListDocumentsPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListDocumentsPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListDocuments page. @@ -191,7 +215,11 @@ func (p *ListDocumentsPaginator) NextPage(ctx context.Context, optFns ...func(*O params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListDocuments(ctx, ¶ms, optFns...) if err != nil { @@ -202,7 +230,10 @@ func (p *ListDocumentsPaginator) NextPage(ctx context.Context, optFns ...func(*O prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -213,7 +244,6 @@ func newServiceMetadataMiddleware_opListDocuments(region string) *awsmiddleware. return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "ListDocuments", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListInventoryEntries.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListInventoryEntries.go index 3d8b15e1..8589e481 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListInventoryEntries.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListInventoryEntries.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -17,7 +18,7 @@ func (c *Client) ListInventoryEntries(ctx context.Context, params *ListInventory params = &ListInventoryEntriesInput{} } - result, metadata, err := c.invokeOperation(ctx, "ListInventoryEntries", params, optFns, addOperationListInventoryEntriesMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "ListInventoryEntries", params, optFns, c.addOperationListInventoryEntriesMiddlewares) if err != nil { return nil, err } @@ -29,7 +30,7 @@ func (c *Client) ListInventoryEntries(ctx context.Context, params *ListInventory type ListInventoryEntriesInput struct { - // The instance ID for which you want inventory information. + // The managed node ID for which you want inventory information. // // This member is required. InstanceId *string @@ -44,29 +45,31 @@ type ListInventoryEntriesInput struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // The token for the next set of items to return. (You received this token from a // previous call.) NextToken *string + + noSmithyDocumentSerde } type ListInventoryEntriesOutput struct { - // The time that inventory information was collected for the instance(s). + // The time that inventory information was collected for the managed node(s). CaptureTime *string - // A list of inventory items on the instance(s). + // A list of inventory items on the managed node(s). Entries []map[string]string - // The instance ID targeted by the request to query inventory information. + // The managed node ID targeted by the request to query inventory information. InstanceId *string // The token to use when requesting the next set of items. If there are no // additional items to return, the string is empty. NextToken *string - // The inventory schema version used by the instance(s). + // The inventory schema version used by the managed node(s). SchemaVersion *string // The type of inventory item returned by the request. @@ -74,9 +77,14 @@ type ListInventoryEntriesOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationListInventoryEntriesMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationListInventoryEntriesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpListInventoryEntries{}, middleware.After) if err != nil { return err @@ -85,6 +93,13 @@ func addOperationListInventoryEntriesMiddlewares(stack *middleware.Stack, option if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListInventoryEntries"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -103,16 +118,13 @@ func addOperationListInventoryEntriesMiddlewares(stack *middleware.Stack, option if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -121,12 +133,18 @@ func addOperationListInventoryEntriesMiddlewares(stack *middleware.Stack, option if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpListInventoryEntriesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListInventoryEntries(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -136,6 +154,9 @@ func addOperationListInventoryEntriesMiddlewares(stack *middleware.Stack, option if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -143,7 +164,6 @@ func newServiceMetadataMiddleware_opListInventoryEntries(region string) *awsmidd return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "ListInventoryEntries", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListOpsItemEvents.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListOpsItemEvents.go index f7df7053..ee55b62b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListOpsItemEvents.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListOpsItemEvents.go @@ -12,15 +12,15 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns a list of all OpsItem events in the current AWS account and Region. You -// can limit the results to events associated with specific OpsItems by specifying -// a filter. +// Returns a list of all OpsItem events in the current Amazon Web Services Region +// and Amazon Web Services account. You can limit the results to events associated +// with specific OpsItems by specifying a filter. func (c *Client) ListOpsItemEvents(ctx context.Context, params *ListOpsItemEventsInput, optFns ...func(*Options)) (*ListOpsItemEventsOutput, error) { if params == nil { params = &ListOpsItemEventsInput{} } - result, metadata, err := c.invokeOperation(ctx, "ListOpsItemEvents", params, optFns, addOperationListOpsItemEventsMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "ListOpsItemEvents", params, optFns, c.addOperationListOpsItemEventsMiddlewares) if err != nil { return nil, err } @@ -42,6 +42,8 @@ type ListOpsItemEventsInput struct { // A token to start the list. Use this token to get the next set of results. NextToken *string + + noSmithyDocumentSerde } type ListOpsItemEventsOutput struct { @@ -55,9 +57,14 @@ type ListOpsItemEventsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationListOpsItemEventsMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationListOpsItemEventsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpListOpsItemEvents{}, middleware.After) if err != nil { return err @@ -66,6 +73,13 @@ func addOperationListOpsItemEventsMiddlewares(stack *middleware.Stack, options O if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListOpsItemEvents"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -84,16 +98,13 @@ func addOperationListOpsItemEventsMiddlewares(stack *middleware.Stack, options O if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -102,12 +113,18 @@ func addOperationListOpsItemEventsMiddlewares(stack *middleware.Stack, options O if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpListOpsItemEventsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListOpsItemEvents(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -117,6 +134,9 @@ func addOperationListOpsItemEventsMiddlewares(stack *middleware.Stack, options O if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -150,6 +170,10 @@ type ListOpsItemEventsPaginator struct { // NewListOpsItemEventsPaginator returns a new ListOpsItemEventsPaginator func NewListOpsItemEventsPaginator(client ListOpsItemEventsAPIClient, params *ListOpsItemEventsInput, optFns ...func(*ListOpsItemEventsPaginatorOptions)) *ListOpsItemEventsPaginator { + if params == nil { + params = &ListOpsItemEventsInput{} + } + options := ListOpsItemEventsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults @@ -159,21 +183,18 @@ func NewListOpsItemEventsPaginator(client ListOpsItemEventsAPIClient, params *Li fn(&options) } - if params == nil { - params = &ListOpsItemEventsInput{} - } - return &ListOpsItemEventsPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListOpsItemEventsPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListOpsItemEvents page. @@ -200,7 +221,10 @@ func (p *ListOpsItemEventsPaginator) NextPage(ctx context.Context, optFns ...fun prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -211,7 +235,6 @@ func newServiceMetadataMiddleware_opListOpsItemEvents(region string) *awsmiddlew return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "ListOpsItemEvents", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListOpsItemRelatedItems.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListOpsItemRelatedItems.go new file mode 100644 index 00000000..4c3819ee --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListOpsItemRelatedItems.go @@ -0,0 +1,245 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssm + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/ssm/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all related-item resources associated with a Systems Manager OpsCenter +// OpsItem. OpsCenter is a capability of Amazon Web Services Systems Manager. +func (c *Client) ListOpsItemRelatedItems(ctx context.Context, params *ListOpsItemRelatedItemsInput, optFns ...func(*Options)) (*ListOpsItemRelatedItemsOutput, error) { + if params == nil { + params = &ListOpsItemRelatedItemsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListOpsItemRelatedItems", params, optFns, c.addOperationListOpsItemRelatedItemsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListOpsItemRelatedItemsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListOpsItemRelatedItemsInput struct { + + // One or more OpsItem filters. Use a filter to return a more specific list of + // results. + Filters []types.OpsItemRelatedItemsFilter + + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + MaxResults *int32 + + // The token for the next set of items to return. (You received this token from a + // previous call.) + NextToken *string + + // The ID of the OpsItem for which you want to list all related-item resources. + OpsItemId *string + + noSmithyDocumentSerde +} + +type ListOpsItemRelatedItemsOutput struct { + + // The token for the next set of items to return. Use this token to get the next + // set of results. + NextToken *string + + // A list of related-item resources for the specified OpsItem. + Summaries []types.OpsItemRelatedItemSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListOpsItemRelatedItemsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListOpsItemRelatedItems{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListOpsItemRelatedItems{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListOpsItemRelatedItems"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpListOpsItemRelatedItemsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListOpsItemRelatedItems(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListOpsItemRelatedItemsAPIClient is a client that implements the +// ListOpsItemRelatedItems operation. +type ListOpsItemRelatedItemsAPIClient interface { + ListOpsItemRelatedItems(context.Context, *ListOpsItemRelatedItemsInput, ...func(*Options)) (*ListOpsItemRelatedItemsOutput, error) +} + +var _ ListOpsItemRelatedItemsAPIClient = (*Client)(nil) + +// ListOpsItemRelatedItemsPaginatorOptions is the paginator options for +// ListOpsItemRelatedItems +type ListOpsItemRelatedItemsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListOpsItemRelatedItemsPaginator is a paginator for ListOpsItemRelatedItems +type ListOpsItemRelatedItemsPaginator struct { + options ListOpsItemRelatedItemsPaginatorOptions + client ListOpsItemRelatedItemsAPIClient + params *ListOpsItemRelatedItemsInput + nextToken *string + firstPage bool +} + +// NewListOpsItemRelatedItemsPaginator returns a new +// ListOpsItemRelatedItemsPaginator +func NewListOpsItemRelatedItemsPaginator(client ListOpsItemRelatedItemsAPIClient, params *ListOpsItemRelatedItemsInput, optFns ...func(*ListOpsItemRelatedItemsPaginatorOptions)) *ListOpsItemRelatedItemsPaginator { + if params == nil { + params = &ListOpsItemRelatedItemsInput{} + } + + options := ListOpsItemRelatedItemsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListOpsItemRelatedItemsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOpsItemRelatedItemsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListOpsItemRelatedItems page. +func (p *ListOpsItemRelatedItemsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOpsItemRelatedItemsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListOpsItemRelatedItems(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListOpsItemRelatedItems(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListOpsItemRelatedItems", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListOpsMetadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListOpsMetadata.go index bc455a12..944fba37 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListOpsMetadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListOpsMetadata.go @@ -12,14 +12,14 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Systems Manager calls this API action when displaying all Application Manager -// OpsMetadata objects or blobs. +// Amazon Web Services Systems Manager calls this API operation when displaying +// all Application Manager OpsMetadata objects or blobs. func (c *Client) ListOpsMetadata(ctx context.Context, params *ListOpsMetadataInput, optFns ...func(*Options)) (*ListOpsMetadataOutput, error) { if params == nil { params = &ListOpsMetadataInput{} } - result, metadata, err := c.invokeOperation(ctx, "ListOpsMetadata", params, optFns, addOperationListOpsMetadataMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "ListOpsMetadata", params, optFns, c.addOperationListOpsMetadataMiddlewares) if err != nil { return nil, err } @@ -37,10 +37,12 @@ type ListOpsMetadataInput struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // A token to start the list. Use this token to get the next set of results. NextToken *string + + noSmithyDocumentSerde } type ListOpsMetadataOutput struct { @@ -54,9 +56,14 @@ type ListOpsMetadataOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationListOpsMetadataMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationListOpsMetadataMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpListOpsMetadata{}, middleware.After) if err != nil { return err @@ -65,6 +72,13 @@ func addOperationListOpsMetadataMiddlewares(stack *middleware.Stack, options Opt if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListOpsMetadata"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -83,16 +97,13 @@ func addOperationListOpsMetadataMiddlewares(stack *middleware.Stack, options Opt if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -101,12 +112,18 @@ func addOperationListOpsMetadataMiddlewares(stack *middleware.Stack, options Opt if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpListOpsMetadataValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListOpsMetadata(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -116,6 +133,9 @@ func addOperationListOpsMetadataMiddlewares(stack *middleware.Stack, options Opt if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -149,30 +169,31 @@ type ListOpsMetadataPaginator struct { // NewListOpsMetadataPaginator returns a new ListOpsMetadataPaginator func NewListOpsMetadataPaginator(client ListOpsMetadataAPIClient, params *ListOpsMetadataInput, optFns ...func(*ListOpsMetadataPaginatorOptions)) *ListOpsMetadataPaginator { + if params == nil { + params = &ListOpsMetadataInput{} + } + options := ListOpsMetadataPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &ListOpsMetadataInput{} - } - return &ListOpsMetadataPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListOpsMetadataPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListOpsMetadata page. @@ -184,7 +205,11 @@ func (p *ListOpsMetadataPaginator) NextPage(ctx context.Context, optFns ...func( params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListOpsMetadata(ctx, ¶ms, optFns...) if err != nil { @@ -195,7 +220,10 @@ func (p *ListOpsMetadataPaginator) NextPage(ctx context.Context, optFns ...func( prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -206,7 +234,6 @@ func newServiceMetadataMiddleware_opListOpsMetadata(region string) *awsmiddlewar return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "ListOpsMetadata", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListResourceComplianceSummaries.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListResourceComplianceSummaries.go index fa8052fd..7bae0aa3 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListResourceComplianceSummaries.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListResourceComplianceSummaries.go @@ -20,7 +20,7 @@ func (c *Client) ListResourceComplianceSummaries(ctx context.Context, params *Li params = &ListResourceComplianceSummariesInput{} } - result, metadata, err := c.invokeOperation(ctx, "ListResourceComplianceSummaries", params, optFns, addOperationListResourceComplianceSummariesMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "ListResourceComplianceSummaries", params, optFns, c.addOperationListResourceComplianceSummariesMiddlewares) if err != nil { return nil, err } @@ -37,10 +37,12 @@ type ListResourceComplianceSummariesInput struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // A token to start the list. Use this token to get the next set of results. NextToken *string + + noSmithyDocumentSerde } type ListResourceComplianceSummariesOutput struct { @@ -49,17 +51,21 @@ type ListResourceComplianceSummariesOutput struct { // set of results. NextToken *string - // A summary count for specified or targeted managed instances. Summary count - // includes information about compliant and non-compliant State Manager - // associations, patch status, or custom items according to the filter criteria - // that you specify. + // A summary count for specified or targeted managed nodes. Summary count includes + // information about compliant and non-compliant State Manager associations, patch + // status, or custom items according to the filter criteria that you specify. ResourceComplianceSummaryItems []types.ResourceComplianceSummaryItem // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationListResourceComplianceSummariesMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationListResourceComplianceSummariesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpListResourceComplianceSummaries{}, middleware.After) if err != nil { return err @@ -68,6 +74,13 @@ func addOperationListResourceComplianceSummariesMiddlewares(stack *middleware.St if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListResourceComplianceSummaries"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -86,16 +99,13 @@ func addOperationListResourceComplianceSummariesMiddlewares(stack *middleware.St if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -104,9 +114,15 @@ func addOperationListResourceComplianceSummariesMiddlewares(stack *middleware.St if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListResourceComplianceSummaries(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -116,6 +132,9 @@ func addOperationListResourceComplianceSummariesMiddlewares(stack *middleware.St if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -152,30 +171,31 @@ type ListResourceComplianceSummariesPaginator struct { // NewListResourceComplianceSummariesPaginator returns a new // ListResourceComplianceSummariesPaginator func NewListResourceComplianceSummariesPaginator(client ListResourceComplianceSummariesAPIClient, params *ListResourceComplianceSummariesInput, optFns ...func(*ListResourceComplianceSummariesPaginatorOptions)) *ListResourceComplianceSummariesPaginator { + if params == nil { + params = &ListResourceComplianceSummariesInput{} + } + options := ListResourceComplianceSummariesPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &ListResourceComplianceSummariesInput{} - } - return &ListResourceComplianceSummariesPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListResourceComplianceSummariesPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListResourceComplianceSummaries page. @@ -187,7 +207,11 @@ func (p *ListResourceComplianceSummariesPaginator) NextPage(ctx context.Context, params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListResourceComplianceSummaries(ctx, ¶ms, optFns...) if err != nil { @@ -198,7 +222,10 @@ func (p *ListResourceComplianceSummariesPaginator) NextPage(ctx context.Context, prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -209,7 +236,6 @@ func newServiceMetadataMiddleware_opListResourceComplianceSummaries(region strin return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "ListResourceComplianceSummaries", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListResourceDataSync.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListResourceDataSync.go index 26ef1200..20091011 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListResourceDataSync.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListResourceDataSync.go @@ -15,7 +15,7 @@ import ( // Lists your resource data sync configurations. Includes information about the // last time a sync attempted to start, the last sync status, and the last time a // sync successfully completed. The number of sync configurations might be too -// large to return using a single call to ListResourceDataSync. You can limit the +// large to return using a single call to ListResourceDataSync . You can limit the // number of sync configurations returned by using the MaxResults parameter. To // determine whether there are more sync configurations to list, check the value of // NextToken in the output. If there are more sync configurations to list, you can @@ -26,7 +26,7 @@ func (c *Client) ListResourceDataSync(ctx context.Context, params *ListResourceD params = &ListResourceDataSyncInput{} } - result, metadata, err := c.invokeOperation(ctx, "ListResourceDataSync", params, optFns, addOperationListResourceDataSyncMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "ListResourceDataSync", params, optFns, c.addOperationListResourceDataSyncMiddlewares) if err != nil { return nil, err } @@ -40,16 +40,18 @@ type ListResourceDataSyncInput struct { // The maximum number of items to return for this call. The call also returns a // token that you can specify in a subsequent call to get the next set of results. - MaxResults int32 + MaxResults *int32 // A token to start the list. Use this token to get the next set of results. NextToken *string // View a list of resource data syncs according to the sync type. Specify // SyncToDestination to view resource data syncs that synchronize data to an Amazon - // S3 bucket. Specify SyncFromSource to view resource data syncs from AWS - // Organizations or from multiple AWS Regions. + // S3 bucket. Specify SyncFromSource to view resource data syncs from + // Organizations or from multiple Amazon Web Services Regions. SyncType *string + + noSmithyDocumentSerde } type ListResourceDataSyncOutput struct { @@ -58,14 +60,19 @@ type ListResourceDataSyncOutput struct { // set of results. NextToken *string - // A list of your current Resource Data Sync configurations and their statuses. + // A list of your current resource data sync configurations and their statuses. ResourceDataSyncItems []types.ResourceDataSyncItem // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationListResourceDataSyncMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationListResourceDataSyncMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpListResourceDataSync{}, middleware.After) if err != nil { return err @@ -74,6 +81,13 @@ func addOperationListResourceDataSyncMiddlewares(stack *middleware.Stack, option if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListResourceDataSync"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -92,16 +106,13 @@ func addOperationListResourceDataSyncMiddlewares(stack *middleware.Stack, option if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -110,9 +121,15 @@ func addOperationListResourceDataSyncMiddlewares(stack *middleware.Stack, option if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListResourceDataSync(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -122,6 +139,9 @@ func addOperationListResourceDataSyncMiddlewares(stack *middleware.Stack, option if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -156,30 +176,31 @@ type ListResourceDataSyncPaginator struct { // NewListResourceDataSyncPaginator returns a new ListResourceDataSyncPaginator func NewListResourceDataSyncPaginator(client ListResourceDataSyncAPIClient, params *ListResourceDataSyncInput, optFns ...func(*ListResourceDataSyncPaginatorOptions)) *ListResourceDataSyncPaginator { + if params == nil { + params = &ListResourceDataSyncInput{} + } + options := ListResourceDataSyncPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } - if params == nil { - params = &ListResourceDataSyncInput{} - } - return &ListResourceDataSyncPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListResourceDataSyncPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListResourceDataSync page. @@ -191,7 +212,11 @@ func (p *ListResourceDataSyncPaginator) NextPage(ctx context.Context, optFns ... params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListResourceDataSync(ctx, ¶ms, optFns...) if err != nil { @@ -202,7 +227,10 @@ func (p *ListResourceDataSyncPaginator) NextPage(ctx context.Context, optFns ... prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } @@ -213,7 +241,6 @@ func newServiceMetadataMiddleware_opListResourceDataSync(region string) *awsmidd return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "ListResourceDataSync", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListTagsForResource.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListTagsForResource.go index 7e89fab8..06e7a524 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListTagsForResource.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -11,13 +12,14 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns a list of the tags assigned to the specified resource. +// Returns a list of the tags assigned to the specified resource. For information +// about the ID format for each supported resource type, see AddTagsToResource . func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { if params == nil { params = &ListTagsForResourceInput{} } - result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, addOperationListTagsForResourceMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) if err != nil { return nil, err } @@ -38,6 +40,8 @@ type ListTagsForResourceInput struct { // // This member is required. ResourceType types.ResourceTypeForTagging + + noSmithyDocumentSerde } type ListTagsForResourceOutput struct { @@ -47,9 +51,14 @@ type ListTagsForResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTagsForResource{}, middleware.After) if err != nil { return err @@ -58,6 +67,13 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListTagsForResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -76,16 +92,13 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -94,12 +107,18 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -109,6 +128,9 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -116,7 +138,6 @@ func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "ListTagsForResource", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ModifyDocumentPermission.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ModifyDocumentPermission.go index dc5189f5..cf28685c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ModifyDocumentPermission.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ModifyDocumentPermission.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -11,16 +12,16 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Shares a Systems Manager document publicly or privately. If you share a document -// privately, you must specify the AWS user account IDs for those people who can -// use the document. If you share a document publicly, you must specify All as the -// account ID. +// Shares a Amazon Web Services Systems Manager document (SSM document)publicly or +// privately. If you share a document privately, you must specify the Amazon Web +// Services user IDs for those people who can use the document. If you share a +// document publicly, you must specify All as the account ID. func (c *Client) ModifyDocumentPermission(ctx context.Context, params *ModifyDocumentPermissionInput, optFns ...func(*Options)) (*ModifyDocumentPermissionOutput, error) { if params == nil { params = &ModifyDocumentPermissionInput{} } - result, metadata, err := c.invokeOperation(ctx, "ModifyDocumentPermission", params, optFns, addOperationModifyDocumentPermissionMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "ModifyDocumentPermission", params, optFns, c.addOperationModifyDocumentPermissionMiddlewares) if err != nil { return nil, err } @@ -42,27 +43,34 @@ type ModifyDocumentPermissionInput struct { // This member is required. PermissionType types.DocumentPermissionType - // The AWS user accounts that should have access to the document. The account IDs - // can either be a group of account IDs or All. + // The Amazon Web Services users that should have access to the document. The + // account IDs can either be a group of account IDs or All. AccountIdsToAdd []string - // The AWS user accounts that should no longer have access to the document. The AWS - // user account can either be a group of account IDs or All. This action has a - // higher priority than AccountIdsToAdd. If you specify an account ID to add and - // the same ID to remove, the system removes access to the document. + // The Amazon Web Services users that should no longer have access to the + // document. The Amazon Web Services user can either be a group of account IDs or + // All. This action has a higher priority than AccountIdsToAdd. If you specify an + // ID to add and the same ID to remove, the system removes access to the document. AccountIdsToRemove []string - // (Optional) The version of the document to share. If it's not specified, the + // (Optional) The version of the document to share. If it isn't specified, the // system choose the Default version to share. SharedDocumentVersion *string + + noSmithyDocumentSerde } type ModifyDocumentPermissionOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationModifyDocumentPermissionMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationModifyDocumentPermissionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpModifyDocumentPermission{}, middleware.After) if err != nil { return err @@ -71,6 +79,13 @@ func addOperationModifyDocumentPermissionMiddlewares(stack *middleware.Stack, op if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyDocumentPermission"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -89,16 +104,13 @@ func addOperationModifyDocumentPermissionMiddlewares(stack *middleware.Stack, op if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -107,12 +119,18 @@ func addOperationModifyDocumentPermissionMiddlewares(stack *middleware.Stack, op if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpModifyDocumentPermissionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyDocumentPermission(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -122,6 +140,9 @@ func addOperationModifyDocumentPermissionMiddlewares(stack *middleware.Stack, op if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -129,7 +150,6 @@ func newServiceMetadataMiddleware_opModifyDocumentPermission(region string) *aws return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "ModifyDocumentPermission", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_PutComplianceItems.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_PutComplianceItems.go index d35be971..74324928 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_PutComplianceItems.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_PutComplianceItems.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -12,61 +13,36 @@ import ( ) // Registers a compliance type and other compliance details on a designated -// resource. This action lets you register custom compliance details with a +// resource. This operation lets you register custom compliance details with a // resource. This call overwrites existing compliance information on the resource, // so you must provide a full list of compliance items each time that you send the // request. ComplianceType can be one of the following: -// -// * ExecutionId: The -// execution ID when the patch, association, or custom compliance item was -// applied. -// -// * ExecutionType: Specify patch, association, or Custom:string. -// -// * -// ExecutionTime. The time the patch, association, or custom compliance item was -// applied to the instance. -// -// * Id: The patch, association, or custom compliance -// ID. -// -// * Title: A title. -// -// * Status: The status of the compliance item. For -// example, approved for patches, or Failed for associations. -// -// * Severity: A patch -// severity. For example, critical. -// -// * DocumentName: A SSM document name. For -// example, AWS-RunPatchBaseline. -// -// * DocumentVersion: An SSM document version -// number. For example, 4. -// -// * Classification: A patch classification. For example, -// security updates. -// -// * PatchBaselineId: A patch baseline ID. -// -// * PatchSeverity: A -// patch severity. For example, Critical. -// -// * PatchState: A patch state. For -// example, InstancesWithFailedPatches. -// -// * PatchGroup: The name of a patch -// group. -// -// * InstalledTime: The time the association, patch, or custom compliance -// item was applied to the resource. Specify the time by using the following -// format: yyyy-MM-dd'T'HH:mm:ss'Z' +// - ExecutionId: The execution ID when the patch, association, or custom +// compliance item was applied. +// - ExecutionType: Specify patch, association, or Custom: string . +// - ExecutionTime. The time the patch, association, or custom compliance item +// was applied to the managed node. +// - Id: The patch, association, or custom compliance ID. +// - Title: A title. +// - Status: The status of the compliance item. For example, approved for +// patches, or Failed for associations. +// - Severity: A patch severity. For example, Critical . +// - DocumentName: An SSM document name. For example, AWS-RunPatchBaseline . +// - DocumentVersion: An SSM document version number. For example, 4. +// - Classification: A patch classification. For example, security updates . +// - PatchBaselineId: A patch baseline ID. +// - PatchSeverity: A patch severity. For example, Critical . +// - PatchState: A patch state. For example, InstancesWithFailedPatches . +// - PatchGroup: The name of a patch group. +// - InstalledTime: The time the association, patch, or custom compliance item +// was applied to the resource. Specify the time by using the following format: +// yyyy-MM-dd'T'HH:mm:ss'Z' func (c *Client) PutComplianceItems(ctx context.Context, params *PutComplianceItemsInput, optFns ...func(*Options)) (*PutComplianceItemsOutput, error) { if params == nil { params = &PutComplianceItemsInput{} } - result, metadata, err := c.invokeOperation(ctx, "PutComplianceItems", params, optFns, addOperationPutComplianceItemsMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "PutComplianceItems", params, optFns, c.addOperationPutComplianceItemsMiddlewares) if err != nil { return nil, err } @@ -79,27 +55,26 @@ func (c *Client) PutComplianceItems(ctx context.Context, params *PutComplianceIt type PutComplianceItemsInput struct { // Specify the compliance type. For example, specify Association (for a State - // Manager association), Patch, or Custom:string. + // Manager association), Patch, or Custom: string . // // This member is required. ComplianceType *string // A summary of the call execution that includes an execution ID, the type of - // execution (for example, Command), and the date/time of the execution using a + // execution (for example, Command ), and the date/time of the execution using a // datetime object that is saved in the following format: yyyy-MM-dd'T'HH:mm:ss'Z'. // // This member is required. ExecutionSummary *types.ComplianceExecutionSummary // Information about the compliance as defined by the resource type. For example, - // for a patch compliance type, Items includes information about the PatchSeverity, - // Classification, and so on. + // for a patch compliance type, Items includes information about the + // PatchSeverity, Classification, and so on. // // This member is required. Items []types.ComplianceItemEntry - // Specify an ID for this resource. For a managed instance, this is the instance - // ID. + // Specify an ID for this resource. For a managed node, this is the node ID. // // This member is required. ResourceId *string @@ -115,22 +90,29 @@ type PutComplianceItemsInput struct { // request to put compliance information is ignored. ItemContentHash *string - // The mode for uploading compliance items. You can specify COMPLETE or PARTIAL. In - // COMPLETE mode, the system overwrites all existing compliance information for the - // resource. You must provide a full list of compliance items each time you send - // the request. In PARTIAL mode, the system overwrites compliance information for a - // specific association. The association must be configured with SyncCompliance set - // to MANUAL. By default, all requests use COMPLETE mode. This attribute is only - // valid for association compliance. + // The mode for uploading compliance items. You can specify COMPLETE or PARTIAL . + // In COMPLETE mode, the system overwrites all existing compliance information for + // the resource. You must provide a full list of compliance items each time you + // send the request. In PARTIAL mode, the system overwrites compliance information + // for a specific association. The association must be configured with + // SyncCompliance set to MANUAL . By default, all requests use COMPLETE mode. This + // attribute is only valid for association compliance. UploadType types.ComplianceUploadType + + noSmithyDocumentSerde } type PutComplianceItemsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationPutComplianceItemsMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationPutComplianceItemsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutComplianceItems{}, middleware.After) if err != nil { return err @@ -139,6 +121,13 @@ func addOperationPutComplianceItemsMiddlewares(stack *middleware.Stack, options if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutComplianceItems"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -157,16 +146,13 @@ func addOperationPutComplianceItemsMiddlewares(stack *middleware.Stack, options if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -175,12 +161,18 @@ func addOperationPutComplianceItemsMiddlewares(stack *middleware.Stack, options if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpPutComplianceItemsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutComplianceItems(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -190,6 +182,9 @@ func addOperationPutComplianceItemsMiddlewares(stack *middleware.Stack, options if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -197,7 +192,6 @@ func newServiceMetadataMiddleware_opPutComplianceItems(region string) *awsmiddle return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "PutComplianceItems", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_PutInventory.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_PutInventory.go index 71de74cc..b4ef83b7 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_PutInventory.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_PutInventory.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -11,15 +12,15 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Bulk update custom inventory items on one more instance. The request adds an -// inventory item, if it doesn't already exist, or updates an inventory item, if it -// does exist. +// Bulk update custom inventory items on one or more managed nodes. The request +// adds an inventory item, if it doesn't already exist, or updates an inventory +// item, if it does exist. func (c *Client) PutInventory(ctx context.Context, params *PutInventoryInput, optFns ...func(*Options)) (*PutInventoryOutput, error) { if params == nil { params = &PutInventoryInput{} } - result, metadata, err := c.invokeOperation(ctx, "PutInventory", params, optFns, addOperationPutInventoryMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "PutInventory", params, optFns, c.addOperationPutInventoryMiddlewares) if err != nil { return nil, err } @@ -31,15 +32,17 @@ func (c *Client) PutInventory(ctx context.Context, params *PutInventoryInput, op type PutInventoryInput struct { - // An instance ID where you want to add or update inventory items. + // An managed node ID where you want to add or update inventory items. // // This member is required. InstanceId *string - // The inventory items that you want to add or update on instances. + // The inventory items that you want to add or update on managed nodes. // // This member is required. Items []types.InventoryItem + + noSmithyDocumentSerde } type PutInventoryOutput struct { @@ -49,9 +52,14 @@ type PutInventoryOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationPutInventoryMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationPutInventoryMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutInventory{}, middleware.After) if err != nil { return err @@ -60,6 +68,13 @@ func addOperationPutInventoryMiddlewares(stack *middleware.Stack, options Option if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutInventory"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -78,16 +93,13 @@ func addOperationPutInventoryMiddlewares(stack *middleware.Stack, options Option if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -96,12 +108,18 @@ func addOperationPutInventoryMiddlewares(stack *middleware.Stack, options Option if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpPutInventoryValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutInventory(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -111,6 +129,9 @@ func addOperationPutInventoryMiddlewares(stack *middleware.Stack, options Option if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -118,7 +139,6 @@ func newServiceMetadataMiddleware_opPutInventory(region string) *awsmiddleware.R return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "PutInventory", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_PutParameter.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_PutParameter.go index 31b920b7..e56044b4 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_PutParameter.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_PutParameter.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -17,7 +18,7 @@ func (c *Client) PutParameter(ctx context.Context, params *PutParameterInput, op params = &PutParameterInput{} } - result, metadata, err := c.invokeOperation(ctx, "PutParameter", params, optFns, addOperationPutParameterMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "PutParameter", params, optFns, c.addOperationPutParameterMiddlewares) if err != nil { return nil, err } @@ -34,40 +35,30 @@ type PutParameterInput struct { // and name. For parameters in a hierarchy, you must include a leading forward // slash character (/) when you create or reference a parameter. For example: // /Dev/DBServer/MySQL/db-string13 Naming Constraints: - // - // * Parameter names are case - // sensitive. - // - // * A parameter name must be unique within an AWS Region - // - // * A - // parameter name can't be prefixed with "aws" or "ssm" (case-insensitive). - // - // * - // Parameter names can include only the following symbols and letters: - // a-zA-Z0-9_.-/ - // - // * A parameter name can't include spaces. - // - // * Parameter hierarchies - // are limited to a maximum depth of fifteen levels. - // - // For additional information - // about valid values for parameter names, see About requirements and constraints - // for parameter names - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-parameter-name-constraints.html) - // in the AWS Systems Manager User Guide. The maximum length constraint listed - // below includes capacity for additional system attributes that are not part of - // the name. The maximum length for a parameter name, including the full length of - // the parameter ARN, is 1011 characters. For example, the length of the following - // parameter name is 65 characters, not 20 characters: - // arn:aws:ssm:us-east-2:111122223333:parameter/ExampleParameterName + // - Parameter names are case sensitive. + // - A parameter name must be unique within an Amazon Web Services Region + // - A parameter name can't be prefixed with " aws " or " ssm " + // (case-insensitive). + // - Parameter names can include only the following symbols and letters: + // a-zA-Z0-9_.- In addition, the slash character ( / ) is used to delineate + // hierarchies in parameter names. For example: + // /Dev/Production/East/Project-ABC/MyParameter + // - A parameter name can't include spaces. + // - Parameter hierarchies are limited to a maximum depth of fifteen levels. + // For additional information about valid values for parameter names, see Creating + // Systems Manager parameters (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-su-create.html) + // in the Amazon Web Services Systems Manager User Guide. The maximum length + // constraint of 2048 characters listed below includes 1037 characters reserved for + // internal use by Systems Manager. The maximum length for a parameter name that + // you create is 1011 characters. This includes the characters in the ARN that + // precede the name you specify, such as + // arn:aws:ssm:us-east-2:111122223333:parameter/ . // // This member is required. Name *string - // The parameter value that you want to add to the system. Standard parameters have - // a value limit of 4 KB. Advanced parameters have a value limit of 8 KB. + // The parameter value that you want to add to the system. Standard parameters + // have a value limit of 4 KB. Advanced parameters have a value limit of 8 KB. // Parameters can't be referenced or nested in the values of other parameters. You // can't include {{}} or {{ssm:parameter-name}} in a parameter value. // @@ -80,146 +71,134 @@ type PutParameterInput struct { AllowedPattern *string // The data type for a String parameter. Supported data types include plain text - // and Amazon Machine Image IDs. The following data type values are supported. - // - // * - // text - // - // * aws:ec2:image - // - // When you create a String parameter and specify - // aws:ec2:image, Systems Manager validates the parameter value is in the required - // format, such as ami-12345abcdeEXAMPLE, and that the specified AMI is available - // in your AWS account. For more information, see Native parameter support for - // Amazon Machine Image IDs - // (http://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-ec2-aliases.html) - // in the AWS Systems Manager User Guide. + // and Amazon Machine Image (AMI) IDs. The following data type values are + // supported. + // - text + // - aws:ec2:image + // - aws:ssm:integration + // When you create a String parameter and specify aws:ec2:image , Amazon Web + // Services Systems Manager validates the parameter value is in the required + // format, such as ami-12345abcdeEXAMPLE , and that the specified AMI is available + // in your Amazon Web Services account. If the action is successful, the service + // sends back an HTTP 200 response which indicates a successful PutParameter call + // for all cases except for data type aws:ec2:image . If you call PutParameter + // with aws:ec2:image data type, a successful HTTP 200 response does not guarantee + // that your parameter was successfully created or updated. The aws:ec2:image + // value is validated asynchronously, and the PutParameter call returns before the + // validation is complete. If you submit an invalid AMI value, the PutParameter + // operation will return success, but the asynchronous validation will fail and the + // parameter will not be created or updated. To monitor whether your aws:ec2:image + // parameters are created successfully, see Setting up notifications or trigger + // actions based on Parameter Store events (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-cwe.html) + // . For more information about AMI format validation , see Native parameter + // support for Amazon Machine Image (AMI) IDs (https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-ec2-aliases.html) + // . DataType *string - // Information about the parameter that you want to add to the system. Optional but - // recommended. Do not enter personally identifiable information in this field. + // Information about the parameter that you want to add to the system. Optional + // but recommended. Don't enter personally identifiable information in this field. Description *string - // The KMS Key ID that you want to use to encrypt a parameter. Either the default - // AWS Key Management Service (AWS KMS) key automatically assigned to your AWS - // account or a custom key. Required for parameters that use the SecureString data - // type. If you don't specify a key ID, the system uses the default key associated - // with your AWS account. - // - // * To use your default AWS KMS key, choose the - // SecureString data type, and do not specify the Key ID when you create the - // parameter. The system automatically populates Key ID with your default KMS - // key. - // - // * To use a custom KMS key, choose the SecureString data type with the Key - // ID parameter. + // The Key Management Service (KMS) ID that you want to use to encrypt a + // parameter. Use a custom key for better security. Required for parameters that + // use the SecureString data type. If you don't specify a key ID, the system uses + // the default key associated with your Amazon Web Services account which is not as + // secure as using a custom key. + // - To use a custom KMS key, choose the SecureString data type with the Key ID + // parameter. KeyId *string - // Overwrite an existing parameter. If not specified, will default to "false". - Overwrite bool + // Overwrite an existing parameter. The default value is false . + Overwrite *bool - // One or more policies to apply to a parameter. This action takes a JSON array. - // Parameter Store supports the following policy types: Expiration: This policy - // deletes the parameter after it expires. When you create the policy, you specify - // the expiration date. You can update the expiration date and time by updating the - // policy. Updating the parameter does not affect the expiration date and time. - // When the expiration time is reached, Parameter Store deletes the parameter. - // ExpirationNotification: This policy triggers an event in Amazon CloudWatch + // One or more policies to apply to a parameter. This operation takes a JSON + // array. Parameter Store, a capability of Amazon Web Services Systems Manager + // supports the following policy types: Expiration: This policy deletes the + // parameter after it expires. When you create the policy, you specify the + // expiration date. You can update the expiration date and time by updating the + // policy. Updating the parameter doesn't affect the expiration date and time. When + // the expiration time is reached, Parameter Store deletes the parameter. + // ExpirationNotification: This policy initiates an event in Amazon CloudWatch // Events that notifies you about the expiration. By using this policy, you can // receive notification before or after the expiration time is reached, in units of - // days or hours. NoChangeNotification: This policy triggers a CloudWatch event if - // a parameter has not been modified for a specified period of time. This policy - // type is useful when, for example, a secret needs to be changed within a period - // of time, but it has not been changed. All existing policies are preserved until - // you send new policies or an empty policy. For more information about parameter - // policies, see Assigning parameter policies - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-policies.html). + // days or hours. NoChangeNotification: This policy initiates a CloudWatch Events + // event if a parameter hasn't been modified for a specified period of time. This + // policy type is useful when, for example, a secret needs to be changed within a + // period of time, but it hasn't been changed. All existing policies are preserved + // until you send new policies or an empty policy. For more information about + // parameter policies, see Assigning parameter policies (https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-policies.html) + // . Policies *string - // Optional metadata that you assign to a resource. Tags enable you to categorize a - // resource in different ways, such as by purpose, owner, or environment. For + // Optional metadata that you assign to a resource. Tags enable you to categorize + // a resource in different ways, such as by purpose, owner, or environment. For // example, you might want to tag a Systems Manager parameter to identify the type // of resource to which it applies, the environment, or the type of configuration // data referenced by the parameter. In this case, you could specify the following - // key name/value pairs: - // - // * Key=Resource,Value=S3bucket - // - // * Key=OS,Value=Windows - // - // * - // Key=ParameterType,Value=LicenseKey - // - // To add tags to an existing Systems Manager - // parameter, use the AddTagsToResource action. + // key-value pairs: + // - Key=Resource,Value=S3bucket + // - Key=OS,Value=Windows + // - Key=ParameterType,Value=LicenseKey + // To add tags to an existing Systems Manager parameter, use the AddTagsToResource + // operation. Tags []types.Tag // The parameter tier to assign to a parameter. Parameter Store offers a standard // tier and an advanced tier for parameters. Standard parameters have a content // size limit of 4 KB and can't be configured to use parameter policies. You can - // create a maximum of 10,000 standard parameters for each Region in an AWS - // account. Standard parameters are offered at no additional cost. Advanced - // parameters have a content size limit of 8 KB and can be configured to use - // parameter policies. You can create a maximum of 100,000 advanced parameters for - // each Region in an AWS account. Advanced parameters incur a charge. For more - // information, see Standard and advanced parameter tiers - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-advanced-parameters.html) - // in the AWS Systems Manager User Guide. You can change a standard parameter to an - // advanced parameter any time. But you can't revert an advanced parameter to a - // standard parameter. Reverting an advanced parameter to a standard parameter - // would result in data loss because the system would truncate the size of the - // parameter from 8 KB to 4 KB. Reverting would also remove any policies attached - // to the parameter. Lastly, advanced parameters use a different form of encryption - // than standard parameters. If you no longer need an advanced parameter, or if you - // no longer want to incur charges for an advanced parameter, you must delete it - // and recreate it as a new standard parameter. Using the Default Tier - // Configuration In PutParameter requests, you can specify the tier to create the - // parameter in. Whenever you specify a tier in the request, Parameter Store - // creates or updates the parameter according to that request. However, if you do - // not specify a tier in a request, Parameter Store assigns the tier based on the - // current Parameter Store default tier configuration. The default tier when you - // begin using Parameter Store is the standard-parameter tier. If you use the - // advanced-parameter tier, you can specify one of the following as the default: - // - // * - // Advanced: With this option, Parameter Store evaluates all requests as advanced - // parameters. - // - // * Intelligent-Tiering: With this option, Parameter Store evaluates - // each request to determine if the parameter is standard or advanced. If the - // request doesn't include any options that require an advanced parameter, the - // parameter is created in the standard-parameter tier. If one or more options - // requiring an advanced parameter are included in the request, Parameter Store - // create a parameter in the advanced-parameter tier. This approach helps control - // your parameter-related costs by always creating standard parameters unless an - // advanced parameter is necessary. - // - // Options that require an advanced parameter - // include the following: - // - // * The content size of the parameter is more than 4 - // KB. - // - // * The parameter uses a parameter policy. - // - // * More than 10,000 parameters - // already exist in your AWS account in the current Region. - // - // For more information - // about configuring the default tier option, see Specifying a default parameter - // tier - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/ps-default-tier.html) - // in the AWS Systems Manager User Guide. + // create a maximum of 10,000 standard parameters for each Region in an Amazon Web + // Services account. Standard parameters are offered at no additional cost. + // Advanced parameters have a content size limit of 8 KB and can be configured to + // use parameter policies. You can create a maximum of 100,000 advanced parameters + // for each Region in an Amazon Web Services account. Advanced parameters incur a + // charge. For more information, see Standard and advanced parameter tiers (https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-advanced-parameters.html) + // in the Amazon Web Services Systems Manager User Guide. You can change a standard + // parameter to an advanced parameter any time. But you can't revert an advanced + // parameter to a standard parameter. Reverting an advanced parameter to a standard + // parameter would result in data loss because the system would truncate the size + // of the parameter from 8 KB to 4 KB. Reverting would also remove any policies + // attached to the parameter. Lastly, advanced parameters use a different form of + // encryption than standard parameters. If you no longer need an advanced + // parameter, or if you no longer want to incur charges for an advanced parameter, + // you must delete it and recreate it as a new standard parameter. Using the + // Default Tier Configuration In PutParameter requests, you can specify the tier + // to create the parameter in. Whenever you specify a tier in the request, + // Parameter Store creates or updates the parameter according to that request. + // However, if you don't specify a tier in a request, Parameter Store assigns the + // tier based on the current Parameter Store default tier configuration. The + // default tier when you begin using Parameter Store is the standard-parameter + // tier. If you use the advanced-parameter tier, you can specify one of the + // following as the default: + // - Advanced: With this option, Parameter Store evaluates all requests as + // advanced parameters. + // - Intelligent-Tiering: With this option, Parameter Store evaluates each + // request to determine if the parameter is standard or advanced. If the request + // doesn't include any options that require an advanced parameter, the parameter is + // created in the standard-parameter tier. If one or more options requiring an + // advanced parameter are included in the request, Parameter Store create a + // parameter in the advanced-parameter tier. This approach helps control your + // parameter-related costs by always creating standard parameters unless an + // advanced parameter is necessary. + // Options that require an advanced parameter include the following: + // - The content size of the parameter is more than 4 KB. + // - The parameter uses a parameter policy. + // - More than 10,000 parameters already exist in your Amazon Web Services + // account in the current Amazon Web Services Region. + // For more information about configuring the default tier option, see Specifying + // a default parameter tier (https://docs.aws.amazon.com/systems-manager/latest/userguide/ps-default-tier.html) + // in the Amazon Web Services Systems Manager User Guide. Tier types.ParameterTier - // The type of parameter that you want to add to the system. SecureString is not - // currently supported for AWS CloudFormation templates. Items in a StringList must - // be separated by a comma (,). You can't use other punctuation or special - // character to escape items in the list. If you have a parameter value that - // requires a comma, then use the String data type. Specifying a parameter type is - // not required when updating a parameter. You must specify a parameter type when + // The type of parameter that you want to add to the system. SecureString isn't + // currently supported for CloudFormation templates. Items in a StringList must be + // separated by a comma (,). You can't use other punctuation or special character + // to escape items in the list. If you have a parameter value that requires a + // comma, then use the String data type. Specifying a parameter type isn't + // required when updating a parameter. You must specify a parameter type when // creating a parameter. Type types.ParameterType + + noSmithyDocumentSerde } type PutParameterOutput struct { @@ -229,7 +208,7 @@ type PutParameterOutput struct { // The new version number of a parameter. If you edit a parameter value, Parameter // Store automatically creates a new version and assigns this new version a unique - // ID. You can reference a parameter version ID in API actions or in Systems + // ID. You can reference a parameter version ID in API operations or in Systems // Manager documents (SSM documents). By default, if you don't specify a specific // version, the system returns the latest parameter value when a parameter is // called. @@ -237,9 +216,14 @@ type PutParameterOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationPutParameterMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationPutParameterMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutParameter{}, middleware.After) if err != nil { return err @@ -248,6 +232,13 @@ func addOperationPutParameterMiddlewares(stack *middleware.Stack, options Option if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutParameter"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -266,16 +257,13 @@ func addOperationPutParameterMiddlewares(stack *middleware.Stack, options Option if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -284,12 +272,18 @@ func addOperationPutParameterMiddlewares(stack *middleware.Stack, options Option if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpPutParameterValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutParameter(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -299,6 +293,9 @@ func addOperationPutParameterMiddlewares(stack *middleware.Stack, options Option if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -306,7 +303,6 @@ func newServiceMetadataMiddleware_opPutParameter(region string) *awsmiddleware.R return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "PutParameter", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_PutResourcePolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_PutResourcePolicy.go new file mode 100644 index 00000000..0ca5a2ad --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_PutResourcePolicy.go @@ -0,0 +1,157 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssm + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates or updates a Systems Manager resource policy. A resource policy helps +// you to define the IAM entity (for example, an Amazon Web Services account) that +// can manage your Systems Manager resources. Currently, OpsItemGroup is the only +// resource that supports Systems Manager resource policies. The resource policy +// for OpsItemGroup enables Amazon Web Services accounts to view and interact with +// OpsCenter operational work items (OpsItems). +func (c *Client) PutResourcePolicy(ctx context.Context, params *PutResourcePolicyInput, optFns ...func(*Options)) (*PutResourcePolicyOutput, error) { + if params == nil { + params = &PutResourcePolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutResourcePolicy", params, optFns, c.addOperationPutResourcePolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutResourcePolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutResourcePolicyInput struct { + + // A policy you want to associate with a resource. + // + // This member is required. + Policy *string + + // Amazon Resource Name (ARN) of the resource to which you want to attach a policy. + // + // This member is required. + ResourceArn *string + + // ID of the current policy version. The hash helps to prevent a situation where + // multiple users attempt to overwrite a policy. You must provide this hash when + // updating or deleting a policy. + PolicyHash *string + + // The policy ID. + PolicyId *string + + noSmithyDocumentSerde +} + +type PutResourcePolicyOutput struct { + + // ID of the current policy version. + PolicyHash *string + + // The policy ID. To update a policy, you must specify PolicyId and PolicyHash . + PolicyId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutResourcePolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutResourcePolicy{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutResourcePolicy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpPutResourcePolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutResourcePolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "PutResourcePolicy", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_RegisterDefaultPatchBaseline.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_RegisterDefaultPatchBaseline.go index 462d5b83..6139a66a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_RegisterDefaultPatchBaseline.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_RegisterDefaultPatchBaseline.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" @@ -11,16 +12,17 @@ import ( ) // Defines the default patch baseline for the relevant operating system. To reset -// the AWS predefined patch baseline as the default, specify the full patch -// baseline ARN as the baseline ID value. For example, for CentOS, specify +// the Amazon Web Services-predefined patch baseline as the default, specify the +// full patch baseline Amazon Resource Name (ARN) as the baseline ID value. For +// example, for CentOS, specify // arn:aws:ssm:us-east-2:733109147000:patchbaseline/pb-0574b43a65ea646ed instead of -// pb-0574b43a65ea646ed. +// pb-0574b43a65ea646ed . func (c *Client) RegisterDefaultPatchBaseline(ctx context.Context, params *RegisterDefaultPatchBaselineInput, optFns ...func(*Options)) (*RegisterDefaultPatchBaselineOutput, error) { if params == nil { params = &RegisterDefaultPatchBaselineInput{} } - result, metadata, err := c.invokeOperation(ctx, "RegisterDefaultPatchBaseline", params, optFns, addOperationRegisterDefaultPatchBaselineMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "RegisterDefaultPatchBaseline", params, optFns, c.addOperationRegisterDefaultPatchBaselineMiddlewares) if err != nil { return nil, err } @@ -36,6 +38,8 @@ type RegisterDefaultPatchBaselineInput struct { // // This member is required. BaselineId *string + + noSmithyDocumentSerde } type RegisterDefaultPatchBaselineOutput struct { @@ -45,9 +49,14 @@ type RegisterDefaultPatchBaselineOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationRegisterDefaultPatchBaselineMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationRegisterDefaultPatchBaselineMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpRegisterDefaultPatchBaseline{}, middleware.After) if err != nil { return err @@ -56,6 +65,13 @@ func addOperationRegisterDefaultPatchBaselineMiddlewares(stack *middleware.Stack if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "RegisterDefaultPatchBaseline"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -74,16 +90,13 @@ func addOperationRegisterDefaultPatchBaselineMiddlewares(stack *middleware.Stack if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -92,12 +105,18 @@ func addOperationRegisterDefaultPatchBaselineMiddlewares(stack *middleware.Stack if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpRegisterDefaultPatchBaselineValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterDefaultPatchBaseline(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -107,6 +126,9 @@ func addOperationRegisterDefaultPatchBaselineMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -114,7 +136,6 @@ func newServiceMetadataMiddleware_opRegisterDefaultPatchBaseline(region string) return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "RegisterDefaultPatchBaseline", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_RegisterPatchBaselineForPatchGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_RegisterPatchBaselineForPatchGroup.go index 5c7d019d..bd808bee 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_RegisterPatchBaselineForPatchGroup.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_RegisterPatchBaselineForPatchGroup.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" @@ -16,7 +17,7 @@ func (c *Client) RegisterPatchBaselineForPatchGroup(ctx context.Context, params params = &RegisterPatchBaselineForPatchGroupInput{} } - result, metadata, err := c.invokeOperation(ctx, "RegisterPatchBaselineForPatchGroup", params, optFns, addOperationRegisterPatchBaselineForPatchGroupMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "RegisterPatchBaselineForPatchGroup", params, optFns, c.addOperationRegisterPatchBaselineForPatchGroupMiddlewares) if err != nil { return nil, err } @@ -28,15 +29,17 @@ func (c *Client) RegisterPatchBaselineForPatchGroup(ctx context.Context, params type RegisterPatchBaselineForPatchGroupInput struct { - // The ID of the patch baseline to register the patch group with. + // The ID of the patch baseline to register with the patch group. // // This member is required. BaselineId *string - // The name of the patch group that should be registered with the patch baseline. + // The name of the patch group to be registered with the patch baseline. // // This member is required. PatchGroup *string + + noSmithyDocumentSerde } type RegisterPatchBaselineForPatchGroupOutput struct { @@ -49,9 +52,14 @@ type RegisterPatchBaselineForPatchGroupOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationRegisterPatchBaselineForPatchGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationRegisterPatchBaselineForPatchGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpRegisterPatchBaselineForPatchGroup{}, middleware.After) if err != nil { return err @@ -60,6 +68,13 @@ func addOperationRegisterPatchBaselineForPatchGroupMiddlewares(stack *middleware if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "RegisterPatchBaselineForPatchGroup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -78,16 +93,13 @@ func addOperationRegisterPatchBaselineForPatchGroupMiddlewares(stack *middleware if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -96,12 +108,18 @@ func addOperationRegisterPatchBaselineForPatchGroupMiddlewares(stack *middleware if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpRegisterPatchBaselineForPatchGroupValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterPatchBaselineForPatchGroup(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -111,6 +129,9 @@ func addOperationRegisterPatchBaselineForPatchGroupMiddlewares(stack *middleware if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -118,7 +139,6 @@ func newServiceMetadataMiddleware_opRegisterPatchBaselineForPatchGroup(region st return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "RegisterPatchBaselineForPatchGroup", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_RegisterTargetWithMaintenanceWindow.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_RegisterTargetWithMaintenanceWindow.go index f02ec2b4..33b680ba 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_RegisterTargetWithMaintenanceWindow.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_RegisterTargetWithMaintenanceWindow.go @@ -18,7 +18,7 @@ func (c *Client) RegisterTargetWithMaintenanceWindow(ctx context.Context, params params = &RegisterTargetWithMaintenanceWindowInput{} } - result, metadata, err := c.invokeOperation(ctx, "RegisterTargetWithMaintenanceWindow", params, optFns, addOperationRegisterTargetWithMaintenanceWindowMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "RegisterTargetWithMaintenanceWindow", params, optFns, c.addOperationRegisterTargetWithMaintenanceWindowMiddlewares) if err != nil { return nil, err } @@ -36,23 +36,23 @@ type RegisterTargetWithMaintenanceWindowInput struct { ResourceType types.MaintenanceWindowResourceType // The targets to register with the maintenance window. In other words, the - // instances to run commands on when the maintenance window runs. You can specify - // targets using instance IDs, resource group names, or tags that have been applied - // to instances. Example 1: Specify instance IDs - // Key=InstanceIds,Values=instance-id-1,instance-id-2,instance-id-3 Example 2: Use - // tag key-pairs applied to instances - // Key=tag:my-tag-key,Values=my-tag-value-1,my-tag-value-2 Example 3: Use tag-keys - // applied to instances Key=tag-key,Values=my-tag-key-1,my-tag-key-2 Example 4: - // Use resource group names Key=resource-groups:Name,Values=resource-group-name - // Example 5: Use filters for resource group types - // Key=resource-groups:ResourceTypeFilters,Values=resource-type-1,resource-type-2 - // For Key=resource-groups:ResourceTypeFilters, specify resource types in the + // managed nodes to run commands on when the maintenance window runs. If a single + // maintenance window task is registered with multiple targets, its task + // invocations occur sequentially and not in parallel. If your task must run on + // multiple targets at the same time, register a task for each target individually + // and assign each task the same priority level. You can specify targets using + // managed node IDs, resource group names, or tags that have been applied to + // managed nodes. Example 1: Specify managed node IDs Key=InstanceIds,Values=,, + // Example 2: Use tag key-pairs applied to managed nodes Key=tag:,Values=, Example + // 3: Use tag-keys applied to managed nodes Key=tag-key,Values=, Example 4: Use + // resource group names Key=resource-groups:Name,Values= Example 5: Use filters + // for resource group types Key=resource-groups:ResourceTypeFilters,Values=, For + // Key=resource-groups:ResourceTypeFilters , specify resource types in the // following format // Key=resource-groups:ResourceTypeFilters,Values=AWS::EC2::INSTANCE,AWS::EC2::VPC // For more information about these examples formats, including the best use case - // for each one, see Examples: Register targets with a maintenance window - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/mw-cli-tutorial-targets-examples.html) - // in the AWS Systems Manager User Guide. + // for each one, see Examples: Register targets with a maintenance window (https://docs.aws.amazon.com/systems-manager/latest/userguide/mw-cli-tutorial-targets-examples.html) + // in the Amazon Web Services Systems Manager User Guide. // // This member is required. Targets []types.Target @@ -71,9 +71,11 @@ type RegisterTargetWithMaintenanceWindowInput struct { // An optional name for the target. Name *string - // User-provided value that will be included in any CloudWatch events raised while - // running tasks for these targets in this maintenance window. + // User-provided value that will be included in any Amazon CloudWatch Events + // events raised while running tasks for these targets in this maintenance window. OwnerInformation *string + + noSmithyDocumentSerde } type RegisterTargetWithMaintenanceWindowOutput struct { @@ -83,9 +85,14 @@ type RegisterTargetWithMaintenanceWindowOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationRegisterTargetWithMaintenanceWindowMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationRegisterTargetWithMaintenanceWindowMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpRegisterTargetWithMaintenanceWindow{}, middleware.After) if err != nil { return err @@ -94,6 +101,13 @@ func addOperationRegisterTargetWithMaintenanceWindowMiddlewares(stack *middlewar if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "RegisterTargetWithMaintenanceWindow"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -112,16 +126,13 @@ func addOperationRegisterTargetWithMaintenanceWindowMiddlewares(stack *middlewar if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -130,6 +141,9 @@ func addOperationRegisterTargetWithMaintenanceWindowMiddlewares(stack *middlewar if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addIdempotencyToken_opRegisterTargetWithMaintenanceWindowMiddleware(stack, options); err != nil { return err } @@ -139,6 +153,9 @@ func addOperationRegisterTargetWithMaintenanceWindowMiddlewares(stack *middlewar if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterTargetWithMaintenanceWindow(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -148,6 +165,9 @@ func addOperationRegisterTargetWithMaintenanceWindowMiddlewares(stack *middlewar if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -188,7 +208,6 @@ func newServiceMetadataMiddleware_opRegisterTargetWithMaintenanceWindow(region s return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "RegisterTargetWithMaintenanceWindow", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_RegisterTaskWithMaintenanceWindow.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_RegisterTaskWithMaintenanceWindow.go index 22dea168..21a3cb65 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_RegisterTaskWithMaintenanceWindow.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_RegisterTaskWithMaintenanceWindow.go @@ -18,7 +18,7 @@ func (c *Client) RegisterTaskWithMaintenanceWindow(ctx context.Context, params * params = &RegisterTaskWithMaintenanceWindowInput{} } - result, metadata, err := c.invokeOperation(ctx, "RegisterTaskWithMaintenanceWindow", params, optFns, addOperationRegisterTaskWithMaintenanceWindowMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "RegisterTaskWithMaintenanceWindow", params, optFns, c.addOperationRegisterTaskWithMaintenanceWindowMiddlewares) if err != nil { return nil, err } @@ -45,30 +45,55 @@ type RegisterTaskWithMaintenanceWindowInput struct { // This member is required. WindowId *string + // The CloudWatch alarm you want to apply to your maintenance window task. + AlarmConfiguration *types.AlarmConfiguration + // User-provided idempotency token. ClientToken *string + // Indicates whether tasks should continue to run after the cutoff time specified + // in the maintenance windows is reached. + // - CONTINUE_TASK : When the cutoff time is reached, any tasks that are running + // continue. The default value. + // - CANCEL_TASK : + // - For Automation, Lambda, Step Functions tasks: When the cutoff time is + // reached, any task invocations that are already running continue, but no new task + // invocations are started. + // - For Run Command tasks: When the cutoff time is reached, the system sends a + // CancelCommand operation that attempts to cancel the command associated with + // the task. However, there is no guarantee that the command will be terminated and + // the underlying process stopped. The status for tasks that are not completed + // is TIMED_OUT . + CutoffBehavior types.MaintenanceWindowTaskCutoffBehavior + // An optional description for the task. Description *string - // A structure containing information about an S3 bucket to write instance-level - // logs to. LoggingInfo has been deprecated. To specify an S3 bucket to contain - // logs, instead use the OutputS3BucketName and OutputS3KeyPrefix options in the - // TaskInvocationParameters structure. For information about how Systems Manager - // handles these options for the supported maintenance window task types, see - // MaintenanceWindowTaskInvocationParameters. + // A structure containing information about an Amazon Simple Storage Service + // (Amazon S3) bucket to write managed node-level logs to. LoggingInfo has been + // deprecated. To specify an Amazon Simple Storage Service (Amazon S3) bucket to + // contain logs, instead use the OutputS3BucketName and OutputS3KeyPrefix options + // in the TaskInvocationParameters structure. For information about how Amazon Web + // Services Systems Manager handles these options for the supported maintenance + // window task types, see MaintenanceWindowTaskInvocationParameters . LoggingInfo *types.LoggingInfo - // The maximum number of targets this task can be run for in parallel. For - // maintenance window tasks without a target specified, you cannot supply a value - // for this option. Instead, the system inserts a placeholder value of 1. This - // value does not affect the running of your task. + // The maximum number of targets this task can be run for, in parallel. Although + // this element is listed as "Required: No", a value can be omitted only when you + // are registering or updating a targetless task (https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html) + // You must provide a value in all other cases. For maintenance window tasks + // without a target specified, you can't supply a value for this option. Instead, + // the system inserts a placeholder value of 1 . This value doesn't affect the + // running of your task. MaxConcurrency *string - // The maximum number of errors allowed before this task stops being scheduled. For - // maintenance window tasks without a target specified, you cannot supply a value - // for this option. Instead, the system inserts a placeholder value of 1. This - // value does not affect the running of your task. + // The maximum number of errors allowed before this task stops being scheduled. + // Although this element is listed as "Required: No", a value can be omitted only + // when you are registering or updating a targetless task (https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html) + // You must provide a value in all other cases. For maintenance window tasks + // without a target specified, you can't supply a value for this option. Instead, + // the system inserts a placeholder value of 1 . This value doesn't affect the + // running of your task. MaxErrors *string // An optional name for the task. @@ -77,35 +102,29 @@ type RegisterTaskWithMaintenanceWindowInput struct { // The priority of the task in the maintenance window, the lower the number the // higher the priority. Tasks in a maintenance window are scheduled in priority // order with tasks that have the same priority scheduled in parallel. - Priority int32 - - // The ARN of the IAM service role for Systems Manager to assume when running a - // maintenance window task. If you do not specify a service role ARN, Systems - // Manager uses your account's service-linked role. If no service-linked role for - // Systems Manager exists in your account, it is created when you run - // RegisterTaskWithMaintenanceWindow. For more information, see the following - // topics in the in the AWS Systems Manager User Guide: - // - // * Using service-linked - // roles for Systems Manager - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/using-service-linked-roles.html#slr-permissions) - // - // * - // Should I use a service-linked role or a custom service role to run maintenance - // window tasks? - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-maintenance-permissions.html#maintenance-window-tasks-service-role) + Priority *int32 + + // The Amazon Resource Name (ARN) of the IAM service role for Amazon Web Services + // Systems Manager to assume when running a maintenance window task. If you do not + // specify a service role ARN, Systems Manager uses your account's service-linked + // role. If no service-linked role for Systems Manager exists in your account, it + // is created when you run RegisterTaskWithMaintenanceWindow . For more + // information, see the following topics in the in the Amazon Web Services Systems + // Manager User Guide: + // - Using service-linked roles for Systems Manager (https://docs.aws.amazon.com/systems-manager/latest/userguide/using-service-linked-roles.html#slr-permissions) + // - Should I use a service-linked role or a custom service role to run + // maintenance window tasks? (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-maintenance-permissions.html#maintenance-window-tasks-service-role) ServiceRoleArn *string - // The targets (either instances or maintenance window targets). One or more + // The targets (either managed nodes or maintenance window targets). One or more // targets must be specified for maintenance window Run Command-type tasks. // Depending on the task, targets are optional for other maintenance window task - // types (Automation, AWS Lambda, and AWS Step Functions). For more information - // about running tasks that do not specify targets, see see Registering maintenance - // window tasks without targets - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html) - // in the AWS Systems Manager User Guide. Specify instances using the following - // format: Key=InstanceIds,Values=, Specify maintenance window targets using the - // following format: Key=WindowTargetIds,Values=, + // types (Automation, Lambda, and Step Functions). For more information about + // running tasks that don't specify targets, see Registering maintenance window + // tasks without targets (https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html) + // in the Amazon Web Services Systems Manager User Guide. Specify managed nodes + // using the following format: Key=InstanceIds,Values=, Specify maintenance window + // targets using the following format: Key=WindowTargetIds,Values=, Targets []types.Target // The parameters that the task should use during execution. Populate only the @@ -114,10 +133,13 @@ type RegisterTaskWithMaintenanceWindowInput struct { // The parameters that should be passed to the task when it is run. TaskParameters // has been deprecated. To specify parameters to pass to a task when it runs, - // instead use the Parameters option in the TaskInvocationParameters structure. For - // information about how Systems Manager handles these options for the supported - // maintenance window task types, see MaintenanceWindowTaskInvocationParameters. + // instead use the Parameters option in the TaskInvocationParameters structure. + // For information about how Systems Manager handles these options for the + // supported maintenance window task types, see + // MaintenanceWindowTaskInvocationParameters . TaskParameters map[string]types.MaintenanceWindowTaskParameterValueExpression + + noSmithyDocumentSerde } type RegisterTaskWithMaintenanceWindowOutput struct { @@ -127,9 +149,14 @@ type RegisterTaskWithMaintenanceWindowOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationRegisterTaskWithMaintenanceWindowMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationRegisterTaskWithMaintenanceWindowMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpRegisterTaskWithMaintenanceWindow{}, middleware.After) if err != nil { return err @@ -138,6 +165,13 @@ func addOperationRegisterTaskWithMaintenanceWindowMiddlewares(stack *middleware. if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "RegisterTaskWithMaintenanceWindow"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -156,16 +190,13 @@ func addOperationRegisterTaskWithMaintenanceWindowMiddlewares(stack *middleware. if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -174,6 +205,9 @@ func addOperationRegisterTaskWithMaintenanceWindowMiddlewares(stack *middleware. if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addIdempotencyToken_opRegisterTaskWithMaintenanceWindowMiddleware(stack, options); err != nil { return err } @@ -183,6 +217,9 @@ func addOperationRegisterTaskWithMaintenanceWindowMiddlewares(stack *middleware. if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterTaskWithMaintenanceWindow(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -192,6 +229,9 @@ func addOperationRegisterTaskWithMaintenanceWindowMiddlewares(stack *middleware. if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -232,7 +272,6 @@ func newServiceMetadataMiddleware_opRegisterTaskWithMaintenanceWindow(region str return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "RegisterTaskWithMaintenanceWindow", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_RemoveTagsFromResource.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_RemoveTagsFromResource.go index 40e31b7b..f35351ee 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_RemoveTagsFromResource.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_RemoveTagsFromResource.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -17,7 +18,7 @@ func (c *Client) RemoveTagsFromResource(ctx context.Context, params *RemoveTagsF params = &RemoveTagsFromResourceInput{} } - result, metadata, err := c.invokeOperation(ctx, "RemoveTagsFromResource", params, optFns, addOperationRemoveTagsFromResourceMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "RemoveTagsFromResource", params, optFns, c.addOperationRemoveTagsFromResourceMiddlewares) if err != nil { return nil, err } @@ -30,19 +31,26 @@ func (c *Client) RemoveTagsFromResource(ctx context.Context, params *RemoveTagsF type RemoveTagsFromResourceInput struct { // The ID of the resource from which you want to remove tags. For example: - // ManagedInstance: mi-012345abcde MaintenanceWindow: mw-012345abcde PatchBaseline: - // pb-012345abcde For the Document and Parameter values, use the name of the - // resource. The ManagedInstance type for this API action is only for on-premises - // managed instances. Specify the name of the managed instance in the following - // format: mi-ID_number. For example, mi-1a2b3c4d5e6f. + // ManagedInstance: mi-012345abcde MaintenanceWindow: mw-012345abcde Automation : + // example-c160-4567-8519-012345abcde PatchBaseline: pb-012345abcde OpsMetadata + // object: ResourceID for tagging is created from the Amazon Resource Name (ARN) + // for the object. Specifically, ResourceID is created from the strings that come + // after the word opsmetadata in the ARN. For example, an OpsMetadata object with + // an ARN of + // arn:aws:ssm:us-east-2:1234567890:opsmetadata/aws/ssm/MyGroup/appmanager has a + // ResourceID of either aws/ssm/MyGroup/appmanager or /aws/ssm/MyGroup/appmanager . + // For the Document and Parameter values, use the name of the resource. The + // ManagedInstance type for this API operation is only for on-premises managed + // nodes. Specify the name of the managed node in the following format: + // mi-ID_number. For example, mi-1a2b3c4d5e6f. // // This member is required. ResourceId *string // The type of resource from which you want to remove a tag. The ManagedInstance - // type for this API action is only for on-premises managed instances. Specify the - // name of the managed instance in the following format: mi-ID_number. For example, - // mi-1a2b3c4d5e6f. + // type for this API operation is only for on-premises managed nodes. Specify the + // name of the managed node in the following format: mi-ID_number . For example, + // mi-1a2b3c4d5e6f . // // This member is required. ResourceType types.ResourceTypeForTagging @@ -51,14 +59,21 @@ type RemoveTagsFromResourceInput struct { // // This member is required. TagKeys []string + + noSmithyDocumentSerde } type RemoveTagsFromResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationRemoveTagsFromResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationRemoveTagsFromResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpRemoveTagsFromResource{}, middleware.After) if err != nil { return err @@ -67,6 +82,13 @@ func addOperationRemoveTagsFromResourceMiddlewares(stack *middleware.Stack, opti if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "RemoveTagsFromResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -85,16 +107,13 @@ func addOperationRemoveTagsFromResourceMiddlewares(stack *middleware.Stack, opti if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -103,12 +122,18 @@ func addOperationRemoveTagsFromResourceMiddlewares(stack *middleware.Stack, opti if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpRemoveTagsFromResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveTagsFromResource(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -118,6 +143,9 @@ func addOperationRemoveTagsFromResourceMiddlewares(stack *middleware.Stack, opti if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -125,7 +153,6 @@ func newServiceMetadataMiddleware_opRemoveTagsFromResource(region string) *awsmi return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "RemoveTagsFromResource", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ResetServiceSetting.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ResetServiceSetting.go index 876edc3d..fef61e36 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ResetServiceSetting.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ResetServiceSetting.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -11,25 +12,26 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// ServiceSetting is an account-level setting for an AWS service. This setting -// defines how a user interacts with or uses a service or a feature of a service. -// For example, if an AWS service charges money to the account based on feature or -// service usage, then the AWS service team might create a default setting of -// "false". This means the user can't use this feature unless they change the -// setting to "true" and intentionally opt in for a paid feature. Services map a -// SettingId object to a setting value. AWS services teams define the default value -// for a SettingId. You can't create a new SettingId, but you can overwrite the -// default value if you have the ssm:UpdateServiceSetting permission for the -// setting. Use the GetServiceSetting API action to view the current value. Use the -// UpdateServiceSetting API action to change the default setting. Reset the service -// setting for the account to the default value as provisioned by the AWS service +// ServiceSetting is an account-level setting for an Amazon Web Services service. +// This setting defines how a user interacts with or uses a service or a feature of +// a service. For example, if an Amazon Web Services service charges money to the +// account based on feature or service usage, then the Amazon Web Services service +// team might create a default setting of "false". This means the user can't use +// this feature unless they change the setting to "true" and intentionally opt in +// for a paid feature. Services map a SettingId object to a setting value. Amazon +// Web Services services teams define the default value for a SettingId . You can't +// create a new SettingId , but you can overwrite the default value if you have the +// ssm:UpdateServiceSetting permission for the setting. Use the GetServiceSetting +// API operation to view the current value. Use the UpdateServiceSetting API +// operation to change the default setting. Reset the service setting for the +// account to the default value as provisioned by the Amazon Web Services service // team. func (c *Client) ResetServiceSetting(ctx context.Context, params *ResetServiceSettingInput, optFns ...func(*Options)) (*ResetServiceSettingOutput, error) { if params == nil { params = &ResetServiceSettingInput{} } - result, metadata, err := c.invokeOperation(ctx, "ResetServiceSetting", params, optFns, addOperationResetServiceSettingMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "ResetServiceSetting", params, optFns, c.addOperationResetServiceSettingMiddlewares) if err != nil { return nil, err } @@ -39,31 +41,43 @@ func (c *Client) ResetServiceSetting(ctx context.Context, params *ResetServiceSe return out, nil } -// The request body of the ResetServiceSetting API action. +// The request body of the ResetServiceSetting API operation. type ResetServiceSettingInput struct { // The Amazon Resource Name (ARN) of the service setting to reset. The setting ID - // can be /ssm/parameter-store/default-parameter-tier, - // /ssm/parameter-store/high-throughput-enabled, or - // /ssm/managed-instance/activation-tier. For example, - // arn:aws:ssm:us-east-1:111122223333:servicesetting/ssm/parameter-store/high-throughput-enabled. + // can be one of the following. + // - /ssm/managed-instance/default-ec2-instance-management-role + // - /ssm/automation/customer-script-log-destination + // - /ssm/automation/customer-script-log-group-name + // - /ssm/documents/console/public-sharing-permission + // - /ssm/managed-instance/activation-tier + // - /ssm/opsinsights/opscenter + // - /ssm/parameter-store/default-parameter-tier + // - /ssm/parameter-store/high-throughput-enabled // // This member is required. SettingId *string + + noSmithyDocumentSerde } -// The result body of the ResetServiceSetting API action. +// The result body of the ResetServiceSetting API operation. type ResetServiceSettingOutput struct { - // The current, effective service setting after calling the ResetServiceSetting API - // action. + // The current, effective service setting after calling the ResetServiceSetting + // API operation. ServiceSetting *types.ServiceSetting // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationResetServiceSettingMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationResetServiceSettingMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpResetServiceSetting{}, middleware.After) if err != nil { return err @@ -72,6 +86,13 @@ func addOperationResetServiceSettingMiddlewares(stack *middleware.Stack, options if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ResetServiceSetting"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -90,16 +111,13 @@ func addOperationResetServiceSettingMiddlewares(stack *middleware.Stack, options if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -108,12 +126,18 @@ func addOperationResetServiceSettingMiddlewares(stack *middleware.Stack, options if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpResetServiceSettingValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opResetServiceSetting(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -123,6 +147,9 @@ func addOperationResetServiceSettingMiddlewares(stack *middleware.Stack, options if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -130,7 +157,6 @@ func newServiceMetadataMiddleware_opResetServiceSetting(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "ResetServiceSetting", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ResumeSession.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ResumeSession.go index 65f30a89..731f79e0 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ResumeSession.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_ResumeSession.go @@ -4,22 +4,24 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Reconnects a session to an instance after it has been disconnected. Connections -// can be resumed for disconnected sessions, but not terminated sessions. This -// command is primarily for use by client machines to automatically reconnect -// during intermittent network issues. It is not intended for any other use. +// Reconnects a session to a managed node after it has been disconnected. +// Connections can be resumed for disconnected sessions, but not terminated +// sessions. This command is primarily for use by client machines to automatically +// reconnect during intermittent network issues. It isn't intended for any other +// use. func (c *Client) ResumeSession(ctx context.Context, params *ResumeSessionInput, optFns ...func(*Options)) (*ResumeSessionOutput, error) { if params == nil { params = &ResumeSessionInput{} } - result, metadata, err := c.invokeOperation(ctx, "ResumeSession", params, optFns, addOperationResumeSessionMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "ResumeSession", params, optFns, c.addOperationResumeSessionMiddlewares) if err != nil { return nil, err } @@ -35,6 +37,8 @@ type ResumeSessionInput struct { // // This member is required. SessionId *string + + noSmithyDocumentSerde } type ResumeSessionOutput struct { @@ -42,26 +46,31 @@ type ResumeSessionOutput struct { // The ID of the session. SessionId *string - // A URL back to SSM Agent on the instance that the Session Manager client uses to - // send commands and receive output from the instance. Format: - // wss://ssmmessages.region.amazonaws.com/v1/data-channel/session-id?stream=(input|output). - // region represents the Region identifier for an AWS Region supported by AWS - // Systems Manager, such as us-east-2 for the US East (Ohio) Region. For a list of - // supported region values, see the Region column in Systems Manager service - // endpoints (http://docs.aws.amazon.com/general/latest/gr/ssm.html#ssm_region) in - // the AWS General Reference. session-id represents the ID of a Session Manager - // session, such as 1a2b3c4dEXAMPLE. + // A URL back to SSM Agent on the managed node that the Session Manager client + // uses to send commands and receive output from the managed node. Format: + // wss://ssmmessages.region.amazonaws.com/v1/data-channel/session-id?stream=(input|output) + // . region represents the Region identifier for an Amazon Web Services Region + // supported by Amazon Web Services Systems Manager, such as us-east-2 for the US + // East (Ohio) Region. For a list of supported region values, see the Region column + // in Systems Manager service endpoints (https://docs.aws.amazon.com/general/latest/gr/ssm.html#ssm_region) + // in the Amazon Web Services General Reference. session-id represents the ID of a + // Session Manager session, such as 1a2b3c4dEXAMPLE . StreamUrl *string // An encrypted token value containing session and caller information. Used to - // authenticate the connection to the instance. + // authenticate the connection to the managed node. TokenValue *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationResumeSessionMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationResumeSessionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpResumeSession{}, middleware.After) if err != nil { return err @@ -70,6 +79,13 @@ func addOperationResumeSessionMiddlewares(stack *middleware.Stack, options Optio if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ResumeSession"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -88,16 +104,13 @@ func addOperationResumeSessionMiddlewares(stack *middleware.Stack, options Optio if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -106,12 +119,18 @@ func addOperationResumeSessionMiddlewares(stack *middleware.Stack, options Optio if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpResumeSessionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opResumeSession(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -121,6 +140,9 @@ func addOperationResumeSessionMiddlewares(stack *middleware.Stack, options Optio if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -128,7 +150,6 @@ func newServiceMetadataMiddleware_opResumeSession(region string) *awsmiddleware. return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "ResumeSession", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_SendAutomationSignal.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_SendAutomationSignal.go index 4e26c2ca..94933a39 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_SendAutomationSignal.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_SendAutomationSignal.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -18,7 +19,7 @@ func (c *Client) SendAutomationSignal(ctx context.Context, params *SendAutomatio params = &SendAutomationSignalInput{} } - result, metadata, err := c.invokeOperation(ctx, "SendAutomationSignal", params, optFns, addOperationSendAutomationSignalMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "SendAutomationSignal", params, optFns, c.addOperationSendAutomationSignalMiddlewares) if err != nil { return nil, err } @@ -30,8 +31,8 @@ func (c *Client) SendAutomationSignal(ctx context.Context, params *SendAutomatio type SendAutomationSignalInput struct { - // The unique identifier for an existing Automation execution that you want to send - // the signal to. + // The unique identifier for an existing Automation execution that you want to + // send the signal to. // // This member is required. AutomationExecutionId *string @@ -50,14 +51,21 @@ type SendAutomationSignalInput struct { // ID as the payload. For example: // StepExecutionId="97fff367-fc5a-4299-aed8-0123456789ab" Payload map[string][]string + + noSmithyDocumentSerde } type SendAutomationSignalOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationSendAutomationSignalMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationSendAutomationSignalMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpSendAutomationSignal{}, middleware.After) if err != nil { return err @@ -66,6 +74,13 @@ func addOperationSendAutomationSignalMiddlewares(stack *middleware.Stack, option if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "SendAutomationSignal"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -84,16 +99,13 @@ func addOperationSendAutomationSignalMiddlewares(stack *middleware.Stack, option if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -102,12 +114,18 @@ func addOperationSendAutomationSignalMiddlewares(stack *middleware.Stack, option if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpSendAutomationSignalValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSendAutomationSignal(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -117,6 +135,9 @@ func addOperationSendAutomationSignalMiddlewares(stack *middleware.Stack, option if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -124,7 +145,6 @@ func newServiceMetadataMiddleware_opSendAutomationSignal(region string) *awsmidd return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "SendAutomationSignal", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_SendCommand.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_SendCommand.go index ef8daeef..76be45f4 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_SendCommand.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_SendCommand.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -11,13 +12,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Runs commands on one or more managed instances. +// Runs commands on one or more managed nodes. func (c *Client) SendCommand(ctx context.Context, params *SendCommandInput, optFns ...func(*Options)) (*SendCommandOutput, error) { if params == nil { params = &SendCommandInput{} } - result, metadata, err := c.invokeOperation(ctx, "SendCommand", params, optFns, addOperationSendCommandMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "SendCommand", params, optFns, c.addOperationSendCommandMiddlewares) if err != nil { return nil, err } @@ -29,13 +30,24 @@ func (c *Client) SendCommand(ctx context.Context, params *SendCommandInput, optF type SendCommandInput struct { - // Required. The name of the Systems Manager document to run. This can be a public - // document or a custom document. + // The name of the Amazon Web Services Systems Manager document (SSM document) to + // run. This can be a public document or a custom document. To run a shared + // document belonging to another account, specify the document Amazon Resource Name + // (ARN). For more information about how to use shared documents, see Using shared + // SSM documents (https://docs.aws.amazon.com/systems-manager/latest/userguide/ssm-using-shared.html) + // in the Amazon Web Services Systems Manager User Guide. If you specify a document + // name or ARN that hasn't been shared with your account, you receive an + // InvalidDocument error. // // This member is required. DocumentName *string - // Enables Systems Manager to send Run Command output to Amazon CloudWatch Logs. + // The CloudWatch alarm you want to apply to your command. + AlarmConfiguration *types.AlarmConfiguration + + // Enables Amazon Web Services Systems Manager to send Run Command output to + // Amazon CloudWatch Logs. Run Command is a capability of Amazon Web Services + // Systems Manager. CloudWatchOutputConfig *types.CloudWatchOutputConfig // User-specified information about the command, such as a brief description of @@ -50,40 +62,37 @@ type SendCommandInput struct { DocumentHashType types.DocumentHashType // The SSM document version to use in the request. You can specify $DEFAULT, - // $LATEST, or a specific version number. If you run commands by using the AWS CLI, - // then you must escape the first two options by using a backslash. If you specify - // a version number, then you don't need to use the backslash. For example: - // --document-version "\$DEFAULT" --document-version "\$LATEST" --document-version - // "3" + // $LATEST, or a specific version number. If you run commands by using the Command + // Line Interface (Amazon Web Services CLI), then you must escape the first two + // options by using a backslash. If you specify a version number, then you don't + // need to use the backslash. For example: --document-version "\$DEFAULT" + // --document-version "\$LATEST" --document-version "3" DocumentVersion *string - // The IDs of the instances where the command should run. Specifying instance IDs - // is most useful when you are targeting a limited number of instances, though you - // can specify up to 50 IDs. To target a larger number of instances, or if you - // prefer not to list individual instance IDs, we recommend using the Targets - // option instead. Using Targets, which accepts tag key-value pairs to identify the - // instances to send commands to, you can a send command to tens, hundreds, or - // thousands of instances at once. For more information about how to use targets, - // see Using targets and rate controls to send commands to a fleet - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/send-commands-multiple.html) - // in the AWS Systems Manager User Guide. + // The IDs of the managed nodes where the command should run. Specifying managed + // node IDs is most useful when you are targeting a limited number of managed + // nodes, though you can specify up to 50 IDs. To target a larger number of managed + // nodes, or if you prefer not to list individual node IDs, we recommend using the + // Targets option instead. Using Targets , which accepts tag key-value pairs to + // identify the managed nodes to send commands to, you can a send command to tens, + // hundreds, or thousands of nodes at once. For more information about how to use + // targets, see Using targets and rate controls to send commands to a fleet (https://docs.aws.amazon.com/systems-manager/latest/userguide/send-commands-multiple.html) + // in the Amazon Web Services Systems Manager User Guide. InstanceIds []string - // (Optional) The maximum number of instances that are allowed to run the command - // at the same time. You can specify a number such as 10 or a percentage such as - // 10%. The default value is 50. For more information about how to use - // MaxConcurrency, see Using concurrency controls - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/send-commands-multiple.html#send-commands-velocity) - // in the AWS Systems Manager User Guide. + // (Optional) The maximum number of managed nodes that are allowed to run the + // command at the same time. You can specify a number such as 10 or a percentage + // such as 10%. The default value is 50 . For more information about how to use + // MaxConcurrency , see Using concurrency controls (https://docs.aws.amazon.com/systems-manager/latest/userguide/send-commands-multiple.html#send-commands-velocity) + // in the Amazon Web Services Systems Manager User Guide. MaxConcurrency *string // The maximum number of errors allowed without the command failing. When the - // command fails one more time beyond the value of MaxErrors, the systems stops + // command fails one more time beyond the value of MaxErrors , the systems stops // sending the command to additional targets. You can specify a number like 10 or a - // percentage like 10%. The default value is 0. For more information about how to - // use MaxErrors, see Using error controls - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/send-commands-multiple.html#send-commands-maxerrors) - // in the AWS Systems Manager User Guide. + // percentage like 10%. The default value is 0 . For more information about how to + // use MaxErrors , see Using error controls (https://docs.aws.amazon.com/systems-manager/latest/userguide/send-commands-multiple.html#send-commands-maxerrors) + // in the Amazon Web Services Systems Manager User Guide. MaxErrors *string // Configurations for sending notifications. @@ -97,30 +106,36 @@ type SendCommandInput struct { OutputS3KeyPrefix *string // (Deprecated) You can no longer specify this parameter. The system ignores it. - // Instead, Systems Manager automatically determines the Region of the S3 bucket. + // Instead, Systems Manager automatically determines the Amazon Web Services Region + // of the S3 bucket. OutputS3Region *string // The required and optional parameters specified in the document being run. Parameters map[string][]string - // The ARN of the IAM service role to use to publish Amazon Simple Notification - // Service (Amazon SNS) notifications for Run Command commands. + // The ARN of the Identity and Access Management (IAM) service role to use to + // publish Amazon Simple Notification Service (Amazon SNS) notifications for Run + // Command commands. This role must provide the sns:Publish permission for your + // notification topic. For information about creating and using this service role, + // see Monitoring Systems Manager status changes using Amazon SNS notifications (https://docs.aws.amazon.com/systems-manager/latest/userguide/monitoring-sns-notifications.html) + // in the Amazon Web Services Systems Manager User Guide. ServiceRoleArn *string - // An array of search criteria that targets instances using a Key,Value combination - // that you specify. Specifying targets is most useful when you want to send a - // command to a large number of instances at once. Using Targets, which accepts tag - // key-value pairs to identify instances, you can send a command to tens, hundreds, - // or thousands of instances at once. To send a command to a smaller number of - // instances, you can use the InstanceIds option instead. For more information - // about how to use targets, see Sending commands to a fleet - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/send-commands-multiple.html) - // in the AWS Systems Manager User Guide. + // An array of search criteria that targets managed nodes using a Key,Value + // combination that you specify. Specifying targets is most useful when you want to + // send a command to a large number of managed nodes at once. Using Targets , which + // accepts tag key-value pairs to identify managed nodes, you can send a command to + // tens, hundreds, or thousands of nodes at once. To send a command to a smaller + // number of managed nodes, you can use the InstanceIds option instead. For more + // information about how to use targets, see Sending commands to a fleet (https://docs.aws.amazon.com/systems-manager/latest/userguide/send-commands-multiple.html) + // in the Amazon Web Services Systems Manager User Guide. Targets []types.Target - // If this time is reached and the command has not already started running, it will - // not run. - TimeoutSeconds int32 + // If this time is reached and the command hasn't already started running, it + // won't run. + TimeoutSeconds *int32 + + noSmithyDocumentSerde } type SendCommandOutput struct { @@ -131,9 +146,14 @@ type SendCommandOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationSendCommandMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationSendCommandMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpSendCommand{}, middleware.After) if err != nil { return err @@ -142,6 +162,13 @@ func addOperationSendCommandMiddlewares(stack *middleware.Stack, options Options if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "SendCommand"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -160,16 +187,13 @@ func addOperationSendCommandMiddlewares(stack *middleware.Stack, options Options if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -178,12 +202,18 @@ func addOperationSendCommandMiddlewares(stack *middleware.Stack, options Options if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpSendCommandValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSendCommand(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -193,6 +223,9 @@ func addOperationSendCommandMiddlewares(stack *middleware.Stack, options Options if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -200,7 +233,6 @@ func newServiceMetadataMiddleware_opSendCommand(region string) *awsmiddleware.Re return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "SendCommand", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_StartAssociationsOnce.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_StartAssociationsOnce.go index 290cb570..b1346fca 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_StartAssociationsOnce.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_StartAssociationsOnce.go @@ -4,20 +4,21 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Use this API action to run an association immediately and only one time. This -// action can be helpful when troubleshooting associations. +// Runs an association immediately and only one time. This operation can be +// helpful when troubleshooting associations. func (c *Client) StartAssociationsOnce(ctx context.Context, params *StartAssociationsOnceInput, optFns ...func(*Options)) (*StartAssociationsOnceOutput, error) { if params == nil { params = &StartAssociationsOnceInput{} } - result, metadata, err := c.invokeOperation(ctx, "StartAssociationsOnce", params, optFns, addOperationStartAssociationsOnceMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "StartAssociationsOnce", params, optFns, c.addOperationStartAssociationsOnceMiddlewares) if err != nil { return nil, err } @@ -33,14 +34,21 @@ type StartAssociationsOnceInput struct { // // This member is required. AssociationIds []string + + noSmithyDocumentSerde } type StartAssociationsOnceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationStartAssociationsOnceMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationStartAssociationsOnceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartAssociationsOnce{}, middleware.After) if err != nil { return err @@ -49,6 +57,13 @@ func addOperationStartAssociationsOnceMiddlewares(stack *middleware.Stack, optio if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "StartAssociationsOnce"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -67,16 +82,13 @@ func addOperationStartAssociationsOnceMiddlewares(stack *middleware.Stack, optio if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -85,12 +97,18 @@ func addOperationStartAssociationsOnceMiddlewares(stack *middleware.Stack, optio if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpStartAssociationsOnceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartAssociationsOnce(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -100,6 +118,9 @@ func addOperationStartAssociationsOnceMiddlewares(stack *middleware.Stack, optio if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -107,7 +128,6 @@ func newServiceMetadataMiddleware_opStartAssociationsOnce(region string) *awsmid return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "StartAssociationsOnce", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_StartAutomationExecution.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_StartAutomationExecution.go index 8999eab5..fcdb6775 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_StartAutomationExecution.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_StartAutomationExecution.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -11,13 +12,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Initiates execution of an Automation document. +// Initiates execution of an Automation runbook. func (c *Client) StartAutomationExecution(ctx context.Context, params *StartAutomationExecutionInput, optFns ...func(*Options)) (*StartAutomationExecutionOutput, error) { if params == nil { params = &StartAutomationExecutionInput{} } - result, metadata, err := c.invokeOperation(ctx, "StartAutomationExecution", params, optFns, addOperationStartAutomationExecutionMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "StartAutomationExecution", params, optFns, c.addOperationStartAutomationExecutionMiddlewares) if err != nil { return nil, err } @@ -29,21 +30,28 @@ func (c *Client) StartAutomationExecution(ctx context.Context, params *StartAuto type StartAutomationExecutionInput struct { - // The name of the Automation document to use for this execution. + // The name of the SSM document to run. This can be a public document or a custom + // document. To run a shared document belonging to another account, specify the + // document ARN. For more information about how to use shared documents, see Using + // shared SSM documents (https://docs.aws.amazon.com/systems-manager/latest/userguide/ssm-using-shared.html) + // in the Amazon Web Services Systems Manager User Guide. // // This member is required. DocumentName *string + // The CloudWatch alarm you want to apply to your automation. + AlarmConfiguration *types.AlarmConfiguration + // User-provided idempotency token. The token must be unique, is case insensitive, // enforces the UUID format, and can't be reused. ClientToken *string - // The version of the Automation document to use for this execution. + // The version of the Automation runbook to use for this execution. DocumentVersion *string // The maximum number of targets allowed to run this task in parallel. You can // specify a number, such as 10, or a percentage, such as 10%. The default value is - // 10. + // 10 . MaxConcurrency *string // The number of errors that are allowed before the system stops running the @@ -65,34 +73,29 @@ type StartAutomationExecutionInput struct { Mode types.ExecutionMode // A key-value map of execution parameters, which match the declared parameters in - // the Automation document. + // the Automation runbook. Parameters map[string][]string // Optional metadata that you assign to a resource. You can specify a maximum of // five tags for an automation. Tags enable you to categorize a resource in // different ways, such as by purpose, owner, or environment. For example, you // might want to tag an automation to identify an environment or operating system. - // In this case, you could specify the following key name/value pairs: - // - // * - // Key=environment,Value=test - // - // * Key=OS,Value=Windows - // - // To add tags to an existing - // patch baseline, use the AddTagsToResource action. + // In this case, you could specify the following key-value pairs: + // - Key=environment,Value=test + // - Key=OS,Value=Windows + // To add tags to an existing automation, use the AddTagsToResource operation. Tags []types.Tag - // A location is a combination of AWS Regions and/or AWS accounts where you want to - // run the Automation. Use this action to start an Automation in multiple Regions - // and multiple accounts. For more information, see Running Automation workflows in - // multiple AWS Regions and accounts - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-automation-multiple-accounts-and-regions.html) - // in the AWS Systems Manager User Guide. + // A location is a combination of Amazon Web Services Regions and/or Amazon Web + // Services accounts where you want to run the automation. Use this operation to + // start an automation in multiple Amazon Web Services Regions and multiple Amazon + // Web Services accounts. For more information, see Running Automation workflows + // in multiple Amazon Web Services Regions and Amazon Web Services accounts (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-automation-multiple-accounts-and-regions.html) + // in the Amazon Web Services Systems Manager User Guide. TargetLocations []types.TargetLocation - // A key-value mapping of document parameters to target resources. Both Targets and - // TargetMaps cannot be specified together. + // A key-value mapping of document parameters to target resources. Both Targets + // and TargetMaps can't be specified together. TargetMaps []map[string][]string // The name of the parameter used as the target resource for the rate-controlled @@ -102,6 +105,8 @@ type StartAutomationExecutionInput struct { // A key-value mapping to target resources. Required if you specify // TargetParameterName. Targets []types.Target + + noSmithyDocumentSerde } type StartAutomationExecutionOutput struct { @@ -111,9 +116,14 @@ type StartAutomationExecutionOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationStartAutomationExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationStartAutomationExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartAutomationExecution{}, middleware.After) if err != nil { return err @@ -122,6 +132,13 @@ func addOperationStartAutomationExecutionMiddlewares(stack *middleware.Stack, op if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "StartAutomationExecution"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -140,16 +157,13 @@ func addOperationStartAutomationExecutionMiddlewares(stack *middleware.Stack, op if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -158,12 +172,18 @@ func addOperationStartAutomationExecutionMiddlewares(stack *middleware.Stack, op if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpStartAutomationExecutionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartAutomationExecution(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -173,6 +193,9 @@ func addOperationStartAutomationExecutionMiddlewares(stack *middleware.Stack, op if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -180,7 +203,6 @@ func newServiceMetadataMiddleware_opStartAutomationExecution(region string) *aws return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "StartAutomationExecution", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_StartChangeRequestExecution.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_StartChangeRequestExecution.go index c1e95954..556361e2 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_StartChangeRequestExecution.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_StartChangeRequestExecution.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -12,15 +13,15 @@ import ( "time" ) -// Creates a change request for Change Manager. The runbooks (Automation documents) -// specified in the change request run only after all required approvals for the -// change request have been received. +// Creates a change request for Change Manager. The Automation runbooks specified +// in the change request run only after all required approvals for the change +// request have been received. func (c *Client) StartChangeRequestExecution(ctx context.Context, params *StartChangeRequestExecutionInput, optFns ...func(*Options)) (*StartChangeRequestExecutionOutput, error) { if params == nil { params = &StartChangeRequestExecutionInput{} } - result, metadata, err := c.invokeOperation(ctx, "StartChangeRequestExecution", params, optFns, addOperationStartChangeRequestExecutionMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "StartChangeRequestExecution", params, optFns, c.addOperationStartChangeRequestExecutionMiddlewares) if err != nil { return nil, err } @@ -37,14 +38,28 @@ type StartChangeRequestExecutionInput struct { // This member is required. DocumentName *string - // Information about the Automation runbooks (Automation documents) that are run - // during the runbook workflow. The Automation runbooks specified for the runbook - // workflow can't run until all required approvals for the change request have been - // received. + // Information about the Automation runbooks that are run during the runbook + // workflow. The Automation runbooks specified for the runbook workflow can't run + // until all required approvals for the change request have been received. // // This member is required. Runbooks []types.Runbook + // Indicates whether the change request can be approved automatically without the + // need for manual approvals. If AutoApprovable is enabled in a change template, + // then setting AutoApprove to true in StartChangeRequestExecution creates a + // change request that bypasses approver review. Change Calendar restrictions are + // not bypassed in this scenario. If the state of an associated calendar is CLOSED + // , change freeze approvers must still grant permission for this change request to + // run. If they don't, the change won't be processed until the calendar state is + // again OPEN . + AutoApprove bool + + // User-provided details about the change. If no details are provided, content + // specified in the Template information section of the associated change template + // is added. + ChangeDetails *string + // The name of the change request associated with the runbook workflow to be run. ChangeRequestName *string @@ -59,6 +74,11 @@ type StartChangeRequestExecutionInput struct { // template document. Parameters map[string][]string + // The time that the requester expects the runbook workflow related to the change + // request to complete. The time is an estimate only that the requester provides + // for reviewers. + ScheduledEndTime *time.Time + // The date and time specified in the change request to run the Automation // runbooks. The Automation runbooks specified for the runbook workflow can't run // until all required approvals for the change request have been received. @@ -67,14 +87,14 @@ type StartChangeRequestExecutionInput struct { // Optional metadata that you assign to a resource. You can specify a maximum of // five tags for a change request. Tags enable you to categorize a resource in // different ways, such as by purpose, owner, or environment. For example, you - // might want to tag a change request to identify an environment or target AWS - // Region. In this case, you could specify the following key-value pairs: - // - // * - // Key=Environment,Value=Production - // - // * Key=Region,Value=us-east-2 + // might want to tag a change request to identify an environment or target Amazon + // Web Services Region. In this case, you could specify the following key-value + // pairs: + // - Key=Environment,Value=Production + // - Key=Region,Value=us-east-2 Tags []types.Tag + + noSmithyDocumentSerde } type StartChangeRequestExecutionOutput struct { @@ -85,9 +105,14 @@ type StartChangeRequestExecutionOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationStartChangeRequestExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationStartChangeRequestExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartChangeRequestExecution{}, middleware.After) if err != nil { return err @@ -96,6 +121,13 @@ func addOperationStartChangeRequestExecutionMiddlewares(stack *middleware.Stack, if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "StartChangeRequestExecution"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -114,16 +146,13 @@ func addOperationStartChangeRequestExecutionMiddlewares(stack *middleware.Stack, if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -132,12 +161,18 @@ func addOperationStartChangeRequestExecutionMiddlewares(stack *middleware.Stack, if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpStartChangeRequestExecutionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartChangeRequestExecution(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -147,6 +182,9 @@ func addOperationStartChangeRequestExecutionMiddlewares(stack *middleware.Stack, if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -154,7 +192,6 @@ func newServiceMetadataMiddleware_opStartChangeRequestExecution(region string) * return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "StartChangeRequestExecution", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_StartSession.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_StartSession.go index 65afbf10..0fbe804e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_StartSession.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_StartSession.go @@ -4,28 +4,29 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Initiates a connection to a target (for example, an instance) for a Session +// Initiates a connection to a target (for example, a managed node) for a Session // Manager session. Returns a URL and token that can be used to open a WebSocket -// connection for sending input and receiving outputs. AWS CLI usage: start-session -// is an interactive command that requires the Session Manager plugin to be -// installed on the client machine making the call. For information, see Install -// the Session Manager plugin for the AWS CLI -// (https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html) -// in the AWS Systems Manager User Guide. AWS Tools for PowerShell usage: -// Start-SSMSession is not currently supported by AWS Tools for PowerShell on -// Windows local machines. +// connection for sending input and receiving outputs. Amazon Web Services CLI +// usage: start-session is an interactive command that requires the Session +// Manager plugin to be installed on the client machine making the call. For +// information, see Install the Session Manager plugin for the Amazon Web Services +// CLI (https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html) +// in the Amazon Web Services Systems Manager User Guide. Amazon Web Services Tools +// for PowerShell usage: Start-SSMSession isn't currently supported by Amazon Web +// Services Tools for PowerShell on Windows local machines. func (c *Client) StartSession(ctx context.Context, params *StartSessionInput, optFns ...func(*Options)) (*StartSessionOutput, error) { if params == nil { params = &StartSessionInput{} } - result, metadata, err := c.invokeOperation(ctx, "StartSession", params, optFns, addOperationStartSessionMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "StartSession", params, optFns, c.addOperationStartSessionMiddlewares) if err != nil { return nil, err } @@ -37,20 +38,30 @@ func (c *Client) StartSession(ctx context.Context, params *StartSessionInput, op type StartSessionInput struct { - // The instance to connect to for the session. + // The managed node to connect to for the session. // // This member is required. Target *string - // The name of the SSM document to define the parameters and plugin settings for - // the session. For example, SSM-SessionManagerRunShell. You can call the - // GetDocument API to verify the document exists before attempting to start a - // session. If no document name is provided, a shell to the instance is launched by - // default. + // The name of the SSM document you want to use to define the type of session, + // input parameters, or preferences for the session. For example, + // SSM-SessionManagerRunShell . You can call the GetDocument API to verify the + // document exists before attempting to start a session. If no document name is + // provided, a shell to the managed node is launched by default. For more + // information, see Start a session (https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-sessions-start.html) + // in the Amazon Web Services Systems Manager User Guide. DocumentName *string - // Reserved for future use. + // The values you want to specify for the parameters defined in the Session + // document. Parameters map[string][]string + + // The reason for connecting to the instance. This value is included in the + // details for the Amazon CloudWatch Events event created when you start the + // session. + Reason *string + + noSmithyDocumentSerde } type StartSessionOutput struct { @@ -58,26 +69,33 @@ type StartSessionOutput struct { // The ID of the session. SessionId *string - // A URL back to SSM Agent on the instance that the Session Manager client uses to - // send commands and receive output from the instance. Format: + // A URL back to SSM Agent on the managed node that the Session Manager client + // uses to send commands and receive output from the node. Format: // wss://ssmmessages.region.amazonaws.com/v1/data-channel/session-id?stream=(input|output) - // region represents the Region identifier for an AWS Region supported by AWS - // Systems Manager, such as us-east-2 for the US East (Ohio) Region. For a list of - // supported region values, see the Region column in Systems Manager service - // endpoints (http://docs.aws.amazon.com/general/latest/gr/ssm.html#ssm_region) in - // the AWS General Reference. session-id represents the ID of a Session Manager - // session, such as 1a2b3c4dEXAMPLE. + // region represents the Region identifier for an Amazon Web Services Region + // supported by Amazon Web Services Systems Manager, such as us-east-2 for the US + // East (Ohio) Region. For a list of supported region values, see the Region column + // in Systems Manager service endpoints (https://docs.aws.amazon.com/general/latest/gr/ssm.html#ssm_region) + // in the Amazon Web Services General Reference. session-id represents the ID of a + // Session Manager session, such as 1a2b3c4dEXAMPLE . StreamUrl *string - // An encrypted token value containing session and caller information. Used to - // authenticate the connection to the instance. + // An encrypted token value containing session and caller information. This token + // is used to authenticate the connection to the managed node, and is valid only + // long enough to ensure the connection is successful. Never share your session's + // token. TokenValue *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationStartSessionMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationStartSessionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartSession{}, middleware.After) if err != nil { return err @@ -86,6 +104,13 @@ func addOperationStartSessionMiddlewares(stack *middleware.Stack, options Option if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "StartSession"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -104,16 +129,13 @@ func addOperationStartSessionMiddlewares(stack *middleware.Stack, options Option if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -122,12 +144,18 @@ func addOperationStartSessionMiddlewares(stack *middleware.Stack, options Option if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpStartSessionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartSession(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -137,6 +165,9 @@ func addOperationStartSessionMiddlewares(stack *middleware.Stack, options Option if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -144,7 +175,6 @@ func newServiceMetadataMiddleware_opStartSession(region string) *awsmiddleware.R return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "StartSession", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_StopAutomationExecution.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_StopAutomationExecution.go index 0fafe11a..cb2928c9 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_StopAutomationExecution.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_StopAutomationExecution.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -17,7 +18,7 @@ func (c *Client) StopAutomationExecution(ctx context.Context, params *StopAutoma params = &StopAutomationExecutionInput{} } - result, metadata, err := c.invokeOperation(ctx, "StopAutomationExecution", params, optFns, addOperationStopAutomationExecutionMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "StopAutomationExecution", params, optFns, c.addOperationStopAutomationExecutionMiddlewares) if err != nil { return nil, err } @@ -37,14 +38,21 @@ type StopAutomationExecutionInput struct { // The stop request type. Valid types include the following: Cancel and Complete. // The default type is Cancel. Type types.StopType + + noSmithyDocumentSerde } type StopAutomationExecutionOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationStopAutomationExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationStopAutomationExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpStopAutomationExecution{}, middleware.After) if err != nil { return err @@ -53,6 +61,13 @@ func addOperationStopAutomationExecutionMiddlewares(stack *middleware.Stack, opt if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "StopAutomationExecution"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -71,16 +86,13 @@ func addOperationStopAutomationExecutionMiddlewares(stack *middleware.Stack, opt if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -89,12 +101,18 @@ func addOperationStopAutomationExecutionMiddlewares(stack *middleware.Stack, opt if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpStopAutomationExecutionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopAutomationExecution(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -104,6 +122,9 @@ func addOperationStopAutomationExecutionMiddlewares(stack *middleware.Stack, opt if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -111,7 +132,6 @@ func newServiceMetadataMiddleware_opStopAutomationExecution(region string) *awsm return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "StopAutomationExecution", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_TerminateSession.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_TerminateSession.go index e2cb1865..f1dbd68c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_TerminateSession.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_TerminateSession.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" @@ -11,14 +12,14 @@ import ( ) // Permanently ends a session and closes the data connection between the Session -// Manager client and SSM Agent on the instance. A terminated session cannot be +// Manager client and SSM Agent on the managed node. A terminated session can't be // resumed. func (c *Client) TerminateSession(ctx context.Context, params *TerminateSessionInput, optFns ...func(*Options)) (*TerminateSessionOutput, error) { if params == nil { params = &TerminateSessionInput{} } - result, metadata, err := c.invokeOperation(ctx, "TerminateSession", params, optFns, addOperationTerminateSessionMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "TerminateSession", params, optFns, c.addOperationTerminateSessionMiddlewares) if err != nil { return nil, err } @@ -34,6 +35,8 @@ type TerminateSessionInput struct { // // This member is required. SessionId *string + + noSmithyDocumentSerde } type TerminateSessionOutput struct { @@ -43,9 +46,14 @@ type TerminateSessionOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationTerminateSessionMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationTerminateSessionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpTerminateSession{}, middleware.After) if err != nil { return err @@ -54,6 +62,13 @@ func addOperationTerminateSessionMiddlewares(stack *middleware.Stack, options Op if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "TerminateSession"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -72,16 +87,13 @@ func addOperationTerminateSessionMiddlewares(stack *middleware.Stack, options Op if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -90,12 +102,18 @@ func addOperationTerminateSessionMiddlewares(stack *middleware.Stack, options Op if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpTerminateSessionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTerminateSession(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -105,6 +123,9 @@ func addOperationTerminateSessionMiddlewares(stack *middleware.Stack, options Op if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -112,7 +133,6 @@ func newServiceMetadataMiddleware_opTerminateSession(region string) *awsmiddlewa return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "TerminateSession", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UnlabelParameterVersion.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UnlabelParameterVersion.go new file mode 100644 index 00000000..f45c3ff3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UnlabelParameterVersion.go @@ -0,0 +1,150 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssm + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Remove a label or labels from a parameter. +func (c *Client) UnlabelParameterVersion(ctx context.Context, params *UnlabelParameterVersionInput, optFns ...func(*Options)) (*UnlabelParameterVersionOutput, error) { + if params == nil { + params = &UnlabelParameterVersionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UnlabelParameterVersion", params, optFns, c.addOperationUnlabelParameterVersionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UnlabelParameterVersionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UnlabelParameterVersionInput struct { + + // One or more labels to delete from the specified parameter version. + // + // This member is required. + Labels []string + + // The name of the parameter from which you want to delete one or more labels. + // + // This member is required. + Name *string + + // The specific version of the parameter which you want to delete one or more + // labels from. If it isn't present, the call will fail. + // + // This member is required. + ParameterVersion *int64 + + noSmithyDocumentSerde +} + +type UnlabelParameterVersionOutput struct { + + // The labels that aren't attached to the given parameter version. + InvalidLabels []string + + // A list of all labels deleted from the parameter. + RemovedLabels []string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUnlabelParameterVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUnlabelParameterVersion{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUnlabelParameterVersion{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UnlabelParameterVersion"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpUnlabelParameterVersionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUnlabelParameterVersion(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUnlabelParameterVersion(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UnlabelParameterVersion", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateAssociation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateAssociation.go index 5f0ebfdc..d72a6986 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateAssociation.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateAssociation.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -12,20 +13,28 @@ import ( ) // Updates an association. You can update the association name and version, the -// document version, schedule, parameters, and Amazon S3 output. In order to call -// this API action, your IAM user account, group, or role must be configured with -// permission to call the DescribeAssociation API action. If you don't have -// permission to call DescribeAssociation, then you receive the following error: An -// error occurred (AccessDeniedException) when calling the UpdateAssociation -// operation: User: is not authorized to perform: ssm:DescribeAssociation on -// resource: When you update an association, the association immediately runs -// against the specified targets. +// document version, schedule, parameters, and Amazon Simple Storage Service +// (Amazon S3) output. When you call UpdateAssociation , the system removes all +// optional parameters from the request and overwrites the association with null +// values for those parameters. This is by design. You must specify all optional +// parameters in the call, even if you are not changing the parameters. This +// includes the Name parameter. Before calling this API action, we recommend that +// you call the DescribeAssociation API operation and make a note of all optional +// parameters required for your UpdateAssociation call. In order to call this API +// operation, a user, group, or role must be granted permission to call the +// DescribeAssociation API operation. If you don't have permission to call +// DescribeAssociation , then you receive the following error: An error occurred +// (AccessDeniedException) when calling the UpdateAssociation operation: User: +// isn't authorized to perform: ssm:DescribeAssociation on resource: When you +// update an association, the association immediately runs against the specified +// targets. You can add the ApplyOnlyAtCronInterval parameter to run the +// association during the next schedule run. func (c *Client) UpdateAssociation(ctx context.Context, params *UpdateAssociationInput, optFns ...func(*Options)) (*UpdateAssociationOutput, error) { if params == nil { params = &UpdateAssociationInput{} } - result, metadata, err := c.invokeOperation(ctx, "UpdateAssociation", params, optFns, addOperationUpdateAssociationMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "UpdateAssociation", params, optFns, c.addOperationUpdateAssociationMiddlewares) if err != nil { return nil, err } @@ -42,14 +51,26 @@ type UpdateAssociationInput struct { // This member is required. AssociationId *string - // By default, when you update an association, the system runs it immediately after - // it is updated and then according to the schedule you specified. Specify this - // option if you don't want an association to run immediately after you update it. - // This parameter is not supported for rate expressions. Also, if you specified - // this option when you created the association, you can reset it. To do so, - // specify the no-apply-only-at-cron-interval parameter when you update the - // association from the command line. This parameter forces the association to run - // immediately after updating it and according to the interval specified. + // The details for the CloudWatch alarm you want to apply to an automation or + // command. + AlarmConfiguration *types.AlarmConfiguration + + // By default, when you update an association, the system runs it immediately + // after it is updated and then according to the schedule you specified. Specify + // this option if you don't want an association to run immediately after you update + // it. This parameter isn't supported for rate expressions. If you chose this + // option when you created an association and later you edit that association or + // you make changes to the SSM document on which that association is based (by + // using the Documents page in the console), State Manager applies the association + // at the next specified cron interval. For example, if you chose the Latest + // version of an SSM document when you created an association and you edit the + // association by choosing a different document version on the Documents page, + // State Manager applies the association at the next specified cron interval if you + // previously selected this option. If this option wasn't selected, State Manager + // immediately runs the association. You can reset this option. To do so, specify + // the no-apply-only-at-cron-interval parameter when you update the association + // from the command line. This parameter forces the association to run immediately + // after updating it and according to the interval specified. ApplyOnlyAtCronInterval bool // The name of the association that you want to update. @@ -57,27 +78,42 @@ type UpdateAssociationInput struct { // This parameter is provided for concurrency control purposes. You must specify // the latest association version in the service. If you want to ensure that this - // request succeeds, either specify $LATEST, or omit this parameter. + // request succeeds, either specify $LATEST , or omit this parameter. AssociationVersion *string - // Specify the target for the association. This target is required for associations - // that use an Automation document and target resources by using rate controls. + // Choose the parameter that will define how your automation will branch out. This + // target is required for associations that use an Automation runbook and target + // resources by using rate controls. Automation is a capability of Amazon Web + // Services Systems Manager. AutomationTargetParameterName *string + // The names or Amazon Resource Names (ARNs) of the Change Calendar type documents + // you want to gate your associations under. The associations only run when that + // change calendar is open. For more information, see Amazon Web Services Systems + // Manager Change Calendar (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-change-calendar) + // . + CalendarNames []string + // The severity level to assign to the association. ComplianceSeverity types.AssociationComplianceSeverity - // The document version you want update for the association. + // The document version you want update for the association. State Manager doesn't + // support running associations that use a new version of a document if that + // document is shared from another account. State Manager always runs the default + // version of a document if shared from another account, even though the Systems + // Manager console shows that a new version was processed. If you want to run an + // association using a new version of a document shared form another account, you + // must set the document version to default . DocumentVersion *string // The maximum number of targets allowed to run the association at the same time. // You can specify a number, for example 10, or a percentage of the target set, for // example 10%. The default value is 100%, which means all targets run the - // association at the same time. If a new instance starts and attempts to run an - // association while Systems Manager is running MaxConcurrency associations, the - // association is allowed to run. During the next association interval, the new - // instance will process its association within the limit specified for - // MaxConcurrency. + // association at the same time. If a new managed node starts and attempts to run + // an association while Systems Manager is running MaxConcurrency associations, + // the association is allowed to run. During the next association interval, the new + // managed node will process its association within the limit specified for + // MaxConcurrency . MaxConcurrency *string // The number of errors that are allowed before the system stops sending requests @@ -86,55 +122,73 @@ type UpdateAssociationInput struct { // 10%. If you specify 3, for example, the system stops sending requests when the // fourth error is received. If you specify 0, then the system stops sending // requests after the first error is returned. If you run an association on 50 - // instances and set MaxError to 10%, then the system stops sending the request - // when the sixth error is received. Executions that are already running an - // association when MaxErrors is reached are allowed to complete, but some of these - // executions may fail as well. If you need to ensure that there won't be more than - // max-errors failed executions, set MaxConcurrency to 1 so that executions proceed - // one at a time. + // managed nodes and set MaxError to 10%, then the system stops sending the + // request when the sixth error is received. Executions that are already running an + // association when MaxErrors is reached are allowed to complete, but some of + // these executions may fail as well. If you need to ensure that there won't be + // more than max-errors failed executions, set MaxConcurrency to 1 so that + // executions proceed one at a time. MaxErrors *string - // The name of the SSM document that contains the configuration information for the - // instance. You can specify Command or Automation documents. You can specify - // AWS-predefined documents, documents you created, or a document that is shared - // with you from another account. For SSM documents that are shared with you from - // other AWS accounts, you must specify the complete SSM document ARN, in the - // following format: arn:aws:ssm:region:account-id:document/document-name For - // example: arn:aws:ssm:us-east-2:12345678912:document/My-Shared-Document For - // AWS-predefined documents and SSM documents you created in your account, you only - // need to specify the document name. For example, AWS-ApplyPatchBaseline or - // My-Document. + // The name of the SSM Command document or Automation runbook that contains the + // configuration information for the managed node. You can specify Amazon Web + // Services-predefined documents, documents you created, or a document that is + // shared with you from another account. For Systems Manager document (SSM + // document) that are shared with you from other Amazon Web Services accounts, you + // must specify the complete SSM document ARN, in the following format: + // arn:aws:ssm:region:account-id:document/document-name For example: + // arn:aws:ssm:us-east-2:12345678912:document/My-Shared-Document For Amazon Web + // Services-predefined documents and SSM documents you created in your account, you + // only need to specify the document name. For example, AWS-ApplyPatchBaseline or + // My-Document . Name *string // An S3 bucket where you want to store the results of this request. OutputLocation *types.InstanceAssociationOutputLocation - // The parameters you want to update for the association. If you create a parameter - // using Parameter Store, you can reference the parameter using - // {{ssm:parameter-name}} + // The parameters you want to update for the association. If you create a + // parameter using Parameter Store, a capability of Amazon Web Services Systems + // Manager, you can reference the parameter using {{ssm:parameter-name}} . Parameters map[string][]string // The cron expression used to schedule the association that you want to update. ScheduleExpression *string - // The mode for generating association compliance. You can specify AUTO or MANUAL. + // Number of days to wait after the scheduled day to run an association. For + // example, if you specified a cron schedule of cron(0 0 ? * THU#2 *) , you could + // specify an offset of 3 to run the association each Sunday after the second + // Thursday of the month. For more information about cron schedules for + // associations, see Reference: Cron and rate expressions for Systems Manager (https://docs.aws.amazon.com/systems-manager/latest/userguide/reference-cron-and-rate-expressions.html) + // in the Amazon Web Services Systems Manager User Guide. To use offsets, you must + // specify the ApplyOnlyAtCronInterval parameter. This option tells the system not + // to run an association immediately after you create it. + ScheduleOffset *int32 + + // The mode for generating association compliance. You can specify AUTO or MANUAL . // In AUTO mode, the system uses the status of the association execution to // determine the compliance status. If the association execution runs successfully, - // then the association is COMPLIANT. If the association execution doesn't run - // successfully, the association is NON-COMPLIANT. In MANUAL mode, you must specify - // the AssociationId as a parameter for the PutComplianceItems API action. In this - // case, compliance data is not managed by State Manager. It is managed by your - // direct call to the PutComplianceItems API action. By default, all associations - // use AUTO mode. + // then the association is COMPLIANT . If the association execution doesn't run + // successfully, the association is NON-COMPLIANT . In MANUAL mode, you must + // specify the AssociationId as a parameter for the PutComplianceItems API + // operation. In this case, compliance data isn't managed by State Manager, a + // capability of Amazon Web Services Systems Manager. It is managed by your direct + // call to the PutComplianceItems API operation. By default, all associations use + // AUTO mode. SyncCompliance types.AssociationSyncCompliance - // A location is a combination of AWS Regions and AWS accounts where you want to - // run the association. Use this action to update an association in multiple - // Regions and multiple accounts. + // A location is a combination of Amazon Web Services Regions and Amazon Web + // Services accounts where you want to run the association. Use this action to + // update an association in multiple Regions and multiple accounts. TargetLocations []types.TargetLocation + // A key-value mapping of document parameters to target resources. Both Targets + // and TargetMaps can't be specified together. + TargetMaps []map[string][]string + // The targets of the association. Targets []types.Target + + noSmithyDocumentSerde } type UpdateAssociationOutput struct { @@ -144,9 +198,14 @@ type UpdateAssociationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationUpdateAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationUpdateAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateAssociation{}, middleware.After) if err != nil { return err @@ -155,6 +214,13 @@ func addOperationUpdateAssociationMiddlewares(stack *middleware.Stack, options O if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateAssociation"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -173,16 +239,13 @@ func addOperationUpdateAssociationMiddlewares(stack *middleware.Stack, options O if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -191,12 +254,18 @@ func addOperationUpdateAssociationMiddlewares(stack *middleware.Stack, options O if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpUpdateAssociationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAssociation(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -206,6 +275,9 @@ func addOperationUpdateAssociationMiddlewares(stack *middleware.Stack, options O if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -213,7 +285,6 @@ func newServiceMetadataMiddleware_opUpdateAssociation(region string) *awsmiddlew return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "UpdateAssociation", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateAssociationStatus.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateAssociationStatus.go index 1b5ca97a..6030e693 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateAssociationStatus.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateAssociationStatus.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -11,14 +12,17 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Updates the status of the Systems Manager document associated with the specified -// instance. +// Updates the status of the Amazon Web Services Systems Manager document (SSM +// document) associated with the specified managed node. UpdateAssociationStatus +// is primarily used by the Amazon Web Services Systems Manager Agent (SSM Agent) +// to report status updates about your associations and is only used for +// associations created with the InstanceId legacy parameter. func (c *Client) UpdateAssociationStatus(ctx context.Context, params *UpdateAssociationStatusInput, optFns ...func(*Options)) (*UpdateAssociationStatusOutput, error) { if params == nil { params = &UpdateAssociationStatusInput{} } - result, metadata, err := c.invokeOperation(ctx, "UpdateAssociationStatus", params, optFns, addOperationUpdateAssociationStatusMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "UpdateAssociationStatus", params, optFns, c.addOperationUpdateAssociationStatusMiddlewares) if err != nil { return nil, err } @@ -35,15 +39,17 @@ type UpdateAssociationStatusInput struct { // This member is required. AssociationStatus *types.AssociationStatus - // The ID of the instance. + // The managed node ID. // // This member is required. InstanceId *string - // The name of the Systems Manager document. + // The name of the SSM document. // // This member is required. Name *string + + noSmithyDocumentSerde } type UpdateAssociationStatusOutput struct { @@ -53,9 +59,14 @@ type UpdateAssociationStatusOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationUpdateAssociationStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationUpdateAssociationStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateAssociationStatus{}, middleware.After) if err != nil { return err @@ -64,6 +75,13 @@ func addOperationUpdateAssociationStatusMiddlewares(stack *middleware.Stack, opt if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateAssociationStatus"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -82,16 +100,13 @@ func addOperationUpdateAssociationStatusMiddlewares(stack *middleware.Stack, opt if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -100,12 +115,18 @@ func addOperationUpdateAssociationStatusMiddlewares(stack *middleware.Stack, opt if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpUpdateAssociationStatusValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAssociationStatus(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -115,6 +136,9 @@ func addOperationUpdateAssociationStatusMiddlewares(stack *middleware.Stack, opt if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -122,7 +146,6 @@ func newServiceMetadataMiddleware_opUpdateAssociationStatus(region string) *awsm return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "UpdateAssociationStatus", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateDocument.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateDocument.go index e66cf6e8..e240848e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateDocument.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateDocument.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -17,7 +18,7 @@ func (c *Client) UpdateDocument(ctx context.Context, params *UpdateDocumentInput params = &UpdateDocumentInput{} } - result, metadata, err := c.invokeOperation(ctx, "UpdateDocument", params, optFns, addOperationUpdateDocumentMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "UpdateDocument", params, optFns, c.addOperationUpdateDocumentMiddlewares) if err != nil { return nil, err } @@ -34,22 +35,30 @@ type UpdateDocumentInput struct { // This member is required. Content *string - // The name of the document that you want to update. + // The name of the SSM document that you want to update. // // This member is required. Name *string - // A list of key and value pairs that describe attachments to a version of a - // document. + // A list of key-value pairs that describe attachments to a version of a document. Attachments []types.AttachmentsSource + // The friendly name of the SSM document that you want to update. This value can + // differ for each version of the document. If you don't specify a value for this + // parameter in your request, the existing value is applied to the new document + // version. + DisplayName *string + // Specify the document format for the new document version. Systems Manager // supports JSON and YAML documents. JSON is the default format. DocumentFormat types.DocumentFormat - // (Required) The latest version of the document that you want to update. The - // latest document version can be specified using the $LATEST variable or by the - // version number. Updating a previous version of a document is not supported. + // The version of the document that you want to update. Currently, Systems Manager + // supports updating only the latest version of the document. You can specify the + // version number of the latest version or use the $LATEST variable. If you change + // a document version for a State Manager association, Systems Manager immediately + // runs the association unless you previously specifed the + // apply-only-at-cron-interval parameter. DocumentVersion *string // Specify a new target type for the document. @@ -57,8 +66,10 @@ type UpdateDocumentInput struct { // An optional field specifying the version of the artifact you are updating with // the document. For example, "Release 12, Update 6". This value is unique across - // all versions of a document, and cannot be changed. + // all versions of a document, and can't be changed. VersionName *string + + noSmithyDocumentSerde } type UpdateDocumentOutput struct { @@ -68,9 +79,14 @@ type UpdateDocumentOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationUpdateDocumentMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationUpdateDocumentMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateDocument{}, middleware.After) if err != nil { return err @@ -79,6 +95,13 @@ func addOperationUpdateDocumentMiddlewares(stack *middleware.Stack, options Opti if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateDocument"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -97,16 +120,13 @@ func addOperationUpdateDocumentMiddlewares(stack *middleware.Stack, options Opti if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -115,12 +135,18 @@ func addOperationUpdateDocumentMiddlewares(stack *middleware.Stack, options Opti if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpUpdateDocumentValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDocument(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -130,6 +156,9 @@ func addOperationUpdateDocumentMiddlewares(stack *middleware.Stack, options Opti if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -137,7 +166,6 @@ func newServiceMetadataMiddleware_opUpdateDocument(region string) *awsmiddleware return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "UpdateDocument", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateDocumentDefaultVersion.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateDocumentDefaultVersion.go index c723a562..e395516e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateDocumentDefaultVersion.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateDocumentDefaultVersion.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -11,13 +12,15 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Set the default version of a document. +// Set the default version of a document. If you change a document version for a +// State Manager association, Systems Manager immediately runs the association +// unless you previously specifed the apply-only-at-cron-interval parameter. func (c *Client) UpdateDocumentDefaultVersion(ctx context.Context, params *UpdateDocumentDefaultVersionInput, optFns ...func(*Options)) (*UpdateDocumentDefaultVersionOutput, error) { if params == nil { params = &UpdateDocumentDefaultVersionInput{} } - result, metadata, err := c.invokeOperation(ctx, "UpdateDocumentDefaultVersion", params, optFns, addOperationUpdateDocumentDefaultVersionMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "UpdateDocumentDefaultVersion", params, optFns, c.addOperationUpdateDocumentDefaultVersionMiddlewares) if err != nil { return nil, err } @@ -38,6 +41,8 @@ type UpdateDocumentDefaultVersionInput struct { // // This member is required. Name *string + + noSmithyDocumentSerde } type UpdateDocumentDefaultVersionOutput struct { @@ -48,9 +53,14 @@ type UpdateDocumentDefaultVersionOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationUpdateDocumentDefaultVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationUpdateDocumentDefaultVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateDocumentDefaultVersion{}, middleware.After) if err != nil { return err @@ -59,6 +69,13 @@ func addOperationUpdateDocumentDefaultVersionMiddlewares(stack *middleware.Stack if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateDocumentDefaultVersion"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -77,16 +94,13 @@ func addOperationUpdateDocumentDefaultVersionMiddlewares(stack *middleware.Stack if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -95,12 +109,18 @@ func addOperationUpdateDocumentDefaultVersionMiddlewares(stack *middleware.Stack if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpUpdateDocumentDefaultVersionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDocumentDefaultVersion(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -110,6 +130,9 @@ func addOperationUpdateDocumentDefaultVersionMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -117,7 +140,6 @@ func newServiceMetadataMiddleware_opUpdateDocumentDefaultVersion(region string) return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "UpdateDocumentDefaultVersion", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateDocumentMetadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateDocumentMetadata.go index cf9b2b88..8d82e9a8 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateDocumentMetadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateDocumentMetadata.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -12,13 +13,13 @@ import ( ) // Updates information related to approval reviews for a specific version of a -// document. +// change template in Change Manager. func (c *Client) UpdateDocumentMetadata(ctx context.Context, params *UpdateDocumentMetadataInput, optFns ...func(*Options)) (*UpdateDocumentMetadataOutput, error) { if params == nil { params = &UpdateDocumentMetadataInput{} } - result, metadata, err := c.invokeOperation(ctx, "UpdateDocumentMetadata", params, optFns, addOperationUpdateDocumentMetadataMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "UpdateDocumentMetadata", params, optFns, c.addOperationUpdateDocumentMetadataMiddlewares) if err != nil { return nil, err } @@ -30,26 +31,33 @@ func (c *Client) UpdateDocumentMetadata(ctx context.Context, params *UpdateDocum type UpdateDocumentMetadataInput struct { - // The document review details to update. + // The change template review details to update. // // This member is required. DocumentReviews *types.DocumentReviews - // The name of the document for which a version is to be updated. + // The name of the change template for which a version's metadata is to be updated. // // This member is required. Name *string - // The version of a document to update. + // The version of a change template in which to update approval metadata. DocumentVersion *string + + noSmithyDocumentSerde } type UpdateDocumentMetadataOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationUpdateDocumentMetadataMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationUpdateDocumentMetadataMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateDocumentMetadata{}, middleware.After) if err != nil { return err @@ -58,6 +66,13 @@ func addOperationUpdateDocumentMetadataMiddlewares(stack *middleware.Stack, opti if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateDocumentMetadata"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -76,16 +91,13 @@ func addOperationUpdateDocumentMetadataMiddlewares(stack *middleware.Stack, opti if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -94,12 +106,18 @@ func addOperationUpdateDocumentMetadataMiddlewares(stack *middleware.Stack, opti if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpUpdateDocumentMetadataValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDocumentMetadata(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -109,6 +127,9 @@ func addOperationUpdateDocumentMetadataMiddlewares(stack *middleware.Stack, opti if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -116,7 +137,6 @@ func newServiceMetadataMiddleware_opUpdateDocumentMetadata(region string) *awsmi return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "UpdateDocumentMetadata", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateMaintenanceWindow.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateMaintenanceWindow.go index fdf0788a..4be08b36 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateMaintenanceWindow.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateMaintenanceWindow.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" @@ -14,7 +15,7 @@ import ( // The value you specify for Duration determines the specific end time for the // maintenance window based on the time it begins. No maintenance window tasks are // permitted to start after the resulting endtime minus the number of hours you -// specify for Cutoff. For example, if the maintenance window starts at 3 PM, the +// specify for Cutoff . For example, if the maintenance window starts at 3 PM, the // duration is three hours, and the value you specify for Cutoff is one hour, no // maintenance window tasks can start after 5 PM. func (c *Client) UpdateMaintenanceWindow(ctx context.Context, params *UpdateMaintenanceWindowInput, optFns ...func(*Options)) (*UpdateMaintenanceWindowOutput, error) { @@ -22,7 +23,7 @@ func (c *Client) UpdateMaintenanceWindow(ctx context.Context, params *UpdateMain params = &UpdateMaintenanceWindowInput{} } - result, metadata, err := c.invokeOperation(ctx, "UpdateMaintenanceWindow", params, optFns, addOperationUpdateMaintenanceWindowMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "UpdateMaintenanceWindow", params, optFns, c.addOperationUpdateMaintenanceWindowMiddlewares) if err != nil { return nil, err } @@ -41,43 +42,43 @@ type UpdateMaintenanceWindowInput struct { // Whether targets must be registered with the maintenance window before tasks can // be defined for those targets. - AllowUnassociatedTargets bool + AllowUnassociatedTargets *bool - // The number of hours before the end of the maintenance window that Systems - // Manager stops scheduling new tasks for execution. - Cutoff int32 + // The number of hours before the end of the maintenance window that Amazon Web + // Services Systems Manager stops scheduling new tasks for execution. + Cutoff *int32 // An optional description for the update request. Description *string // The duration of the maintenance window in hours. - Duration int32 + Duration *int32 // Whether the maintenance window is enabled. - Enabled bool + Enabled *bool // The date and time, in ISO-8601 Extended format, for when you want the - // maintenance window to become inactive. EndDate allows you to set a date and time - // in the future when the maintenance window will no longer run. + // maintenance window to become inactive. EndDate allows you to set a date and + // time in the future when the maintenance window will no longer run. EndDate *string // The name of the maintenance window. Name *string - // If True, then all fields that are required by the CreateMaintenanceWindow action - // are also required for this API request. Optional fields that are not specified - // are set to null. - Replace bool + // If True , then all fields that are required by the CreateMaintenanceWindow + // operation are also required for this API request. Optional fields that aren't + // specified are set to null. + Replace *bool // The schedule of the maintenance window in the form of a cron or rate expression. Schedule *string - // The number of days to wait after the date and time specified by a CRON + // The number of days to wait after the date and time specified by a cron // expression before running the maintenance window. For example, the following // cron expression schedules a maintenance window to run the third Tuesday of every - // month at 11:30 PM. cron(30 23 ? * TUE#3 *) If the schedule offset is 2, the + // month at 11:30 PM. cron(30 23 ? * TUE#3 *) If the schedule offset is 2 , the // maintenance window won't run until two days later. - ScheduleOffset int32 + ScheduleOffset *int32 // The time zone that the scheduled maintenance window executions are based on, in // Internet Assigned Numbers Authority (IANA) format. For example: @@ -85,11 +86,12 @@ type UpdateMaintenanceWindowInput struct { // Time Zone Database (https://www.iana.org/time-zones) on the IANA website. ScheduleTimezone *string - // The time zone that the scheduled maintenance window executions are based on, in - // Internet Assigned Numbers Authority (IANA) format. For example: - // "America/Los_Angeles", "UTC", or "Asia/Seoul". For more information, see the - // Time Zone Database (https://www.iana.org/time-zones) on the IANA website. + // The date and time, in ISO-8601 Extended format, for when you want the + // maintenance window to become active. StartDate allows you to delay activation + // of the maintenance window until the specified future date. StartDate *string + + noSmithyDocumentSerde } type UpdateMaintenanceWindowOutput struct { @@ -98,21 +100,21 @@ type UpdateMaintenanceWindowOutput struct { // be defined for those targets. AllowUnassociatedTargets bool - // The number of hours before the end of the maintenance window that Systems - // Manager stops scheduling new tasks for execution. + // The number of hours before the end of the maintenance window that Amazon Web + // Services Systems Manager stops scheduling new tasks for execution. Cutoff int32 // An optional description of the update. Description *string // The duration of the maintenance window in hours. - Duration int32 + Duration *int32 // Whether the maintenance window is enabled. Enabled bool // The date and time, in ISO-8601 Extended format, for when the maintenance window - // is scheduled to become inactive. The maintenance window will not run after this + // is scheduled to become inactive. The maintenance window won't run after this // specified time. EndDate *string @@ -122,9 +124,9 @@ type UpdateMaintenanceWindowOutput struct { // The schedule of the maintenance window in the form of a cron or rate expression. Schedule *string - // The number of days to wait to run a maintenance window after the scheduled CRON + // The number of days to wait to run a maintenance window after the scheduled cron // expression date and time. - ScheduleOffset int32 + ScheduleOffset *int32 // The time zone that the scheduled maintenance window executions are based on, in // Internet Assigned Numbers Authority (IANA) format. For example: @@ -133,7 +135,7 @@ type UpdateMaintenanceWindowOutput struct { ScheduleTimezone *string // The date and time, in ISO-8601 Extended format, for when the maintenance window - // is scheduled to become active. The maintenance window will not run before this + // is scheduled to become active. The maintenance window won't run before this // specified time. StartDate *string @@ -142,9 +144,14 @@ type UpdateMaintenanceWindowOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationUpdateMaintenanceWindowMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationUpdateMaintenanceWindowMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateMaintenanceWindow{}, middleware.After) if err != nil { return err @@ -153,6 +160,13 @@ func addOperationUpdateMaintenanceWindowMiddlewares(stack *middleware.Stack, opt if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateMaintenanceWindow"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -171,16 +185,13 @@ func addOperationUpdateMaintenanceWindowMiddlewares(stack *middleware.Stack, opt if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -189,12 +200,18 @@ func addOperationUpdateMaintenanceWindowMiddlewares(stack *middleware.Stack, opt if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpUpdateMaintenanceWindowValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateMaintenanceWindow(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -204,6 +221,9 @@ func addOperationUpdateMaintenanceWindowMiddlewares(stack *middleware.Stack, opt if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -211,7 +231,6 @@ func newServiceMetadataMiddleware_opUpdateMaintenanceWindow(region string) *awsm return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "UpdateMaintenanceWindow", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateMaintenanceWindowTarget.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateMaintenanceWindowTarget.go index 5f733b78..48a366a1 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateMaintenanceWindowTarget.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateMaintenanceWindowTarget.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -13,29 +14,21 @@ import ( // Modifies the target of an existing maintenance window. You can change the // following: +// - Name +// - Description +// - Owner +// - IDs for an ID target +// - Tags for a Tag target +// - From any supported tag type to another. The three supported tag types are +// ID target, Tag target, and resource group. For more information, see Target . // -// * Name -// -// * Description -// -// * Owner -// -// * IDs for an ID target -// -// * Tags for a -// Tag target -// -// * From any supported tag type to another. The three supported tag -// types are ID target, Tag target, and resource group. For more information, see -// Target. -// -// If a parameter is null, then the corresponding field is not modified. +// If a parameter is null, then the corresponding field isn't modified. func (c *Client) UpdateMaintenanceWindowTarget(ctx context.Context, params *UpdateMaintenanceWindowTargetInput, optFns ...func(*Options)) (*UpdateMaintenanceWindowTargetOutput, error) { if params == nil { params = &UpdateMaintenanceWindowTargetInput{} } - result, metadata, err := c.invokeOperation(ctx, "UpdateMaintenanceWindowTarget", params, optFns, addOperationUpdateMaintenanceWindowTargetMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "UpdateMaintenanceWindowTarget", params, optFns, c.addOperationUpdateMaintenanceWindowTargetMiddlewares) if err != nil { return nil, err } @@ -63,17 +56,19 @@ type UpdateMaintenanceWindowTargetInput struct { // A name for the update. Name *string - // User-provided value that will be included in any CloudWatch events raised while - // running tasks for these targets in this maintenance window. + // User-provided value that will be included in any Amazon CloudWatch Events + // events raised while running tasks for these targets in this maintenance window. OwnerInformation *string - // If True, then all fields that are required by the - // RegisterTargetWithMaintenanceWindow action are also required for this API - // request. Optional fields that are not specified are set to null. - Replace bool + // If True , then all fields that are required by the + // RegisterTargetWithMaintenanceWindow operation are also required for this API + // request. Optional fields that aren't specified are set to null. + Replace *bool // The targets to add or replace. Targets []types.Target + + noSmithyDocumentSerde } type UpdateMaintenanceWindowTargetOutput struct { @@ -98,9 +93,14 @@ type UpdateMaintenanceWindowTargetOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationUpdateMaintenanceWindowTargetMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationUpdateMaintenanceWindowTargetMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateMaintenanceWindowTarget{}, middleware.After) if err != nil { return err @@ -109,6 +109,13 @@ func addOperationUpdateMaintenanceWindowTargetMiddlewares(stack *middleware.Stac if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateMaintenanceWindowTarget"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -127,16 +134,13 @@ func addOperationUpdateMaintenanceWindowTargetMiddlewares(stack *middleware.Stac if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -145,12 +149,18 @@ func addOperationUpdateMaintenanceWindowTargetMiddlewares(stack *middleware.Stac if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpUpdateMaintenanceWindowTargetValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateMaintenanceWindowTarget(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -160,6 +170,9 @@ func addOperationUpdateMaintenanceWindowTargetMiddlewares(stack *middleware.Stac if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -167,7 +180,6 @@ func newServiceMetadataMiddleware_opUpdateMaintenanceWindowTarget(region string) return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "UpdateMaintenanceWindowTarget", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateMaintenanceWindowTask.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateMaintenanceWindowTask.go index d209cc70..07abf522 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateMaintenanceWindowTask.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateMaintenanceWindowTask.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -13,46 +14,38 @@ import ( // Modifies a task assigned to a maintenance window. You can't change the task // type, but you can change the following values: +// - TaskARN . For example, you can change a RUN_COMMAND task from +// AWS-RunPowerShellScript to AWS-RunShellScript . +// - ServiceRoleArn +// - TaskInvocationParameters +// - Priority +// - MaxConcurrency +// - MaxErrors // -// * TaskARN. For example, you can -// change a RUN_COMMAND task from AWS-RunPowerShellScript to AWS-RunShellScript. -// -// * -// ServiceRoleArn -// -// * TaskInvocationParameters -// -// * Priority -// -// * MaxConcurrency -// -// * -// MaxErrors -// -// One or more targets must be specified for maintenance window Run -// Command-type tasks. Depending on the task, targets are optional for other -// maintenance window task types (Automation, AWS Lambda, and AWS Step Functions). -// For more information about running tasks that do not specify targets, see see -// Registering maintenance window tasks without targets -// (https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html) -// in the AWS Systems Manager User Guide. If the value for a parameter in -// UpdateMaintenanceWindowTask is null, then the corresponding field is not -// modified. If you set Replace to true, then all fields required by the -// RegisterTaskWithMaintenanceWindow action are required for this request. Optional -// fields that aren't specified are set to null. When you update a maintenance -// window task that has options specified in TaskInvocationParameters, you must -// provide again all the TaskInvocationParameters values that you want to retain. -// The values you do not specify again are removed. For example, suppose that when -// you registered a Run Command task, you specified TaskInvocationParameters values -// for Comment, NotificationConfig, and OutputS3BucketName. If you update the -// maintenance window task and specify only a different OutputS3BucketName value, -// the values for Comment and NotificationConfig are removed. +// One or more targets must be specified for maintenance window Run Command-type +// tasks. Depending on the task, targets are optional for other maintenance window +// task types (Automation, Lambda, and Step Functions). For more information about +// running tasks that don't specify targets, see Registering maintenance window +// tasks without targets (https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html) +// in the Amazon Web Services Systems Manager User Guide. If the value for a +// parameter in UpdateMaintenanceWindowTask is null, then the corresponding field +// isn't modified. If you set Replace to true, then all fields required by the +// RegisterTaskWithMaintenanceWindow operation are required for this request. +// Optional fields that aren't specified are set to null. When you update a +// maintenance window task that has options specified in TaskInvocationParameters , +// you must provide again all the TaskInvocationParameters values that you want to +// retain. The values you don't specify again are removed. For example, suppose +// that when you registered a Run Command task, you specified +// TaskInvocationParameters values for Comment , NotificationConfig , and +// OutputS3BucketName . If you update the maintenance window task and specify only +// a different OutputS3BucketName value, the values for Comment and +// NotificationConfig are removed. func (c *Client) UpdateMaintenanceWindowTask(ctx context.Context, params *UpdateMaintenanceWindowTaskInput, optFns ...func(*Options)) (*UpdateMaintenanceWindowTaskOutput, error) { if params == nil { params = &UpdateMaintenanceWindowTaskInput{} } - result, metadata, err := c.invokeOperation(ctx, "UpdateMaintenanceWindowTask", params, optFns, addOperationUpdateMaintenanceWindowTaskMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "UpdateMaintenanceWindowTask", params, optFns, c.addOperationUpdateMaintenanceWindowTaskMiddlewares) if err != nil { return nil, err } @@ -74,71 +67,88 @@ type UpdateMaintenanceWindowTaskInput struct { // This member is required. WindowTaskId *string + // The CloudWatch alarm you want to apply to your maintenance window task. + AlarmConfiguration *types.AlarmConfiguration + + // Indicates whether tasks should continue to run after the cutoff time specified + // in the maintenance windows is reached. + // - CONTINUE_TASK : When the cutoff time is reached, any tasks that are running + // continue. The default value. + // - CANCEL_TASK : + // - For Automation, Lambda, Step Functions tasks: When the cutoff time is + // reached, any task invocations that are already running continue, but no new task + // invocations are started. + // - For Run Command tasks: When the cutoff time is reached, the system sends a + // CancelCommand operation that attempts to cancel the command associated with + // the task. However, there is no guarantee that the command will be terminated and + // the underlying process stopped. The status for tasks that are not completed + // is TIMED_OUT . + CutoffBehavior types.MaintenanceWindowTaskCutoffBehavior + // The new task description to specify. Description *string // The new logging location in Amazon S3 to specify. LoggingInfo has been - // deprecated. To specify an S3 bucket to contain logs, instead use the - // OutputS3BucketName and OutputS3KeyPrefix options in the TaskInvocationParameters - // structure. For information about how Systems Manager handles these options for - // the supported maintenance window task types, see - // MaintenanceWindowTaskInvocationParameters. + // deprecated. To specify an Amazon Simple Storage Service (Amazon S3) bucket to + // contain logs, instead use the OutputS3BucketName and OutputS3KeyPrefix options + // in the TaskInvocationParameters structure. For information about how Amazon Web + // Services Systems Manager handles these options for the supported maintenance + // window task types, see MaintenanceWindowTaskInvocationParameters . LoggingInfo *types.LoggingInfo // The new MaxConcurrency value you want to specify. MaxConcurrency is the number - // of targets that are allowed to run this task in parallel. For maintenance window - // tasks without a target specified, you cannot supply a value for this option. - // Instead, the system inserts a placeholder value of 1, which may be reported in - // the response to this command. This value does not affect the running of your - // task and can be ignored. + // of targets that are allowed to run this task, in parallel. Although this element + // is listed as "Required: No", a value can be omitted only when you are + // registering or updating a targetless task (https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html) + // You must provide a value in all other cases. For maintenance window tasks + // without a target specified, you can't supply a value for this option. Instead, + // the system inserts a placeholder value of 1 . This value doesn't affect the + // running of your task. MaxConcurrency *string // The new MaxErrors value to specify. MaxErrors is the maximum number of errors - // that are allowed before the task stops being scheduled. For maintenance window - // tasks without a target specified, you cannot supply a value for this option. - // Instead, the system inserts a placeholder value of 1, which may be reported in - // the response to this command. This value does not affect the running of your - // task and can be ignored. + // that are allowed before the task stops being scheduled. Although this element is + // listed as "Required: No", a value can be omitted only when you are registering + // or updating a targetless task (https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html) + // You must provide a value in all other cases. For maintenance window tasks + // without a target specified, you can't supply a value for this option. Instead, + // the system inserts a placeholder value of 1 . This value doesn't affect the + // running of your task. MaxErrors *string // The new task name to specify. Name *string - // The new task priority to specify. The lower the number, the higher the priority. - // Tasks that have the same priority are scheduled in parallel. - Priority int32 + // The new task priority to specify. The lower the number, the higher the + // priority. Tasks that have the same priority are scheduled in parallel. + Priority *int32 // If True, then all fields that are required by the - // RegisterTaskWithMaintenanceWindow action are also required for this API request. - // Optional fields that are not specified are set to null. - Replace bool - - // The ARN of the IAM service role for Systems Manager to assume when running a - // maintenance window task. If you do not specify a service role ARN, Systems - // Manager uses your account's service-linked role. If no service-linked role for - // Systems Manager exists in your account, it is created when you run - // RegisterTaskWithMaintenanceWindow. For more information, see the following - // topics in the in the AWS Systems Manager User Guide: - // - // * Using service-linked - // roles for Systems Manager - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/using-service-linked-roles.html#slr-permissions) - // - // * - // Should I use a service-linked role or a custom service role to run maintenance - // window tasks? - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-maintenance-permissions.html#maintenance-window-tasks-service-role) + // RegisterTaskWithMaintenanceWindow operation are also required for this API + // request. Optional fields that aren't specified are set to null. + Replace *bool + + // The Amazon Resource Name (ARN) of the IAM service role for Amazon Web Services + // Systems Manager to assume when running a maintenance window task. If you do not + // specify a service role ARN, Systems Manager uses your account's service-linked + // role. If no service-linked role for Systems Manager exists in your account, it + // is created when you run RegisterTaskWithMaintenanceWindow . For more + // information, see the following topics in the in the Amazon Web Services Systems + // Manager User Guide: + // - Using service-linked roles for Systems Manager (https://docs.aws.amazon.com/systems-manager/latest/userguide/using-service-linked-roles.html#slr-permissions) + // - Should I use a service-linked role or a custom service role to run + // maintenance window tasks? (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-maintenance-permissions.html#maintenance-window-tasks-service-role) ServiceRoleArn *string - // The targets (either instances or tags) to modify. Instances are specified using - // Key=instanceids,Values=instanceID_1,instanceID_2. Tags are specified using - // Key=tag_name,Values=tag_value. One or more targets must be specified for - // maintenance window Run Command-type tasks. Depending on the task, targets are - // optional for other maintenance window task types (Automation, AWS Lambda, and - // AWS Step Functions). For more information about running tasks that do not - // specify targets, see see Registering maintenance window tasks without targets - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html) - // in the AWS Systems Manager User Guide. + // The targets (either managed nodes or tags) to modify. Managed nodes are + // specified using the format Key=instanceids,Values=instanceID_1,instanceID_2 . + // Tags are specified using the format Key=tag_name,Values=tag_value . One or more + // targets must be specified for maintenance window Run Command-type tasks. + // Depending on the task, targets are optional for other maintenance window task + // types (Automation, Lambda, and Step Functions). For more information about + // running tasks that don't specify targets, see Registering maintenance window + // tasks without targets (https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html) + // in the Amazon Web Services Systems Manager User Guide. Targets []types.Target // The task ARN to modify. @@ -147,35 +157,46 @@ type UpdateMaintenanceWindowTaskInput struct { // The parameters that the task should use during execution. Populate only the // fields that match the task type. All other fields should be empty. When you // update a maintenance window task that has options specified in - // TaskInvocationParameters, you must provide again all the - // TaskInvocationParameters values that you want to retain. The values you do not + // TaskInvocationParameters , you must provide again all the + // TaskInvocationParameters values that you want to retain. The values you don't // specify again are removed. For example, suppose that when you registered a Run - // Command task, you specified TaskInvocationParameters values for Comment, - // NotificationConfig, and OutputS3BucketName. If you update the maintenance window - // task and specify only a different OutputS3BucketName value, the values for - // Comment and NotificationConfig are removed. + // Command task, you specified TaskInvocationParameters values for Comment , + // NotificationConfig , and OutputS3BucketName . If you update the maintenance + // window task and specify only a different OutputS3BucketName value, the values + // for Comment and NotificationConfig are removed. TaskInvocationParameters *types.MaintenanceWindowTaskInvocationParameters // The parameters to modify. TaskParameters has been deprecated. To specify // parameters to pass to a task when it runs, instead use the Parameters option in // the TaskInvocationParameters structure. For information about how Systems // Manager handles these options for the supported maintenance window task types, - // see MaintenanceWindowTaskInvocationParameters. The map has the following format: - // Key: string, between 1 and 255 characters Value: an array of strings, each - // string is between 1 and 255 characters + // see MaintenanceWindowTaskInvocationParameters . The map has the following + // format: Key: string, between 1 and 255 characters Value: an array of strings, + // each string is between 1 and 255 characters TaskParameters map[string]types.MaintenanceWindowTaskParameterValueExpression + + noSmithyDocumentSerde } type UpdateMaintenanceWindowTaskOutput struct { + // The details for the CloudWatch alarm you applied to your maintenance window + // task. + AlarmConfiguration *types.AlarmConfiguration + + // The specification for whether tasks should continue to run after the cutoff + // time specified in the maintenance windows is reached. + CutoffBehavior types.MaintenanceWindowTaskCutoffBehavior + // The updated task description. Description *string // The updated logging information in Amazon S3. LoggingInfo has been deprecated. - // To specify an S3 bucket to contain logs, instead use the OutputS3BucketName and - // OutputS3KeyPrefix options in the TaskInvocationParameters structure. For - // information about how Systems Manager handles these options for the supported - // maintenance window task types, see MaintenanceWindowTaskInvocationParameters. + // To specify an Amazon Simple Storage Service (Amazon S3) bucket to contain logs, + // instead use the OutputS3BucketName and OutputS3KeyPrefix options in the + // TaskInvocationParameters structure. For information about how Amazon Web + // Services Systems Manager handles these options for the supported maintenance + // window task types, see MaintenanceWindowTaskInvocationParameters . LoggingInfo *types.LoggingInfo // The updated MaxConcurrency value. @@ -190,8 +211,9 @@ type UpdateMaintenanceWindowTaskOutput struct { // The updated priority value. Priority int32 - // The ARN of the IAM service role to use to publish Amazon Simple Notification - // Service (Amazon SNS) notifications for maintenance window Run Command tasks. + // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) + // service role to use to publish Amazon Simple Notification Service (Amazon SNS) + // notifications for maintenance window Run Command tasks. ServiceRoleArn *string // The updated target values. @@ -207,7 +229,7 @@ type UpdateMaintenanceWindowTaskOutput struct { // parameters to pass to a task when it runs, instead use the Parameters option in // the TaskInvocationParameters structure. For information about how Systems // Manager handles these options for the supported maintenance window task types, - // see MaintenanceWindowTaskInvocationParameters. + // see MaintenanceWindowTaskInvocationParameters . TaskParameters map[string]types.MaintenanceWindowTaskParameterValueExpression // The ID of the maintenance window that was updated. @@ -218,9 +240,14 @@ type UpdateMaintenanceWindowTaskOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationUpdateMaintenanceWindowTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationUpdateMaintenanceWindowTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateMaintenanceWindowTask{}, middleware.After) if err != nil { return err @@ -229,6 +256,13 @@ func addOperationUpdateMaintenanceWindowTaskMiddlewares(stack *middleware.Stack, if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateMaintenanceWindowTask"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -247,16 +281,13 @@ func addOperationUpdateMaintenanceWindowTaskMiddlewares(stack *middleware.Stack, if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -265,12 +296,18 @@ func addOperationUpdateMaintenanceWindowTaskMiddlewares(stack *middleware.Stack, if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpUpdateMaintenanceWindowTaskValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateMaintenanceWindowTask(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -280,6 +317,9 @@ func addOperationUpdateMaintenanceWindowTaskMiddlewares(stack *middleware.Stack, if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -287,7 +327,6 @@ func newServiceMetadataMiddleware_opUpdateMaintenanceWindowTask(region string) * return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "UpdateMaintenanceWindowTask", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateManagedInstanceRole.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateManagedInstanceRole.go index f796ad5c..9cd1965b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateManagedInstanceRole.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateManagedInstanceRole.go @@ -4,22 +4,23 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Changes the Amazon Identity and Access Management (IAM) role that is assigned to -// the on-premises instance or virtual machines (VM). IAM roles are first assigned -// to these hybrid instances during the activation process. For more information, -// see CreateActivation. +// Changes the Identity and Access Management (IAM) role that is assigned to the +// on-premises server, edge device, or virtual machines (VM). IAM roles are first +// assigned to these hybrid nodes during the activation process. For more +// information, see CreateActivation . func (c *Client) UpdateManagedInstanceRole(ctx context.Context, params *UpdateManagedInstanceRoleInput, optFns ...func(*Options)) (*UpdateManagedInstanceRoleOutput, error) { if params == nil { params = &UpdateManagedInstanceRoleInput{} } - result, metadata, err := c.invokeOperation(ctx, "UpdateManagedInstanceRole", params, optFns, addOperationUpdateManagedInstanceRoleMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "UpdateManagedInstanceRole", params, optFns, c.addOperationUpdateManagedInstanceRoleMiddlewares) if err != nil { return nil, err } @@ -31,23 +32,35 @@ func (c *Client) UpdateManagedInstanceRole(ctx context.Context, params *UpdateMa type UpdateManagedInstanceRoleInput struct { - // The IAM role you want to assign or change. + // The name of the Identity and Access Management (IAM) role that you want to + // assign to the managed node. This IAM role must provide AssumeRole permissions + // for the Amazon Web Services Systems Manager service principal ssm.amazonaws.com + // . For more information, see Create an IAM service role for a hybrid environment (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-service-role.html) + // in the Amazon Web Services Systems Manager User Guide. You can't specify an IAM + // service-linked role for this parameter. You must create a unique role. // // This member is required. IamRole *string - // The ID of the managed instance where you want to update the role. + // The ID of the managed node where you want to update the role. // // This member is required. InstanceId *string + + noSmithyDocumentSerde } type UpdateManagedInstanceRoleOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationUpdateManagedInstanceRoleMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationUpdateManagedInstanceRoleMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateManagedInstanceRole{}, middleware.After) if err != nil { return err @@ -56,6 +69,13 @@ func addOperationUpdateManagedInstanceRoleMiddlewares(stack *middleware.Stack, o if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateManagedInstanceRole"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -74,16 +94,13 @@ func addOperationUpdateManagedInstanceRoleMiddlewares(stack *middleware.Stack, o if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -92,12 +109,18 @@ func addOperationUpdateManagedInstanceRoleMiddlewares(stack *middleware.Stack, o if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpUpdateManagedInstanceRoleValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateManagedInstanceRole(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -107,6 +130,9 @@ func addOperationUpdateManagedInstanceRoleMiddlewares(stack *middleware.Stack, o if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -114,7 +140,6 @@ func newServiceMetadataMiddleware_opUpdateManagedInstanceRole(region string) *aw return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "UpdateManagedInstanceRole", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateOpsItem.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateOpsItem.go index cd01b117..6203ad28 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateOpsItem.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateOpsItem.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -12,22 +13,21 @@ import ( "time" ) -// Edit or change an OpsItem. You must have permission in AWS Identity and Access -// Management (IAM) to update an OpsItem. For more information, see Getting started -// with OpsCenter -// (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-getting-started.html) -// in the AWS Systems Manager User Guide. Operations engineers and IT professionals -// use OpsCenter to view, investigate, and remediate operational issues impacting -// the performance and health of their AWS resources. For more information, see AWS -// Systems Manager OpsCenter -// (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter.html) in -// the AWS Systems Manager User Guide. +// Edit or change an OpsItem. You must have permission in Identity and Access +// Management (IAM) to update an OpsItem. For more information, see Set up +// OpsCenter (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-setup.html) +// in the Amazon Web Services Systems Manager User Guide. Operations engineers and +// IT professionals use Amazon Web Services Systems Manager OpsCenter to view, +// investigate, and remediate operational issues impacting the performance and +// health of their Amazon Web Services resources. For more information, see +// OpsCenter (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter.html) +// in the Amazon Web Services Systems Manager User Guide. func (c *Client) UpdateOpsItem(ctx context.Context, params *UpdateOpsItemInput, optFns ...func(*Options)) (*UpdateOpsItemOutput, error) { if params == nil { params = &UpdateOpsItemInput{} } - result, metadata, err := c.invokeOperation(ctx, "UpdateOpsItem", params, optFns, addOperationUpdateOpsItemMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "UpdateOpsItem", params, optFns, c.addOperationUpdateOpsItemMiddlewares) if err != nil { return nil, err } @@ -45,22 +45,22 @@ type UpdateOpsItemInput struct { OpsItemId *string // The time a runbook workflow ended. Currently reported only for the OpsItem type - // /aws/changerequest. + // /aws/changerequest . ActualEndTime *time.Time // The time a runbook workflow started. Currently reported only for the OpsItem - // type /aws/changerequest. + // type /aws/changerequest . ActualStartTime *time.Time // Specify a new category for an OpsItem. Category *string - // Update the information about the OpsItem. Provide enough information so that - // users reading this OpsItem for the first time understand the issue. + // User-defined text that contains information about the OpsItem, in Markdown + // format. Description *string - // The Amazon Resource Name (ARN) of an SNS topic where notifications are sent when - // this OpsItem is edited or changed. + // The Amazon Resource Name (ARN) of an SNS topic where notifications are sent + // when this OpsItem is edited or changed. Notifications []types.OpsItemNotification // Add new keys or edit existing key-value pairs of the OperationalData map in the @@ -69,29 +69,32 @@ type UpdateOpsItemInput struct { // strings, license keys, troubleshooting tips, or other relevant data. You enter // operational data as key-value pairs. The key has a maximum length of 128 // characters. The value has a maximum size of 20 KB. Operational data keys can't - // begin with the following: amazon, aws, amzn, ssm, /amazon, /aws, /amzn, /ssm. - // You can choose to make the data searchable by other users in the account or you - // can restrict search access. Searchable data means that all users with access to - // the OpsItem Overview page (as provided by the DescribeOpsItems API action) can - // view and search on the specified data. Operational data that is not searchable - // is only viewable by users who have access to the OpsItem (as provided by the - // GetOpsItem API action). Use the /aws/resources key in OperationalData to specify - // a related resource in the request. Use the /aws/automations key in - // OperationalData to associate an Automation runbook with the OpsItem. To view AWS - // CLI example commands that use these keys, see Creating OpsItems manually - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-creating-OpsItems.html#OpsCenter-manually-create-OpsItems) - // in the AWS Systems Manager User Guide. + // begin with the following: amazon , aws , amzn , ssm , /amazon , /aws , /amzn , + // /ssm . You can choose to make the data searchable by other users in the account + // or you can restrict search access. Searchable data means that all users with + // access to the OpsItem Overview page (as provided by the DescribeOpsItems API + // operation) can view and search on the specified data. Operational data that + // isn't searchable is only viewable by users who have access to the OpsItem (as + // provided by the GetOpsItem API operation). Use the /aws/resources key in + // OperationalData to specify a related resource in the request. Use the + // /aws/automations key in OperationalData to associate an Automation runbook with + // the OpsItem. To view Amazon Web Services CLI example commands that use these + // keys, see Creating OpsItems manually (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-manually-create-OpsItems.html) + // in the Amazon Web Services Systems Manager User Guide. OperationalData map[string]types.OpsItemDataValue // Keys that you want to remove from the OperationalData map. OperationalDataToDelete []string + // The OpsItem Amazon Resource Name (ARN). + OpsItemArn *string + // The time specified in a change request for a runbook workflow to end. Currently - // supported only for the OpsItem type /aws/changerequest. + // supported only for the OpsItem type /aws/changerequest . PlannedEndTime *time.Time // The time specified in a change request for a runbook workflow to start. - // Currently supported only for the OpsItem type /aws/changerequest. + // Currently supported only for the OpsItem type /aws/changerequest . PlannedStartTime *time.Time // The importance of this OpsItem in relation to other OpsItems in the system. @@ -105,23 +108,29 @@ type UpdateOpsItemInput struct { // Specify a new severity for an OpsItem. Severity *string - // The OpsItem status. Status can be Open, In Progress, or Resolved. For more - // information, see Editing OpsItem details - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-working-with-OpsItems.html#OpsCenter-working-with-OpsItems-editing-details) - // in the AWS Systems Manager User Guide. + // The OpsItem status. Status can be Open , In Progress , or Resolved . For more + // information, see Editing OpsItem details (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-working-with-OpsItems-editing-details.html) + // in the Amazon Web Services Systems Manager User Guide. Status types.OpsItemStatus // A short heading that describes the nature of the OpsItem and the impacted // resource. Title *string + + noSmithyDocumentSerde } type UpdateOpsItemOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationUpdateOpsItemMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationUpdateOpsItemMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateOpsItem{}, middleware.After) if err != nil { return err @@ -130,6 +139,13 @@ func addOperationUpdateOpsItemMiddlewares(stack *middleware.Stack, options Optio if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateOpsItem"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -148,16 +164,13 @@ func addOperationUpdateOpsItemMiddlewares(stack *middleware.Stack, options Optio if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -166,12 +179,18 @@ func addOperationUpdateOpsItemMiddlewares(stack *middleware.Stack, options Optio if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpUpdateOpsItemValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateOpsItem(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -181,6 +200,9 @@ func addOperationUpdateOpsItemMiddlewares(stack *middleware.Stack, options Optio if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -188,7 +210,6 @@ func newServiceMetadataMiddleware_opUpdateOpsItem(region string) *awsmiddleware. return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "UpdateOpsItem", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateOpsMetadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateOpsMetadata.go index be46dc68..2ce5ccd8 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateOpsMetadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateOpsMetadata.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -11,14 +12,14 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Systems Manager calls this API action when you edit OpsMetadata in Application -// Manager. +// Amazon Web Services Systems Manager calls this API operation when you edit +// OpsMetadata in Application Manager. func (c *Client) UpdateOpsMetadata(ctx context.Context, params *UpdateOpsMetadataInput, optFns ...func(*Options)) (*UpdateOpsMetadataOutput, error) { if params == nil { params = &UpdateOpsMetadataInput{} } - result, metadata, err := c.invokeOperation(ctx, "UpdateOpsMetadata", params, optFns, addOperationUpdateOpsMetadataMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "UpdateOpsMetadata", params, optFns, c.addOperationUpdateOpsMetadataMiddlewares) if err != nil { return nil, err } @@ -30,7 +31,7 @@ func (c *Client) UpdateOpsMetadata(ctx context.Context, params *UpdateOpsMetadat type UpdateOpsMetadataInput struct { - // The Amazon Resoure Name (ARN) of the OpsMetadata Object to update. + // The Amazon Resource Name (ARN) of the OpsMetadata Object to update. // // This member is required. OpsMetadataArn *string @@ -40,6 +41,8 @@ type UpdateOpsMetadataInput struct { // Metadata to add to an OpsMetadata object. MetadataToUpdate map[string]types.MetadataValue + + noSmithyDocumentSerde } type UpdateOpsMetadataOutput struct { @@ -49,9 +52,14 @@ type UpdateOpsMetadataOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationUpdateOpsMetadataMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationUpdateOpsMetadataMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateOpsMetadata{}, middleware.After) if err != nil { return err @@ -60,6 +68,13 @@ func addOperationUpdateOpsMetadataMiddlewares(stack *middleware.Stack, options O if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateOpsMetadata"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -78,16 +93,13 @@ func addOperationUpdateOpsMetadataMiddlewares(stack *middleware.Stack, options O if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -96,12 +108,18 @@ func addOperationUpdateOpsMetadataMiddlewares(stack *middleware.Stack, options O if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpUpdateOpsMetadataValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateOpsMetadata(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -111,6 +129,9 @@ func addOperationUpdateOpsMetadataMiddlewares(stack *middleware.Stack, options O if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -118,7 +139,6 @@ func newServiceMetadataMiddleware_opUpdateOpsMetadata(region string) *awsmiddlew return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "UpdateOpsMetadata", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdatePatchBaseline.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdatePatchBaseline.go index b62da9b2..656174ab 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdatePatchBaseline.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdatePatchBaseline.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -13,15 +14,14 @@ import ( ) // Modifies an existing patch baseline. Fields not specified in the request are -// left unchanged. For information about valid key and value pairs in PatchFilters -// for each supported operating system type, see PatchFilter -// (http://docs.aws.amazon.com/systems-manager/latest/APIReference/API_PatchFilter.html). +// left unchanged. For information about valid key-value pairs in PatchFilters for +// each supported operating system type, see PatchFilter . func (c *Client) UpdatePatchBaseline(ctx context.Context, params *UpdatePatchBaselineInput, optFns ...func(*Options)) (*UpdatePatchBaselineOutput, error) { if params == nil { params = &UpdatePatchBaselineInput{} } - result, metadata, err := c.invokeOperation(ctx, "UpdatePatchBaseline", params, optFns, addOperationUpdatePatchBaselineMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "UpdatePatchBaseline", params, optFns, c.addOperationUpdatePatchBaselineMiddlewares) if err != nil { return nil, err } @@ -43,18 +43,17 @@ type UpdatePatchBaselineInput struct { // A list of explicitly approved patches for the baseline. For information about // accepted formats for lists of approved patches and rejected patches, see About - // package name formats for approved and rejected patch lists - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html) - // in the AWS Systems Manager User Guide. + // package name formats for approved and rejected patch lists (https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html) + // in the Amazon Web Services Systems Manager User Guide. ApprovedPatches []string // Assigns a new compliance severity level to an existing patch baseline. ApprovedPatchesComplianceLevel types.PatchComplianceLevel // Indicates whether the list of approved patches includes non-security updates - // that should be applied to the instances. The default value is 'false'. Applies - // to Linux instances only. - ApprovedPatchesEnableNonSecurity bool + // that should be applied to the managed nodes. The default value is false . + // Applies to Linux managed nodes only. + ApprovedPatchesEnableNonSecurity *bool // A description of the patch baseline. Description *string @@ -67,34 +66,34 @@ type UpdatePatchBaselineInput struct { // A list of explicitly rejected patches for the baseline. For information about // accepted formats for lists of approved patches and rejected patches, see About - // package name formats for approved and rejected patch lists - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html) - // in the AWS Systems Manager User Guide. + // package name formats for approved and rejected patch lists (https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html) + // in the Amazon Web Services Systems Manager User Guide. RejectedPatches []string // The action for Patch Manager to take on patches included in the RejectedPackages // list. - // - // * ALLOW_AS_DEPENDENCY: A package in the Rejected patches list is - // installed only if it is a dependency of another package. It is considered - // compliant with the patch baseline, and its status is reported as InstalledOther. - // This is the default action if no option is specified. - // - // * BLOCK: Packages in the - // RejectedPatches list, and packages that include them as dependencies, are not - // installed under any circumstances. If a package was installed before it was - // added to the Rejected patches list, it is considered non-compliant with the - // patch baseline, and its status is reported as InstalledRejected. + // - ALLOW_AS_DEPENDENCY : A package in the Rejected patches list is installed + // only if it is a dependency of another package. It is considered compliant with + // the patch baseline, and its status is reported as InstalledOther . This is the + // default action if no option is specified. + // - BLOCK : Packages in the RejectedPatches list, and packages that include them + // as dependencies, aren't installed under any circumstances. If a package was + // installed before it was added to the Rejected patches list, it is considered + // non-compliant with the patch baseline, and its status is reported as + // InstalledRejected . RejectedPatchesAction types.PatchAction - // If True, then all fields that are required by the CreatePatchBaseline action are - // also required for this API request. Optional fields that are not specified are - // set to null. - Replace bool + // If True, then all fields that are required by the CreatePatchBaseline operation + // are also required for this API request. Optional fields that aren't specified + // are set to null. + Replace *bool - // Information about the patches to use to update the instances, including target - // operating systems and source repositories. Applies to Linux instances only. + // Information about the patches to use to update the managed nodes, including + // target operating systems and source repositories. Applies to Linux managed nodes + // only. Sources []types.PatchSource + + noSmithyDocumentSerde } type UpdatePatchBaselineOutput struct { @@ -110,9 +109,9 @@ type UpdatePatchBaselineOutput struct { ApprovedPatchesComplianceLevel types.PatchComplianceLevel // Indicates whether the list of approved patches includes non-security updates - // that should be applied to the instances. The default value is 'false'. Applies - // to Linux instances only. - ApprovedPatchesEnableNonSecurity bool + // that should be applied to the managed nodes. The default value is false . + // Applies to Linux managed nodes only. + ApprovedPatchesEnableNonSecurity *bool // The ID of the deleted patch baseline. BaselineId *string @@ -120,7 +119,7 @@ type UpdatePatchBaselineOutput struct { // The date when the patch baseline was created. CreatedDate *time.Time - // A description of the Patch Baseline. + // A description of the patch baseline. Description *string // A set of global filters used to exclude patches from the baseline. @@ -143,15 +142,21 @@ type UpdatePatchBaselineOutput struct { // entirely along with packages that include it as a dependency. RejectedPatchesAction types.PatchAction - // Information about the patches to use to update the instances, including target - // operating systems and source repositories. Applies to Linux instances only. + // Information about the patches to use to update the managed nodes, including + // target operating systems and source repositories. Applies to Linux managed nodes + // only. Sources []types.PatchSource // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationUpdatePatchBaselineMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationUpdatePatchBaselineMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdatePatchBaseline{}, middleware.After) if err != nil { return err @@ -160,6 +165,13 @@ func addOperationUpdatePatchBaselineMiddlewares(stack *middleware.Stack, options if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdatePatchBaseline"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -178,16 +190,13 @@ func addOperationUpdatePatchBaselineMiddlewares(stack *middleware.Stack, options if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -196,12 +205,18 @@ func addOperationUpdatePatchBaselineMiddlewares(stack *middleware.Stack, options if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpUpdatePatchBaselineValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdatePatchBaseline(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -211,6 +226,9 @@ func addOperationUpdatePatchBaselineMiddlewares(stack *middleware.Stack, options if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -218,7 +236,6 @@ func newServiceMetadataMiddleware_opUpdatePatchBaseline(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "UpdatePatchBaseline", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateResourceDataSync.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateResourceDataSync.go index 74433978..a7412206 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateResourceDataSync.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateResourceDataSync.go @@ -4,6 +4,7 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ssm/types" @@ -11,19 +12,20 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Update a resource data sync. After you create a resource data sync for a Region, -// you can't change the account options for that sync. For example, if you create a -// sync in the us-east-2 (Ohio) Region and you choose the Include only the current -// account option, you can't edit that sync later and choose the Include all -// accounts from my AWS Organizations configuration option. Instead, you must -// delete the first resource data sync, and create a new one. This API action only -// supports a resource data sync that was created with a SyncFromSource SyncType. +// Update a resource data sync. After you create a resource data sync for a +// Region, you can't change the account options for that sync. For example, if you +// create a sync in the us-east-2 (Ohio) Region and you choose the Include only +// the current account option, you can't edit that sync later and choose the +// Include all accounts from my Organizations configuration option. Instead, you +// must delete the first resource data sync, and create a new one. This API +// operation only supports a resource data sync that was created with a +// SyncFromSource SyncType . func (c *Client) UpdateResourceDataSync(ctx context.Context, params *UpdateResourceDataSyncInput, optFns ...func(*Options)) (*UpdateResourceDataSyncOutput, error) { if params == nil { params = &UpdateResourceDataSyncInput{} } - result, metadata, err := c.invokeOperation(ctx, "UpdateResourceDataSync", params, optFns, addOperationUpdateResourceDataSyncMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "UpdateResourceDataSync", params, optFns, c.addOperationUpdateResourceDataSyncMiddlewares) if err != nil { return nil, err } @@ -49,14 +51,21 @@ type UpdateResourceDataSyncInput struct { // // This member is required. SyncType *string + + noSmithyDocumentSerde } type UpdateResourceDataSyncOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationUpdateResourceDataSyncMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationUpdateResourceDataSyncMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateResourceDataSync{}, middleware.After) if err != nil { return err @@ -65,6 +74,13 @@ func addOperationUpdateResourceDataSyncMiddlewares(stack *middleware.Stack, opti if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateResourceDataSync"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -83,16 +99,13 @@ func addOperationUpdateResourceDataSyncMiddlewares(stack *middleware.Stack, opti if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -101,12 +114,18 @@ func addOperationUpdateResourceDataSyncMiddlewares(stack *middleware.Stack, opti if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpUpdateResourceDataSyncValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateResourceDataSync(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -116,6 +135,9 @@ func addOperationUpdateResourceDataSyncMiddlewares(stack *middleware.Stack, opti if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -123,7 +145,6 @@ func newServiceMetadataMiddleware_opUpdateResourceDataSync(region string) *awsmi return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "UpdateResourceDataSync", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateServiceSetting.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateServiceSetting.go index c32c0a65..75e4928f 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateServiceSetting.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/api_op_UpdateServiceSetting.go @@ -4,30 +4,32 @@ package ssm import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// ServiceSetting is an account-level setting for an AWS service. This setting -// defines how a user interacts with or uses a service or a feature of a service. -// For example, if an AWS service charges money to the account based on feature or -// service usage, then the AWS service team might create a default setting of -// "false". This means the user can't use this feature unless they change the -// setting to "true" and intentionally opt in for a paid feature. Services map a -// SettingId object to a setting value. AWS services teams define the default value -// for a SettingId. You can't create a new SettingId, but you can overwrite the -// default value if you have the ssm:UpdateServiceSetting permission for the -// setting. Use the GetServiceSetting API action to view the current value. Or, use -// the ResetServiceSetting to change the value back to the original value defined -// by the AWS service team. Update the service setting for the account. +// ServiceSetting is an account-level setting for an Amazon Web Services service. +// This setting defines how a user interacts with or uses a service or a feature of +// a service. For example, if an Amazon Web Services service charges money to the +// account based on feature or service usage, then the Amazon Web Services service +// team might create a default setting of "false". This means the user can't use +// this feature unless they change the setting to "true" and intentionally opt in +// for a paid feature. Services map a SettingId object to a setting value. Amazon +// Web Services services teams define the default value for a SettingId . You can't +// create a new SettingId , but you can overwrite the default value if you have the +// ssm:UpdateServiceSetting permission for the setting. Use the GetServiceSetting +// API operation to view the current value. Or, use the ResetServiceSetting to +// change the value back to the original value defined by the Amazon Web Services +// service team. Update the service setting for the account. func (c *Client) UpdateServiceSetting(ctx context.Context, params *UpdateServiceSettingInput, optFns ...func(*Options)) (*UpdateServiceSettingOutput, error) { if params == nil { params = &UpdateServiceSettingInput{} } - result, metadata, err := c.invokeOperation(ctx, "UpdateServiceSetting", params, optFns, addOperationUpdateServiceSettingMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "UpdateServiceSetting", params, optFns, c.addOperationUpdateServiceSettingMiddlewares) if err != nil { return nil, err } @@ -37,51 +39,61 @@ func (c *Client) UpdateServiceSetting(ctx context.Context, params *UpdateService return out, nil } -// The request body of the UpdateServiceSetting API action. +// The request body of the UpdateServiceSetting API operation. type UpdateServiceSettingInput struct { - // The Amazon Resource Name (ARN) of the service setting to reset. For example, - // arn:aws:ssm:us-east-1:111122223333:servicesetting/ssm/parameter-store/high-throughput-enabled. - // The setting ID can be one of the following. - // - // * - // /ssm/parameter-store/default-parameter-tier - // - // * - // /ssm/parameter-store/high-throughput-enabled - // - // * - // /ssm/managed-instance/activation-tier + // The Amazon Resource Name (ARN) of the service setting to update. For example, + // arn:aws:ssm:us-east-1:111122223333:servicesetting/ssm/parameter-store/high-throughput-enabled + // . The setting ID can be one of the following. + // - /ssm/managed-instance/default-ec2-instance-management-role + // - /ssm/automation/customer-script-log-destination + // - /ssm/automation/customer-script-log-group-name + // - /ssm/documents/console/public-sharing-permission + // - /ssm/managed-instance/activation-tier + // - /ssm/opsinsights/opscenter + // - /ssm/parameter-store/default-parameter-tier + // - /ssm/parameter-store/high-throughput-enabled + // Permissions to update the + // /ssm/managed-instance/default-ec2-instance-management-role setting should only + // be provided to administrators. Implement least privilege access when allowing + // individuals to configure or modify the Default Host Management Configuration. // // This member is required. SettingId *string - // The new value to specify for the service setting. For the - // /ssm/parameter-store/default-parameter-tier setting ID, the setting value can be - // one of the following. - // - // * Standard - // - // * Advanced - // - // * Intelligent-Tiering - // - // For the - // /ssm/parameter-store/high-throughput-enabled, and - // /ssm/managed-instance/activation-tier setting IDs, the setting value can be true - // or false. + // The new value to specify for the service setting. The following list specifies + // the available values for each setting. + // - For /ssm/managed-instance/default-ec2-instance-management-role , enter the + // name of an IAM role. + // - For /ssm/automation/customer-script-log-destination , enter CloudWatch . + // - For /ssm/automation/customer-script-log-group-name , enter the name of an + // Amazon CloudWatch Logs log group. + // - For /ssm/documents/console/public-sharing-permission , enter Enable or + // Disable . + // - For /ssm/managed-instance/activation-tier , enter standard or advanced . + // - For /ssm/opsinsights/opscenter , enter Enabled or Disabled . + // - For /ssm/parameter-store/default-parameter-tier , enter Standard , Advanced + // , or Intelligent-Tiering + // - For /ssm/parameter-store/high-throughput-enabled , enter true or false . // // This member is required. SettingValue *string + + noSmithyDocumentSerde } -// The result body of the UpdateServiceSetting API action. +// The result body of the UpdateServiceSetting API operation. type UpdateServiceSettingOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationUpdateServiceSettingMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationUpdateServiceSettingMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateServiceSetting{}, middleware.After) if err != nil { return err @@ -90,6 +102,13 @@ func addOperationUpdateServiceSettingMiddlewares(stack *middleware.Stack, option if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateServiceSetting"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -108,16 +127,13 @@ func addOperationUpdateServiceSettingMiddlewares(stack *middleware.Stack, option if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -126,12 +142,18 @@ func addOperationUpdateServiceSettingMiddlewares(stack *middleware.Stack, option if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpUpdateServiceSettingValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateServiceSetting(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -141,6 +163,9 @@ func addOperationUpdateServiceSettingMiddlewares(stack *middleware.Stack, option if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -148,7 +173,6 @@ func newServiceMetadataMiddleware_opUpdateServiceSetting(region string) *awsmidd return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "ssm", OperationName: "UpdateServiceSetting", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/auth.go new file mode 100644 index 00000000..bad85d05 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/auth.go @@ -0,0 +1,284 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssm + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func bindAuthParamsRegion(params *AuthResolverParameters, _ interface{}, options Options) { + params.Region = options.Region +} + +type setLegacyContextSigningOptionsMiddleware struct { +} + +func (*setLegacyContextSigningOptionsMiddleware) ID() string { + return "setLegacyContextSigningOptions" +} + +func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + schemeID := rscheme.Scheme.SchemeID() + + if sn := awsmiddleware.GetSigningName(ctx); sn != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) + } + } + + if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) + } + } + + return next.HandleFinalize(ctx, in) +} + +func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) +} + +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + +// AuthResolverParameters contains the set of inputs necessary for auth scheme +// resolution. +type AuthResolverParameters struct { + // The name of the operation being invoked. + Operation string + + // The region in which the operation is being invoked. + Region string +} + +func bindAuthResolverParams(operation string, input interface{}, options Options) *AuthResolverParameters { + params := &AuthResolverParameters{ + Operation: operation, + } + + bindAuthParamsRegion(params, input, options) + + return params +} + +// AuthSchemeResolver returns a set of possible authentication options for an +// operation. +type AuthSchemeResolver interface { + ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) +} + +type defaultAuthSchemeResolver struct{} + +var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) + +func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + if overrides, ok := operationAuthOptions[params.Operation]; ok { + return overrides(params), nil + } + return serviceAuthOptions(params), nil +} + +var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{} + +func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + { + SchemeID: smithyauth.SchemeIDSigV4, + SignerProperties: func() smithy.Properties { + var props smithy.Properties + smithyhttp.SetSigV4SigningName(&props, "ssm") + smithyhttp.SetSigV4SigningRegion(&props, params.Region) + return props + }(), + }, + } +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + params := bindAuthResolverParams(m.operation, getOperationInput(ctx), m.options) + options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) + } + + scheme, ok := m.selectScheme(options) + if !ok { + return out, metadata, fmt.Errorf("could not select an auth scheme") + } + + ctx = setResolvedAuthScheme(ctx, scheme) + return next.HandleFinalize(ctx, in) +} + +func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { + for _, option := range options { + if option.SchemeID == smithyauth.SchemeIDAnonymous { + return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true + } + + for _, scheme := range m.options.AuthSchemes { + if scheme.SchemeID() != option.SchemeID { + continue + } + + if scheme.IdentityResolver(m.options) != nil { + return newResolvedAuthScheme(scheme, option), true + } + } + } + + return nil, false +} + +type resolvedAuthSchemeKey struct{} + +type resolvedAuthScheme struct { + Scheme smithyhttp.AuthScheme + IdentityProperties smithy.Properties + SignerProperties smithy.Properties +} + +func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { + return &resolvedAuthScheme{ + Scheme: scheme, + IdentityProperties: option.IdentityProperties, + SignerProperties: option.SignerProperties, + } +} + +func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { + return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) +} + +func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { + v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) + return v +} + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + resolver := rscheme.Scheme.IdentityResolver(m.options) + if resolver == nil { + return out, metadata, fmt.Errorf("no identity resolver") + } + + identity, err := resolver.GetIdentity(ctx, rscheme.IdentityProperties) + if err != nil { + return out, metadata, fmt.Errorf("get identity: %w", err) + } + + ctx = setIdentity(ctx, identity) + return next.HandleFinalize(ctx, in) +} + +type identityKey struct{} + +func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { + return middleware.WithStackValue(ctx, identityKey{}, identity) +} + +func getIdentity(ctx context.Context) smithyauth.Identity { + v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) + return v +} + +type signRequestMiddleware struct { +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + signer := rscheme.Scheme.Signer() + if signer == nil { + return out, metadata, fmt.Errorf("no signer") + } + + if err := signer.SignRequest(ctx, req, identity, rscheme.SignerProperties); err != nil { + return out, metadata, fmt.Errorf("sign request: %w", err) + } + + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/deserializers.go index 4d6d087c..048cc313 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/deserializers.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/deserializers.go @@ -87,9 +87,9 @@ func awsAwsjson11_deserializeOpErrorAddTagsToResource(response *smithyhttp.Respo errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -98,7 +98,7 @@ func awsAwsjson11_deserializeOpErrorAddTagsToResource(response *smithyhttp.Respo body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -110,8 +110,8 @@ func awsAwsjson11_deserializeOpErrorAddTagsToResource(response *smithyhttp.Respo } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -143,6 +143,132 @@ func awsAwsjson11_deserializeOpErrorAddTagsToResource(response *smithyhttp.Respo } } +type awsAwsjson11_deserializeOpAssociateOpsItemRelatedItem struct { +} + +func (*awsAwsjson11_deserializeOpAssociateOpsItemRelatedItem) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpAssociateOpsItemRelatedItem) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorAssociateOpsItemRelatedItem(response, &metadata) + } + output := &AssociateOpsItemRelatedItemOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentAssociateOpsItemRelatedItemOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorAssociateOpsItemRelatedItem(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("OpsItemConflictException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemConflictException(response, errorBody) + + case strings.EqualFold("OpsItemInvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemInvalidParameterException(response, errorBody) + + case strings.EqualFold("OpsItemLimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemLimitExceededException(response, errorBody) + + case strings.EqualFold("OpsItemNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemNotFoundException(response, errorBody) + + case strings.EqualFold("OpsItemRelatedItemAlreadyExistsException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemRelatedItemAlreadyExistsException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpCancelCommand struct { } @@ -210,9 +336,9 @@ func awsAwsjson11_deserializeOpErrorCancelCommand(response *smithyhttp.Response, errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -221,7 +347,7 @@ func awsAwsjson11_deserializeOpErrorCancelCommand(response *smithyhttp.Response, body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -233,8 +359,8 @@ func awsAwsjson11_deserializeOpErrorCancelCommand(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -330,9 +456,9 @@ func awsAwsjson11_deserializeOpErrorCancelMaintenanceWindowExecution(response *s errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -341,7 +467,7 @@ func awsAwsjson11_deserializeOpErrorCancelMaintenanceWindowExecution(response *s body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -353,8 +479,8 @@ func awsAwsjson11_deserializeOpErrorCancelMaintenanceWindowExecution(response *s } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -444,9 +570,9 @@ func awsAwsjson11_deserializeOpErrorCreateActivation(response *smithyhttp.Respon errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -455,7 +581,7 @@ func awsAwsjson11_deserializeOpErrorCreateActivation(response *smithyhttp.Respon body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -467,8 +593,8 @@ func awsAwsjson11_deserializeOpErrorCreateActivation(response *smithyhttp.Respon } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -478,6 +604,9 @@ func awsAwsjson11_deserializeOpErrorCreateActivation(response *smithyhttp.Respon case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + case strings.EqualFold("InvalidParameters", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameters(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -555,9 +684,9 @@ func awsAwsjson11_deserializeOpErrorCreateAssociation(response *smithyhttp.Respo errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -566,7 +695,7 @@ func awsAwsjson11_deserializeOpErrorCreateAssociation(response *smithyhttp.Respo body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -578,8 +707,8 @@ func awsAwsjson11_deserializeOpErrorCreateAssociation(response *smithyhttp.Respo } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -613,9 +742,15 @@ func awsAwsjson11_deserializeOpErrorCreateAssociation(response *smithyhttp.Respo case strings.EqualFold("InvalidSchedule", errorCode): return awsAwsjson11_deserializeErrorInvalidSchedule(response, errorBody) + case strings.EqualFold("InvalidTag", errorCode): + return awsAwsjson11_deserializeErrorInvalidTag(response, errorBody) + case strings.EqualFold("InvalidTarget", errorCode): return awsAwsjson11_deserializeErrorInvalidTarget(response, errorBody) + case strings.EqualFold("InvalidTargetMaps", errorCode): + return awsAwsjson11_deserializeErrorInvalidTargetMaps(response, errorBody) + case strings.EqualFold("UnsupportedPlatformType", errorCode): return awsAwsjson11_deserializeErrorUnsupportedPlatformType(response, errorBody) @@ -696,9 +831,9 @@ func awsAwsjson11_deserializeOpErrorCreateAssociationBatch(response *smithyhttp. errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -707,7 +842,7 @@ func awsAwsjson11_deserializeOpErrorCreateAssociationBatch(response *smithyhttp. body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -719,8 +854,8 @@ func awsAwsjson11_deserializeOpErrorCreateAssociationBatch(response *smithyhttp. } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -757,6 +892,9 @@ func awsAwsjson11_deserializeOpErrorCreateAssociationBatch(response *smithyhttp. case strings.EqualFold("InvalidTarget", errorCode): return awsAwsjson11_deserializeErrorInvalidTarget(response, errorBody) + case strings.EqualFold("InvalidTargetMaps", errorCode): + return awsAwsjson11_deserializeErrorInvalidTargetMaps(response, errorBody) + case strings.EqualFold("UnsupportedPlatformType", errorCode): return awsAwsjson11_deserializeErrorUnsupportedPlatformType(response, errorBody) @@ -837,9 +975,9 @@ func awsAwsjson11_deserializeOpErrorCreateDocument(response *smithyhttp.Response errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -848,7 +986,7 @@ func awsAwsjson11_deserializeOpErrorCreateDocument(response *smithyhttp.Response body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -860,8 +998,8 @@ func awsAwsjson11_deserializeOpErrorCreateDocument(response *smithyhttp.Response } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -963,9 +1101,9 @@ func awsAwsjson11_deserializeOpErrorCreateMaintenanceWindow(response *smithyhttp errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -974,7 +1112,7 @@ func awsAwsjson11_deserializeOpErrorCreateMaintenanceWindow(response *smithyhttp body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -986,8 +1124,8 @@ func awsAwsjson11_deserializeOpErrorCreateMaintenanceWindow(response *smithyhttp } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -1080,9 +1218,9 @@ func awsAwsjson11_deserializeOpErrorCreateOpsItem(response *smithyhttp.Response, errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -1091,7 +1229,7 @@ func awsAwsjson11_deserializeOpErrorCreateOpsItem(response *smithyhttp.Response, body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1103,8 +1241,8 @@ func awsAwsjson11_deserializeOpErrorCreateOpsItem(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -1114,6 +1252,9 @@ func awsAwsjson11_deserializeOpErrorCreateOpsItem(response *smithyhttp.Response, case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + case strings.EqualFold("OpsItemAccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemAccessDeniedException(response, errorBody) + case strings.EqualFold("OpsItemAlreadyExistsException", errorCode): return awsAwsjson11_deserializeErrorOpsItemAlreadyExistsException(response, errorBody) @@ -1200,9 +1341,9 @@ func awsAwsjson11_deserializeOpErrorCreateOpsMetadata(response *smithyhttp.Respo errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -1211,7 +1352,7 @@ func awsAwsjson11_deserializeOpErrorCreateOpsMetadata(response *smithyhttp.Respo body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1223,8 +1364,8 @@ func awsAwsjson11_deserializeOpErrorCreateOpsMetadata(response *smithyhttp.Respo } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -1323,9 +1464,9 @@ func awsAwsjson11_deserializeOpErrorCreatePatchBaseline(response *smithyhttp.Res errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -1334,7 +1475,7 @@ func awsAwsjson11_deserializeOpErrorCreatePatchBaseline(response *smithyhttp.Res body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1346,8 +1487,8 @@ func awsAwsjson11_deserializeOpErrorCreatePatchBaseline(response *smithyhttp.Res } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -1440,9 +1581,9 @@ func awsAwsjson11_deserializeOpErrorCreateResourceDataSync(response *smithyhttp. errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -1451,7 +1592,7 @@ func awsAwsjson11_deserializeOpErrorCreateResourceDataSync(response *smithyhttp. body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1463,8 +1604,8 @@ func awsAwsjson11_deserializeOpErrorCreateResourceDataSync(response *smithyhttp. } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -1560,9 +1701,9 @@ func awsAwsjson11_deserializeOpErrorDeleteActivation(response *smithyhttp.Respon errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -1571,7 +1712,7 @@ func awsAwsjson11_deserializeOpErrorDeleteActivation(response *smithyhttp.Respon body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1583,8 +1724,8 @@ func awsAwsjson11_deserializeOpErrorDeleteActivation(response *smithyhttp.Respon } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -1680,9 +1821,9 @@ func awsAwsjson11_deserializeOpErrorDeleteAssociation(response *smithyhttp.Respo errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -1691,7 +1832,7 @@ func awsAwsjson11_deserializeOpErrorDeleteAssociation(response *smithyhttp.Respo body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1703,8 +1844,8 @@ func awsAwsjson11_deserializeOpErrorDeleteAssociation(response *smithyhttp.Respo } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -1803,9 +1944,9 @@ func awsAwsjson11_deserializeOpErrorDeleteDocument(response *smithyhttp.Response errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -1814,7 +1955,7 @@ func awsAwsjson11_deserializeOpErrorDeleteDocument(response *smithyhttp.Response body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1826,8 +1967,8 @@ func awsAwsjson11_deserializeOpErrorDeleteDocument(response *smithyhttp.Response } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -1923,9 +2064,9 @@ func awsAwsjson11_deserializeOpErrorDeleteInventory(response *smithyhttp.Respons errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -1934,7 +2075,7 @@ func awsAwsjson11_deserializeOpErrorDeleteInventory(response *smithyhttp.Respons body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1946,8 +2087,8 @@ func awsAwsjson11_deserializeOpErrorDeleteInventory(response *smithyhttp.Respons } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -2046,9 +2187,9 @@ func awsAwsjson11_deserializeOpErrorDeleteMaintenanceWindow(response *smithyhttp errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -2057,7 +2198,7 @@ func awsAwsjson11_deserializeOpErrorDeleteMaintenanceWindow(response *smithyhttp body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2069,8 +2210,8 @@ func awsAwsjson11_deserializeOpErrorDeleteMaintenanceWindow(response *smithyhttp } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -2090,6 +2231,120 @@ func awsAwsjson11_deserializeOpErrorDeleteMaintenanceWindow(response *smithyhttp } } +type awsAwsjson11_deserializeOpDeleteOpsItem struct { +} + +func (*awsAwsjson11_deserializeOpDeleteOpsItem) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDeleteOpsItem) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteOpsItem(response, &metadata) + } + output := &DeleteOpsItemOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentDeleteOpsItemOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorDeleteOpsItem(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("OpsItemInvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemInvalidParameterException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpDeleteOpsMetadata struct { } @@ -2157,9 +2412,9 @@ func awsAwsjson11_deserializeOpErrorDeleteOpsMetadata(response *smithyhttp.Respo errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -2168,7 +2423,7 @@ func awsAwsjson11_deserializeOpErrorDeleteOpsMetadata(response *smithyhttp.Respo body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2180,8 +2435,8 @@ func awsAwsjson11_deserializeOpErrorDeleteOpsMetadata(response *smithyhttp.Respo } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -2274,9 +2529,9 @@ func awsAwsjson11_deserializeOpErrorDeleteParameter(response *smithyhttp.Respons errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -2285,7 +2540,7 @@ func awsAwsjson11_deserializeOpErrorDeleteParameter(response *smithyhttp.Respons body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2297,8 +2552,8 @@ func awsAwsjson11_deserializeOpErrorDeleteParameter(response *smithyhttp.Respons } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -2388,9 +2643,9 @@ func awsAwsjson11_deserializeOpErrorDeleteParameters(response *smithyhttp.Respon errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -2399,7 +2654,7 @@ func awsAwsjson11_deserializeOpErrorDeleteParameters(response *smithyhttp.Respon body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2411,8 +2666,8 @@ func awsAwsjson11_deserializeOpErrorDeleteParameters(response *smithyhttp.Respon } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -2499,9 +2754,9 @@ func awsAwsjson11_deserializeOpErrorDeletePatchBaseline(response *smithyhttp.Res errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -2510,7 +2765,7 @@ func awsAwsjson11_deserializeOpErrorDeletePatchBaseline(response *smithyhttp.Res body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2522,8 +2777,8 @@ func awsAwsjson11_deserializeOpErrorDeletePatchBaseline(response *smithyhttp.Res } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -2613,9 +2868,9 @@ func awsAwsjson11_deserializeOpErrorDeleteResourceDataSync(response *smithyhttp. errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -2624,7 +2879,7 @@ func awsAwsjson11_deserializeOpErrorDeleteResourceDataSync(response *smithyhttp. body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2636,8 +2891,8 @@ func awsAwsjson11_deserializeOpErrorDeleteResourceDataSync(response *smithyhttp. } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -2663,14 +2918,14 @@ func awsAwsjson11_deserializeOpErrorDeleteResourceDataSync(response *smithyhttp. } } -type awsAwsjson11_deserializeOpDeregisterManagedInstance struct { +type awsAwsjson11_deserializeOpDeleteResourcePolicy struct { } -func (*awsAwsjson11_deserializeOpDeregisterManagedInstance) ID() string { +func (*awsAwsjson11_deserializeOpDeleteResourcePolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeregisterManagedInstance) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2684,9 +2939,9 @@ func (m *awsAwsjson11_deserializeOpDeregisterManagedInstance) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeregisterManagedInstance(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteResourcePolicy(response, &metadata) } - output := &DeregisterManagedInstanceOutput{} + output := &DeleteResourcePolicyOutput{} out.Result = output var buff [1024]byte @@ -2706,7 +2961,7 @@ func (m *awsAwsjson11_deserializeOpDeregisterManagedInstance) HandleDeserialize( return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDeregisterManagedInstanceOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeleteResourcePolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2720,7 +2975,7 @@ func (m *awsAwsjson11_deserializeOpDeregisterManagedInstance) HandleDeserialize( return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeregisterManagedInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2730,9 +2985,9 @@ func awsAwsjson11_deserializeOpErrorDeregisterManagedInstance(response *smithyht errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -2741,7 +2996,7 @@ func awsAwsjson11_deserializeOpErrorDeregisterManagedInstance(response *smithyht body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2753,8 +3008,8 @@ func awsAwsjson11_deserializeOpErrorDeregisterManagedInstance(response *smithyht } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -2764,8 +3019,11 @@ func awsAwsjson11_deserializeOpErrorDeregisterManagedInstance(response *smithyht case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("InvalidInstanceId", errorCode): - return awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody) + case strings.EqualFold("ResourcePolicyConflictException", errorCode): + return awsAwsjson11_deserializeErrorResourcePolicyConflictException(response, errorBody) + + case strings.EqualFold("ResourcePolicyInvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorResourcePolicyInvalidParameterException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -2777,14 +3035,14 @@ func awsAwsjson11_deserializeOpErrorDeregisterManagedInstance(response *smithyht } } -type awsAwsjson11_deserializeOpDeregisterPatchBaselineForPatchGroup struct { +type awsAwsjson11_deserializeOpDeregisterManagedInstance struct { } -func (*awsAwsjson11_deserializeOpDeregisterPatchBaselineForPatchGroup) ID() string { +func (*awsAwsjson11_deserializeOpDeregisterManagedInstance) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeregisterPatchBaselineForPatchGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeregisterManagedInstance) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2798,9 +3056,9 @@ func (m *awsAwsjson11_deserializeOpDeregisterPatchBaselineForPatchGroup) HandleD } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeregisterPatchBaselineForPatchGroup(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeregisterManagedInstance(response, &metadata) } - output := &DeregisterPatchBaselineForPatchGroupOutput{} + output := &DeregisterManagedInstanceOutput{} out.Result = output var buff [1024]byte @@ -2820,7 +3078,7 @@ func (m *awsAwsjson11_deserializeOpDeregisterPatchBaselineForPatchGroup) HandleD return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDeregisterPatchBaselineForPatchGroupOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeregisterManagedInstanceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2834,7 +3092,7 @@ func (m *awsAwsjson11_deserializeOpDeregisterPatchBaselineForPatchGroup) HandleD return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeregisterPatchBaselineForPatchGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeregisterManagedInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2844,9 +3102,9 @@ func awsAwsjson11_deserializeOpErrorDeregisterPatchBaselineForPatchGroup(respons errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -2855,7 +3113,7 @@ func awsAwsjson11_deserializeOpErrorDeregisterPatchBaselineForPatchGroup(respons body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2867,8 +3125,8 @@ func awsAwsjson11_deserializeOpErrorDeregisterPatchBaselineForPatchGroup(respons } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -2878,8 +3136,8 @@ func awsAwsjson11_deserializeOpErrorDeregisterPatchBaselineForPatchGroup(respons case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("InvalidResourceId", errorCode): - return awsAwsjson11_deserializeErrorInvalidResourceId(response, errorBody) + case strings.EqualFold("InvalidInstanceId", errorCode): + return awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -2891,14 +3149,14 @@ func awsAwsjson11_deserializeOpErrorDeregisterPatchBaselineForPatchGroup(respons } } -type awsAwsjson11_deserializeOpDeregisterTargetFromMaintenanceWindow struct { +type awsAwsjson11_deserializeOpDeregisterPatchBaselineForPatchGroup struct { } -func (*awsAwsjson11_deserializeOpDeregisterTargetFromMaintenanceWindow) ID() string { +func (*awsAwsjson11_deserializeOpDeregisterPatchBaselineForPatchGroup) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeregisterTargetFromMaintenanceWindow) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeregisterPatchBaselineForPatchGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2912,9 +3170,9 @@ func (m *awsAwsjson11_deserializeOpDeregisterTargetFromMaintenanceWindow) Handle } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeregisterTargetFromMaintenanceWindow(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeregisterPatchBaselineForPatchGroup(response, &metadata) } - output := &DeregisterTargetFromMaintenanceWindowOutput{} + output := &DeregisterPatchBaselineForPatchGroupOutput{} out.Result = output var buff [1024]byte @@ -2934,7 +3192,7 @@ func (m *awsAwsjson11_deserializeOpDeregisterTargetFromMaintenanceWindow) Handle return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDeregisterTargetFromMaintenanceWindowOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeregisterPatchBaselineForPatchGroupOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2948,7 +3206,7 @@ func (m *awsAwsjson11_deserializeOpDeregisterTargetFromMaintenanceWindow) Handle return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeregisterTargetFromMaintenanceWindow(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeregisterPatchBaselineForPatchGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2958,9 +3216,9 @@ func awsAwsjson11_deserializeOpErrorDeregisterTargetFromMaintenanceWindow(respon errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -2969,7 +3227,7 @@ func awsAwsjson11_deserializeOpErrorDeregisterTargetFromMaintenanceWindow(respon body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2981,8 +3239,122 @@ func awsAwsjson11_deserializeOpErrorDeregisterTargetFromMaintenanceWindow(respon } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("InvalidResourceId", errorCode): + return awsAwsjson11_deserializeErrorInvalidResourceId(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpDeregisterTargetFromMaintenanceWindow struct { +} + +func (*awsAwsjson11_deserializeOpDeregisterTargetFromMaintenanceWindow) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDeregisterTargetFromMaintenanceWindow) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorDeregisterTargetFromMaintenanceWindow(response, &metadata) + } + output := &DeregisterTargetFromMaintenanceWindowOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentDeregisterTargetFromMaintenanceWindowOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorDeregisterTargetFromMaintenanceWindow(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -3075,9 +3447,9 @@ func awsAwsjson11_deserializeOpErrorDeregisterTaskFromMaintenanceWindow(response errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -3086,7 +3458,7 @@ func awsAwsjson11_deserializeOpErrorDeregisterTaskFromMaintenanceWindow(response body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3098,8 +3470,8 @@ func awsAwsjson11_deserializeOpErrorDeregisterTaskFromMaintenanceWindow(response } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -3189,9 +3561,9 @@ func awsAwsjson11_deserializeOpErrorDescribeActivations(response *smithyhttp.Res errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -3200,7 +3572,7 @@ func awsAwsjson11_deserializeOpErrorDescribeActivations(response *smithyhttp.Res body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3212,8 +3584,8 @@ func awsAwsjson11_deserializeOpErrorDescribeActivations(response *smithyhttp.Res } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -3306,9 +3678,9 @@ func awsAwsjson11_deserializeOpErrorDescribeAssociation(response *smithyhttp.Res errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -3317,7 +3689,7 @@ func awsAwsjson11_deserializeOpErrorDescribeAssociation(response *smithyhttp.Res body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3329,8 +3701,8 @@ func awsAwsjson11_deserializeOpErrorDescribeAssociation(response *smithyhttp.Res } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -3429,9 +3801,9 @@ func awsAwsjson11_deserializeOpErrorDescribeAssociationExecutions(response *smit errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -3440,7 +3812,7 @@ func awsAwsjson11_deserializeOpErrorDescribeAssociationExecutions(response *smit body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3452,8 +3824,8 @@ func awsAwsjson11_deserializeOpErrorDescribeAssociationExecutions(response *smit } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -3546,9 +3918,9 @@ func awsAwsjson11_deserializeOpErrorDescribeAssociationExecutionTargets(response errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -3557,7 +3929,7 @@ func awsAwsjson11_deserializeOpErrorDescribeAssociationExecutionTargets(response body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3569,8 +3941,8 @@ func awsAwsjson11_deserializeOpErrorDescribeAssociationExecutionTargets(response } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -3666,9 +4038,9 @@ func awsAwsjson11_deserializeOpErrorDescribeAutomationExecutions(response *smith errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -3677,7 +4049,7 @@ func awsAwsjson11_deserializeOpErrorDescribeAutomationExecutions(response *smith body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3689,8 +4061,8 @@ func awsAwsjson11_deserializeOpErrorDescribeAutomationExecutions(response *smith } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -3786,9 +4158,9 @@ func awsAwsjson11_deserializeOpErrorDescribeAutomationStepExecutions(response *s errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -3797,7 +4169,7 @@ func awsAwsjson11_deserializeOpErrorDescribeAutomationStepExecutions(response *s body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3809,8 +4181,8 @@ func awsAwsjson11_deserializeOpErrorDescribeAutomationStepExecutions(response *s } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -3909,9 +4281,9 @@ func awsAwsjson11_deserializeOpErrorDescribeAvailablePatches(response *smithyhtt errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -3920,7 +4292,7 @@ func awsAwsjson11_deserializeOpErrorDescribeAvailablePatches(response *smithyhtt body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3932,8 +4304,8 @@ func awsAwsjson11_deserializeOpErrorDescribeAvailablePatches(response *smithyhtt } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -4020,9 +4392,9 @@ func awsAwsjson11_deserializeOpErrorDescribeDocument(response *smithyhttp.Respon errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -4031,7 +4403,7 @@ func awsAwsjson11_deserializeOpErrorDescribeDocument(response *smithyhttp.Respon body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4043,8 +4415,8 @@ func awsAwsjson11_deserializeOpErrorDescribeDocument(response *smithyhttp.Respon } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -4137,9 +4509,9 @@ func awsAwsjson11_deserializeOpErrorDescribeDocumentPermission(response *smithyh errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -4148,7 +4520,7 @@ func awsAwsjson11_deserializeOpErrorDescribeDocumentPermission(response *smithyh body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4160,8 +4532,8 @@ func awsAwsjson11_deserializeOpErrorDescribeDocumentPermission(response *smithyh } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -4174,6 +4546,12 @@ func awsAwsjson11_deserializeOpErrorDescribeDocumentPermission(response *smithyh case strings.EqualFold("InvalidDocument", errorCode): return awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody) + case strings.EqualFold("InvalidDocumentOperation", errorCode): + return awsAwsjson11_deserializeErrorInvalidDocumentOperation(response, errorBody) + + case strings.EqualFold("InvalidNextToken", errorCode): + return awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody) + case strings.EqualFold("InvalidPermissionType", errorCode): return awsAwsjson11_deserializeErrorInvalidPermissionType(response, errorBody) @@ -4254,9 +4632,9 @@ func awsAwsjson11_deserializeOpErrorDescribeEffectiveInstanceAssociations(respon errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -4265,7 +4643,7 @@ func awsAwsjson11_deserializeOpErrorDescribeEffectiveInstanceAssociations(respon body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4277,8 +4655,8 @@ func awsAwsjson11_deserializeOpErrorDescribeEffectiveInstanceAssociations(respon } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -4371,9 +4749,9 @@ func awsAwsjson11_deserializeOpErrorDescribeEffectivePatchesForPatchBaseline(res errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -4382,7 +4760,7 @@ func awsAwsjson11_deserializeOpErrorDescribeEffectivePatchesForPatchBaseline(res body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4394,8 +4772,8 @@ func awsAwsjson11_deserializeOpErrorDescribeEffectivePatchesForPatchBaseline(res } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -4491,9 +4869,9 @@ func awsAwsjson11_deserializeOpErrorDescribeInstanceAssociationsStatus(response errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -4502,7 +4880,7 @@ func awsAwsjson11_deserializeOpErrorDescribeInstanceAssociationsStatus(response body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4514,8 +4892,8 @@ func awsAwsjson11_deserializeOpErrorDescribeInstanceAssociationsStatus(response } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -4608,9 +4986,9 @@ func awsAwsjson11_deserializeOpErrorDescribeInstanceInformation(response *smithy errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -4619,7 +4997,7 @@ func awsAwsjson11_deserializeOpErrorDescribeInstanceInformation(response *smithy body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4631,8 +5009,8 @@ func awsAwsjson11_deserializeOpErrorDescribeInstanceInformation(response *smithy } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -4731,9 +5109,9 @@ func awsAwsjson11_deserializeOpErrorDescribeInstancePatches(response *smithyhttp errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -4742,7 +5120,7 @@ func awsAwsjson11_deserializeOpErrorDescribeInstancePatches(response *smithyhttp body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4754,8 +5132,8 @@ func awsAwsjson11_deserializeOpErrorDescribeInstancePatches(response *smithyhttp } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -4851,9 +5229,9 @@ func awsAwsjson11_deserializeOpErrorDescribeInstancePatchStates(response *smithy errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -4862,7 +5240,7 @@ func awsAwsjson11_deserializeOpErrorDescribeInstancePatchStates(response *smithy body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4874,8 +5252,8 @@ func awsAwsjson11_deserializeOpErrorDescribeInstancePatchStates(response *smithy } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -4965,9 +5343,9 @@ func awsAwsjson11_deserializeOpErrorDescribeInstancePatchStatesForPatchGroup(res errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -4976,7 +5354,7 @@ func awsAwsjson11_deserializeOpErrorDescribeInstancePatchStatesForPatchGroup(res body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4988,8 +5366,8 @@ func awsAwsjson11_deserializeOpErrorDescribeInstancePatchStatesForPatchGroup(res } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -5082,9 +5460,9 @@ func awsAwsjson11_deserializeOpErrorDescribeInventoryDeletions(response *smithyh errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -5093,7 +5471,7 @@ func awsAwsjson11_deserializeOpErrorDescribeInventoryDeletions(response *smithyh body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5105,8 +5483,8 @@ func awsAwsjson11_deserializeOpErrorDescribeInventoryDeletions(response *smithyh } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -5199,9 +5577,9 @@ func awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowExecutions(response errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -5210,7 +5588,7 @@ func awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowExecutions(response body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5222,8 +5600,8 @@ func awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowExecutions(response } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -5310,9 +5688,9 @@ func awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowExecutionTaskInvoca errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -5321,7 +5699,7 @@ func awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowExecutionTaskInvoca body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5333,8 +5711,8 @@ func awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowExecutionTaskInvoca } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -5424,9 +5802,9 @@ func awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowExecutionTasks(resp errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -5435,7 +5813,7 @@ func awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowExecutionTasks(resp body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5447,8 +5825,8 @@ func awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowExecutionTasks(resp } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -5538,9 +5916,9 @@ func awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindows(response *smithyh errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -5549,7 +5927,7 @@ func awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindows(response *smithyh body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5561,8 +5939,8 @@ func awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindows(response *smithyh } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -5649,9 +6027,9 @@ func awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowSchedule(response * errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -5660,7 +6038,7 @@ func awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowSchedule(response * body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5672,8 +6050,8 @@ func awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowSchedule(response * } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -5763,9 +6141,9 @@ func awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowsForTarget(response errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -5774,7 +6152,7 @@ func awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowsForTarget(response body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5786,8 +6164,8 @@ func awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowsForTarget(response } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -5874,9 +6252,9 @@ func awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowTargets(response *s errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -5885,7 +6263,7 @@ func awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowTargets(response *s body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5897,8 +6275,8 @@ func awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowTargets(response *s } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -5988,9 +6366,9 @@ func awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowTasks(response *smi errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -5999,7 +6377,7 @@ func awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowTasks(response *smi body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6011,8 +6389,8 @@ func awsAwsjson11_deserializeOpErrorDescribeMaintenanceWindowTasks(response *smi } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -6102,9 +6480,9 @@ func awsAwsjson11_deserializeOpErrorDescribeOpsItems(response *smithyhttp.Respon errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -6113,7 +6491,7 @@ func awsAwsjson11_deserializeOpErrorDescribeOpsItems(response *smithyhttp.Respon body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6125,8 +6503,8 @@ func awsAwsjson11_deserializeOpErrorDescribeOpsItems(response *smithyhttp.Respon } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -6213,9 +6591,9 @@ func awsAwsjson11_deserializeOpErrorDescribeParameters(response *smithyhttp.Resp errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -6224,7 +6602,7 @@ func awsAwsjson11_deserializeOpErrorDescribeParameters(response *smithyhttp.Resp body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6236,8 +6614,8 @@ func awsAwsjson11_deserializeOpErrorDescribeParameters(response *smithyhttp.Resp } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -6336,9 +6714,9 @@ func awsAwsjson11_deserializeOpErrorDescribePatchBaselines(response *smithyhttp. errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -6347,7 +6725,7 @@ func awsAwsjson11_deserializeOpErrorDescribePatchBaselines(response *smithyhttp. body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6359,8 +6737,8 @@ func awsAwsjson11_deserializeOpErrorDescribePatchBaselines(response *smithyhttp. } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -6447,9 +6825,9 @@ func awsAwsjson11_deserializeOpErrorDescribePatchGroups(response *smithyhttp.Res errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -6458,7 +6836,7 @@ func awsAwsjson11_deserializeOpErrorDescribePatchGroups(response *smithyhttp.Res body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6470,8 +6848,8 @@ func awsAwsjson11_deserializeOpErrorDescribePatchGroups(response *smithyhttp.Res } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -6558,9 +6936,9 @@ func awsAwsjson11_deserializeOpErrorDescribePatchGroupState(response *smithyhttp errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -6569,7 +6947,7 @@ func awsAwsjson11_deserializeOpErrorDescribePatchGroupState(response *smithyhttp body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6581,8 +6959,8 @@ func awsAwsjson11_deserializeOpErrorDescribePatchGroupState(response *smithyhttp } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -6672,9 +7050,9 @@ func awsAwsjson11_deserializeOpErrorDescribePatchProperties(response *smithyhttp errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -6683,7 +7061,7 @@ func awsAwsjson11_deserializeOpErrorDescribePatchProperties(response *smithyhttp body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6695,8 +7073,8 @@ func awsAwsjson11_deserializeOpErrorDescribePatchProperties(response *smithyhttp } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -6783,9 +7161,9 @@ func awsAwsjson11_deserializeOpErrorDescribeSessions(response *smithyhttp.Respon errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -6794,7 +7172,7 @@ func awsAwsjson11_deserializeOpErrorDescribeSessions(response *smithyhttp.Respon body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6806,8 +7184,8 @@ func awsAwsjson11_deserializeOpErrorDescribeSessions(response *smithyhttp.Respon } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -6833,14 +7211,14 @@ func awsAwsjson11_deserializeOpErrorDescribeSessions(response *smithyhttp.Respon } } -type awsAwsjson11_deserializeOpGetAutomationExecution struct { +type awsAwsjson11_deserializeOpDisassociateOpsItemRelatedItem struct { } -func (*awsAwsjson11_deserializeOpGetAutomationExecution) ID() string { +func (*awsAwsjson11_deserializeOpDisassociateOpsItemRelatedItem) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetAutomationExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDisassociateOpsItemRelatedItem) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6854,9 +7232,9 @@ func (m *awsAwsjson11_deserializeOpGetAutomationExecution) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetAutomationExecution(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDisassociateOpsItemRelatedItem(response, &metadata) } - output := &GetAutomationExecutionOutput{} + output := &DisassociateOpsItemRelatedItemOutput{} out.Result = output var buff [1024]byte @@ -6876,7 +7254,7 @@ func (m *awsAwsjson11_deserializeOpGetAutomationExecution) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetAutomationExecutionOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDisassociateOpsItemRelatedItemOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6890,7 +7268,7 @@ func (m *awsAwsjson11_deserializeOpGetAutomationExecution) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetAutomationExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDisassociateOpsItemRelatedItem(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6900,9 +7278,9 @@ func awsAwsjson11_deserializeOpErrorGetAutomationExecution(response *smithyhttp. errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -6911,7 +7289,7 @@ func awsAwsjson11_deserializeOpErrorGetAutomationExecution(response *smithyhttp. body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6923,20 +7301,29 @@ func awsAwsjson11_deserializeOpErrorGetAutomationExecution(response *smithyhttp. } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { - case strings.EqualFold("AutomationExecutionNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorAutomationExecutionNotFoundException(response, errorBody) - case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + case strings.EqualFold("OpsItemConflictException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemConflictException(response, errorBody) + + case strings.EqualFold("OpsItemInvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemInvalidParameterException(response, errorBody) + + case strings.EqualFold("OpsItemNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemNotFoundException(response, errorBody) + + case strings.EqualFold("OpsItemRelatedItemAssociationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemRelatedItemAssociationNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -6947,14 +7334,14 @@ func awsAwsjson11_deserializeOpErrorGetAutomationExecution(response *smithyhttp. } } -type awsAwsjson11_deserializeOpGetCalendarState struct { +type awsAwsjson11_deserializeOpGetAutomationExecution struct { } -func (*awsAwsjson11_deserializeOpGetCalendarState) ID() string { +func (*awsAwsjson11_deserializeOpGetAutomationExecution) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetCalendarState) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetAutomationExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6968,9 +7355,9 @@ func (m *awsAwsjson11_deserializeOpGetCalendarState) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetCalendarState(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetAutomationExecution(response, &metadata) } - output := &GetCalendarStateOutput{} + output := &GetAutomationExecutionOutput{} out.Result = output var buff [1024]byte @@ -6990,7 +7377,7 @@ func (m *awsAwsjson11_deserializeOpGetCalendarState) HandleDeserialize(ctx conte return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetCalendarStateOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetAutomationExecutionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7004,7 +7391,7 @@ func (m *awsAwsjson11_deserializeOpGetCalendarState) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetCalendarState(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetAutomationExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7014,9 +7401,9 @@ func awsAwsjson11_deserializeOpErrorGetCalendarState(response *smithyhttp.Respon errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -7025,7 +7412,7 @@ func awsAwsjson11_deserializeOpErrorGetCalendarState(response *smithyhttp.Respon body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7037,26 +7424,20 @@ func awsAwsjson11_deserializeOpErrorGetCalendarState(response *smithyhttp.Respon } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { + case strings.EqualFold("AutomationExecutionNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorAutomationExecutionNotFoundException(response, errorBody) + case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("InvalidDocument", errorCode): - return awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody) - - case strings.EqualFold("InvalidDocumentType", errorCode): - return awsAwsjson11_deserializeErrorInvalidDocumentType(response, errorBody) - - case strings.EqualFold("UnsupportedCalendarException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedCalendarException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -7067,14 +7448,14 @@ func awsAwsjson11_deserializeOpErrorGetCalendarState(response *smithyhttp.Respon } } -type awsAwsjson11_deserializeOpGetCommandInvocation struct { +type awsAwsjson11_deserializeOpGetCalendarState struct { } -func (*awsAwsjson11_deserializeOpGetCommandInvocation) ID() string { +func (*awsAwsjson11_deserializeOpGetCalendarState) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetCommandInvocation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetCalendarState) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7088,9 +7469,9 @@ func (m *awsAwsjson11_deserializeOpGetCommandInvocation) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetCommandInvocation(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetCalendarState(response, &metadata) } - output := &GetCommandInvocationOutput{} + output := &GetCalendarStateOutput{} out.Result = output var buff [1024]byte @@ -7110,7 +7491,7 @@ func (m *awsAwsjson11_deserializeOpGetCommandInvocation) HandleDeserialize(ctx c return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetCommandInvocationOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetCalendarStateOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7124,7 +7505,7 @@ func (m *awsAwsjson11_deserializeOpGetCommandInvocation) HandleDeserialize(ctx c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetCommandInvocation(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetCalendarState(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7134,9 +7515,9 @@ func awsAwsjson11_deserializeOpErrorGetCommandInvocation(response *smithyhttp.Re errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -7145,7 +7526,7 @@ func awsAwsjson11_deserializeOpErrorGetCommandInvocation(response *smithyhttp.Re body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7157,8 +7538,8 @@ func awsAwsjson11_deserializeOpErrorGetCommandInvocation(response *smithyhttp.Re } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -7168,17 +7549,14 @@ func awsAwsjson11_deserializeOpErrorGetCommandInvocation(response *smithyhttp.Re case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("InvalidCommandId", errorCode): - return awsAwsjson11_deserializeErrorInvalidCommandId(response, errorBody) - - case strings.EqualFold("InvalidInstanceId", errorCode): - return awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody) + case strings.EqualFold("InvalidDocument", errorCode): + return awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody) - case strings.EqualFold("InvalidPluginName", errorCode): - return awsAwsjson11_deserializeErrorInvalidPluginName(response, errorBody) + case strings.EqualFold("InvalidDocumentType", errorCode): + return awsAwsjson11_deserializeErrorInvalidDocumentType(response, errorBody) - case strings.EqualFold("InvocationDoesNotExist", errorCode): - return awsAwsjson11_deserializeErrorInvocationDoesNotExist(response, errorBody) + case strings.EqualFold("UnsupportedCalendarException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedCalendarException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -7190,14 +7568,14 @@ func awsAwsjson11_deserializeOpErrorGetCommandInvocation(response *smithyhttp.Re } } -type awsAwsjson11_deserializeOpGetConnectionStatus struct { +type awsAwsjson11_deserializeOpGetCommandInvocation struct { } -func (*awsAwsjson11_deserializeOpGetConnectionStatus) ID() string { +func (*awsAwsjson11_deserializeOpGetCommandInvocation) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetConnectionStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetCommandInvocation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7211,9 +7589,9 @@ func (m *awsAwsjson11_deserializeOpGetConnectionStatus) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetConnectionStatus(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetCommandInvocation(response, &metadata) } - output := &GetConnectionStatusOutput{} + output := &GetCommandInvocationOutput{} out.Result = output var buff [1024]byte @@ -7233,7 +7611,7 @@ func (m *awsAwsjson11_deserializeOpGetConnectionStatus) HandleDeserialize(ctx co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetConnectionStatusOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetCommandInvocationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7247,7 +7625,7 @@ func (m *awsAwsjson11_deserializeOpGetConnectionStatus) HandleDeserialize(ctx co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetConnectionStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetCommandInvocation(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7257,9 +7635,9 @@ func awsAwsjson11_deserializeOpErrorGetConnectionStatus(response *smithyhttp.Res errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -7268,7 +7646,7 @@ func awsAwsjson11_deserializeOpErrorGetConnectionStatus(response *smithyhttp.Res body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7280,8 +7658,8 @@ func awsAwsjson11_deserializeOpErrorGetConnectionStatus(response *smithyhttp.Res } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -7291,6 +7669,18 @@ func awsAwsjson11_deserializeOpErrorGetConnectionStatus(response *smithyhttp.Res case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + case strings.EqualFold("InvalidCommandId", errorCode): + return awsAwsjson11_deserializeErrorInvalidCommandId(response, errorBody) + + case strings.EqualFold("InvalidInstanceId", errorCode): + return awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody) + + case strings.EqualFold("InvalidPluginName", errorCode): + return awsAwsjson11_deserializeErrorInvalidPluginName(response, errorBody) + + case strings.EqualFold("InvocationDoesNotExist", errorCode): + return awsAwsjson11_deserializeErrorInvocationDoesNotExist(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -7301,14 +7691,14 @@ func awsAwsjson11_deserializeOpErrorGetConnectionStatus(response *smithyhttp.Res } } -type awsAwsjson11_deserializeOpGetDefaultPatchBaseline struct { +type awsAwsjson11_deserializeOpGetConnectionStatus struct { } -func (*awsAwsjson11_deserializeOpGetDefaultPatchBaseline) ID() string { +func (*awsAwsjson11_deserializeOpGetConnectionStatus) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetDefaultPatchBaseline) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetConnectionStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7322,9 +7712,9 @@ func (m *awsAwsjson11_deserializeOpGetDefaultPatchBaseline) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetDefaultPatchBaseline(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetConnectionStatus(response, &metadata) } - output := &GetDefaultPatchBaselineOutput{} + output := &GetConnectionStatusOutput{} out.Result = output var buff [1024]byte @@ -7344,7 +7734,7 @@ func (m *awsAwsjson11_deserializeOpGetDefaultPatchBaseline) HandleDeserialize(ct return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetDefaultPatchBaselineOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetConnectionStatusOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7358,7 +7748,7 @@ func (m *awsAwsjson11_deserializeOpGetDefaultPatchBaseline) HandleDeserialize(ct return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetDefaultPatchBaseline(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetConnectionStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7368,9 +7758,9 @@ func awsAwsjson11_deserializeOpErrorGetDefaultPatchBaseline(response *smithyhttp errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -7379,7 +7769,7 @@ func awsAwsjson11_deserializeOpErrorGetDefaultPatchBaseline(response *smithyhttp body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7391,8 +7781,8 @@ func awsAwsjson11_deserializeOpErrorGetDefaultPatchBaseline(response *smithyhttp } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -7412,14 +7802,14 @@ func awsAwsjson11_deserializeOpErrorGetDefaultPatchBaseline(response *smithyhttp } } -type awsAwsjson11_deserializeOpGetDeployablePatchSnapshotForInstance struct { +type awsAwsjson11_deserializeOpGetDefaultPatchBaseline struct { } -func (*awsAwsjson11_deserializeOpGetDeployablePatchSnapshotForInstance) ID() string { +func (*awsAwsjson11_deserializeOpGetDefaultPatchBaseline) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetDeployablePatchSnapshotForInstance) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetDefaultPatchBaseline) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7433,9 +7823,9 @@ func (m *awsAwsjson11_deserializeOpGetDeployablePatchSnapshotForInstance) Handle } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetDeployablePatchSnapshotForInstance(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetDefaultPatchBaseline(response, &metadata) } - output := &GetDeployablePatchSnapshotForInstanceOutput{} + output := &GetDefaultPatchBaselineOutput{} out.Result = output var buff [1024]byte @@ -7455,7 +7845,7 @@ func (m *awsAwsjson11_deserializeOpGetDeployablePatchSnapshotForInstance) Handle return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetDeployablePatchSnapshotForInstanceOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetDefaultPatchBaselineOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7469,7 +7859,7 @@ func (m *awsAwsjson11_deserializeOpGetDeployablePatchSnapshotForInstance) Handle return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetDeployablePatchSnapshotForInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetDefaultPatchBaseline(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7479,9 +7869,9 @@ func awsAwsjson11_deserializeOpErrorGetDeployablePatchSnapshotForInstance(respon errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -7490,7 +7880,7 @@ func awsAwsjson11_deserializeOpErrorGetDeployablePatchSnapshotForInstance(respon body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7502,8 +7892,8 @@ func awsAwsjson11_deserializeOpErrorGetDeployablePatchSnapshotForInstance(respon } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -7513,12 +7903,6 @@ func awsAwsjson11_deserializeOpErrorGetDeployablePatchSnapshotForInstance(respon case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("UnsupportedFeatureRequiredException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedFeatureRequiredException(response, errorBody) - - case strings.EqualFold("UnsupportedOperatingSystem", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedOperatingSystem(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -7529,14 +7913,14 @@ func awsAwsjson11_deserializeOpErrorGetDeployablePatchSnapshotForInstance(respon } } -type awsAwsjson11_deserializeOpGetDocument struct { +type awsAwsjson11_deserializeOpGetDeployablePatchSnapshotForInstance struct { } -func (*awsAwsjson11_deserializeOpGetDocument) ID() string { +func (*awsAwsjson11_deserializeOpGetDeployablePatchSnapshotForInstance) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetDocument) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetDeployablePatchSnapshotForInstance) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7550,9 +7934,9 @@ func (m *awsAwsjson11_deserializeOpGetDocument) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetDocument(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetDeployablePatchSnapshotForInstance(response, &metadata) } - output := &GetDocumentOutput{} + output := &GetDeployablePatchSnapshotForInstanceOutput{} out.Result = output var buff [1024]byte @@ -7572,7 +7956,7 @@ func (m *awsAwsjson11_deserializeOpGetDocument) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetDocumentOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetDeployablePatchSnapshotForInstanceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7586,7 +7970,7 @@ func (m *awsAwsjson11_deserializeOpGetDocument) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetDocument(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetDeployablePatchSnapshotForInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7596,9 +7980,9 @@ func awsAwsjson11_deserializeOpErrorGetDocument(response *smithyhttp.Response, m errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -7607,7 +7991,7 @@ func awsAwsjson11_deserializeOpErrorGetDocument(response *smithyhttp.Response, m body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7619,8 +8003,125 @@ func awsAwsjson11_deserializeOpErrorGetDocument(response *smithyhttp.Response, m } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("UnsupportedFeatureRequiredException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedFeatureRequiredException(response, errorBody) + + case strings.EqualFold("UnsupportedOperatingSystem", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedOperatingSystem(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpGetDocument struct { +} + +func (*awsAwsjson11_deserializeOpGetDocument) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetDocument) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorGetDocument(response, &metadata) + } + output := &GetDocumentOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentGetDocumentOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorGetDocument(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -7713,9 +8214,9 @@ func awsAwsjson11_deserializeOpErrorGetInventory(response *smithyhttp.Response, errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -7724,7 +8225,7 @@ func awsAwsjson11_deserializeOpErrorGetInventory(response *smithyhttp.Response, body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7736,8 +8237,8 @@ func awsAwsjson11_deserializeOpErrorGetInventory(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -7842,9 +8343,9 @@ func awsAwsjson11_deserializeOpErrorGetInventorySchema(response *smithyhttp.Resp errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -7853,7 +8354,7 @@ func awsAwsjson11_deserializeOpErrorGetInventorySchema(response *smithyhttp.Resp body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7865,8 +8366,8 @@ func awsAwsjson11_deserializeOpErrorGetInventorySchema(response *smithyhttp.Resp } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -7959,9 +8460,9 @@ func awsAwsjson11_deserializeOpErrorGetMaintenanceWindow(response *smithyhttp.Re errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -7970,7 +8471,7 @@ func awsAwsjson11_deserializeOpErrorGetMaintenanceWindow(response *smithyhttp.Re body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7982,8 +8483,8 @@ func awsAwsjson11_deserializeOpErrorGetMaintenanceWindow(response *smithyhttp.Re } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -8073,9 +8574,9 @@ func awsAwsjson11_deserializeOpErrorGetMaintenanceWindowExecution(response *smit errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -8084,7 +8585,7 @@ func awsAwsjson11_deserializeOpErrorGetMaintenanceWindowExecution(response *smit body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8096,8 +8597,8 @@ func awsAwsjson11_deserializeOpErrorGetMaintenanceWindowExecution(response *smit } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -8187,9 +8688,9 @@ func awsAwsjson11_deserializeOpErrorGetMaintenanceWindowExecutionTask(response * errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -8198,7 +8699,7 @@ func awsAwsjson11_deserializeOpErrorGetMaintenanceWindowExecutionTask(response * body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8210,8 +8711,8 @@ func awsAwsjson11_deserializeOpErrorGetMaintenanceWindowExecutionTask(response * } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -8301,9 +8802,9 @@ func awsAwsjson11_deserializeOpErrorGetMaintenanceWindowExecutionTaskInvocation( errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -8312,7 +8813,7 @@ func awsAwsjson11_deserializeOpErrorGetMaintenanceWindowExecutionTaskInvocation( body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8324,8 +8825,8 @@ func awsAwsjson11_deserializeOpErrorGetMaintenanceWindowExecutionTaskInvocation( } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -8415,9 +8916,9 @@ func awsAwsjson11_deserializeOpErrorGetMaintenanceWindowTask(response *smithyhtt errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -8426,7 +8927,7 @@ func awsAwsjson11_deserializeOpErrorGetMaintenanceWindowTask(response *smithyhtt body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8438,8 +8939,8 @@ func awsAwsjson11_deserializeOpErrorGetMaintenanceWindowTask(response *smithyhtt } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -8529,9 +9030,9 @@ func awsAwsjson11_deserializeOpErrorGetOpsItem(response *smithyhttp.Response, me errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -8540,7 +9041,7 @@ func awsAwsjson11_deserializeOpErrorGetOpsItem(response *smithyhttp.Response, me body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8552,8 +9053,8 @@ func awsAwsjson11_deserializeOpErrorGetOpsItem(response *smithyhttp.Response, me } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -8563,6 +9064,9 @@ func awsAwsjson11_deserializeOpErrorGetOpsItem(response *smithyhttp.Response, me case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + case strings.EqualFold("OpsItemAccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemAccessDeniedException(response, errorBody) + case strings.EqualFold("OpsItemNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOpsItemNotFoundException(response, errorBody) @@ -8643,9 +9147,9 @@ func awsAwsjson11_deserializeOpErrorGetOpsMetadata(response *smithyhttp.Response errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -8654,7 +9158,7 @@ func awsAwsjson11_deserializeOpErrorGetOpsMetadata(response *smithyhttp.Response body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8666,8 +9170,8 @@ func awsAwsjson11_deserializeOpErrorGetOpsMetadata(response *smithyhttp.Response } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -8760,9 +9264,9 @@ func awsAwsjson11_deserializeOpErrorGetOpsSummary(response *smithyhttp.Response, errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -8771,7 +9275,7 @@ func awsAwsjson11_deserializeOpErrorGetOpsSummary(response *smithyhttp.Response, body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8783,8 +9287,8 @@ func awsAwsjson11_deserializeOpErrorGetOpsSummary(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -8886,9 +9390,9 @@ func awsAwsjson11_deserializeOpErrorGetParameter(response *smithyhttp.Response, errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -8897,7 +9401,7 @@ func awsAwsjson11_deserializeOpErrorGetParameter(response *smithyhttp.Response, body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8909,8 +9413,8 @@ func awsAwsjson11_deserializeOpErrorGetParameter(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -9006,9 +9510,9 @@ func awsAwsjson11_deserializeOpErrorGetParameterHistory(response *smithyhttp.Res errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -9017,7 +9521,7 @@ func awsAwsjson11_deserializeOpErrorGetParameterHistory(response *smithyhttp.Res body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9029,8 +9533,8 @@ func awsAwsjson11_deserializeOpErrorGetParameterHistory(response *smithyhttp.Res } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -9126,9 +9630,9 @@ func awsAwsjson11_deserializeOpErrorGetParameters(response *smithyhttp.Response, errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -9137,7 +9641,7 @@ func awsAwsjson11_deserializeOpErrorGetParameters(response *smithyhttp.Response, body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9149,8 +9653,8 @@ func awsAwsjson11_deserializeOpErrorGetParameters(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -9240,9 +9744,9 @@ func awsAwsjson11_deserializeOpErrorGetParametersByPath(response *smithyhttp.Res errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -9251,7 +9755,7 @@ func awsAwsjson11_deserializeOpErrorGetParametersByPath(response *smithyhttp.Res body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9263,8 +9767,8 @@ func awsAwsjson11_deserializeOpErrorGetParametersByPath(response *smithyhttp.Res } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -9366,9 +9870,9 @@ func awsAwsjson11_deserializeOpErrorGetPatchBaseline(response *smithyhttp.Respon errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -9377,7 +9881,7 @@ func awsAwsjson11_deserializeOpErrorGetPatchBaseline(response *smithyhttp.Respon body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9389,8 +9893,8 @@ func awsAwsjson11_deserializeOpErrorGetPatchBaseline(response *smithyhttp.Respon } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -9483,9 +9987,9 @@ func awsAwsjson11_deserializeOpErrorGetPatchBaselineForPatchGroup(response *smit errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -9494,7 +9998,7 @@ func awsAwsjson11_deserializeOpErrorGetPatchBaselineForPatchGroup(response *smit body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9506,8 +10010,8 @@ func awsAwsjson11_deserializeOpErrorGetPatchBaselineForPatchGroup(response *smit } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -9527,6 +10031,120 @@ func awsAwsjson11_deserializeOpErrorGetPatchBaselineForPatchGroup(response *smit } } +type awsAwsjson11_deserializeOpGetResourcePolicies struct { +} + +func (*awsAwsjson11_deserializeOpGetResourcePolicies) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetResourcePolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorGetResourcePolicies(response, &metadata) + } + output := &GetResourcePoliciesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentGetResourcePoliciesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorGetResourcePolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("ResourcePolicyInvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorResourcePolicyInvalidParameterException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpGetServiceSetting struct { } @@ -9594,9 +10212,9 @@ func awsAwsjson11_deserializeOpErrorGetServiceSetting(response *smithyhttp.Respo errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -9605,7 +10223,7 @@ func awsAwsjson11_deserializeOpErrorGetServiceSetting(response *smithyhttp.Respo body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9617,8 +10235,8 @@ func awsAwsjson11_deserializeOpErrorGetServiceSetting(response *smithyhttp.Respo } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -9708,9 +10326,9 @@ func awsAwsjson11_deserializeOpErrorLabelParameterVersion(response *smithyhttp.R errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -9719,7 +10337,7 @@ func awsAwsjson11_deserializeOpErrorLabelParameterVersion(response *smithyhttp.R body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9731,8 +10349,8 @@ func awsAwsjson11_deserializeOpErrorLabelParameterVersion(response *smithyhttp.R } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -9831,9 +10449,9 @@ func awsAwsjson11_deserializeOpErrorListAssociations(response *smithyhttp.Respon errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -9842,7 +10460,7 @@ func awsAwsjson11_deserializeOpErrorListAssociations(response *smithyhttp.Respon body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9854,8 +10472,8 @@ func awsAwsjson11_deserializeOpErrorListAssociations(response *smithyhttp.Respon } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -9945,9 +10563,9 @@ func awsAwsjson11_deserializeOpErrorListAssociationVersions(response *smithyhttp errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -9956,7 +10574,7 @@ func awsAwsjson11_deserializeOpErrorListAssociationVersions(response *smithyhttp body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9968,8 +10586,8 @@ func awsAwsjson11_deserializeOpErrorListAssociationVersions(response *smithyhttp } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -10062,9 +10680,9 @@ func awsAwsjson11_deserializeOpErrorListCommandInvocations(response *smithyhttp. errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -10073,7 +10691,7 @@ func awsAwsjson11_deserializeOpErrorListCommandInvocations(response *smithyhttp. body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10085,8 +10703,8 @@ func awsAwsjson11_deserializeOpErrorListCommandInvocations(response *smithyhttp. } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -10185,9 +10803,9 @@ func awsAwsjson11_deserializeOpErrorListCommands(response *smithyhttp.Response, errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -10196,7 +10814,7 @@ func awsAwsjson11_deserializeOpErrorListCommands(response *smithyhttp.Response, body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10208,8 +10826,8 @@ func awsAwsjson11_deserializeOpErrorListCommands(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -10308,9 +10926,9 @@ func awsAwsjson11_deserializeOpErrorListComplianceItems(response *smithyhttp.Res errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -10319,7 +10937,7 @@ func awsAwsjson11_deserializeOpErrorListComplianceItems(response *smithyhttp.Res body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10331,8 +10949,8 @@ func awsAwsjson11_deserializeOpErrorListComplianceItems(response *smithyhttp.Res } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -10431,9 +11049,9 @@ func awsAwsjson11_deserializeOpErrorListComplianceSummaries(response *smithyhttp errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -10442,7 +11060,7 @@ func awsAwsjson11_deserializeOpErrorListComplianceSummaries(response *smithyhttp body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10454,8 +11072,8 @@ func awsAwsjson11_deserializeOpErrorListComplianceSummaries(response *smithyhttp } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -10548,9 +11166,9 @@ func awsAwsjson11_deserializeOpErrorListDocumentMetadataHistory(response *smithy errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -10559,7 +11177,7 @@ func awsAwsjson11_deserializeOpErrorListDocumentMetadataHistory(response *smithy body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10571,8 +11189,8 @@ func awsAwsjson11_deserializeOpErrorListDocumentMetadataHistory(response *smithy } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -10668,9 +11286,9 @@ func awsAwsjson11_deserializeOpErrorListDocuments(response *smithyhttp.Response, errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -10679,7 +11297,7 @@ func awsAwsjson11_deserializeOpErrorListDocuments(response *smithyhttp.Response, body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10691,8 +11309,8 @@ func awsAwsjson11_deserializeOpErrorListDocuments(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -10785,9 +11403,9 @@ func awsAwsjson11_deserializeOpErrorListDocumentVersions(response *smithyhttp.Re errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -10796,7 +11414,7 @@ func awsAwsjson11_deserializeOpErrorListDocumentVersions(response *smithyhttp.Re body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10808,8 +11426,8 @@ func awsAwsjson11_deserializeOpErrorListDocumentVersions(response *smithyhttp.Re } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -10902,9 +11520,9 @@ func awsAwsjson11_deserializeOpErrorListInventoryEntries(response *smithyhttp.Re errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -10913,7 +11531,7 @@ func awsAwsjson11_deserializeOpErrorListInventoryEntries(response *smithyhttp.Re body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10925,8 +11543,8 @@ func awsAwsjson11_deserializeOpErrorListInventoryEntries(response *smithyhttp.Re } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -11025,9 +11643,9 @@ func awsAwsjson11_deserializeOpErrorListOpsItemEvents(response *smithyhttp.Respo errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -11036,7 +11654,7 @@ func awsAwsjson11_deserializeOpErrorListOpsItemEvents(response *smithyhttp.Respo body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11048,8 +11666,8 @@ func awsAwsjson11_deserializeOpErrorListOpsItemEvents(response *smithyhttp.Respo } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -11078,14 +11696,14 @@ func awsAwsjson11_deserializeOpErrorListOpsItemEvents(response *smithyhttp.Respo } } -type awsAwsjson11_deserializeOpListOpsMetadata struct { +type awsAwsjson11_deserializeOpListOpsItemRelatedItems struct { } -func (*awsAwsjson11_deserializeOpListOpsMetadata) ID() string { +func (*awsAwsjson11_deserializeOpListOpsItemRelatedItems) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListOpsMetadata) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListOpsItemRelatedItems) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -11099,9 +11717,9 @@ func (m *awsAwsjson11_deserializeOpListOpsMetadata) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListOpsMetadata(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListOpsItemRelatedItems(response, &metadata) } - output := &ListOpsMetadataOutput{} + output := &ListOpsItemRelatedItemsOutput{} out.Result = output var buff [1024]byte @@ -11121,7 +11739,7 @@ func (m *awsAwsjson11_deserializeOpListOpsMetadata) HandleDeserialize(ctx contex return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListOpsMetadataOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListOpsItemRelatedItemsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11135,7 +11753,7 @@ func (m *awsAwsjson11_deserializeOpListOpsMetadata) HandleDeserialize(ctx contex return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListOpsMetadata(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListOpsItemRelatedItems(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -11145,9 +11763,9 @@ func awsAwsjson11_deserializeOpErrorListOpsMetadata(response *smithyhttp.Respons errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -11156,7 +11774,7 @@ func awsAwsjson11_deserializeOpErrorListOpsMetadata(response *smithyhttp.Respons body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11168,8 +11786,8 @@ func awsAwsjson11_deserializeOpErrorListOpsMetadata(response *smithyhttp.Respons } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -11179,8 +11797,8 @@ func awsAwsjson11_deserializeOpErrorListOpsMetadata(response *smithyhttp.Respons case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("OpsMetadataInvalidArgumentException", errorCode): - return awsAwsjson11_deserializeErrorOpsMetadataInvalidArgumentException(response, errorBody) + case strings.EqualFold("OpsItemInvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemInvalidParameterException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -11192,14 +11810,14 @@ func awsAwsjson11_deserializeOpErrorListOpsMetadata(response *smithyhttp.Respons } } -type awsAwsjson11_deserializeOpListResourceComplianceSummaries struct { +type awsAwsjson11_deserializeOpListOpsMetadata struct { } -func (*awsAwsjson11_deserializeOpListResourceComplianceSummaries) ID() string { +func (*awsAwsjson11_deserializeOpListOpsMetadata) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListResourceComplianceSummaries) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListOpsMetadata) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -11213,9 +11831,9 @@ func (m *awsAwsjson11_deserializeOpListResourceComplianceSummaries) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListResourceComplianceSummaries(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListOpsMetadata(response, &metadata) } - output := &ListResourceComplianceSummariesOutput{} + output := &ListOpsMetadataOutput{} out.Result = output var buff [1024]byte @@ -11235,7 +11853,7 @@ func (m *awsAwsjson11_deserializeOpListResourceComplianceSummaries) HandleDeseri return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListResourceComplianceSummariesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListOpsMetadataOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11249,7 +11867,7 @@ func (m *awsAwsjson11_deserializeOpListResourceComplianceSummaries) HandleDeseri return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListResourceComplianceSummaries(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListOpsMetadata(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -11259,9 +11877,9 @@ func awsAwsjson11_deserializeOpErrorListResourceComplianceSummaries(response *sm errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -11270,7 +11888,7 @@ func awsAwsjson11_deserializeOpErrorListResourceComplianceSummaries(response *sm body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11282,8 +11900,8 @@ func awsAwsjson11_deserializeOpErrorListResourceComplianceSummaries(response *sm } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -11293,11 +11911,8 @@ func awsAwsjson11_deserializeOpErrorListResourceComplianceSummaries(response *sm case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("InvalidFilter", errorCode): - return awsAwsjson11_deserializeErrorInvalidFilter(response, errorBody) - - case strings.EqualFold("InvalidNextToken", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody) + case strings.EqualFold("OpsMetadataInvalidArgumentException", errorCode): + return awsAwsjson11_deserializeErrorOpsMetadataInvalidArgumentException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -11309,14 +11924,14 @@ func awsAwsjson11_deserializeOpErrorListResourceComplianceSummaries(response *sm } } -type awsAwsjson11_deserializeOpListResourceDataSync struct { +type awsAwsjson11_deserializeOpListResourceComplianceSummaries struct { } -func (*awsAwsjson11_deserializeOpListResourceDataSync) ID() string { +func (*awsAwsjson11_deserializeOpListResourceComplianceSummaries) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListResourceDataSync) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListResourceComplianceSummaries) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -11330,9 +11945,9 @@ func (m *awsAwsjson11_deserializeOpListResourceDataSync) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListResourceDataSync(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListResourceComplianceSummaries(response, &metadata) } - output := &ListResourceDataSyncOutput{} + output := &ListResourceComplianceSummariesOutput{} out.Result = output var buff [1024]byte @@ -11352,7 +11967,7 @@ func (m *awsAwsjson11_deserializeOpListResourceDataSync) HandleDeserialize(ctx c return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListResourceDataSyncOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListResourceComplianceSummariesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11366,7 +11981,7 @@ func (m *awsAwsjson11_deserializeOpListResourceDataSync) HandleDeserialize(ctx c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListResourceDataSync(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListResourceComplianceSummaries(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -11376,9 +11991,9 @@ func awsAwsjson11_deserializeOpErrorListResourceDataSync(response *smithyhttp.Re errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -11387,7 +12002,7 @@ func awsAwsjson11_deserializeOpErrorListResourceDataSync(response *smithyhttp.Re body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11399,8 +12014,125 @@ func awsAwsjson11_deserializeOpErrorListResourceDataSync(response *smithyhttp.Re } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("InvalidFilter", errorCode): + return awsAwsjson11_deserializeErrorInvalidFilter(response, errorBody) + + case strings.EqualFold("InvalidNextToken", errorCode): + return awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpListResourceDataSync struct { +} + +func (*awsAwsjson11_deserializeOpListResourceDataSync) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListResourceDataSync) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorListResourceDataSync(response, &metadata) + } + output := &ListResourceDataSyncOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentListResourceDataSyncOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorListResourceDataSync(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -11493,9 +12225,9 @@ func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Res errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -11504,7 +12236,7 @@ func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Res body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11516,8 +12248,8 @@ func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -11610,9 +12342,9 @@ func awsAwsjson11_deserializeOpErrorModifyDocumentPermission(response *smithyhtt errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -11621,7 +12353,7 @@ func awsAwsjson11_deserializeOpErrorModifyDocumentPermission(response *smithyhtt body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11633,8 +12365,8 @@ func awsAwsjson11_deserializeOpErrorModifyDocumentPermission(response *smithyhtt } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -11733,9 +12465,9 @@ func awsAwsjson11_deserializeOpErrorPutComplianceItems(response *smithyhttp.Resp errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -11744,7 +12476,7 @@ func awsAwsjson11_deserializeOpErrorPutComplianceItems(response *smithyhttp.Resp body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11756,8 +12488,8 @@ func awsAwsjson11_deserializeOpErrorPutComplianceItems(response *smithyhttp.Resp } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -11862,9 +12594,9 @@ func awsAwsjson11_deserializeOpErrorPutInventory(response *smithyhttp.Response, errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -11873,7 +12605,7 @@ func awsAwsjson11_deserializeOpErrorPutInventory(response *smithyhttp.Response, body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11885,8 +12617,8 @@ func awsAwsjson11_deserializeOpErrorPutInventory(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -12006,9 +12738,9 @@ func awsAwsjson11_deserializeOpErrorPutParameter(response *smithyhttp.Response, errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -12017,7 +12749,7 @@ func awsAwsjson11_deserializeOpErrorPutParameter(response *smithyhttp.Response, body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -12029,8 +12761,8 @@ func awsAwsjson11_deserializeOpErrorPutParameter(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -12092,6 +12824,126 @@ func awsAwsjson11_deserializeOpErrorPutParameter(response *smithyhttp.Response, } } +type awsAwsjson11_deserializeOpPutResourcePolicy struct { +} + +func (*awsAwsjson11_deserializeOpPutResourcePolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpPutResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorPutResourcePolicy(response, &metadata) + } + output := &PutResourcePolicyOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentPutResourcePolicyOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("ResourcePolicyConflictException", errorCode): + return awsAwsjson11_deserializeErrorResourcePolicyConflictException(response, errorBody) + + case strings.EqualFold("ResourcePolicyInvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorResourcePolicyInvalidParameterException(response, errorBody) + + case strings.EqualFold("ResourcePolicyLimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorResourcePolicyLimitExceededException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpRegisterDefaultPatchBaseline struct { } @@ -12159,9 +13011,9 @@ func awsAwsjson11_deserializeOpErrorRegisterDefaultPatchBaseline(response *smith errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -12170,7 +13022,7 @@ func awsAwsjson11_deserializeOpErrorRegisterDefaultPatchBaseline(response *smith body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -12182,8 +13034,8 @@ func awsAwsjson11_deserializeOpErrorRegisterDefaultPatchBaseline(response *smith } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -12276,9 +13128,9 @@ func awsAwsjson11_deserializeOpErrorRegisterPatchBaselineForPatchGroup(response errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -12287,7 +13139,7 @@ func awsAwsjson11_deserializeOpErrorRegisterPatchBaselineForPatchGroup(response body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -12299,8 +13151,8 @@ func awsAwsjson11_deserializeOpErrorRegisterPatchBaselineForPatchGroup(response } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -12399,9 +13251,9 @@ func awsAwsjson11_deserializeOpErrorRegisterTargetWithMaintenanceWindow(response errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -12410,7 +13262,7 @@ func awsAwsjson11_deserializeOpErrorRegisterTargetWithMaintenanceWindow(response body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -12422,8 +13274,8 @@ func awsAwsjson11_deserializeOpErrorRegisterTargetWithMaintenanceWindow(response } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -12519,9 +13371,9 @@ func awsAwsjson11_deserializeOpErrorRegisterTaskWithMaintenanceWindow(response * errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -12530,7 +13382,7 @@ func awsAwsjson11_deserializeOpErrorRegisterTaskWithMaintenanceWindow(response * body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -12542,8 +13394,8 @@ func awsAwsjson11_deserializeOpErrorRegisterTaskWithMaintenanceWindow(response * } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -12642,9 +13494,9 @@ func awsAwsjson11_deserializeOpErrorRemoveTagsFromResource(response *smithyhttp. errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -12653,7 +13505,7 @@ func awsAwsjson11_deserializeOpErrorRemoveTagsFromResource(response *smithyhttp. body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -12665,8 +13517,8 @@ func awsAwsjson11_deserializeOpErrorRemoveTagsFromResource(response *smithyhttp. } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -12762,9 +13614,9 @@ func awsAwsjson11_deserializeOpErrorResetServiceSetting(response *smithyhttp.Res errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -12773,7 +13625,7 @@ func awsAwsjson11_deserializeOpErrorResetServiceSetting(response *smithyhttp.Res body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -12785,8 +13637,8 @@ func awsAwsjson11_deserializeOpErrorResetServiceSetting(response *smithyhttp.Res } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -12879,9 +13731,9 @@ func awsAwsjson11_deserializeOpErrorResumeSession(response *smithyhttp.Response, errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -12890,7 +13742,7 @@ func awsAwsjson11_deserializeOpErrorResumeSession(response *smithyhttp.Response, body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -12902,8 +13754,8 @@ func awsAwsjson11_deserializeOpErrorResumeSession(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -12993,9 +13845,9 @@ func awsAwsjson11_deserializeOpErrorSendAutomationSignal(response *smithyhttp.Re errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -13004,7 +13856,7 @@ func awsAwsjson11_deserializeOpErrorSendAutomationSignal(response *smithyhttp.Re body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -13016,8 +13868,8 @@ func awsAwsjson11_deserializeOpErrorSendAutomationSignal(response *smithyhttp.Re } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -13113,9 +13965,9 @@ func awsAwsjson11_deserializeOpErrorSendCommand(response *smithyhttp.Response, m errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -13124,7 +13976,7 @@ func awsAwsjson11_deserializeOpErrorSendCommand(response *smithyhttp.Response, m body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -13136,8 +13988,8 @@ func awsAwsjson11_deserializeOpErrorSendCommand(response *smithyhttp.Response, m } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -13254,9 +14106,9 @@ func awsAwsjson11_deserializeOpErrorStartAssociationsOnce(response *smithyhttp.R errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -13265,7 +14117,7 @@ func awsAwsjson11_deserializeOpErrorStartAssociationsOnce(response *smithyhttp.R body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -13277,8 +14129,8 @@ func awsAwsjson11_deserializeOpErrorStartAssociationsOnce(response *smithyhttp.R } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -13368,9 +14220,9 @@ func awsAwsjson11_deserializeOpErrorStartAutomationExecution(response *smithyhtt errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -13379,7 +14231,7 @@ func awsAwsjson11_deserializeOpErrorStartAutomationExecution(response *smithyhtt body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -13391,8 +14243,8 @@ func awsAwsjson11_deserializeOpErrorStartAutomationExecution(response *smithyhtt } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -13497,9 +14349,9 @@ func awsAwsjson11_deserializeOpErrorStartChangeRequestExecution(response *smithy errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -13508,7 +14360,7 @@ func awsAwsjson11_deserializeOpErrorStartChangeRequestExecution(response *smithy body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -13520,8 +14372,8 @@ func awsAwsjson11_deserializeOpErrorStartChangeRequestExecution(response *smithy } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -13626,9 +14478,9 @@ func awsAwsjson11_deserializeOpErrorStartSession(response *smithyhttp.Response, errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -13637,7 +14489,7 @@ func awsAwsjson11_deserializeOpErrorStartSession(response *smithyhttp.Response, body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -13649,8 +14501,8 @@ func awsAwsjson11_deserializeOpErrorStartSession(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -13743,9 +14595,9 @@ func awsAwsjson11_deserializeOpErrorStopAutomationExecution(response *smithyhttp errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -13754,7 +14606,7 @@ func awsAwsjson11_deserializeOpErrorStopAutomationExecution(response *smithyhttp body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -13766,8 +14618,8 @@ func awsAwsjson11_deserializeOpErrorStopAutomationExecution(response *smithyhttp } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -13860,9 +14712,9 @@ func awsAwsjson11_deserializeOpErrorTerminateSession(response *smithyhttp.Respon errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -13871,7 +14723,7 @@ func awsAwsjson11_deserializeOpErrorTerminateSession(response *smithyhttp.Respon body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -13883,17 +14735,14 @@ func awsAwsjson11_deserializeOpErrorTerminateSession(response *smithyhttp.Respon } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { - case strings.EqualFold("DoesNotExistException", errorCode): - return awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody) - case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) @@ -13907,14 +14756,14 @@ func awsAwsjson11_deserializeOpErrorTerminateSession(response *smithyhttp.Respon } } -type awsAwsjson11_deserializeOpUpdateAssociation struct { +type awsAwsjson11_deserializeOpUnlabelParameterVersion struct { } -func (*awsAwsjson11_deserializeOpUpdateAssociation) ID() string { +func (*awsAwsjson11_deserializeOpUnlabelParameterVersion) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpUnlabelParameterVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -13928,9 +14777,9 @@ func (m *awsAwsjson11_deserializeOpUpdateAssociation) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateAssociation(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorUnlabelParameterVersion(response, &metadata) } - output := &UpdateAssociationOutput{} + output := &UnlabelParameterVersionOutput{} out.Result = output var buff [1024]byte @@ -13950,7 +14799,7 @@ func (m *awsAwsjson11_deserializeOpUpdateAssociation) HandleDeserialize(ctx cont return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateAssociationOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentUnlabelParameterVersionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -13964,7 +14813,7 @@ func (m *awsAwsjson11_deserializeOpUpdateAssociation) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorUnlabelParameterVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -13974,9 +14823,9 @@ func awsAwsjson11_deserializeOpErrorUpdateAssociation(response *smithyhttp.Respo errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -13985,7 +14834,7 @@ func awsAwsjson11_deserializeOpErrorUpdateAssociation(response *smithyhttp.Respo body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -13997,46 +14846,22 @@ func awsAwsjson11_deserializeOpErrorUpdateAssociation(response *smithyhttp.Respo } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { - case strings.EqualFold("AssociationDoesNotExist", errorCode): - return awsAwsjson11_deserializeErrorAssociationDoesNotExist(response, errorBody) - - case strings.EqualFold("AssociationVersionLimitExceeded", errorCode): - return awsAwsjson11_deserializeErrorAssociationVersionLimitExceeded(response, errorBody) - case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("InvalidAssociationVersion", errorCode): - return awsAwsjson11_deserializeErrorInvalidAssociationVersion(response, errorBody) - - case strings.EqualFold("InvalidDocument", errorCode): - return awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody) - - case strings.EqualFold("InvalidDocumentVersion", errorCode): - return awsAwsjson11_deserializeErrorInvalidDocumentVersion(response, errorBody) - - case strings.EqualFold("InvalidOutputLocation", errorCode): - return awsAwsjson11_deserializeErrorInvalidOutputLocation(response, errorBody) - - case strings.EqualFold("InvalidParameters", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameters(response, errorBody) - - case strings.EqualFold("InvalidSchedule", errorCode): - return awsAwsjson11_deserializeErrorInvalidSchedule(response, errorBody) - - case strings.EqualFold("InvalidTarget", errorCode): - return awsAwsjson11_deserializeErrorInvalidTarget(response, errorBody) + case strings.EqualFold("ParameterNotFound", errorCode): + return awsAwsjson11_deserializeErrorParameterNotFound(response, errorBody) - case strings.EqualFold("InvalidUpdate", errorCode): - return awsAwsjson11_deserializeErrorInvalidUpdate(response, errorBody) + case strings.EqualFold("ParameterVersionNotFound", errorCode): + return awsAwsjson11_deserializeErrorParameterVersionNotFound(response, errorBody) case strings.EqualFold("TooManyUpdates", errorCode): return awsAwsjson11_deserializeErrorTooManyUpdates(response, errorBody) @@ -14051,14 +14876,14 @@ func awsAwsjson11_deserializeOpErrorUpdateAssociation(response *smithyhttp.Respo } } -type awsAwsjson11_deserializeOpUpdateAssociationStatus struct { +type awsAwsjson11_deserializeOpUpdateAssociation struct { } -func (*awsAwsjson11_deserializeOpUpdateAssociationStatus) ID() string { +func (*awsAwsjson11_deserializeOpUpdateAssociation) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateAssociationStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpUpdateAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -14072,9 +14897,9 @@ func (m *awsAwsjson11_deserializeOpUpdateAssociationStatus) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateAssociationStatus(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateAssociation(response, &metadata) } - output := &UpdateAssociationStatusOutput{} + output := &UpdateAssociationOutput{} out.Result = output var buff [1024]byte @@ -14094,7 +14919,7 @@ func (m *awsAwsjson11_deserializeOpUpdateAssociationStatus) HandleDeserialize(ct return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateAssociationStatusOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentUpdateAssociationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -14108,7 +14933,7 @@ func (m *awsAwsjson11_deserializeOpUpdateAssociationStatus) HandleDeserialize(ct return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateAssociationStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorUpdateAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -14118,9 +14943,9 @@ func awsAwsjson11_deserializeOpErrorUpdateAssociationStatus(response *smithyhttp errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -14129,7 +14954,7 @@ func awsAwsjson11_deserializeOpErrorUpdateAssociationStatus(response *smithyhttp body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -14141,8 +14966,8 @@ func awsAwsjson11_deserializeOpErrorUpdateAssociationStatus(response *smithyhttp } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -14152,17 +14977,38 @@ func awsAwsjson11_deserializeOpErrorUpdateAssociationStatus(response *smithyhttp case strings.EqualFold("AssociationDoesNotExist", errorCode): return awsAwsjson11_deserializeErrorAssociationDoesNotExist(response, errorBody) + case strings.EqualFold("AssociationVersionLimitExceeded", errorCode): + return awsAwsjson11_deserializeErrorAssociationVersionLimitExceeded(response, errorBody) + case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + case strings.EqualFold("InvalidAssociationVersion", errorCode): + return awsAwsjson11_deserializeErrorInvalidAssociationVersion(response, errorBody) + case strings.EqualFold("InvalidDocument", errorCode): return awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody) - case strings.EqualFold("InvalidInstanceId", errorCode): - return awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody) + case strings.EqualFold("InvalidDocumentVersion", errorCode): + return awsAwsjson11_deserializeErrorInvalidDocumentVersion(response, errorBody) - case strings.EqualFold("StatusUnchanged", errorCode): - return awsAwsjson11_deserializeErrorStatusUnchanged(response, errorBody) + case strings.EqualFold("InvalidOutputLocation", errorCode): + return awsAwsjson11_deserializeErrorInvalidOutputLocation(response, errorBody) + + case strings.EqualFold("InvalidParameters", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameters(response, errorBody) + + case strings.EqualFold("InvalidSchedule", errorCode): + return awsAwsjson11_deserializeErrorInvalidSchedule(response, errorBody) + + case strings.EqualFold("InvalidTarget", errorCode): + return awsAwsjson11_deserializeErrorInvalidTarget(response, errorBody) + + case strings.EqualFold("InvalidTargetMaps", errorCode): + return awsAwsjson11_deserializeErrorInvalidTargetMaps(response, errorBody) + + case strings.EqualFold("InvalidUpdate", errorCode): + return awsAwsjson11_deserializeErrorInvalidUpdate(response, errorBody) case strings.EqualFold("TooManyUpdates", errorCode): return awsAwsjson11_deserializeErrorTooManyUpdates(response, errorBody) @@ -14177,14 +15023,14 @@ func awsAwsjson11_deserializeOpErrorUpdateAssociationStatus(response *smithyhttp } } -type awsAwsjson11_deserializeOpUpdateDocument struct { +type awsAwsjson11_deserializeOpUpdateAssociationStatus struct { } -func (*awsAwsjson11_deserializeOpUpdateDocument) ID() string { +func (*awsAwsjson11_deserializeOpUpdateAssociationStatus) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateDocument) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpUpdateAssociationStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -14198,9 +15044,9 @@ func (m *awsAwsjson11_deserializeOpUpdateDocument) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateDocument(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateAssociationStatus(response, &metadata) } - output := &UpdateDocumentOutput{} + output := &UpdateAssociationStatusOutput{} out.Result = output var buff [1024]byte @@ -14220,7 +15066,7 @@ func (m *awsAwsjson11_deserializeOpUpdateDocument) HandleDeserialize(ctx context return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateDocumentOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentUpdateAssociationStatusOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -14234,7 +15080,7 @@ func (m *awsAwsjson11_deserializeOpUpdateDocument) HandleDeserialize(ctx context return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateDocument(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorUpdateAssociationStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -14244,9 +15090,9 @@ func awsAwsjson11_deserializeOpErrorUpdateDocument(response *smithyhttp.Response errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -14255,7 +15101,7 @@ func awsAwsjson11_deserializeOpErrorUpdateDocument(response *smithyhttp.Response body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -14267,22 +15113,16 @@ func awsAwsjson11_deserializeOpErrorUpdateDocument(response *smithyhttp.Response } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { - case strings.EqualFold("DocumentVersionLimitExceeded", errorCode): - return awsAwsjson11_deserializeErrorDocumentVersionLimitExceeded(response, errorBody) - - case strings.EqualFold("DuplicateDocumentContent", errorCode): - return awsAwsjson11_deserializeErrorDuplicateDocumentContent(response, errorBody) - - case strings.EqualFold("DuplicateDocumentVersionName", errorCode): - return awsAwsjson11_deserializeErrorDuplicateDocumentVersionName(response, errorBody) + case strings.EqualFold("AssociationDoesNotExist", errorCode): + return awsAwsjson11_deserializeErrorAssociationDoesNotExist(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) @@ -14290,20 +15130,14 @@ func awsAwsjson11_deserializeOpErrorUpdateDocument(response *smithyhttp.Response case strings.EqualFold("InvalidDocument", errorCode): return awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody) - case strings.EqualFold("InvalidDocumentContent", errorCode): - return awsAwsjson11_deserializeErrorInvalidDocumentContent(response, errorBody) - - case strings.EqualFold("InvalidDocumentOperation", errorCode): - return awsAwsjson11_deserializeErrorInvalidDocumentOperation(response, errorBody) - - case strings.EqualFold("InvalidDocumentSchemaVersion", errorCode): - return awsAwsjson11_deserializeErrorInvalidDocumentSchemaVersion(response, errorBody) + case strings.EqualFold("InvalidInstanceId", errorCode): + return awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody) - case strings.EqualFold("InvalidDocumentVersion", errorCode): - return awsAwsjson11_deserializeErrorInvalidDocumentVersion(response, errorBody) + case strings.EqualFold("StatusUnchanged", errorCode): + return awsAwsjson11_deserializeErrorStatusUnchanged(response, errorBody) - case strings.EqualFold("MaxDocumentSizeExceeded", errorCode): - return awsAwsjson11_deserializeErrorMaxDocumentSizeExceeded(response, errorBody) + case strings.EqualFold("TooManyUpdates", errorCode): + return awsAwsjson11_deserializeErrorTooManyUpdates(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -14315,14 +15149,14 @@ func awsAwsjson11_deserializeOpErrorUpdateDocument(response *smithyhttp.Response } } -type awsAwsjson11_deserializeOpUpdateDocumentDefaultVersion struct { +type awsAwsjson11_deserializeOpUpdateDocument struct { } -func (*awsAwsjson11_deserializeOpUpdateDocumentDefaultVersion) ID() string { +func (*awsAwsjson11_deserializeOpUpdateDocument) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateDocumentDefaultVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpUpdateDocument) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -14336,9 +15170,9 @@ func (m *awsAwsjson11_deserializeOpUpdateDocumentDefaultVersion) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateDocumentDefaultVersion(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateDocument(response, &metadata) } - output := &UpdateDocumentDefaultVersionOutput{} + output := &UpdateDocumentOutput{} out.Result = output var buff [1024]byte @@ -14358,7 +15192,7 @@ func (m *awsAwsjson11_deserializeOpUpdateDocumentDefaultVersion) HandleDeseriali return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateDocumentDefaultVersionOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentUpdateDocumentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -14372,7 +15206,7 @@ func (m *awsAwsjson11_deserializeOpUpdateDocumentDefaultVersion) HandleDeseriali return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateDocumentDefaultVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorUpdateDocument(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -14382,9 +15216,9 @@ func awsAwsjson11_deserializeOpErrorUpdateDocumentDefaultVersion(response *smith errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -14393,7 +15227,7 @@ func awsAwsjson11_deserializeOpErrorUpdateDocumentDefaultVersion(response *smith body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -14405,26 +15239,44 @@ func awsAwsjson11_deserializeOpErrorUpdateDocumentDefaultVersion(response *smith } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { + case strings.EqualFold("DocumentVersionLimitExceeded", errorCode): + return awsAwsjson11_deserializeErrorDocumentVersionLimitExceeded(response, errorBody) + + case strings.EqualFold("DuplicateDocumentContent", errorCode): + return awsAwsjson11_deserializeErrorDuplicateDocumentContent(response, errorBody) + + case strings.EqualFold("DuplicateDocumentVersionName", errorCode): + return awsAwsjson11_deserializeErrorDuplicateDocumentVersionName(response, errorBody) + case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) case strings.EqualFold("InvalidDocument", errorCode): return awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody) + case strings.EqualFold("InvalidDocumentContent", errorCode): + return awsAwsjson11_deserializeErrorInvalidDocumentContent(response, errorBody) + + case strings.EqualFold("InvalidDocumentOperation", errorCode): + return awsAwsjson11_deserializeErrorInvalidDocumentOperation(response, errorBody) + case strings.EqualFold("InvalidDocumentSchemaVersion", errorCode): return awsAwsjson11_deserializeErrorInvalidDocumentSchemaVersion(response, errorBody) case strings.EqualFold("InvalidDocumentVersion", errorCode): return awsAwsjson11_deserializeErrorInvalidDocumentVersion(response, errorBody) + case strings.EqualFold("MaxDocumentSizeExceeded", errorCode): + return awsAwsjson11_deserializeErrorMaxDocumentSizeExceeded(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -14435,14 +15287,14 @@ func awsAwsjson11_deserializeOpErrorUpdateDocumentDefaultVersion(response *smith } } -type awsAwsjson11_deserializeOpUpdateDocumentMetadata struct { +type awsAwsjson11_deserializeOpUpdateDocumentDefaultVersion struct { } -func (*awsAwsjson11_deserializeOpUpdateDocumentMetadata) ID() string { +func (*awsAwsjson11_deserializeOpUpdateDocumentDefaultVersion) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateDocumentMetadata) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpUpdateDocumentDefaultVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -14456,9 +15308,9 @@ func (m *awsAwsjson11_deserializeOpUpdateDocumentMetadata) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateDocumentMetadata(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateDocumentDefaultVersion(response, &metadata) } - output := &UpdateDocumentMetadataOutput{} + output := &UpdateDocumentDefaultVersionOutput{} out.Result = output var buff [1024]byte @@ -14478,7 +15330,7 @@ func (m *awsAwsjson11_deserializeOpUpdateDocumentMetadata) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateDocumentMetadataOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentUpdateDocumentDefaultVersionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -14492,7 +15344,7 @@ func (m *awsAwsjson11_deserializeOpUpdateDocumentMetadata) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateDocumentMetadata(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorUpdateDocumentDefaultVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -14502,9 +15354,9 @@ func awsAwsjson11_deserializeOpErrorUpdateDocumentMetadata(response *smithyhttp. errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -14513,7 +15365,7 @@ func awsAwsjson11_deserializeOpErrorUpdateDocumentMetadata(response *smithyhttp. body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -14525,8 +15377,8 @@ func awsAwsjson11_deserializeOpErrorUpdateDocumentMetadata(response *smithyhttp. } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -14539,8 +15391,8 @@ func awsAwsjson11_deserializeOpErrorUpdateDocumentMetadata(response *smithyhttp. case strings.EqualFold("InvalidDocument", errorCode): return awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody) - case strings.EqualFold("InvalidDocumentOperation", errorCode): - return awsAwsjson11_deserializeErrorInvalidDocumentOperation(response, errorBody) + case strings.EqualFold("InvalidDocumentSchemaVersion", errorCode): + return awsAwsjson11_deserializeErrorInvalidDocumentSchemaVersion(response, errorBody) case strings.EqualFold("InvalidDocumentVersion", errorCode): return awsAwsjson11_deserializeErrorInvalidDocumentVersion(response, errorBody) @@ -14555,14 +15407,14 @@ func awsAwsjson11_deserializeOpErrorUpdateDocumentMetadata(response *smithyhttp. } } -type awsAwsjson11_deserializeOpUpdateMaintenanceWindow struct { +type awsAwsjson11_deserializeOpUpdateDocumentMetadata struct { } -func (*awsAwsjson11_deserializeOpUpdateMaintenanceWindow) ID() string { +func (*awsAwsjson11_deserializeOpUpdateDocumentMetadata) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindow) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpUpdateDocumentMetadata) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -14576,9 +15428,9 @@ func (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindow) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindow(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateDocumentMetadata(response, &metadata) } - output := &UpdateMaintenanceWindowOutput{} + output := &UpdateDocumentMetadataOutput{} out.Result = output var buff [1024]byte @@ -14598,7 +15450,7 @@ func (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindow) HandleDeserialize(ct return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateMaintenanceWindowOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentUpdateDocumentMetadataOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -14612,7 +15464,7 @@ func (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindow) HandleDeserialize(ct return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindow(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorUpdateDocumentMetadata(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -14622,9 +15474,9 @@ func awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindow(response *smithyhttp errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -14633,7 +15485,7 @@ func awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindow(response *smithyhttp body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -14645,133 +15497,25 @@ func awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindow(response *smithyhttp } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { - case strings.EqualFold("DoesNotExistException", errorCode): - return awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody) - case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpUpdateMaintenanceWindowTarget struct { -} - -func (*awsAwsjson11_deserializeOpUpdateMaintenanceWindowTarget) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindowTarget) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindowTarget(response, &metadata) - } - output := &UpdateMaintenanceWindowTargetOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentUpdateMaintenanceWindowTargetOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindowTarget(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) - } - if len(message) != 0 { - errorMessage = message - } + case strings.EqualFold("InvalidDocument", errorCode): + return awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody) - switch { - case strings.EqualFold("DoesNotExistException", errorCode): - return awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody) + case strings.EqualFold("InvalidDocumentOperation", errorCode): + return awsAwsjson11_deserializeErrorInvalidDocumentOperation(response, errorBody) - case strings.EqualFold("InternalServerError", errorCode): - return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + case strings.EqualFold("InvalidDocumentVersion", errorCode): + return awsAwsjson11_deserializeErrorInvalidDocumentVersion(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -14783,14 +15527,14 @@ func awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindowTarget(response *smit } } -type awsAwsjson11_deserializeOpUpdateMaintenanceWindowTask struct { +type awsAwsjson11_deserializeOpUpdateMaintenanceWindow struct { } -func (*awsAwsjson11_deserializeOpUpdateMaintenanceWindowTask) ID() string { +func (*awsAwsjson11_deserializeOpUpdateMaintenanceWindow) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindowTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindow) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -14804,9 +15548,9 @@ func (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindowTask) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindowTask(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindow(response, &metadata) } - output := &UpdateMaintenanceWindowTaskOutput{} + output := &UpdateMaintenanceWindowOutput{} out.Result = output var buff [1024]byte @@ -14826,7 +15570,7 @@ func (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindowTask) HandleDeserializ return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateMaintenanceWindowTaskOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentUpdateMaintenanceWindowOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -14840,7 +15584,7 @@ func (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindowTask) HandleDeserializ return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindowTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindow(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -14850,9 +15594,9 @@ func awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindowTask(response *smithy errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -14861,7 +15605,7 @@ func awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindowTask(response *smithy body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -14873,8 +15617,236 @@ func awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindowTask(response *smithy } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("DoesNotExistException", errorCode): + return awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody) + + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdateMaintenanceWindowTarget struct { +} + +func (*awsAwsjson11_deserializeOpUpdateMaintenanceWindowTarget) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindowTarget) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindowTarget(response, &metadata) + } + output := &UpdateMaintenanceWindowTargetOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentUpdateMaintenanceWindowTargetOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindowTarget(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("DoesNotExistException", errorCode): + return awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody) + + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdateMaintenanceWindowTask struct { +} + +func (*awsAwsjson11_deserializeOpUpdateMaintenanceWindowTask) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindowTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindowTask(response, &metadata) + } + output := &UpdateMaintenanceWindowTaskOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentUpdateMaintenanceWindowTaskOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindowTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -14964,9 +15936,9 @@ func awsAwsjson11_deserializeOpErrorUpdateManagedInstanceRole(response *smithyht errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -14975,7 +15947,7 @@ func awsAwsjson11_deserializeOpErrorUpdateManagedInstanceRole(response *smithyht body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -14987,8 +15959,8 @@ func awsAwsjson11_deserializeOpErrorUpdateManagedInstanceRole(response *smithyht } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -15078,9 +16050,9 @@ func awsAwsjson11_deserializeOpErrorUpdateOpsItem(response *smithyhttp.Response, errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -15089,7 +16061,7 @@ func awsAwsjson11_deserializeOpErrorUpdateOpsItem(response *smithyhttp.Response, body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -15101,8 +16073,8 @@ func awsAwsjson11_deserializeOpErrorUpdateOpsItem(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -15112,9 +16084,15 @@ func awsAwsjson11_deserializeOpErrorUpdateOpsItem(response *smithyhttp.Response, case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + case strings.EqualFold("OpsItemAccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemAccessDeniedException(response, errorBody) + case strings.EqualFold("OpsItemAlreadyExistsException", errorCode): return awsAwsjson11_deserializeErrorOpsItemAlreadyExistsException(response, errorBody) + case strings.EqualFold("OpsItemConflictException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemConflictException(response, errorBody) + case strings.EqualFold("OpsItemInvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorOpsItemInvalidParameterException(response, errorBody) @@ -15201,9 +16179,9 @@ func awsAwsjson11_deserializeOpErrorUpdateOpsMetadata(response *smithyhttp.Respo errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -15212,7 +16190,7 @@ func awsAwsjson11_deserializeOpErrorUpdateOpsMetadata(response *smithyhttp.Respo body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -15224,8 +16202,8 @@ func awsAwsjson11_deserializeOpErrorUpdateOpsMetadata(response *smithyhttp.Respo } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -15324,9 +16302,9 @@ func awsAwsjson11_deserializeOpErrorUpdatePatchBaseline(response *smithyhttp.Res errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -15335,7 +16313,7 @@ func awsAwsjson11_deserializeOpErrorUpdatePatchBaseline(response *smithyhttp.Res body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -15347,8 +16325,8 @@ func awsAwsjson11_deserializeOpErrorUpdatePatchBaseline(response *smithyhttp.Res } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -15438,9 +16416,9 @@ func awsAwsjson11_deserializeOpErrorUpdateResourceDataSync(response *smithyhttp. errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -15449,7 +16427,7 @@ func awsAwsjson11_deserializeOpErrorUpdateResourceDataSync(response *smithyhttp. body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -15461,8 +16439,8 @@ func awsAwsjson11_deserializeOpErrorUpdateResourceDataSync(response *smithyhttp. } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -15558,9 +16536,9 @@ func awsAwsjson11_deserializeOpErrorUpdateServiceSetting(response *smithyhttp.Re errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -15569,7 +16547,7 @@ func awsAwsjson11_deserializeOpErrorUpdateServiceSetting(response *smithyhttp.Re body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -15581,8 +16559,8 @@ func awsAwsjson11_deserializeOpErrorUpdateServiceSetting(response *smithyhttp.Re } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -18163,6 +19141,41 @@ func awsAwsjson11_deserializeErrorInvalidSchedule(response *smithyhttp.Response, return output } +func awsAwsjson11_deserializeErrorInvalidTag(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.InvalidTag{} + err := awsAwsjson11_deserializeDocumentInvalidTag(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + func awsAwsjson11_deserializeErrorInvalidTarget(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -18198,6 +19211,41 @@ func awsAwsjson11_deserializeErrorInvalidTarget(response *smithyhttp.Response, e return output } +func awsAwsjson11_deserializeErrorInvalidTargetMaps(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.InvalidTargetMaps{} + err := awsAwsjson11_deserializeDocumentInvalidTargetMaps(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + func awsAwsjson11_deserializeErrorInvalidTypeNameException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -18408,6 +19456,41 @@ func awsAwsjson11_deserializeErrorMaxDocumentSizeExceeded(response *smithyhttp.R return output } +func awsAwsjson11_deserializeErrorOpsItemAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.OpsItemAccessDeniedException{} + err := awsAwsjson11_deserializeDocumentOpsItemAccessDeniedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + func awsAwsjson11_deserializeErrorOpsItemAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -18443,6 +19526,41 @@ func awsAwsjson11_deserializeErrorOpsItemAlreadyExistsException(response *smithy return output } +func awsAwsjson11_deserializeErrorOpsItemConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.OpsItemConflictException{} + err := awsAwsjson11_deserializeDocumentOpsItemConflictException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + func awsAwsjson11_deserializeErrorOpsItemInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -18548,6 +19666,76 @@ func awsAwsjson11_deserializeErrorOpsItemNotFoundException(response *smithyhttp. return output } +func awsAwsjson11_deserializeErrorOpsItemRelatedItemAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.OpsItemRelatedItemAlreadyExistsException{} + err := awsAwsjson11_deserializeDocumentOpsItemRelatedItemAlreadyExistsException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorOpsItemRelatedItemAssociationNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.OpsItemRelatedItemAssociationNotFoundException{} + err := awsAwsjson11_deserializeDocumentOpsItemRelatedItemAssociationNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + func awsAwsjson11_deserializeErrorOpsMetadataAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -19283,6 +20471,111 @@ func awsAwsjson11_deserializeErrorResourceLimitExceededException(response *smith return output } +func awsAwsjson11_deserializeErrorResourcePolicyConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ResourcePolicyConflictException{} + err := awsAwsjson11_deserializeDocumentResourcePolicyConflictException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorResourcePolicyInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ResourcePolicyInvalidParameterException{} + err := awsAwsjson11_deserializeDocumentResourcePolicyInvalidParameterException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorResourcePolicyLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ResourcePolicyLimitExceededException{} + err := awsAwsjson11_deserializeDocumentResourcePolicyLimitExceededException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + func awsAwsjson11_deserializeErrorServiceSettingNotFound(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -19996,15 +21289,18 @@ func awsAwsjson11_deserializeDocumentActivation(v **types.Activation, value inte case "CreatedDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected CreatedDate to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected CreatedDate to be a JSON Number, got %T instead", value) + } - sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "DefaultInstanceName": @@ -20027,15 +21323,18 @@ func awsAwsjson11_deserializeDocumentActivation(v **types.Activation, value inte case "ExpirationDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected ExpirationDate to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ExpirationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected ExpirationDate to be a JSON Number, got %T instead", value) + } - sv.ExpirationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Expired": @@ -20066,7 +21365,7 @@ func awsAwsjson11_deserializeDocumentActivation(v **types.Activation, value inte if err != nil { return err } - sv.RegistrationLimit = int32(i64) + sv.RegistrationLimit = ptr.Int32(int32(i64)) } case "RegistrationsCount": @@ -20079,7 +21378,7 @@ func awsAwsjson11_deserializeDocumentActivation(v **types.Activation, value inte if err != nil { return err } - sv.RegistrationsCount = int32(i64) + sv.RegistrationsCount = ptr.Int32(int32(i64)) } case "Tags": @@ -20130,6 +21429,208 @@ func awsAwsjson11_deserializeDocumentActivationList(v *[]types.Activation, value return nil } +func awsAwsjson11_deserializeDocumentAlarm(v **types.Alarm, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Alarm + if *v == nil { + sv = &types.Alarm{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AlarmName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentAlarmConfiguration(v **types.AlarmConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AlarmConfiguration + if *v == nil { + sv = &types.AlarmConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Alarms": + if err := awsAwsjson11_deserializeDocumentAlarmList(&sv.Alarms, value); err != nil { + return err + } + + case "IgnorePollAlarmFailure": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IgnorePollAlarmFailure = jtv + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentAlarmList(v *[]types.Alarm, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.Alarm + if *v == nil { + cv = []types.Alarm{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Alarm + destAddr := &col + if err := awsAwsjson11_deserializeDocumentAlarm(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentAlarmStateInformation(v **types.AlarmStateInformation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AlarmStateInformation + if *v == nil { + sv = &types.AlarmStateInformation{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AlarmName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "State": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExternalAlarmState to be of type string, got %T instead", value) + } + sv.State = types.ExternalAlarmState(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentAlarmStateInformationList(v *[]types.AlarmStateInformation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.AlarmStateInformation + if *v == nil { + cv = []types.AlarmStateInformation{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AlarmStateInformation + destAddr := &col + if err := awsAwsjson11_deserializeDocumentAlarmStateInformation(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentAlreadyExistsException(v **types.AlreadyExistsException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -20270,15 +21771,18 @@ func awsAwsjson11_deserializeDocumentAssociation(v **types.Association, value in case "LastExecutionDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastExecutionDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.LastExecutionDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Name": @@ -20304,6 +21808,24 @@ func awsAwsjson11_deserializeDocumentAssociation(v **types.Association, value in sv.ScheduleExpression = ptr.String(jtv) } + case "ScheduleOffset": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ScheduleOffset to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ScheduleOffset = ptr.Int32(int32(i64)) + } + + case "TargetMaps": + if err := awsAwsjson11_deserializeDocumentTargetMaps(&sv.TargetMaps, value); err != nil { + return err + } + case "Targets": if err := awsAwsjson11_deserializeDocumentTargets(&sv.Targets, value); err != nil { return err @@ -20371,6 +21893,11 @@ func awsAwsjson11_deserializeDocumentAssociationDescription(v **types.Associatio for key, value := range shape { switch key { + case "AlarmConfiguration": + if err := awsAwsjson11_deserializeDocumentAlarmConfiguration(&sv.AlarmConfiguration, value); err != nil { + return err + } + case "ApplyOnlyAtCronInterval": if value != nil { jtv, ok := value.(bool) @@ -20416,6 +21943,11 @@ func awsAwsjson11_deserializeDocumentAssociationDescription(v **types.Associatio sv.AutomationTargetParameterName = ptr.String(jtv) } + case "CalendarNames": + if err := awsAwsjson11_deserializeDocumentCalendarNameOrARNList(&sv.CalendarNames, value); err != nil { + return err + } + case "ComplianceSeverity": if value != nil { jtv, ok := value.(string) @@ -20427,15 +21959,18 @@ func awsAwsjson11_deserializeDocumentAssociationDescription(v **types.Associatio case "Date": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Date = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.Date = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "DocumentVersion": @@ -20458,41 +21993,50 @@ func awsAwsjson11_deserializeDocumentAssociationDescription(v **types.Associatio case "LastExecutionDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastExecutionDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.LastExecutionDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "LastSuccessfulExecutionDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastSuccessfulExecutionDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.LastSuccessfulExecutionDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "LastUpdateAssociationDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdateAssociationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.LastUpdateAssociationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "MaxConcurrency": @@ -20546,6 +22090,19 @@ func awsAwsjson11_deserializeDocumentAssociationDescription(v **types.Associatio sv.ScheduleExpression = ptr.String(jtv) } + case "ScheduleOffset": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ScheduleOffset to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ScheduleOffset = ptr.Int32(int32(i64)) + } + case "Status": if err := awsAwsjson11_deserializeDocumentAssociationStatus(&sv.Status, value); err != nil { return err @@ -20565,11 +22122,21 @@ func awsAwsjson11_deserializeDocumentAssociationDescription(v **types.Associatio return err } + case "TargetMaps": + if err := awsAwsjson11_deserializeDocumentTargetMaps(&sv.TargetMaps, value); err != nil { + return err + } + case "Targets": if err := awsAwsjson11_deserializeDocumentTargets(&sv.Targets, value); err != nil { return err } + case "TriggeredAlarms": + if err := awsAwsjson11_deserializeDocumentAlarmStateInformationList(&sv.TriggeredAlarms, value); err != nil { + return err + } + default: _, _ = key, value @@ -20675,6 +22242,11 @@ func awsAwsjson11_deserializeDocumentAssociationExecution(v **types.AssociationE for key, value := range shape { switch key { + case "AlarmConfiguration": + if err := awsAwsjson11_deserializeDocumentAlarmConfiguration(&sv.AlarmConfiguration, value); err != nil { + return err + } + case "AssociationId": if value != nil { jtv, ok := value.(string) @@ -20695,15 +22267,18 @@ func awsAwsjson11_deserializeDocumentAssociationExecution(v **types.AssociationE case "CreatedTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "DetailedStatus": @@ -20726,15 +22301,18 @@ func awsAwsjson11_deserializeDocumentAssociationExecution(v **types.AssociationE case "LastExecutionDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastExecutionDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.LastExecutionDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "ResourceCountByStatus": @@ -20755,6 +22333,11 @@ func awsAwsjson11_deserializeDocumentAssociationExecution(v **types.AssociationE sv.Status = ptr.String(jtv) } + case "TriggeredAlarms": + if err := awsAwsjson11_deserializeDocumentAlarmStateInformationList(&sv.TriggeredAlarms, value); err != nil { + return err + } + default: _, _ = key, value @@ -20898,15 +22481,18 @@ func awsAwsjson11_deserializeDocumentAssociationExecutionTarget(v **types.Associ case "LastExecutionDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastExecutionDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.LastExecutionDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "OutputSource": @@ -21136,15 +22722,18 @@ func awsAwsjson11_deserializeDocumentAssociationStatus(v **types.AssociationStat case "Date": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Date = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.Date = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Message": @@ -21272,6 +22861,11 @@ func awsAwsjson11_deserializeDocumentAssociationVersionInfo(v **types.Associatio sv.AssociationVersion = ptr.String(jtv) } + case "CalendarNames": + if err := awsAwsjson11_deserializeDocumentCalendarNameOrARNList(&sv.CalendarNames, value); err != nil { + return err + } + case "ComplianceSeverity": if value != nil { jtv, ok := value.(string) @@ -21283,15 +22877,18 @@ func awsAwsjson11_deserializeDocumentAssociationVersionInfo(v **types.Associatio case "CreatedDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "DocumentVersion": @@ -21349,6 +22946,19 @@ func awsAwsjson11_deserializeDocumentAssociationVersionInfo(v **types.Associatio sv.ScheduleExpression = ptr.String(jtv) } + case "ScheduleOffset": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ScheduleOffset to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ScheduleOffset = ptr.Int32(int32(i64)) + } + case "SyncCompliance": if value != nil { jtv, ok := value.(string) @@ -21363,6 +22973,11 @@ func awsAwsjson11_deserializeDocumentAssociationVersionInfo(v **types.Associatio return err } + case "TargetMaps": + if err := awsAwsjson11_deserializeDocumentTargetMaps(&sv.TargetMaps, value); err != nil { + return err + } + case "Targets": if err := awsAwsjson11_deserializeDocumentTargets(&sv.Targets, value); err != nil { return err @@ -21781,6 +23396,11 @@ func awsAwsjson11_deserializeDocumentAutomationExecution(v **types.AutomationExe for key, value := range shape { switch key { + case "AlarmConfiguration": + if err := awsAwsjson11_deserializeDocumentAlarmConfiguration(&sv.AlarmConfiguration, value); err != nil { + return err + } + case "AssociationId": if value != nil { jtv, ok := value.(string) @@ -21873,28 +23493,34 @@ func awsAwsjson11_deserializeDocumentAutomationExecution(v **types.AutomationExe case "ExecutionEndTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ExecutionEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.ExecutionEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "ExecutionStartTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ExecutionStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.ExecutionStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "FailureMessage": @@ -21978,15 +23604,18 @@ func awsAwsjson11_deserializeDocumentAutomationExecution(v **types.AutomationExe case "ScheduledTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ScheduledTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.ScheduledTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "StepExecutions": @@ -22036,6 +23665,16 @@ func awsAwsjson11_deserializeDocumentAutomationExecution(v **types.AutomationExe return err } + case "TriggeredAlarms": + if err := awsAwsjson11_deserializeDocumentAlarmStateInformationList(&sv.TriggeredAlarms, value); err != nil { + return err + } + + case "Variables": + if err := awsAwsjson11_deserializeDocumentAutomationParameterMap(&sv.Variables, value); err != nil { + return err + } + default: _, _ = key, value @@ -22107,6 +23746,11 @@ func awsAwsjson11_deserializeDocumentAutomationExecutionMetadata(v **types.Autom for key, value := range shape { switch key { + case "AlarmConfiguration": + if err := awsAwsjson11_deserializeDocumentAlarmConfiguration(&sv.AlarmConfiguration, value); err != nil { + return err + } + case "AssociationId": if value != nil { jtv, ok := value.(string) @@ -22208,28 +23852,34 @@ func awsAwsjson11_deserializeDocumentAutomationExecutionMetadata(v **types.Autom case "ExecutionEndTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ExecutionEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.ExecutionEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "ExecutionStartTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ExecutionStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.ExecutionStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "FailureMessage": @@ -22312,15 +23962,18 @@ func awsAwsjson11_deserializeDocumentAutomationExecutionMetadata(v **types.Autom case "ScheduledTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ScheduledTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.ScheduledTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Target": @@ -22351,6 +24004,11 @@ func awsAwsjson11_deserializeDocumentAutomationExecutionMetadata(v **types.Autom return err } + case "TriggeredAlarms": + if err := awsAwsjson11_deserializeDocumentAlarmStateInformationList(&sv.TriggeredAlarms, value); err != nil { + return err + } + default: _, _ = key, value @@ -22544,6 +24202,114 @@ func awsAwsjson11_deserializeDocumentAutomationStepNotFoundException(v **types.A return nil } +func awsAwsjson11_deserializeDocumentCalendarNameOrARNList(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CalendarNameOrARN to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentCategoryEnumList(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Category to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentCategoryList(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Category to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentCloudWatchOutputConfig(v **types.CloudWatchOutputConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -22615,6 +24381,11 @@ func awsAwsjson11_deserializeDocumentCommand(v **types.Command, value interface{ for key, value := range shape { switch key { + case "AlarmConfiguration": + if err := awsAwsjson11_deserializeDocumentAlarmConfiguration(&sv.AlarmConfiguration, value); err != nil { + return err + } + case "CloudWatchOutputConfig": if err := awsAwsjson11_deserializeDocumentCloudWatchOutputConfig(&sv.CloudWatchOutputConfig, value); err != nil { return err @@ -22697,15 +24468,18 @@ func awsAwsjson11_deserializeDocumentCommand(v **types.Command, value interface{ case "ExpiresAfter": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ExpiresAfter = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.ExpiresAfter = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "InstanceIds": @@ -22770,15 +24544,18 @@ func awsAwsjson11_deserializeDocumentCommand(v **types.Command, value interface{ case "RequestedDateTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.RequestedDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.RequestedDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "ServiceRole": @@ -22836,7 +24613,12 @@ func awsAwsjson11_deserializeDocumentCommand(v **types.Command, value interface{ if err != nil { return err } - sv.TimeoutSeconds = int32(i64) + sv.TimeoutSeconds = ptr.Int32(int32(i64)) + } + + case "TriggeredAlarms": + if err := awsAwsjson11_deserializeDocumentAlarmStateInformationList(&sv.TriggeredAlarms, value); err != nil { + return err } default: @@ -22941,15 +24723,18 @@ func awsAwsjson11_deserializeDocumentCommandInvocation(v **types.CommandInvocati case "RequestedDateTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.RequestedDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.RequestedDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "ServiceRole": @@ -23165,28 +24950,34 @@ func awsAwsjson11_deserializeDocumentCommandPlugin(v **types.CommandPlugin, valu case "ResponseFinishDateTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ResponseFinishDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.ResponseFinishDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "ResponseStartDateTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ResponseStartDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.ResponseStartDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "StandardErrorUrl": @@ -23301,15 +25092,18 @@ func awsAwsjson11_deserializeDocumentComplianceExecutionSummary(v **types.Compli case "ExecutionTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ExecutionTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.ExecutionTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "ExecutionType": @@ -23699,6 +25493,11 @@ func awsAwsjson11_deserializeDocumentCreateAssociationBatchRequestEntry(v **type for key, value := range shape { switch key { + case "AlarmConfiguration": + if err := awsAwsjson11_deserializeDocumentAlarmConfiguration(&sv.AlarmConfiguration, value); err != nil { + return err + } + case "ApplyOnlyAtCronInterval": if value != nil { jtv, ok := value.(bool) @@ -23726,6 +25525,11 @@ func awsAwsjson11_deserializeDocumentCreateAssociationBatchRequestEntry(v **type sv.AutomationTargetParameterName = ptr.String(jtv) } + case "CalendarNames": + if err := awsAwsjson11_deserializeDocumentCalendarNameOrARNList(&sv.CalendarNames, value); err != nil { + return err + } + case "ComplianceSeverity": if value != nil { jtv, ok := value.(string) @@ -23799,6 +25603,19 @@ func awsAwsjson11_deserializeDocumentCreateAssociationBatchRequestEntry(v **type sv.ScheduleExpression = ptr.String(jtv) } + case "ScheduleOffset": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ScheduleOffset to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ScheduleOffset = ptr.Int32(int32(i64)) + } + case "SyncCompliance": if value != nil { jtv, ok := value.(string) @@ -23813,6 +25630,11 @@ func awsAwsjson11_deserializeDocumentCreateAssociationBatchRequestEntry(v **type return err } + case "TargetMaps": + if err := awsAwsjson11_deserializeDocumentTargetMaps(&sv.TargetMaps, value); err != nil { + return err + } + case "Targets": if err := awsAwsjson11_deserializeDocumentTargets(&sv.Targets, value); err != nil { return err @@ -24010,17 +25832,30 @@ func awsAwsjson11_deserializeDocumentDocumentDescription(v **types.DocumentDescr sv.Author = ptr.String(jtv) } + case "Category": + if err := awsAwsjson11_deserializeDocumentCategoryList(&sv.Category, value); err != nil { + return err + } + + case "CategoryEnum": + if err := awsAwsjson11_deserializeDocumentCategoryEnumList(&sv.CategoryEnum, value); err != nil { + return err + } + case "CreatedDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "DefaultVersion": @@ -24041,6 +25876,15 @@ func awsAwsjson11_deserializeDocumentDocumentDescription(v **types.DocumentDescr sv.Description = ptr.String(jtv) } + case "DisplayName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DocumentDisplayName to be of type string, got %T instead", value) + } + sv.DisplayName = ptr.String(jtv) + } + case "DocumentFormat": if value != nil { jtv, ok := value.(string) @@ -24250,6 +26094,31 @@ func awsAwsjson11_deserializeDocumentDocumentIdentifier(v **types.DocumentIdenti sv.Author = ptr.String(jtv) } + case "CreatedDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + + } + } + + case "DisplayName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DocumentDisplayName to be of type string, got %T instead", value) + } + sv.DisplayName = ptr.String(jtv) + } + case "DocumentFormat": if value != nil { jtv, ok := value.(string) @@ -24637,6 +26506,15 @@ func awsAwsjson11_deserializeDocumentDocumentRequires(v **types.DocumentRequires sv.Name = ptr.String(jtv) } + case "RequireType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RequireType to be of type string, got %T instead", value) + } + sv.RequireType = ptr.String(jtv) + } + case "Version": if value != nil { jtv, ok := value.(string) @@ -24646,6 +26524,15 @@ func awsAwsjson11_deserializeDocumentDocumentRequires(v **types.DocumentRequires sv.Version = ptr.String(jtv) } + case "VersionName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DocumentVersionName to be of type string, got %T instead", value) + } + sv.VersionName = ptr.String(jtv) + } + default: _, _ = key, value @@ -24835,15 +26722,18 @@ func awsAwsjson11_deserializeDocumentDocumentReviewerResponseSource(v **types.Do case "CreateTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.CreateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Reviewer": @@ -24866,15 +26756,18 @@ func awsAwsjson11_deserializeDocumentDocumentReviewerResponseSource(v **types.Do case "UpdatedTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.UpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } default: @@ -24910,15 +26803,27 @@ func awsAwsjson11_deserializeDocumentDocumentVersionInfo(v **types.DocumentVersi switch key { case "CreatedDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - f64, err := jtv.Float64() - if err != nil { - return err + } + + case "DisplayName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DocumentDisplayName to be of type string, got %T instead", value) } - sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.DisplayName = ptr.String(jtv) } case "DocumentFormat": @@ -25484,6 +27389,98 @@ func awsAwsjson11_deserializeDocumentFeatureNotAvailableException(v **types.Feat return nil } +func awsAwsjson11_deserializeDocumentGetResourcePoliciesResponseEntries(v *[]types.GetResourcePoliciesResponseEntry, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.GetResourcePoliciesResponseEntry + if *v == nil { + cv = []types.GetResourcePoliciesResponseEntry{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.GetResourcePoliciesResponseEntry + destAddr := &col + if err := awsAwsjson11_deserializeDocumentGetResourcePoliciesResponseEntry(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentGetResourcePoliciesResponseEntry(v **types.GetResourcePoliciesResponseEntry, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.GetResourcePoliciesResponseEntry + if *v == nil { + sv = &types.GetResourcePoliciesResponseEntry{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Policy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Policy to be of type string, got %T instead", value) + } + sv.Policy = ptr.String(jtv) + } + + case "PolicyHash": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyHash to be of type string, got %T instead", value) + } + sv.PolicyHash = ptr.String(jtv) + } + + case "PolicyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyId to be of type string, got %T instead", value) + } + sv.PolicyId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentHierarchyLevelLimitExceededException(v **types.HierarchyLevelLimitExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -25980,15 +27977,18 @@ func awsAwsjson11_deserializeDocumentInstanceAssociationStatusInfo(v **types.Ins case "ExecutionDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ExecutionDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.ExecutionDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "ExecutionSummary": @@ -26207,46 +28207,55 @@ func awsAwsjson11_deserializeDocumentInstanceInformation(v **types.InstanceInfor if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } - sv.IsLatestVersion = jtv + sv.IsLatestVersion = ptr.Bool(jtv) } case "LastAssociationExecutionDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastAssociationExecutionDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.LastAssociationExecutionDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "LastPingDateTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastPingDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.LastPingDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "LastSuccessfulAssociationExecutionDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastSuccessfulAssociationExecutionDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.LastSuccessfulAssociationExecutionDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Name": @@ -26296,15 +28305,18 @@ func awsAwsjson11_deserializeDocumentInstanceInformation(v **types.InstanceInfor case "RegistrationDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.RegistrationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.RegistrationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "ResourceType": @@ -26316,6 +28328,24 @@ func awsAwsjson11_deserializeDocumentInstanceInformation(v **types.InstanceInfor sv.ResourceType = types.ResourceType(jtv) } + case "SourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourceId to be of type string, got %T instead", value) + } + sv.SourceId = ptr.String(jtv) + } + + case "SourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourceType to be of type string, got %T instead", value) + } + sv.SourceType = types.SourceType(jtv) + } + default: _, _ = key, value @@ -26390,6 +28420,19 @@ func awsAwsjson11_deserializeDocumentInstancePatchState(v **types.InstancePatchS sv.BaselineId = ptr.String(jtv) } + case "CriticalNonCompliantCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected PatchCriticalNonCompliantCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.CriticalNonCompliantCount = ptr.Int32(int32(i64)) + } + case "FailedCount": if value != nil { jtv, ok := value.(json.Number) @@ -26439,7 +28482,7 @@ func awsAwsjson11_deserializeDocumentInstancePatchState(v **types.InstancePatchS if err != nil { return err } - sv.InstalledPendingRebootCount = int32(i64) + sv.InstalledPendingRebootCount = ptr.Int32(int32(i64)) } case "InstalledRejectedCount": @@ -26452,7 +28495,7 @@ func awsAwsjson11_deserializeDocumentInstancePatchState(v **types.InstancePatchS if err != nil { return err } - sv.InstalledRejectedCount = int32(i64) + sv.InstalledRejectedCount = ptr.Int32(int32(i64)) } case "InstallOverrideList": @@ -26475,15 +28518,18 @@ func awsAwsjson11_deserializeDocumentInstancePatchState(v **types.InstancePatchS case "LastNoRebootInstallOperationTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastNoRebootInstallOperationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.LastNoRebootInstallOperationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "MissingCount": @@ -26523,28 +28569,47 @@ func awsAwsjson11_deserializeDocumentInstancePatchState(v **types.InstancePatchS case "OperationEndTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.OperationEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.OperationEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "OperationStartTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.OperationStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + + } + } + + case "OtherNonCompliantCount": if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) + return fmt.Errorf("expected PatchOtherNonCompliantCount to be json.Number, got %T instead", value) } - f64, err := jtv.Float64() + i64, err := jtv.Int64() if err != nil { return err } - sv.OperationStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.OtherNonCompliantCount = ptr.Int32(int32(i64)) } case "OwnerInformation": @@ -26574,6 +28639,19 @@ func awsAwsjson11_deserializeDocumentInstancePatchState(v **types.InstancePatchS sv.RebootOption = types.RebootOption(jtv) } + case "SecurityNonCompliantCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected PatchSecurityNonCompliantCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.SecurityNonCompliantCount = ptr.Int32(int32(i64)) + } + case "SnapshotId": if value != nil { jtv, ok := value.(string) @@ -26593,7 +28671,7 @@ func awsAwsjson11_deserializeDocumentInstancePatchState(v **types.InstancePatchS if err != nil { return err } - sv.UnreportedNotApplicableCount = int32(i64) + sv.UnreportedNotApplicableCount = ptr.Int32(int32(i64)) } default: @@ -28419,6 +30497,46 @@ func awsAwsjson11_deserializeDocumentInvalidSchedule(v **types.InvalidSchedule, return nil } +func awsAwsjson11_deserializeDocumentInvalidTag(v **types.InvalidTag, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidTag + if *v == nil { + sv = &types.InvalidTag{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentInvalidTarget(v **types.InvalidTarget, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -28459,6 +30577,46 @@ func awsAwsjson11_deserializeDocumentInvalidTarget(v **types.InvalidTarget, valu return nil } +func awsAwsjson11_deserializeDocumentInvalidTargetMaps(v **types.InvalidTargetMaps, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidTargetMaps + if *v == nil { + sv = &types.InvalidTargetMaps{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentInvalidTypeNameException(v **types.InvalidTypeNameException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -28606,15 +30764,18 @@ func awsAwsjson11_deserializeDocumentInventoryDeletionStatusItem(v **types.Inven case "DeletionStartTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected InventoryDeletionStartTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DeletionStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected InventoryDeletionStartTime to be a JSON Number, got %T instead", value) + } - sv.DeletionStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "DeletionSummary": @@ -28642,15 +30803,18 @@ func awsAwsjson11_deserializeDocumentInventoryDeletionStatusItem(v **types.Inven case "LastStatusUpdateTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected InventoryDeletionLastStatusUpdateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastStatusUpdateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected InventoryDeletionLastStatusUpdateTime to be a JSON Number, got %T instead", value) + } - sv.LastStatusUpdateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "TypeName": @@ -29523,28 +31687,34 @@ func awsAwsjson11_deserializeDocumentMaintenanceWindowExecution(v **types.Mainte switch key { case "EndTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "StartTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Status": @@ -29648,30 +31818,41 @@ func awsAwsjson11_deserializeDocumentMaintenanceWindowExecutionTaskIdentity(v ** for key, value := range shape { switch key { + case "AlarmConfiguration": + if err := awsAwsjson11_deserializeDocumentAlarmConfiguration(&sv.AlarmConfiguration, value); err != nil { + return err + } + case "EndTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "StartTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Status": @@ -29719,6 +31900,11 @@ func awsAwsjson11_deserializeDocumentMaintenanceWindowExecutionTaskIdentity(v ** sv.TaskType = types.MaintenanceWindowTaskType(jtv) } + case "TriggeredAlarms": + if err := awsAwsjson11_deserializeDocumentAlarmStateInformationList(&sv.TriggeredAlarms, value); err != nil { + return err + } + case "WindowExecutionId": if value != nil { jtv, ok := value.(string) @@ -29831,15 +32017,18 @@ func awsAwsjson11_deserializeDocumentMaintenanceWindowExecutionTaskInvocationIde switch key { case "EndTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "ExecutionId": @@ -29880,15 +32069,18 @@ func awsAwsjson11_deserializeDocumentMaintenanceWindowExecutionTaskInvocationIde case "StartTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Status": @@ -30042,7 +32234,7 @@ func awsAwsjson11_deserializeDocumentMaintenanceWindowIdentity(v **types.Mainten if err != nil { return err } - sv.Duration = int32(i64) + sv.Duration = ptr.Int32(int32(i64)) } case "Enabled": @@ -30100,7 +32292,7 @@ func awsAwsjson11_deserializeDocumentMaintenanceWindowIdentity(v **types.Mainten if err != nil { return err } - sv.ScheduleOffset = int32(i64) + sv.ScheduleOffset = ptr.Int32(int32(i64)) } case "ScheduleTimezone": @@ -30394,7 +32586,7 @@ func awsAwsjson11_deserializeDocumentMaintenanceWindowRunCommandParameters(v **t if err != nil { return err } - sv.TimeoutSeconds = int32(i64) + sv.TimeoutSeconds = ptr.Int32(int32(i64)) } default: @@ -30635,6 +32827,20 @@ func awsAwsjson11_deserializeDocumentMaintenanceWindowTask(v **types.Maintenance for key, value := range shape { switch key { + case "AlarmConfiguration": + if err := awsAwsjson11_deserializeDocumentAlarmConfiguration(&sv.AlarmConfiguration, value); err != nil { + return err + } + + case "CutoffBehavior": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MaintenanceWindowTaskCutoffBehavior to be of type string, got %T instead", value) + } + sv.CutoffBehavior = types.MaintenanceWindowTaskCutoffBehavior(jtv) + } + case "Description": if value != nil { jtv, ok := value.(string) @@ -31518,28 +33724,34 @@ func awsAwsjson11_deserializeDocumentOpsItem(v **types.OpsItem, value interface{ switch key { case "ActualEndTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ActualEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.ActualEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "ActualStartTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ActualStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.ActualStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Category": @@ -31562,15 +33774,18 @@ func awsAwsjson11_deserializeDocumentOpsItem(v **types.OpsItem, value interface{ case "CreatedTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Description": @@ -31593,15 +33808,18 @@ func awsAwsjson11_deserializeDocumentOpsItem(v **types.OpsItem, value interface{ case "LastModifiedTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Notifications": @@ -31614,6 +33832,15 @@ func awsAwsjson11_deserializeDocumentOpsItem(v **types.OpsItem, value interface{ return err } + case "OpsItemArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OpsItemArn to be of type string, got %T instead", value) + } + sv.OpsItemArn = ptr.String(jtv) + } + case "OpsItemId": if value != nil { jtv, ok := value.(string) @@ -31634,28 +33861,34 @@ func awsAwsjson11_deserializeDocumentOpsItem(v **types.OpsItem, value interface{ case "PlannedEndTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.PlannedEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.PlannedEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "PlannedStartTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.PlannedStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.PlannedStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Priority": @@ -31730,6 +33963,46 @@ func awsAwsjson11_deserializeDocumentOpsItem(v **types.OpsItem, value interface{ return nil } +func awsAwsjson11_deserializeDocumentOpsItemAccessDeniedException(v **types.OpsItemAccessDeniedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.OpsItemAccessDeniedException + if *v == nil { + sv = &types.OpsItemAccessDeniedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentOpsItemAlreadyExistsException(v **types.OpsItemAlreadyExistsException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -31779,6 +34052,46 @@ func awsAwsjson11_deserializeDocumentOpsItemAlreadyExistsException(v **types.Ops return nil } +func awsAwsjson11_deserializeDocumentOpsItemConflictException(v **types.OpsItemConflictException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.OpsItemConflictException + if *v == nil { + sv = &types.OpsItemConflictException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentOpsItemDataValue(v **types.OpsItemDataValue, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -31891,15 +34204,18 @@ func awsAwsjson11_deserializeDocumentOpsItemEventSummary(v **types.OpsItemEventS case "CreatedTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Detail": @@ -32293,6 +34609,256 @@ func awsAwsjson11_deserializeDocumentOpsItemParameterNamesList(v *[]string, valu return nil } +func awsAwsjson11_deserializeDocumentOpsItemRelatedItemAlreadyExistsException(v **types.OpsItemRelatedItemAlreadyExistsException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.OpsItemRelatedItemAlreadyExistsException + if *v == nil { + sv = &types.OpsItemRelatedItemAlreadyExistsException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "OpsItemId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OpsItemId to be of type string, got %T instead", value) + } + sv.OpsItemId = ptr.String(jtv) + } + + case "ResourceUri": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OpsItemRelatedItemAssociationResourceUri to be of type string, got %T instead", value) + } + sv.ResourceUri = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentOpsItemRelatedItemAssociationNotFoundException(v **types.OpsItemRelatedItemAssociationNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.OpsItemRelatedItemAssociationNotFoundException + if *v == nil { + sv = &types.OpsItemRelatedItemAssociationNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentOpsItemRelatedItemSummaries(v *[]types.OpsItemRelatedItemSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.OpsItemRelatedItemSummary + if *v == nil { + cv = []types.OpsItemRelatedItemSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.OpsItemRelatedItemSummary + destAddr := &col + if err := awsAwsjson11_deserializeDocumentOpsItemRelatedItemSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentOpsItemRelatedItemSummary(v **types.OpsItemRelatedItemSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.OpsItemRelatedItemSummary + if *v == nil { + sv = &types.OpsItemRelatedItemSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AssociationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OpsItemRelatedItemAssociationId to be of type string, got %T instead", value) + } + sv.AssociationId = ptr.String(jtv) + } + + case "AssociationType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OpsItemRelatedItemAssociationType to be of type string, got %T instead", value) + } + sv.AssociationType = ptr.String(jtv) + } + + case "CreatedBy": + if err := awsAwsjson11_deserializeDocumentOpsItemIdentity(&sv.CreatedBy, value); err != nil { + return err + } + + case "CreatedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + + } + } + + case "LastModifiedBy": + if err := awsAwsjson11_deserializeDocumentOpsItemIdentity(&sv.LastModifiedBy, value); err != nil { + return err + } + + case "LastModifiedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + + } + } + + case "OpsItemId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OpsItemId to be of type string, got %T instead", value) + } + sv.OpsItemId = ptr.String(jtv) + } + + case "ResourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OpsItemRelatedItemAssociationResourceType to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + case "ResourceUri": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OpsItemRelatedItemAssociationResourceUri to be of type string, got %T instead", value) + } + sv.ResourceUri = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentOpsItemSummaries(v *[]types.OpsItemSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -32351,28 +34917,34 @@ func awsAwsjson11_deserializeDocumentOpsItemSummary(v **types.OpsItemSummary, va switch key { case "ActualEndTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ActualEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.ActualEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "ActualStartTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ActualStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.ActualStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Category": @@ -32395,15 +34967,18 @@ func awsAwsjson11_deserializeDocumentOpsItemSummary(v **types.OpsItemSummary, va case "CreatedTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "LastModifiedBy": @@ -32417,15 +34992,18 @@ func awsAwsjson11_deserializeDocumentOpsItemSummary(v **types.OpsItemSummary, va case "LastModifiedTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "OperationalData": @@ -32453,28 +35031,34 @@ func awsAwsjson11_deserializeDocumentOpsItemSummary(v **types.OpsItemSummary, va case "PlannedEndTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.PlannedEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.PlannedEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "PlannedStartTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.PlannedStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.PlannedStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Priority": @@ -32559,28 +35143,34 @@ func awsAwsjson11_deserializeDocumentOpsMetadata(v **types.OpsMetadata, value in switch key { case "CreationDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "LastModifiedDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "LastModifiedUser": @@ -32984,15 +35574,18 @@ func awsAwsjson11_deserializeDocumentParameter(v **types.Parameter, value interf case "LastModifiedDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Name": @@ -33167,15 +35760,18 @@ func awsAwsjson11_deserializeDocumentParameterHistory(v **types.ParameterHistory case "LastModifiedDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "LastModifiedUser": @@ -33552,15 +36148,18 @@ func awsAwsjson11_deserializeDocumentParameterMetadata(v **types.ParameterMetada case "LastModifiedDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "LastModifiedUser": @@ -33960,6 +36559,86 @@ func awsAwsjson11_deserializeDocumentParameterVersionNotFound(v **types.Paramete return nil } +func awsAwsjson11_deserializeDocumentParentStepDetails(v **types.ParentStepDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ParentStepDetails + if *v == nil { + sv = &types.ParentStepDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Action": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AutomationActionName to be of type string, got %T instead", value) + } + sv.Action = ptr.String(jtv) + } + + case "Iteration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Iteration = ptr.Int32(int32(i64)) + } + + case "IteratorValue": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.IteratorValue = ptr.String(jtv) + } + + case "StepExecutionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.StepExecutionId = ptr.String(jtv) + } + + case "StepName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.StepName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentPatch(v **types.Patch, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -34129,15 +36808,18 @@ func awsAwsjson11_deserializeDocumentPatch(v **types.Patch, value interface{}) e case "ReleaseDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ReleaseDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.ReleaseDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Repository": @@ -34418,15 +37100,18 @@ func awsAwsjson11_deserializeDocumentPatchComplianceData(v **types.PatchComplian case "InstalledTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.InstalledTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.InstalledTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "KBId": @@ -34980,7 +37665,7 @@ func awsAwsjson11_deserializeDocumentPatchRule(v **types.PatchRule, value interf if err != nil { return err } - sv.ApproveAfterDays = int32(i64) + sv.ApproveAfterDays = ptr.Int32(int32(i64)) } case "ApproveUntilDate": @@ -35007,7 +37692,7 @@ func awsAwsjson11_deserializeDocumentPatchRule(v **types.PatchRule, value interf if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } - sv.EnableNonSecurity = jtv + sv.EnableNonSecurity = ptr.Bool(jtv) } case "PatchFilterGroup": @@ -35242,15 +37927,18 @@ func awsAwsjson11_deserializeDocumentPatchStatus(v **types.PatchStatus, value in switch key { case "ApprovalDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ApprovalDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.ApprovalDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "ComplianceLevel": @@ -36010,15 +38698,18 @@ func awsAwsjson11_deserializeDocumentResourceDataSyncItem(v **types.ResourceData case "LastSuccessfulSyncTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected LastSuccessfulResourceDataSyncTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastSuccessfulSyncTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastSuccessfulResourceDataSyncTime to be a JSON Number, got %T instead", value) + } - sv.LastSuccessfulSyncTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "LastSyncStatusMessage": @@ -36032,15 +38723,18 @@ func awsAwsjson11_deserializeDocumentResourceDataSyncItem(v **types.ResourceData case "LastSyncTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected LastResourceDataSyncTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastSyncTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastResourceDataSyncTime to be a JSON Number, got %T instead", value) + } - sv.LastSyncTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "S3Destination": @@ -36050,28 +38744,34 @@ func awsAwsjson11_deserializeDocumentResourceDataSyncItem(v **types.ResourceData case "SyncCreatedTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected ResourceDataSyncCreatedTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.SyncCreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected ResourceDataSyncCreatedTime to be a JSON Number, got %T instead", value) + } - sv.SyncCreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "SyncLastModifiedTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected ResourceDataSyncLastModifiedTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.SyncLastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected ResourceDataSyncLastModifiedTime to be a JSON Number, got %T instead", value) + } - sv.SyncLastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "SyncName": @@ -36416,6 +39116,15 @@ func awsAwsjson11_deserializeDocumentResourceDataSyncSourceWithState(v **types.R return err } + case "EnableAllOpsDataSources": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected ResourceDataSyncEnableAllOpsDataSources to be of type *bool, got %T instead", value) + } + sv.EnableAllOpsDataSources = jtv + } + case "IncludeFutureRegions": if value != nil { jtv, ok := value.(bool) @@ -36497,7 +39206,87 @@ func awsAwsjson11_deserializeDocumentResourceInUseException(v **types.ResourceIn return nil } -func awsAwsjson11_deserializeDocumentResourceLimitExceededException(v **types.ResourceLimitExceededException, value interface{}) error { +func awsAwsjson11_deserializeDocumentResourceLimitExceededException(v **types.ResourceLimitExceededException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceLimitExceededException + if *v == nil { + sv = &types.ResourceLimitExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentResourcePolicyConflictException(v **types.ResourcePolicyConflictException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourcePolicyConflictException + if *v == nil { + sv = &types.ResourcePolicyConflictException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentResourcePolicyInvalidParameterException(v **types.ResourcePolicyInvalidParameterException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -36510,9 +39299,9 @@ func awsAwsjson11_deserializeDocumentResourceLimitExceededException(v **types.Re return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ResourceLimitExceededException + var sv *types.ResourcePolicyInvalidParameterException if *v == nil { - sv = &types.ResourceLimitExceededException{} + sv = &types.ResourcePolicyInvalidParameterException{} } else { sv = *v } @@ -36528,6 +39317,11 @@ func awsAwsjson11_deserializeDocumentResourceLimitExceededException(v **types.Re sv.Message = ptr.String(jtv) } + case "ParameterNames": + if err := awsAwsjson11_deserializeDocumentResourcePolicyParameterNamesList(&sv.ParameterNames, value); err != nil { + return err + } + default: _, _ = key, value @@ -36537,7 +39331,7 @@ func awsAwsjson11_deserializeDocumentResourceLimitExceededException(v **types.Re return nil } -func awsAwsjson11_deserializeDocumentReviewInformation(v **types.ReviewInformation, value interface{}) error { +func awsAwsjson11_deserializeDocumentResourcePolicyLimitExceededException(v **types.ResourcePolicyLimitExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -36550,26 +39344,127 @@ func awsAwsjson11_deserializeDocumentReviewInformation(v **types.ReviewInformati return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ReviewInformation + var sv *types.ResourcePolicyLimitExceededException if *v == nil { - sv = &types.ReviewInformation{} + sv = &types.ResourcePolicyLimitExceededException{} } else { sv = *v } for key, value := range shape { switch key { - case "ReviewedTime": + case "Limit": if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } - f64, err := jtv.Float64() + i64, err := jtv.Int64() if err != nil { return err } - sv.ReviewedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.Limit = int32(i64) + } + + case "LimitType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.LimitType = ptr.String(jtv) + } + + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentResourcePolicyParameterNamesList(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentReviewInformation(v **types.ReviewInformation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ReviewInformation + if *v == nil { + sv = &types.ReviewInformation{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ReviewedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ReviewedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + + } } case "Reviewer": @@ -36701,6 +39596,11 @@ func awsAwsjson11_deserializeDocumentRunbook(v **types.Runbook, value interface{ return err } + case "TargetMaps": + if err := awsAwsjson11_deserializeDocumentTargetMaps(&sv.TargetMaps, value); err != nil { + return err + } + case "TargetParameterName": if value != nil { jtv, ok := value.(string) @@ -36981,15 +39881,18 @@ func awsAwsjson11_deserializeDocumentServiceSetting(v **types.ServiceSetting, va case "LastModifiedDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "LastModifiedUser": @@ -37119,15 +40022,27 @@ func awsAwsjson11_deserializeDocumentSession(v **types.Session, value interface{ case "EndDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EndDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - f64, err := jtv.Float64() - if err != nil { - return err + } + + case "MaxSessionDuration": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MaxSessionDuration to be of type string, got %T instead", value) } - sv.EndDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.MaxSessionDuration = ptr.String(jtv) } case "OutputUrl": @@ -37144,6 +40059,15 @@ func awsAwsjson11_deserializeDocumentSession(v **types.Session, value interface{ sv.Owner = ptr.String(jtv) } + case "Reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SessionReason to be of type string, got %T instead", value) + } + sv.Reason = ptr.String(jtv) + } + case "SessionId": if value != nil { jtv, ok := value.(string) @@ -37155,15 +40079,18 @@ func awsAwsjson11_deserializeDocumentSession(v **types.Session, value interface{ case "StartDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StartDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.StartDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Status": @@ -37449,28 +40376,34 @@ func awsAwsjson11_deserializeDocumentStepExecution(v **types.StepExecution, valu case "ExecutionEndTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ExecutionEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.ExecutionEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "ExecutionStartTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ExecutionStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.ExecutionStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "FailureDetails": @@ -37498,7 +40431,7 @@ func awsAwsjson11_deserializeDocumentStepExecution(v **types.StepExecution, valu if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } - sv.IsCritical = jtv + sv.IsCritical = ptr.Bool(jtv) } case "IsEnd": @@ -37507,7 +40440,7 @@ func awsAwsjson11_deserializeDocumentStepExecution(v **types.StepExecution, valu if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } - sv.IsEnd = jtv + sv.IsEnd = ptr.Bool(jtv) } case "MaxAttempts": @@ -37520,7 +40453,7 @@ func awsAwsjson11_deserializeDocumentStepExecution(v **types.StepExecution, valu if err != nil { return err } - sv.MaxAttempts = int32(i64) + sv.MaxAttempts = ptr.Int32(int32(i64)) } case "NextStep": @@ -37551,6 +40484,11 @@ func awsAwsjson11_deserializeDocumentStepExecution(v **types.StepExecution, valu return err } + case "ParentStepDetails": + if err := awsAwsjson11_deserializeDocumentParentStepDetails(&sv.ParentStepDetails, value); err != nil { + return err + } + case "Response": if value != nil { jtv, ok := value.(string) @@ -37616,7 +40554,12 @@ func awsAwsjson11_deserializeDocumentStepExecution(v **types.StepExecution, valu if err != nil { return err } - sv.TimeoutSeconds = i64 + sv.TimeoutSeconds = ptr.Int64(i64) + } + + case "TriggeredAlarms": + if err := awsAwsjson11_deserializeDocumentAlarmStateInformationList(&sv.TriggeredAlarms, value); err != nil { + return err } case "ValidNextSteps": @@ -37916,6 +40859,11 @@ func awsAwsjson11_deserializeDocumentTargetLocation(v **types.TargetLocation, va return err } + case "TargetLocationAlarmConfiguration": + if err := awsAwsjson11_deserializeDocumentAlarmConfiguration(&sv.TargetLocationAlarmConfiguration, value); err != nil { + return err + } + case "TargetLocationMaxConcurrency": if value != nil { jtv, ok := value.(string) @@ -38505,7 +41453,127 @@ func awsAwsjson11_deserializeDocumentUnsupportedInventorySchemaVersionException( return nil } -func awsAwsjson11_deserializeDocumentUnsupportedOperatingSystem(v **types.UnsupportedOperatingSystem, value interface{}) error { +func awsAwsjson11_deserializeDocumentUnsupportedOperatingSystem(v **types.UnsupportedOperatingSystem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.UnsupportedOperatingSystem + if *v == nil { + sv = &types.UnsupportedOperatingSystem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentUnsupportedParameterType(v **types.UnsupportedParameterType, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.UnsupportedParameterType + if *v == nil { + sv = &types.UnsupportedParameterType{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentUnsupportedPlatformType(v **types.UnsupportedPlatformType, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.UnsupportedPlatformType + if *v == nil { + sv = &types.UnsupportedPlatformType{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentValidNextStepList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -38513,39 +41581,35 @@ func awsAwsjson11_deserializeDocumentUnsupportedOperatingSystem(v **types.Unsupp return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.UnsupportedOperatingSystem + var cv []string if *v == nil { - sv = &types.UnsupportedOperatingSystem{} + cv = []string{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ValidNextStep to be of type string, got %T instead", value) } - - default: - _, _ = key, value - + col = jtv } + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsAwsjson11_deserializeDocumentUnsupportedParameterType(v **types.UnsupportedParameterType, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentAddTagsToResourceOutput(v **AddTagsToResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -38558,24 +41622,15 @@ func awsAwsjson11_deserializeDocumentUnsupportedParameterType(v **types.Unsuppor return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.UnsupportedParameterType + var sv *AddTagsToResourceOutput if *v == nil { - sv = &types.UnsupportedParameterType{} + sv = &AddTagsToResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - default: _, _ = key, value @@ -38585,7 +41640,7 @@ func awsAwsjson11_deserializeDocumentUnsupportedParameterType(v **types.Unsuppor return nil } -func awsAwsjson11_deserializeDocumentUnsupportedPlatformType(v **types.UnsupportedPlatformType, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentAssociateOpsItemRelatedItemOutput(v **AssociateOpsItemRelatedItemOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -38598,91 +41653,24 @@ func awsAwsjson11_deserializeDocumentUnsupportedPlatformType(v **types.Unsupport return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.UnsupportedPlatformType + var sv *AssociateOpsItemRelatedItemOutput if *v == nil { - sv = &types.UnsupportedPlatformType{} + sv = &AssociateOpsItemRelatedItemOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Message": + case "AssociationId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected OpsItemRelatedItemAssociationId to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentValidNextStepList(v *[]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []string - if *v == nil { - cv = []string{} - } else { - cv = *v - } - - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ValidNextStep to be of type string, got %T instead", value) + sv.AssociationId = ptr.String(jtv) } - col = jtv - } - cv = append(cv, col) - - } - *v = cv - return nil -} -func awsAwsjson11_deserializeOpDocumentAddTagsToResourceOutput(v **AddTagsToResourceOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *AddTagsToResourceOutput - if *v == nil { - sv = &AddTagsToResourceOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { default: _, _ = key, value @@ -38987,6 +41975,15 @@ func awsAwsjson11_deserializeOpDocumentCreateOpsItemOutput(v **CreateOpsItemOutp for key, value := range shape { switch key { + case "OpsItemArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OpsItemArn to be of type string, got %T instead", value) + } + sv.OpsItemArn = ptr.String(jtv) + } + case "OpsItemId": if value != nil { jtv, ok := value.(string) @@ -39303,6 +42300,37 @@ func awsAwsjson11_deserializeOpDocumentDeleteMaintenanceWindowOutput(v **DeleteM return nil } +func awsAwsjson11_deserializeOpDocumentDeleteOpsItemOutput(v **DeleteOpsItemOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteOpsItemOutput + if *v == nil { + sv = &DeleteOpsItemOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentDeleteOpsMetadataOutput(v **DeleteOpsMetadataOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -39477,6 +42505,37 @@ func awsAwsjson11_deserializeOpDocumentDeleteResourceDataSyncOutput(v **DeleteRe return nil } +func awsAwsjson11_deserializeOpDocumentDeleteResourcePolicyOutput(v **DeleteResourcePolicyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteResourcePolicyOutput + if *v == nil { + sv = &DeleteResourcePolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentDeregisterManagedInstanceOutput(v **DeregisterManagedInstanceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -40029,6 +43088,15 @@ func awsAwsjson11_deserializeOpDocumentDescribeDocumentPermissionOutput(v **Desc return err } + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + default: _, _ = key, value @@ -40973,6 +44041,19 @@ func awsAwsjson11_deserializeOpDocumentDescribePatchGroupStateOutput(v **Describ sv.Instances = int32(i64) } + case "InstancesWithCriticalNonCompliantPatches": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected InstancesCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.InstancesWithCriticalNonCompliantPatches = ptr.Int32(int32(i64)) + } + case "InstancesWithFailedPatches": if value != nil { jtv, ok := value.(json.Number) @@ -41022,7 +44103,7 @@ func awsAwsjson11_deserializeOpDocumentDescribePatchGroupStateOutput(v **Describ if err != nil { return err } - sv.InstancesWithInstalledPendingRebootPatches = int32(i64) + sv.InstancesWithInstalledPendingRebootPatches = ptr.Int32(int32(i64)) } case "InstancesWithInstalledRejectedPatches": @@ -41035,7 +44116,7 @@ func awsAwsjson11_deserializeOpDocumentDescribePatchGroupStateOutput(v **Describ if err != nil { return err } - sv.InstancesWithInstalledRejectedPatches = int32(i64) + sv.InstancesWithInstalledRejectedPatches = ptr.Int32(int32(i64)) } case "InstancesWithMissingPatches": @@ -41064,6 +44145,32 @@ func awsAwsjson11_deserializeOpDocumentDescribePatchGroupStateOutput(v **Describ sv.InstancesWithNotApplicablePatches = int32(i64) } + case "InstancesWithOtherNonCompliantPatches": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected InstancesCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.InstancesWithOtherNonCompliantPatches = ptr.Int32(int32(i64)) + } + + case "InstancesWithSecurityNonCompliantPatches": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected InstancesCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.InstancesWithSecurityNonCompliantPatches = ptr.Int32(int32(i64)) + } + case "InstancesWithUnreportedNotApplicablePatches": if value != nil { jtv, ok := value.(json.Number) @@ -41074,7 +44181,7 @@ func awsAwsjson11_deserializeOpDocumentDescribePatchGroupStateOutput(v **Describ if err != nil { return err } - sv.InstancesWithUnreportedNotApplicablePatches = int32(i64) + sv.InstancesWithUnreportedNotApplicablePatches = ptr.Int32(int32(i64)) } default: @@ -41176,6 +44283,37 @@ func awsAwsjson11_deserializeOpDocumentDescribeSessionsOutput(v **DescribeSessio return nil } +func awsAwsjson11_deserializeOpDocumentDisassociateOpsItemRelatedItemOutput(v **DisassociateOpsItemRelatedItemOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DisassociateOpsItemRelatedItemOutput + if *v == nil { + sv = &DisassociateOpsItemRelatedItemOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentGetAutomationExecutionOutput(v **GetAutomationExecutionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -41655,6 +44793,31 @@ func awsAwsjson11_deserializeOpDocumentGetDocumentOutput(v **GetDocumentOutput, sv.Content = ptr.String(jtv) } + case "CreatedDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + + } + } + + case "DisplayName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DocumentDisplayName to be of type string, got %T instead", value) + } + sv.DisplayName = ptr.String(jtv) + } + case "DocumentFormat": if value != nil { jtv, ok := value.(string) @@ -41855,28 +45018,34 @@ func awsAwsjson11_deserializeOpDocumentGetMaintenanceWindowExecutionOutput(v **G switch key { case "EndTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "StartTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Status": @@ -41944,15 +45113,18 @@ func awsAwsjson11_deserializeOpDocumentGetMaintenanceWindowExecutionTaskInvocati switch key { case "EndTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "ExecutionId": @@ -41993,15 +45165,18 @@ func awsAwsjson11_deserializeOpDocumentGetMaintenanceWindowExecutionTaskInvocati case "StartTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Status": @@ -42089,17 +45264,25 @@ func awsAwsjson11_deserializeOpDocumentGetMaintenanceWindowExecutionTaskOutput(v for key, value := range shape { switch key { + case "AlarmConfiguration": + if err := awsAwsjson11_deserializeDocumentAlarmConfiguration(&sv.AlarmConfiguration, value); err != nil { + return err + } + case "EndTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "MaxConcurrency": @@ -42144,15 +45327,18 @@ func awsAwsjson11_deserializeOpDocumentGetMaintenanceWindowExecutionTaskOutput(v case "StartTime": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Status": @@ -42196,6 +45382,11 @@ func awsAwsjson11_deserializeOpDocumentGetMaintenanceWindowExecutionTaskOutput(v return err } + case "TriggeredAlarms": + if err := awsAwsjson11_deserializeDocumentAlarmStateInformationList(&sv.TriggeredAlarms, value); err != nil { + return err + } + case "Type": if value != nil { jtv, ok := value.(string) @@ -42256,15 +45447,18 @@ func awsAwsjson11_deserializeOpDocumentGetMaintenanceWindowOutput(v **GetMainten case "CreatedDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Cutoff": @@ -42299,7 +45493,7 @@ func awsAwsjson11_deserializeOpDocumentGetMaintenanceWindowOutput(v **GetMainten if err != nil { return err } - sv.Duration = int32(i64) + sv.Duration = ptr.Int32(int32(i64)) } case "Enabled": @@ -42322,15 +45516,18 @@ func awsAwsjson11_deserializeOpDocumentGetMaintenanceWindowOutput(v **GetMainten case "ModifiedDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.ModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Name": @@ -42370,7 +45567,7 @@ func awsAwsjson11_deserializeOpDocumentGetMaintenanceWindowOutput(v **GetMainten if err != nil { return err } - sv.ScheduleOffset = int32(i64) + sv.ScheduleOffset = ptr.Int32(int32(i64)) } case "ScheduleTimezone": @@ -42431,6 +45628,20 @@ func awsAwsjson11_deserializeOpDocumentGetMaintenanceWindowTaskOutput(v **GetMai for key, value := range shape { switch key { + case "AlarmConfiguration": + if err := awsAwsjson11_deserializeDocumentAlarmConfiguration(&sv.AlarmConfiguration, value); err != nil { + return err + } + + case "CutoffBehavior": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MaintenanceWindowTaskCutoffBehavior to be of type string, got %T instead", value) + } + sv.CutoffBehavior = types.MaintenanceWindowTaskCutoffBehavior(jtv) + } + case "Description": if value != nil { jtv, ok := value.(string) @@ -42961,7 +46172,7 @@ func awsAwsjson11_deserializeOpDocumentGetPatchBaselineOutput(v **GetPatchBaseli if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } - sv.ApprovedPatchesEnableNonSecurity = jtv + sv.ApprovedPatchesEnableNonSecurity = ptr.Bool(jtv) } case "BaselineId": @@ -42975,15 +46186,18 @@ func awsAwsjson11_deserializeOpDocumentGetPatchBaselineOutput(v **GetPatchBaseli case "CreatedDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Description": @@ -43002,15 +46216,18 @@ func awsAwsjson11_deserializeOpDocumentGetPatchBaselineOutput(v **GetPatchBaseli case "ModifiedDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.ModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Name": @@ -43064,6 +46281,51 @@ func awsAwsjson11_deserializeOpDocumentGetPatchBaselineOutput(v **GetPatchBaseli return nil } +func awsAwsjson11_deserializeOpDocumentGetResourcePoliciesOutput(v **GetResourcePoliciesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetResourcePoliciesOutput + if *v == nil { + sv = &GetResourcePoliciesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "Policies": + if err := awsAwsjson11_deserializeDocumentGetResourcePoliciesResponseEntries(&sv.Policies, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentGetServiceSettingOutput(v **GetServiceSettingOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -43707,6 +46969,51 @@ func awsAwsjson11_deserializeOpDocumentListOpsItemEventsOutput(v **ListOpsItemEv return nil } +func awsAwsjson11_deserializeOpDocumentListOpsItemRelatedItemsOutput(v **ListOpsItemRelatedItemsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListOpsItemRelatedItemsOutput + if *v == nil { + sv = &ListOpsItemRelatedItemsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "Summaries": + if err := awsAwsjson11_deserializeDocumentOpsItemRelatedItemSummaries(&sv.Summaries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentListOpsMetadataOutput(v **ListOpsMetadataOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -44033,6 +47340,55 @@ func awsAwsjson11_deserializeOpDocumentPutParameterOutput(v **PutParameterOutput return nil } +func awsAwsjson11_deserializeOpDocumentPutResourcePolicyOutput(v **PutResourcePolicyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *PutResourcePolicyOutput + if *v == nil { + sv = &PutResourcePolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PolicyHash": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyHash to be of type string, got %T instead", value) + } + sv.PolicyHash = ptr.String(jtv) + } + + case "PolicyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyId to be of type string, got %T instead", value) + } + sv.PolicyId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentRegisterDefaultPatchBaselineOutput(v **RegisterDefaultPatchBaselineOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -44634,6 +47990,47 @@ func awsAwsjson11_deserializeOpDocumentTerminateSessionOutput(v **TerminateSessi return nil } +func awsAwsjson11_deserializeOpDocumentUnlabelParameterVersionOutput(v **UnlabelParameterVersionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UnlabelParameterVersionOutput + if *v == nil { + sv = &UnlabelParameterVersionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "InvalidLabels": + if err := awsAwsjson11_deserializeDocumentParameterLabelList(&sv.InvalidLabels, value); err != nil { + return err + } + + case "RemovedLabels": + if err := awsAwsjson11_deserializeDocumentParameterLabelList(&sv.RemovedLabels, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentUpdateAssociationOutput(v **UpdateAssociationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -44872,7 +48269,7 @@ func awsAwsjson11_deserializeOpDocumentUpdateMaintenanceWindowOutput(v **UpdateM if err != nil { return err } - sv.Duration = int32(i64) + sv.Duration = ptr.Int32(int32(i64)) } case "Enabled": @@ -44921,7 +48318,7 @@ func awsAwsjson11_deserializeOpDocumentUpdateMaintenanceWindowOutput(v **UpdateM if err != nil { return err } - sv.ScheduleOffset = int32(i64) + sv.ScheduleOffset = ptr.Int32(int32(i64)) } case "ScheduleTimezone": @@ -45063,6 +48460,20 @@ func awsAwsjson11_deserializeOpDocumentUpdateMaintenanceWindowTaskOutput(v **Upd for key, value := range shape { switch key { + case "AlarmConfiguration": + if err := awsAwsjson11_deserializeDocumentAlarmConfiguration(&sv.AlarmConfiguration, value); err != nil { + return err + } + + case "CutoffBehavior": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MaintenanceWindowTaskCutoffBehavior to be of type string, got %T instead", value) + } + sv.CutoffBehavior = types.MaintenanceWindowTaskCutoffBehavior(jtv) + } + case "Description": if value != nil { jtv, ok := value.(string) @@ -45326,7 +48737,7 @@ func awsAwsjson11_deserializeOpDocumentUpdatePatchBaselineOutput(v **UpdatePatch if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } - sv.ApprovedPatchesEnableNonSecurity = jtv + sv.ApprovedPatchesEnableNonSecurity = ptr.Bool(jtv) } case "BaselineId": @@ -45340,15 +48751,18 @@ func awsAwsjson11_deserializeOpDocumentUpdatePatchBaselineOutput(v **UpdatePatch case "CreatedDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Description": @@ -45367,15 +48781,18 @@ func awsAwsjson11_deserializeOpDocumentUpdatePatchBaselineOutput(v **UpdatePatch case "ModifiedDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + } - sv.ModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) } case "Name": diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/doc.go index f8b28ba0..e546b708 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/doc.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/doc.go @@ -3,23 +3,26 @@ // Package ssm provides the API client, operations, and parameter types for Amazon // Simple Systems Manager (SSM). // -// AWS Systems Manager AWS Systems Manager is a collection of capabilities that -// helps you automate management tasks such as collecting system inventory, -// applying operating system (OS) patches, automating the creation of Amazon -// Machine Images (AMIs), and configuring operating systems (OSs) and applications -// at scale. Systems Manager lets you remotely and securely manage the -// configuration of your managed instances. A managed instance is any Amazon -// Elastic Compute Cloud instance (EC2 instance), or any on-premises server or -// virtual machine (VM) in your hybrid environment that has been configured for -// Systems Manager. This reference is intended to be used with the AWS Systems -// Manager User Guide -// (https://docs.aws.amazon.com/systems-manager/latest/userguide/). To get started, -// verify prerequisites and configure managed instances. For more information, see -// Setting up AWS Systems Manager -// (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-setting-up.html) -// in the AWS Systems Manager User Guide. For information about other API actions -// you can perform on EC2 instances, see the Amazon EC2 API Reference -// (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/). For information about -// how to use a Query API, see Making API requests -// (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/making-api-requests.html). +// Amazon Web Services Systems Manager is the operations hub for your Amazon Web +// Services applications and resources and a secure end-to-end management solution +// for hybrid cloud environments that enables safe and secure operations at scale. +// This reference is intended to be used with the Amazon Web Services Systems +// Manager User Guide (https://docs.aws.amazon.com/systems-manager/latest/userguide/) +// . To get started, see Setting up Amazon Web Services Systems Manager (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-setting-up.html) +// . Related resources +// - For information about each of the capabilities that comprise Systems +// Manager, see Systems Manager capabilities (https://docs.aws.amazon.com/systems-manager/latest/userguide/what-is-systems-manager.html#systems-manager-capabilities) +// in the Amazon Web Services Systems Manager User Guide. +// - For details about predefined runbooks for Automation, a capability of +// Amazon Web Services Systems Manager, see the Systems Manager Automation +// runbook reference (https://docs.aws.amazon.com/systems-manager-automation-runbooks/latest/userguide/automation-runbook-reference.html) +// . +// - For information about AppConfig, a capability of Systems Manager, see the +// AppConfig User Guide (https://docs.aws.amazon.com/appconfig/latest/userguide/) +// and the AppConfig API Reference (https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/) +// . +// - For information about Incident Manager, a capability of Systems Manager, +// see the Systems Manager Incident Manager User Guide (https://docs.aws.amazon.com/incident-manager/latest/userguide/) +// and the Systems Manager Incident Manager API Reference (https://docs.aws.amazon.com/incident-manager/latest/APIReference/) +// . package ssm diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/endpoints.go index ab4433ed..4cd4e2f7 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/endpoints.go @@ -8,10 +8,19 @@ 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" + "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" internalendpoints "github.com/aws/aws-sdk-go-v2/service/ssm/internal/endpoints" + smithyauth "github.com/aws/smithy-go/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" "net/url" + "os" + "strings" ) // EndpointResolverOptions is the service endpoint resolver options @@ -38,13 +47,6 @@ func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointRe return fn(region, options) } -func resolveDefaultEndpointConfiguration(o *Options) { - if o.EndpointResolver != nil { - return - } - o.EndpointResolver = NewDefaultEndpointResolver() -} - // EndpointResolverFromURL returns an EndpointResolver configured using the // provided endpoint url. By default, the resolved endpoint resolver uses the // client region as signing region, and the endpoint source is set to @@ -78,6 +80,10 @@ func (*ResolveEndpoint) ID() string { func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -87,9 +93,17 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") } + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + var endpoint aws.Endpoint - endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), m.Options) + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) if err != nil { + nf := (&aws.EndpointNotFoundError{}) + if errors.As(err, &nf) { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) + return next.HandleSerialize(ctx, in) + } return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) } @@ -124,37 +138,391 @@ func removeResolveEndpointMiddleware(stack *middleware.Stack) error { } type wrappedEndpointResolver struct { - awsResolver aws.EndpointResolver - resolver EndpointResolver + awsResolver aws.EndpointResolverWithOptions } func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { - if w.awsResolver == nil { - goto fallback + return w.awsResolver.ResolveEndpoint(ServiceID, region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, +// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked +// via its middleware. +// +// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) } - endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region) - if err == nil { - return endpoint, nil + + return &wrappedEndpointResolver{ + awsResolver: resolver, } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() - if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { - return endpoint, err + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } } -fallback: - if w.resolver == nil { - return endpoint, fmt.Errorf("default endpoint resolver provided was nil") +} + +func resolveEndpointResolverV2(options *Options) { + if options.EndpointResolverV2 == nil { + options.EndpointResolverV2 = NewDefaultEndpointResolverV2() } - return w.resolver.ResolveEndpoint(region, options) } -// withEndpointResolver returns an EndpointResolver that first delegates endpoint -// resolution to the awsResolver. If awsResolver returns aws.EndpointNotFoundError -// error, the resolver will use the the provided fallbackResolver for resolution. -// awsResolver and fallbackResolver must not be nil -func withEndpointResolver(awsResolver aws.EndpointResolver, fallbackResolver EndpointResolver) EndpointResolver { - return &wrappedEndpointResolver{ - awsResolver: awsResolver, - resolver: fallbackResolver, +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_SSM") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "SSM", cfg.ConfigSources) + if found && err == nil { + o.BaseEndpoint = &value + } +} + +// EndpointParameters provides the parameters that influence how endpoints are +// resolved. +type EndpointParameters struct { + // The AWS region used to dispatch the request. + // + // Parameter is + // required. + // + // AWS::Region + Region *string + + // When true, use the dual-stack endpoint. If the configured endpoint does not + // support dual-stack, dispatching the request MAY return an error. + // + // Defaults to + // false if no value is provided. + // + // AWS::UseDualStack + UseDualStack *bool + + // When true, send this request to the FIPS-compliant regional endpoint. If the + // configured endpoint does not have a FIPS compliant endpoint, dispatching the + // request will return an error. + // + // Defaults to false if no value is + // provided. + // + // AWS::UseFIPS + UseFIPS *bool + + // Override the endpoint used to send this request + // + // Parameter is + // required. + // + // SDK::Endpoint + Endpoint *string +} + +// ValidateRequired validates required parameters are set. +func (p EndpointParameters) ValidateRequired() error { + if p.UseDualStack == nil { + return fmt.Errorf("parameter UseDualStack is required") + } + + if p.UseFIPS == nil { + return fmt.Errorf("parameter UseFIPS is required") + } + + return nil +} + +// WithDefaults returns a shallow copy of EndpointParameterswith default values +// applied to members where applicable. +func (p EndpointParameters) WithDefaults() EndpointParameters { + if p.UseDualStack == nil { + p.UseDualStack = ptr.Bool(false) } + + if p.UseFIPS == nil { + p.UseFIPS = ptr.Bool(false) + } + return p +} + +// EndpointResolverV2 provides the interface for resolving service endpoints. +type EndpointResolverV2 interface { + // ResolveEndpoint attempts to resolve the endpoint with the provided options, + // returning the endpoint if found. Otherwise an error is returned. + ResolveEndpoint(ctx context.Context, params EndpointParameters) ( + smithyendpoints.Endpoint, error, + ) +} + +// resolver provides the implementation for resolving endpoints. +type resolver struct{} + +func NewDefaultEndpointResolverV2() EndpointResolverV2 { + return &resolver{} +} + +// ResolveEndpoint attempts to resolve the endpoint with the provided options, +// returning the endpoint if found. Otherwise an error is returned. +func (r *resolver) ResolveEndpoint( + ctx context.Context, params EndpointParameters, +) ( + endpoint smithyendpoints.Endpoint, err error, +) { + params = params.WithDefaults() + if err = params.ValidateRequired(); err != nil { + return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) + } + _UseDualStack := *params.UseDualStack + _UseFIPS := *params.UseFIPS + + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if _UseFIPS == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") + } + if _UseDualStack == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") + } + uriString := _Endpoint + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if exprVal := params.Region; exprVal != nil { + _Region := *exprVal + _ = _Region + if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { + _PartitionResult := *exprVal + _ = _PartitionResult + if _UseFIPS == true { + if _UseDualStack == true { + if true == _PartitionResult.SupportsFIPS { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://ssm-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") + } + } + if _UseFIPS == true { + if _PartitionResult.SupportsFIPS == true { + if _PartitionResult.Name == "aws-us-gov" { + uriString := func() string { + var out strings.Builder + out.WriteString("https://ssm.") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://ssm-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") + } + if _UseDualStack == true { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://ssm.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://ssm.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") +} + +type endpointParamsBinder interface { + bindEndpointParams(*EndpointParameters) +} + +func bindEndpointParams(input interface{}, options Options) *EndpointParameters { + params := &EndpointParameters{} + + params.Region = aws.String(endpoints.MapFIPSRegion(options.Region)) + params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) + params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) + params.Endpoint = options.BaseEndpoint + + if b, ok := input.(endpointParamsBinder); ok { + b.bindEndpointParams(params) + } + + return params +} + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.options.EndpointResolverV2 == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := bindEndpointParams(getOperationInput(ctx), m.options) + endpt, err := m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + if endpt.URI.RawPath == "" && req.URL.RawPath != "" { + endpt.URI.RawPath = endpt.URI.Path + } + req.URL.Scheme = endpt.URI.Scheme + req.URL.Host = endpt.URI.Host + req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) + req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) + for k := range endpt.Headers { + req.Header.Set(k, endpt.Headers.Get(k)) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) + for _, o := range opts { + rscheme.SignerProperties.SetAll(&o.SignerProperties) + } + + return next.HandleFinalize(ctx, in) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/generated.json new file mode 100644 index 00000000..b9f761a5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/generated.json @@ -0,0 +1,172 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", + "github.com/aws/smithy-go": "v1.4.0", + "github.com/google/go-cmp": "v0.5.4", + "github.com/jmespath/go-jmespath": "v0.4.0" + }, + "files": [ + "api_client.go", + "api_client_test.go", + "api_op_AddTagsToResource.go", + "api_op_AssociateOpsItemRelatedItem.go", + "api_op_CancelCommand.go", + "api_op_CancelMaintenanceWindowExecution.go", + "api_op_CreateActivation.go", + "api_op_CreateAssociation.go", + "api_op_CreateAssociationBatch.go", + "api_op_CreateDocument.go", + "api_op_CreateMaintenanceWindow.go", + "api_op_CreateOpsItem.go", + "api_op_CreateOpsMetadata.go", + "api_op_CreatePatchBaseline.go", + "api_op_CreateResourceDataSync.go", + "api_op_DeleteActivation.go", + "api_op_DeleteAssociation.go", + "api_op_DeleteDocument.go", + "api_op_DeleteInventory.go", + "api_op_DeleteMaintenanceWindow.go", + "api_op_DeleteOpsItem.go", + "api_op_DeleteOpsMetadata.go", + "api_op_DeleteParameter.go", + "api_op_DeleteParameters.go", + "api_op_DeletePatchBaseline.go", + "api_op_DeleteResourceDataSync.go", + "api_op_DeleteResourcePolicy.go", + "api_op_DeregisterManagedInstance.go", + "api_op_DeregisterPatchBaselineForPatchGroup.go", + "api_op_DeregisterTargetFromMaintenanceWindow.go", + "api_op_DeregisterTaskFromMaintenanceWindow.go", + "api_op_DescribeActivations.go", + "api_op_DescribeAssociation.go", + "api_op_DescribeAssociationExecutionTargets.go", + "api_op_DescribeAssociationExecutions.go", + "api_op_DescribeAutomationExecutions.go", + "api_op_DescribeAutomationStepExecutions.go", + "api_op_DescribeAvailablePatches.go", + "api_op_DescribeDocument.go", + "api_op_DescribeDocumentPermission.go", + "api_op_DescribeEffectiveInstanceAssociations.go", + "api_op_DescribeEffectivePatchesForPatchBaseline.go", + "api_op_DescribeInstanceAssociationsStatus.go", + "api_op_DescribeInstanceInformation.go", + "api_op_DescribeInstancePatchStates.go", + "api_op_DescribeInstancePatchStatesForPatchGroup.go", + "api_op_DescribeInstancePatches.go", + "api_op_DescribeInventoryDeletions.go", + "api_op_DescribeMaintenanceWindowExecutionTaskInvocations.go", + "api_op_DescribeMaintenanceWindowExecutionTasks.go", + "api_op_DescribeMaintenanceWindowExecutions.go", + "api_op_DescribeMaintenanceWindowSchedule.go", + "api_op_DescribeMaintenanceWindowTargets.go", + "api_op_DescribeMaintenanceWindowTasks.go", + "api_op_DescribeMaintenanceWindows.go", + "api_op_DescribeMaintenanceWindowsForTarget.go", + "api_op_DescribeOpsItems.go", + "api_op_DescribeParameters.go", + "api_op_DescribePatchBaselines.go", + "api_op_DescribePatchGroupState.go", + "api_op_DescribePatchGroups.go", + "api_op_DescribePatchProperties.go", + "api_op_DescribeSessions.go", + "api_op_DisassociateOpsItemRelatedItem.go", + "api_op_GetAutomationExecution.go", + "api_op_GetCalendarState.go", + "api_op_GetCommandInvocation.go", + "api_op_GetConnectionStatus.go", + "api_op_GetDefaultPatchBaseline.go", + "api_op_GetDeployablePatchSnapshotForInstance.go", + "api_op_GetDocument.go", + "api_op_GetInventory.go", + "api_op_GetInventorySchema.go", + "api_op_GetMaintenanceWindow.go", + "api_op_GetMaintenanceWindowExecution.go", + "api_op_GetMaintenanceWindowExecutionTask.go", + "api_op_GetMaintenanceWindowExecutionTaskInvocation.go", + "api_op_GetMaintenanceWindowTask.go", + "api_op_GetOpsItem.go", + "api_op_GetOpsMetadata.go", + "api_op_GetOpsSummary.go", + "api_op_GetParameter.go", + "api_op_GetParameterHistory.go", + "api_op_GetParameters.go", + "api_op_GetParametersByPath.go", + "api_op_GetPatchBaseline.go", + "api_op_GetPatchBaselineForPatchGroup.go", + "api_op_GetResourcePolicies.go", + "api_op_GetServiceSetting.go", + "api_op_LabelParameterVersion.go", + "api_op_ListAssociationVersions.go", + "api_op_ListAssociations.go", + "api_op_ListCommandInvocations.go", + "api_op_ListCommands.go", + "api_op_ListComplianceItems.go", + "api_op_ListComplianceSummaries.go", + "api_op_ListDocumentMetadataHistory.go", + "api_op_ListDocumentVersions.go", + "api_op_ListDocuments.go", + "api_op_ListInventoryEntries.go", + "api_op_ListOpsItemEvents.go", + "api_op_ListOpsItemRelatedItems.go", + "api_op_ListOpsMetadata.go", + "api_op_ListResourceComplianceSummaries.go", + "api_op_ListResourceDataSync.go", + "api_op_ListTagsForResource.go", + "api_op_ModifyDocumentPermission.go", + "api_op_PutComplianceItems.go", + "api_op_PutInventory.go", + "api_op_PutParameter.go", + "api_op_PutResourcePolicy.go", + "api_op_RegisterDefaultPatchBaseline.go", + "api_op_RegisterPatchBaselineForPatchGroup.go", + "api_op_RegisterTargetWithMaintenanceWindow.go", + "api_op_RegisterTaskWithMaintenanceWindow.go", + "api_op_RemoveTagsFromResource.go", + "api_op_ResetServiceSetting.go", + "api_op_ResumeSession.go", + "api_op_SendAutomationSignal.go", + "api_op_SendCommand.go", + "api_op_StartAssociationsOnce.go", + "api_op_StartAutomationExecution.go", + "api_op_StartChangeRequestExecution.go", + "api_op_StartSession.go", + "api_op_StopAutomationExecution.go", + "api_op_TerminateSession.go", + "api_op_UnlabelParameterVersion.go", + "api_op_UpdateAssociation.go", + "api_op_UpdateAssociationStatus.go", + "api_op_UpdateDocument.go", + "api_op_UpdateDocumentDefaultVersion.go", + "api_op_UpdateDocumentMetadata.go", + "api_op_UpdateMaintenanceWindow.go", + "api_op_UpdateMaintenanceWindowTarget.go", + "api_op_UpdateMaintenanceWindowTask.go", + "api_op_UpdateManagedInstanceRole.go", + "api_op_UpdateOpsItem.go", + "api_op_UpdateOpsMetadata.go", + "api_op_UpdatePatchBaseline.go", + "api_op_UpdateResourceDataSync.go", + "api_op_UpdateServiceSetting.go", + "auth.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "endpoints_config_test.go", + "endpoints_test.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "options.go", + "protocol_test.go", + "serializers.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/ssm", + "unstable": false +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/go_module_metadata.go new file mode 100644 index 00000000..9b35f7aa --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package ssm + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "1.44.7" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/internal/endpoints/endpoints.go index da5f17be..88f63256 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/internal/endpoints/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/internal/endpoints/endpoints.go @@ -4,13 +4,62 @@ package endpoints import ( "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/internal/endpoints" + endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" + "github.com/aws/smithy-go/logging" "regexp" ) // Options is the endpoint resolver configuration options type Options struct { + // Logger is a logging implementation that log events should be sent to. + Logger logging.Logger + + // LogDeprecated indicates that deprecated endpoints should be logged to the + // provided logger. + LogDeprecated bool + + // ResolvedRegion is used to override the region to be resolved, rather then the + // using the value passed to the ResolveEndpoint method. This value is used by the + // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative + // name. You must not set this value directly in your application. + ResolvedRegion string + + // DisableHTTPS informs the resolver to return an endpoint that does not use the + // HTTPS scheme. DisableHTTPS bool + + // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. + UseDualStackEndpoint aws.DualStackEndpointState + + // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. + UseFIPSEndpoint aws.FIPSEndpointState +} + +func (o Options) GetResolvedRegion() string { + return o.ResolvedRegion +} + +func (o Options) GetDisableHTTPS() bool { + return o.DisableHTTPS +} + +func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { + return o.UseDualStackEndpoint +} + +func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { + return o.UseFIPSEndpoint +} + +func transformToSharedOptions(options Options) endpoints.Options { + return endpoints.Options{ + Logger: options.Logger, + LogDeprecated: options.LogDeprecated, + ResolvedRegion: options.ResolvedRegion, + DisableHTTPS: options.DisableHTTPS, + UseDualStackEndpoint: options.UseDualStackEndpoint, + UseFIPSEndpoint: options.UseFIPSEndpoint, + } } // Resolver SSM endpoint resolver @@ -24,9 +73,7 @@ func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws return endpoint, &aws.MissingRegionError{} } - opt := endpoints.Options{ - DisableHTTPS: options.DisableHTTPS, - } + opt := transformToSharedOptions(options) return r.partitions.ResolveEndpoint(region, opt) } @@ -37,130 +84,451 @@ func New() *Resolver { } } +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsIsoE *regexp.Regexp + AwsIsoF *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), + AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + var defaultPartitions = endpoints.Partitions{ { ID: "aws", - Defaults: endpoints.Endpoint{ - Hostname: "ssm.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "ssm.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "ssm-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "ssm-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "ssm.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, }, - RegionRegex: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), + RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ - "af-south-1": endpoints.Endpoint{}, - "ap-east-1": endpoints.Endpoint{}, - "ap-northeast-1": endpoints.Endpoint{}, - "ap-northeast-2": endpoints.Endpoint{}, - "ap-south-1": endpoints.Endpoint{}, - "ap-southeast-1": endpoints.Endpoint{}, - "ap-southeast-2": endpoints.Endpoint{}, - "ca-central-1": endpoints.Endpoint{}, - "eu-central-1": endpoints.Endpoint{}, - "eu-north-1": endpoints.Endpoint{}, - "eu-south-1": endpoints.Endpoint{}, - "eu-west-1": endpoints.Endpoint{}, - "eu-west-2": endpoints.Endpoint{}, - "eu-west-3": endpoints.Endpoint{}, - "fips-ca-central-1": endpoints.Endpoint{ + endpoints.EndpointKey{ + Region: "af-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-4", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-central-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "ssm-fips.ca-central-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "ca-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "ssm-fips.ca-west-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "eu-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-north-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "fips-ca-central-1", + }: endpoints.Endpoint{ Hostname: "ssm-fips.ca-central-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "ca-central-1", }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-ca-west-1", + }: endpoints.Endpoint{ + Hostname: "ssm-fips.ca-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ca-west-1", + }, + Deprecated: aws.TrueTernary, }, - "fips-us-east-1": endpoints.Endpoint{ + endpoints.EndpointKey{ + Region: "fips-us-east-1", + }: endpoints.Endpoint{ Hostname: "ssm-fips.us-east-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-east-1", }, + Deprecated: aws.TrueTernary, }, - "fips-us-east-2": endpoints.Endpoint{ + endpoints.EndpointKey{ + Region: "fips-us-east-2", + }: endpoints.Endpoint{ Hostname: "ssm-fips.us-east-2.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-east-2", }, + Deprecated: aws.TrueTernary, }, - "fips-us-west-1": endpoints.Endpoint{ + endpoints.EndpointKey{ + Region: "fips-us-west-1", + }: endpoints.Endpoint{ Hostname: "ssm-fips.us-west-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-west-1", }, + Deprecated: aws.TrueTernary, }, - "fips-us-west-2": endpoints.Endpoint{ + endpoints.EndpointKey{ + Region: "fips-us-west-2", + }: endpoints.Endpoint{ Hostname: "ssm-fips.us-west-2.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-west-2", }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "il-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "sa-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "ssm-fips.us-east-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-east-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "ssm-fips.us-east-2.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "ssm-fips.us-west-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-west-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "ssm-fips.us-west-2.amazonaws.com", }, - "me-south-1": endpoints.Endpoint{}, - "sa-east-1": endpoints.Endpoint{}, - "us-east-1": endpoints.Endpoint{}, - "us-east-2": endpoints.Endpoint{}, - "us-west-1": endpoints.Endpoint{}, - "us-west-2": endpoints.Endpoint{}, }, }, { ID: "aws-cn", - Defaults: endpoints.Endpoint{ - Hostname: "ssm.{region}.amazonaws.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "ssm.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "ssm-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "ssm-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "ssm.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, }, - RegionRegex: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + RegionRegex: partitionRegexp.AwsCn, IsRegionalized: true, Endpoints: endpoints.Endpoints{ - "cn-north-1": endpoints.Endpoint{}, - "cn-northwest-1": endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "cn-north-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "cn-northwest-1", + }: endpoints.Endpoint{}, }, }, { ID: "aws-iso", - Defaults: endpoints.Endpoint{ - Hostname: "ssm.{region}.c2s.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "ssm-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "ssm.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, }, - RegionRegex: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + RegionRegex: partitionRegexp.AwsIso, IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-iso-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-iso-west-1", + }: endpoints.Endpoint{}, + }, }, { ID: "aws-iso-b", - Defaults: endpoints.Endpoint{ - Hostname: "ssm.{region}.sc2s.sgov.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "ssm-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "ssm.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, }, - RegionRegex: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + RegionRegex: partitionRegexp.AwsIsoB, IsRegionalized: true, Endpoints: endpoints.Endpoints{ - "us-isob-east-1": endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-isob-east-1", + }: endpoints.Endpoint{}, + }, + }, + { + ID: "aws-iso-e", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "ssm-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "ssm.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, }, + RegionRegex: partitionRegexp.AwsIsoE, + IsRegionalized: true, + }, + { + ID: "aws-iso-f", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "ssm-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "ssm.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoF, + IsRegionalized: true, }, { ID: "aws-us-gov", - Defaults: endpoints.Endpoint{ - Hostname: "ssm.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "ssm.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "ssm.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "ssm-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "ssm.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, }, - RegionRegex: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), + RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, Endpoints: endpoints.Endpoints{ - "fips-us-gov-east-1": endpoints.Endpoint{ + endpoints.EndpointKey{ + Region: "fips-us-gov-east-1", + }: endpoints.Endpoint{ Hostname: "ssm.us-gov-east-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-east-1", }, + Deprecated: aws.TrueTernary, }, - "fips-us-gov-west-1": endpoints.Endpoint{ + endpoints.EndpointKey{ + Region: "fips-us-gov-west-1", + }: endpoints.Endpoint{ Hostname: "ssm.us-gov-west-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-west-1", }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "ssm.us-gov-east-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "ssm.us-gov-west-1.amazonaws.com", }, - "us-gov-east-1": endpoints.Endpoint{}, - "us-gov-west-1": endpoints.Endpoint{}, }, }, } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/options.go new file mode 100644 index 00000000..197dfd32 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/options.go @@ -0,0 +1,221 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssm + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" +) + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // The optional application specific identifier appended to the User-Agent header. + AppID string + + // This endpoint will be given as input to an EndpointResolverV2. It is used for + // providing a custom base endpoint that is subject to modifications by the + // processing EndpointResolverV2. + BaseEndpoint *string + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + // + // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a + // value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. To migrate an EndpointResolver implementation that uses a custom + // endpoint, set the client option BaseEndpoint instead. + EndpointResolver EndpointResolver + + // Resolves the endpoint used for a particular service operation. This should be + // used over the deprecated EndpointResolver. + EndpointResolverV2 EndpointResolverV2 + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // Provides idempotency tokens values that will be automatically populated into + // idempotent API operations. + IdempotencyTokenProvider IdempotencyTokenProvider + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. If specified in an operation call's + // functional options with a value that is different than the constructed client's + // Options, the Client's Retryer will be wrapped to use the operation's specific + // RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. Currently does not support per operation call + // overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. Currently does not support per operation call + // overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient + + // The auth scheme resolver which determines how to authenticate for each + // operation. + AuthSchemeResolver AuthSchemeResolver + + // The list of auth schemes supported by the client. + AuthSchemes []smithyhttp.AuthScheme +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} + +func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { + if schemeID == "aws.auth#sigv4" { + return getSigV4IdentityResolver(o) + } + if schemeID == "smithy.api#noAuth" { + return &smithyauth.AnonymousIdentityResolver{} + } + return nil +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for +// this field will likely prevent you from using any endpoint-related service +// features released after the introduction of EndpointResolverV2 and BaseEndpoint. +// To migrate an EndpointResolver implementation that uses a custom endpoint, set +// the client option BaseEndpoint instead. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +// WithEndpointResolverV2 returns a functional option for setting the Client's +// EndpointResolverV2 option. +func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { + return func(o *Options) { + o.EndpointResolverV2 = v + } +} + +func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { + if o.Credentials != nil { + return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} + } + return nil +} + +// WithSigV4SigningName applies an override to the authentication workflow to +// use the given signing name for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing name from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningName(name string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), + middleware.Before, + ) + }) + } +} + +// WithSigV4SigningRegion applies an override to the authentication workflow to +// use the given signing region for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing region from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningRegion(region string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), + middleware.Before, + ) + }) + } +} + +func ignoreAnonymousAuth(options *Options) { + if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { + options.Credentials = nil + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/serializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/serializers.go index b921f054..9e3ab946 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/serializers.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/serializers.go @@ -13,6 +13,7 @@ import ( "github.com/aws/smithy-go/middleware" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" + "path" ) type awsAwsjson11_serializeOpAddTagsToResource struct { @@ -36,7 +37,15 @@ func (m *awsAwsjson11_serializeOpAddTagsToResource) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -62,6 +71,61 @@ func (m *awsAwsjson11_serializeOpAddTagsToResource) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpAssociateOpsItemRelatedItem struct { +} + +func (*awsAwsjson11_serializeOpAssociateOpsItemRelatedItem) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpAssociateOpsItemRelatedItem) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*AssociateOpsItemRelatedItemInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSSM.AssociateOpsItemRelatedItem") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentAssociateOpsItemRelatedItemInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpCancelCommand struct { } @@ -83,7 +147,15 @@ func (m *awsAwsjson11_serializeOpCancelCommand) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -130,7 +202,15 @@ func (m *awsAwsjson11_serializeOpCancelMaintenanceWindowExecution) HandleSeriali return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -177,7 +257,15 @@ func (m *awsAwsjson11_serializeOpCreateActivation) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -224,7 +312,15 @@ func (m *awsAwsjson11_serializeOpCreateAssociation) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -271,7 +367,15 @@ func (m *awsAwsjson11_serializeOpCreateAssociationBatch) HandleSerialize(ctx con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -318,7 +422,15 @@ func (m *awsAwsjson11_serializeOpCreateDocument) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -365,7 +477,15 @@ func (m *awsAwsjson11_serializeOpCreateMaintenanceWindow) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -412,7 +532,15 @@ func (m *awsAwsjson11_serializeOpCreateOpsItem) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -459,7 +587,15 @@ func (m *awsAwsjson11_serializeOpCreateOpsMetadata) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -506,7 +642,15 @@ func (m *awsAwsjson11_serializeOpCreatePatchBaseline) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -553,7 +697,15 @@ func (m *awsAwsjson11_serializeOpCreateResourceDataSync) HandleSerialize(ctx con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -600,7 +752,15 @@ func (m *awsAwsjson11_serializeOpDeleteActivation) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -647,7 +807,15 @@ func (m *awsAwsjson11_serializeOpDeleteAssociation) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -694,7 +862,15 @@ func (m *awsAwsjson11_serializeOpDeleteDocument) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -741,7 +917,15 @@ func (m *awsAwsjson11_serializeOpDeleteInventory) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -788,7 +972,15 @@ func (m *awsAwsjson11_serializeOpDeleteMaintenanceWindow) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -814,6 +1006,61 @@ func (m *awsAwsjson11_serializeOpDeleteMaintenanceWindow) HandleSerialize(ctx co return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDeleteOpsItem struct { +} + +func (*awsAwsjson11_serializeOpDeleteOpsItem) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteOpsItem) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteOpsItemInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSSM.DeleteOpsItem") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteOpsItemInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpDeleteOpsMetadata struct { } @@ -835,7 +1082,15 @@ func (m *awsAwsjson11_serializeOpDeleteOpsMetadata) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -882,7 +1137,15 @@ func (m *awsAwsjson11_serializeOpDeleteParameter) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -929,7 +1192,15 @@ func (m *awsAwsjson11_serializeOpDeleteParameters) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -976,7 +1247,15 @@ func (m *awsAwsjson11_serializeOpDeletePatchBaseline) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -1023,7 +1302,15 @@ func (m *awsAwsjson11_serializeOpDeleteResourceDataSync) HandleSerialize(ctx con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -1049,6 +1336,61 @@ func (m *awsAwsjson11_serializeOpDeleteResourceDataSync) HandleSerialize(ctx con return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDeleteResourcePolicy struct { +} + +func (*awsAwsjson11_serializeOpDeleteResourcePolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteResourcePolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSSM.DeleteResourcePolicy") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteResourcePolicyInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpDeregisterManagedInstance struct { } @@ -1070,7 +1412,15 @@ func (m *awsAwsjson11_serializeOpDeregisterManagedInstance) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -1117,7 +1467,15 @@ func (m *awsAwsjson11_serializeOpDeregisterPatchBaselineForPatchGroup) HandleSer return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -1164,7 +1522,15 @@ func (m *awsAwsjson11_serializeOpDeregisterTargetFromMaintenanceWindow) HandleSe return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -1211,7 +1577,15 @@ func (m *awsAwsjson11_serializeOpDeregisterTaskFromMaintenanceWindow) HandleSeri return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -1258,7 +1632,15 @@ func (m *awsAwsjson11_serializeOpDescribeActivations) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -1305,7 +1687,15 @@ func (m *awsAwsjson11_serializeOpDescribeAssociation) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -1352,7 +1742,15 @@ func (m *awsAwsjson11_serializeOpDescribeAssociationExecutions) HandleSerialize( return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -1399,7 +1797,15 @@ func (m *awsAwsjson11_serializeOpDescribeAssociationExecutionTargets) HandleSeri return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -1446,7 +1852,15 @@ func (m *awsAwsjson11_serializeOpDescribeAutomationExecutions) HandleSerialize(c return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -1493,7 +1907,15 @@ func (m *awsAwsjson11_serializeOpDescribeAutomationStepExecutions) HandleSeriali return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -1540,7 +1962,15 @@ func (m *awsAwsjson11_serializeOpDescribeAvailablePatches) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -1587,7 +2017,15 @@ func (m *awsAwsjson11_serializeOpDescribeDocument) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -1634,7 +2072,15 @@ func (m *awsAwsjson11_serializeOpDescribeDocumentPermission) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -1681,7 +2127,15 @@ func (m *awsAwsjson11_serializeOpDescribeEffectiveInstanceAssociations) HandleSe return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -1728,7 +2182,15 @@ func (m *awsAwsjson11_serializeOpDescribeEffectivePatchesForPatchBaseline) Handl return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -1775,7 +2237,15 @@ func (m *awsAwsjson11_serializeOpDescribeInstanceAssociationsStatus) HandleSeria return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -1822,7 +2292,15 @@ func (m *awsAwsjson11_serializeOpDescribeInstanceInformation) HandleSerialize(ct return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -1869,7 +2347,15 @@ func (m *awsAwsjson11_serializeOpDescribeInstancePatches) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -1916,7 +2402,15 @@ func (m *awsAwsjson11_serializeOpDescribeInstancePatchStates) HandleSerialize(ct return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -1963,7 +2457,15 @@ func (m *awsAwsjson11_serializeOpDescribeInstancePatchStatesForPatchGroup) Handl return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -2010,7 +2512,15 @@ func (m *awsAwsjson11_serializeOpDescribeInventoryDeletions) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -2057,7 +2567,15 @@ func (m *awsAwsjson11_serializeOpDescribeMaintenanceWindowExecutions) HandleSeri return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -2104,7 +2622,15 @@ func (m *awsAwsjson11_serializeOpDescribeMaintenanceWindowExecutionTaskInvocatio return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -2151,7 +2677,15 @@ func (m *awsAwsjson11_serializeOpDescribeMaintenanceWindowExecutionTasks) Handle return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -2198,7 +2732,15 @@ func (m *awsAwsjson11_serializeOpDescribeMaintenanceWindows) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -2245,7 +2787,15 @@ func (m *awsAwsjson11_serializeOpDescribeMaintenanceWindowSchedule) HandleSerial return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -2292,7 +2842,15 @@ func (m *awsAwsjson11_serializeOpDescribeMaintenanceWindowsForTarget) HandleSeri return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -2339,7 +2897,15 @@ func (m *awsAwsjson11_serializeOpDescribeMaintenanceWindowTargets) HandleSeriali return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -2386,7 +2952,15 @@ func (m *awsAwsjson11_serializeOpDescribeMaintenanceWindowTasks) HandleSerialize return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -2433,7 +3007,15 @@ func (m *awsAwsjson11_serializeOpDescribeOpsItems) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -2480,7 +3062,15 @@ func (m *awsAwsjson11_serializeOpDescribeParameters) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -2527,7 +3117,15 @@ func (m *awsAwsjson11_serializeOpDescribePatchBaselines) HandleSerialize(ctx con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -2574,7 +3172,15 @@ func (m *awsAwsjson11_serializeOpDescribePatchGroups) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -2621,7 +3227,15 @@ func (m *awsAwsjson11_serializeOpDescribePatchGroupState) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -2668,7 +3282,15 @@ func (m *awsAwsjson11_serializeOpDescribePatchProperties) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -2715,7 +3337,15 @@ func (m *awsAwsjson11_serializeOpDescribeSessions) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -2741,14 +3371,14 @@ func (m *awsAwsjson11_serializeOpDescribeSessions) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpGetAutomationExecution struct { +type awsAwsjson11_serializeOpDisassociateOpsItemRelatedItem struct { } -func (*awsAwsjson11_serializeOpGetAutomationExecution) ID() string { +func (*awsAwsjson11_serializeOpDisassociateOpsItemRelatedItem) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpGetAutomationExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDisassociateOpsItemRelatedItem) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2756,23 +3386,31 @@ func (m *awsAwsjson11_serializeOpGetAutomationExecution) HandleSerialize(ctx con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetAutomationExecutionInput) + input, ok := in.Parameters.(*DisassociateOpsItemRelatedItemInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSSM.GetAutomationExecution") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSSM.DisassociateOpsItemRelatedItem") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetAutomationExecutionInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDisassociateOpsItemRelatedItemInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2788,14 +3426,69 @@ func (m *awsAwsjson11_serializeOpGetAutomationExecution) HandleSerialize(ctx con return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpGetCalendarState struct { +type awsAwsjson11_serializeOpGetAutomationExecution struct { } -func (*awsAwsjson11_serializeOpGetCalendarState) ID() string { +func (*awsAwsjson11_serializeOpGetAutomationExecution) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpGetCalendarState) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpGetAutomationExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetAutomationExecutionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSSM.GetAutomationExecution") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetAutomationExecutionInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpGetCalendarState struct { +} + +func (*awsAwsjson11_serializeOpGetCalendarState) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetCalendarState) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2809,7 +3502,15 @@ func (m *awsAwsjson11_serializeOpGetCalendarState) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -2856,7 +3557,15 @@ func (m *awsAwsjson11_serializeOpGetCommandInvocation) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -2903,7 +3612,15 @@ func (m *awsAwsjson11_serializeOpGetConnectionStatus) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -2950,7 +3667,15 @@ func (m *awsAwsjson11_serializeOpGetDefaultPatchBaseline) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -2997,7 +3722,15 @@ func (m *awsAwsjson11_serializeOpGetDeployablePatchSnapshotForInstance) HandleSe return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -3044,7 +3777,15 @@ func (m *awsAwsjson11_serializeOpGetDocument) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -3091,7 +3832,15 @@ func (m *awsAwsjson11_serializeOpGetInventory) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -3138,7 +3887,15 @@ func (m *awsAwsjson11_serializeOpGetInventorySchema) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -3185,7 +3942,15 @@ func (m *awsAwsjson11_serializeOpGetMaintenanceWindow) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -3232,7 +3997,15 @@ func (m *awsAwsjson11_serializeOpGetMaintenanceWindowExecution) HandleSerialize( return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -3279,7 +4052,15 @@ func (m *awsAwsjson11_serializeOpGetMaintenanceWindowExecutionTask) HandleSerial return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -3326,7 +4107,15 @@ func (m *awsAwsjson11_serializeOpGetMaintenanceWindowExecutionTaskInvocation) Ha return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -3373,7 +4162,15 @@ func (m *awsAwsjson11_serializeOpGetMaintenanceWindowTask) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -3420,7 +4217,15 @@ func (m *awsAwsjson11_serializeOpGetOpsItem) HandleSerialize(ctx context.Context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -3467,7 +4272,15 @@ func (m *awsAwsjson11_serializeOpGetOpsMetadata) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -3514,7 +4327,15 @@ func (m *awsAwsjson11_serializeOpGetOpsSummary) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -3561,7 +4382,15 @@ func (m *awsAwsjson11_serializeOpGetParameter) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -3608,7 +4437,15 @@ func (m *awsAwsjson11_serializeOpGetParameterHistory) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -3655,7 +4492,15 @@ func (m *awsAwsjson11_serializeOpGetParameters) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -3702,7 +4547,15 @@ func (m *awsAwsjson11_serializeOpGetParametersByPath) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -3749,7 +4602,15 @@ func (m *awsAwsjson11_serializeOpGetPatchBaseline) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -3796,7 +4657,15 @@ func (m *awsAwsjson11_serializeOpGetPatchBaselineForPatchGroup) HandleSerialize( return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -3822,6 +4691,61 @@ func (m *awsAwsjson11_serializeOpGetPatchBaselineForPatchGroup) HandleSerialize( return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpGetResourcePolicies struct { +} + +func (*awsAwsjson11_serializeOpGetResourcePolicies) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetResourcePolicies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetResourcePoliciesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSSM.GetResourcePolicies") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetResourcePoliciesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpGetServiceSetting struct { } @@ -3843,7 +4767,15 @@ func (m *awsAwsjson11_serializeOpGetServiceSetting) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -3890,7 +4822,15 @@ func (m *awsAwsjson11_serializeOpLabelParameterVersion) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -3937,7 +4877,15 @@ func (m *awsAwsjson11_serializeOpListAssociations) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -3984,7 +4932,15 @@ func (m *awsAwsjson11_serializeOpListAssociationVersions) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -4031,7 +4987,15 @@ func (m *awsAwsjson11_serializeOpListCommandInvocations) HandleSerialize(ctx con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -4078,7 +5042,15 @@ func (m *awsAwsjson11_serializeOpListCommands) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -4125,7 +5097,15 @@ func (m *awsAwsjson11_serializeOpListComplianceItems) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -4172,7 +5152,15 @@ func (m *awsAwsjson11_serializeOpListComplianceSummaries) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -4219,7 +5207,15 @@ func (m *awsAwsjson11_serializeOpListDocumentMetadataHistory) HandleSerialize(ct return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -4266,7 +5262,15 @@ func (m *awsAwsjson11_serializeOpListDocuments) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -4313,7 +5317,15 @@ func (m *awsAwsjson11_serializeOpListDocumentVersions) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -4360,7 +5372,15 @@ func (m *awsAwsjson11_serializeOpListInventoryEntries) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -4407,7 +5427,15 @@ func (m *awsAwsjson11_serializeOpListOpsItemEvents) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -4433,6 +5461,61 @@ func (m *awsAwsjson11_serializeOpListOpsItemEvents) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpListOpsItemRelatedItems struct { +} + +func (*awsAwsjson11_serializeOpListOpsItemRelatedItems) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListOpsItemRelatedItems) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListOpsItemRelatedItemsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSSM.ListOpsItemRelatedItems") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListOpsItemRelatedItemsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpListOpsMetadata struct { } @@ -4454,7 +5537,15 @@ func (m *awsAwsjson11_serializeOpListOpsMetadata) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -4501,7 +5592,15 @@ func (m *awsAwsjson11_serializeOpListResourceComplianceSummaries) HandleSerializ return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -4548,7 +5647,15 @@ func (m *awsAwsjson11_serializeOpListResourceDataSync) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -4595,7 +5702,15 @@ func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -4642,7 +5757,15 @@ func (m *awsAwsjson11_serializeOpModifyDocumentPermission) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -4689,7 +5812,15 @@ func (m *awsAwsjson11_serializeOpPutComplianceItems) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -4736,7 +5867,15 @@ func (m *awsAwsjson11_serializeOpPutInventory) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -4783,7 +5922,15 @@ func (m *awsAwsjson11_serializeOpPutParameter) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -4809,6 +5956,61 @@ func (m *awsAwsjson11_serializeOpPutParameter) HandleSerialize(ctx context.Conte return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpPutResourcePolicy struct { +} + +func (*awsAwsjson11_serializeOpPutResourcePolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpPutResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutResourcePolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSSM.PutResourcePolicy") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentPutResourcePolicyInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpRegisterDefaultPatchBaseline struct { } @@ -4830,7 +6032,15 @@ func (m *awsAwsjson11_serializeOpRegisterDefaultPatchBaseline) HandleSerialize(c return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -4877,7 +6087,15 @@ func (m *awsAwsjson11_serializeOpRegisterPatchBaselineForPatchGroup) HandleSeria return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -4924,7 +6142,15 @@ func (m *awsAwsjson11_serializeOpRegisterTargetWithMaintenanceWindow) HandleSeri return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -4971,7 +6197,15 @@ func (m *awsAwsjson11_serializeOpRegisterTaskWithMaintenanceWindow) HandleSerial return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -5018,7 +6252,15 @@ func (m *awsAwsjson11_serializeOpRemoveTagsFromResource) HandleSerialize(ctx con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -5065,7 +6307,15 @@ func (m *awsAwsjson11_serializeOpResetServiceSetting) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -5112,7 +6362,15 @@ func (m *awsAwsjson11_serializeOpResumeSession) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -5159,7 +6417,15 @@ func (m *awsAwsjson11_serializeOpSendAutomationSignal) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -5206,7 +6472,15 @@ func (m *awsAwsjson11_serializeOpSendCommand) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -5253,7 +6527,15 @@ func (m *awsAwsjson11_serializeOpStartAssociationsOnce) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -5300,7 +6582,15 @@ func (m *awsAwsjson11_serializeOpStartAutomationExecution) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -5347,7 +6637,15 @@ func (m *awsAwsjson11_serializeOpStartChangeRequestExecution) HandleSerialize(ct return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -5394,7 +6692,15 @@ func (m *awsAwsjson11_serializeOpStartSession) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -5441,7 +6747,15 @@ func (m *awsAwsjson11_serializeOpStopAutomationExecution) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -5488,7 +6802,15 @@ func (m *awsAwsjson11_serializeOpTerminateSession) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -5514,6 +6836,61 @@ func (m *awsAwsjson11_serializeOpTerminateSession) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpUnlabelParameterVersion struct { +} + +func (*awsAwsjson11_serializeOpUnlabelParameterVersion) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUnlabelParameterVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UnlabelParameterVersionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSSM.UnlabelParameterVersion") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUnlabelParameterVersionInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpUpdateAssociation struct { } @@ -5535,7 +6912,15 @@ func (m *awsAwsjson11_serializeOpUpdateAssociation) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -5582,7 +6967,15 @@ func (m *awsAwsjson11_serializeOpUpdateAssociationStatus) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -5629,7 +7022,15 @@ func (m *awsAwsjson11_serializeOpUpdateDocument) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -5676,7 +7077,15 @@ func (m *awsAwsjson11_serializeOpUpdateDocumentDefaultVersion) HandleSerialize(c return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -5723,7 +7132,15 @@ func (m *awsAwsjson11_serializeOpUpdateDocumentMetadata) HandleSerialize(ctx con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -5770,7 +7187,15 @@ func (m *awsAwsjson11_serializeOpUpdateMaintenanceWindow) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -5817,7 +7242,15 @@ func (m *awsAwsjson11_serializeOpUpdateMaintenanceWindowTarget) HandleSerialize( return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -5864,7 +7297,15 @@ func (m *awsAwsjson11_serializeOpUpdateMaintenanceWindowTask) HandleSerialize(ct return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -5911,7 +7352,15 @@ func (m *awsAwsjson11_serializeOpUpdateManagedInstanceRole) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -5958,7 +7407,15 @@ func (m *awsAwsjson11_serializeOpUpdateOpsItem) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -6005,7 +7462,15 @@ func (m *awsAwsjson11_serializeOpUpdateOpsMetadata) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -6052,7 +7517,15 @@ func (m *awsAwsjson11_serializeOpUpdatePatchBaseline) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -6099,7 +7572,15 @@ func (m *awsAwsjson11_serializeOpUpdateResourceDataSync) HandleSerialize(ctx con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -6146,7 +7627,15 @@ func (m *awsAwsjson11_serializeOpUpdateServiceSetting) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -6193,6 +7682,50 @@ func awsAwsjson11_serializeDocumentAccounts(v []string, value smithyjson.Value) return nil } +func awsAwsjson11_serializeDocumentAlarm(v *types.Alarm, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + return nil +} + +func awsAwsjson11_serializeDocumentAlarmConfiguration(v *types.AlarmConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Alarms != nil { + ok := object.Key("Alarms") + if err := awsAwsjson11_serializeDocumentAlarmList(v.Alarms, ok); err != nil { + return err + } + } + + if v.IgnorePollAlarmFailure { + ok := object.Key("IgnorePollAlarmFailure") + ok.Boolean(v.IgnorePollAlarmFailure) + } + + return nil +} + +func awsAwsjson11_serializeDocumentAlarmList(v []types.Alarm, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentAlarm(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsjson11_serializeDocumentAssociationExecutionFilter(v *types.AssociationExecutionFilter, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -6403,44 +7936,106 @@ func awsAwsjson11_serializeDocumentAutomationExecutionFilterList(v []types.Autom return err } } - return nil -} - -func awsAwsjson11_serializeDocumentAutomationExecutionFilterValueList(v []string, value smithyjson.Value) error { - array := value.Array() - defer array.Close() + return nil +} + +func awsAwsjson11_serializeDocumentAutomationExecutionFilterValueList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentAutomationParameterMap(v map[string][]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + if vv := v[key]; vv == nil { + continue + } + if err := awsAwsjson11_serializeDocumentAutomationParameterValueList(v[key], om); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentAutomationParameterValueList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentBaselineOverride(v *types.BaselineOverride, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ApprovalRules != nil { + ok := object.Key("ApprovalRules") + if err := awsAwsjson11_serializeDocumentPatchRuleGroup(v.ApprovalRules, ok); err != nil { + return err + } + } + + if v.ApprovedPatches != nil { + ok := object.Key("ApprovedPatches") + if err := awsAwsjson11_serializeDocumentPatchIdList(v.ApprovedPatches, ok); err != nil { + return err + } + } + + if len(v.ApprovedPatchesComplianceLevel) > 0 { + ok := object.Key("ApprovedPatchesComplianceLevel") + ok.String(string(v.ApprovedPatchesComplianceLevel)) + } + + if v.ApprovedPatchesEnableNonSecurity { + ok := object.Key("ApprovedPatchesEnableNonSecurity") + ok.Boolean(v.ApprovedPatchesEnableNonSecurity) + } + + if v.GlobalFilters != nil { + ok := object.Key("GlobalFilters") + if err := awsAwsjson11_serializeDocumentPatchFilterGroup(v.GlobalFilters, ok); err != nil { + return err + } + } - for i := range v { - av := array.Value() - av.String(v[i]) + if len(v.OperatingSystem) > 0 { + ok := object.Key("OperatingSystem") + ok.String(string(v.OperatingSystem)) } - return nil -} - -func awsAwsjson11_serializeDocumentAutomationParameterMap(v map[string][]string, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - for key := range v { - om := object.Key(key) - if vv := v[key]; vv == nil { - continue - } - if err := awsAwsjson11_serializeDocumentAutomationParameterValueList(v[key], om); err != nil { + if v.RejectedPatches != nil { + ok := object.Key("RejectedPatches") + if err := awsAwsjson11_serializeDocumentPatchIdList(v.RejectedPatches, ok); err != nil { return err } } - return nil -} -func awsAwsjson11_serializeDocumentAutomationParameterValueList(v []string, value smithyjson.Value) error { - array := value.Array() - defer array.Close() + if len(v.RejectedPatchesAction) > 0 { + ok := object.Key("RejectedPatchesAction") + ok.String(string(v.RejectedPatchesAction)) + } - for i := range v { - av := array.Value() - av.String(v[i]) + if v.Sources != nil { + ok := object.Key("Sources") + if err := awsAwsjson11_serializeDocumentPatchSourceList(v.Sources, ok); err != nil { + return err + } } + return nil } @@ -6669,6 +8264,13 @@ func awsAwsjson11_serializeDocumentCreateAssociationBatchRequestEntry(v *types.C object := value.Object() defer object.Close() + if v.AlarmConfiguration != nil { + ok := object.Key("AlarmConfiguration") + if err := awsAwsjson11_serializeDocumentAlarmConfiguration(v.AlarmConfiguration, ok); err != nil { + return err + } + } + if v.ApplyOnlyAtCronInterval { ok := object.Key("ApplyOnlyAtCronInterval") ok.Boolean(v.ApplyOnlyAtCronInterval) @@ -6684,6 +8286,13 @@ func awsAwsjson11_serializeDocumentCreateAssociationBatchRequestEntry(v *types.C ok.String(*v.AutomationTargetParameterName) } + if v.CalendarNames != nil { + ok := object.Key("CalendarNames") + if err := awsAwsjson11_serializeDocumentCalendarNameOrARNList(v.CalendarNames, ok); err != nil { + return err + } + } + if len(v.ComplianceSeverity) > 0 { ok := object.Key("ComplianceSeverity") ok.String(string(v.ComplianceSeverity)) @@ -6733,6 +8342,11 @@ func awsAwsjson11_serializeDocumentCreateAssociationBatchRequestEntry(v *types.C ok.String(*v.ScheduleExpression) } + if v.ScheduleOffset != nil { + ok := object.Key("ScheduleOffset") + ok.Integer(*v.ScheduleOffset) + } + if len(v.SyncCompliance) > 0 { ok := object.Key("SyncCompliance") ok.String(string(v.SyncCompliance)) @@ -6745,6 +8359,13 @@ func awsAwsjson11_serializeDocumentCreateAssociationBatchRequestEntry(v *types.C } } + if v.TargetMaps != nil { + ok := object.Key("TargetMaps") + if err := awsAwsjson11_serializeDocumentTargetMaps(v.TargetMaps, ok); err != nil { + return err + } + } + if v.Targets != nil { ok := object.Key("Targets") if err := awsAwsjson11_serializeDocumentTargets(v.Targets, ok); err != nil { @@ -6869,11 +8490,21 @@ func awsAwsjson11_serializeDocumentDocumentRequires(v *types.DocumentRequires, v ok.String(*v.Name) } + if v.RequireType != nil { + ok := object.Key("RequireType") + ok.String(*v.RequireType) + } + if v.Version != nil { ok := object.Key("Version") ok.String(*v.Version) } + if v.VersionName != nil { + ok := object.Key("VersionName") + ok.String(*v.VersionName) + } + return nil } @@ -7475,9 +9106,9 @@ func awsAwsjson11_serializeDocumentMaintenanceWindowRunCommandParameters(v *type ok.String(*v.ServiceRoleArn) } - if v.TimeoutSeconds != 0 { + if v.TimeoutSeconds != nil { ok := object.Key("TimeoutSeconds") - ok.Integer(v.TimeoutSeconds) + ok.Integer(*v.TimeoutSeconds) } return nil @@ -7924,6 +9555,54 @@ func awsAwsjson11_serializeDocumentOpsItemOpsDataKeysList(v []string, value smit return nil } +func awsAwsjson11_serializeDocumentOpsItemRelatedItemsFilter(v *types.OpsItemRelatedItemsFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Key) > 0 { + ok := object.Key("Key") + ok.String(string(v.Key)) + } + + if len(v.Operator) > 0 { + ok := object.Key("Operator") + ok.String(string(v.Operator)) + } + + if v.Values != nil { + ok := object.Key("Values") + if err := awsAwsjson11_serializeDocumentOpsItemRelatedItemsFilterValues(v.Values, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentOpsItemRelatedItemsFilters(v []types.OpsItemRelatedItemsFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentOpsItemRelatedItemsFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentOpsItemRelatedItemsFilterValues(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsAwsjson11_serializeDocumentOpsMetadataFilter(v *types.OpsMetadataFilter, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -8247,9 +9926,9 @@ func awsAwsjson11_serializeDocumentPatchRule(v *types.PatchRule, value smithyjso object := value.Object() defer object.Close() - if v.ApproveAfterDays != 0 { + if v.ApproveAfterDays != nil { ok := object.Key("ApproveAfterDays") - ok.Integer(v.ApproveAfterDays) + ok.Integer(*v.ApproveAfterDays) } if v.ApproveUntilDate != nil { @@ -8262,9 +9941,9 @@ func awsAwsjson11_serializeDocumentPatchRule(v *types.PatchRule, value smithyjso ok.String(string(v.ComplianceLevel)) } - if v.EnableNonSecurity { + if v.EnableNonSecurity != nil { ok := object.Key("EnableNonSecurity") - ok.Boolean(v.EnableNonSecurity) + ok.Boolean(*v.EnableNonSecurity) } if v.PatchFilterGroup != nil { @@ -8363,6 +10042,36 @@ func awsAwsjson11_serializeDocumentRegions(v []string, value smithyjson.Value) e return nil } +func awsAwsjson11_serializeDocumentRegistrationMetadataItem(v *types.RegistrationMetadataItem, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Key != nil { + ok := object.Key("Key") + ok.String(*v.Key) + } + + if v.Value != nil { + ok := object.Key("Value") + ok.String(*v.Value) + } + + return nil +} + +func awsAwsjson11_serializeDocumentRegistrationMetadataList(v []types.RegistrationMetadataItem, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentRegistrationMetadataItem(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsjson11_serializeDocumentRelatedOpsItem(v *types.RelatedOpsItem, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -8494,6 +10203,11 @@ func awsAwsjson11_serializeDocumentResourceDataSyncSource(v *types.ResourceDataS } } + if v.EnableAllOpsDataSources { + ok := object.Key("EnableAllOpsDataSources") + ok.Boolean(v.EnableAllOpsDataSources) + } + if v.IncludeFutureRegions { ok := object.Key("IncludeFutureRegions") ok.Boolean(v.IncludeFutureRegions) @@ -8588,6 +10302,13 @@ func awsAwsjson11_serializeDocumentRunbook(v *types.Runbook, value smithyjson.Va } } + if v.TargetMaps != nil { + ok := object.Key("TargetMaps") + if err := awsAwsjson11_serializeDocumentTargetMaps(v.TargetMaps, ok); err != nil { + return err + } + } + if v.TargetParameterName != nil { ok := object.Key("TargetParameterName") ok.String(*v.TargetParameterName) @@ -8821,6 +10542,13 @@ func awsAwsjson11_serializeDocumentTargetLocation(v *types.TargetLocation, value } } + if v.TargetLocationAlarmConfiguration != nil { + ok := object.Key("TargetLocationAlarmConfiguration") + if err := awsAwsjson11_serializeDocumentAlarmConfiguration(v.TargetLocationAlarmConfiguration, ok); err != nil { + return err + } + } + if v.TargetLocationMaxConcurrency != nil { ok := object.Key("TargetLocationMaxConcurrency") ok.String(*v.TargetLocationMaxConcurrency) @@ -8938,6 +10666,33 @@ func awsAwsjson11_serializeOpDocumentAddTagsToResourceInput(v *AddTagsToResource return nil } +func awsAwsjson11_serializeOpDocumentAssociateOpsItemRelatedItemInput(v *AssociateOpsItemRelatedItemInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AssociationType != nil { + ok := object.Key("AssociationType") + ok.String(*v.AssociationType) + } + + if v.OpsItemId != nil { + ok := object.Key("OpsItemId") + ok.String(*v.OpsItemId) + } + + if v.ResourceType != nil { + ok := object.Key("ResourceType") + ok.String(*v.ResourceType) + } + + if v.ResourceUri != nil { + ok := object.Key("ResourceUri") + ok.String(*v.ResourceUri) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentCancelCommandInput(v *CancelCommandInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -8993,9 +10748,16 @@ func awsAwsjson11_serializeOpDocumentCreateActivationInput(v *CreateActivationIn ok.String(*v.IamRole) } - if v.RegistrationLimit != 0 { + if v.RegistrationLimit != nil { ok := object.Key("RegistrationLimit") - ok.Integer(v.RegistrationLimit) + ok.Integer(*v.RegistrationLimit) + } + + if v.RegistrationMetadata != nil { + ok := object.Key("RegistrationMetadata") + if err := awsAwsjson11_serializeDocumentRegistrationMetadataList(v.RegistrationMetadata, ok); err != nil { + return err + } } if v.Tags != nil { @@ -9026,6 +10788,13 @@ func awsAwsjson11_serializeOpDocumentCreateAssociationInput(v *CreateAssociation object := value.Object() defer object.Close() + if v.AlarmConfiguration != nil { + ok := object.Key("AlarmConfiguration") + if err := awsAwsjson11_serializeDocumentAlarmConfiguration(v.AlarmConfiguration, ok); err != nil { + return err + } + } + if v.ApplyOnlyAtCronInterval { ok := object.Key("ApplyOnlyAtCronInterval") ok.Boolean(v.ApplyOnlyAtCronInterval) @@ -9041,6 +10810,13 @@ func awsAwsjson11_serializeOpDocumentCreateAssociationInput(v *CreateAssociation ok.String(*v.AutomationTargetParameterName) } + if v.CalendarNames != nil { + ok := object.Key("CalendarNames") + if err := awsAwsjson11_serializeDocumentCalendarNameOrARNList(v.CalendarNames, ok); err != nil { + return err + } + } + if len(v.ComplianceSeverity) > 0 { ok := object.Key("ComplianceSeverity") ok.String(string(v.ComplianceSeverity)) @@ -9090,11 +10866,23 @@ func awsAwsjson11_serializeOpDocumentCreateAssociationInput(v *CreateAssociation ok.String(*v.ScheduleExpression) } + if v.ScheduleOffset != nil { + ok := object.Key("ScheduleOffset") + ok.Integer(*v.ScheduleOffset) + } + if len(v.SyncCompliance) > 0 { ok := object.Key("SyncCompliance") ok.String(string(v.SyncCompliance)) } + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + if v.TargetLocations != nil { ok := object.Key("TargetLocations") if err := awsAwsjson11_serializeDocumentTargetLocations(v.TargetLocations, ok); err != nil { @@ -9102,6 +10890,13 @@ func awsAwsjson11_serializeOpDocumentCreateAssociationInput(v *CreateAssociation } } + if v.TargetMaps != nil { + ok := object.Key("TargetMaps") + if err := awsAwsjson11_serializeDocumentTargetMaps(v.TargetMaps, ok); err != nil { + return err + } + } + if v.Targets != nil { ok := object.Key("Targets") if err := awsAwsjson11_serializeDocumentTargets(v.Targets, ok); err != nil { @@ -9128,6 +10923,11 @@ func awsAwsjson11_serializeOpDocumentCreateDocumentInput(v *CreateDocumentInput, ok.String(*v.Content) } + if v.DisplayName != nil { + ok := object.Key("DisplayName") + ok.String(*v.DisplayName) + } + if len(v.DocumentFormat) > 0 { ok := object.Key("DocumentFormat") ok.String(string(v.DocumentFormat)) @@ -9174,7 +10974,7 @@ func awsAwsjson11_serializeOpDocumentCreateMaintenanceWindowInput(v *CreateMaint object := value.Object() defer object.Close() - if v.AllowUnassociatedTargets { + { ok := object.Key("AllowUnassociatedTargets") ok.Boolean(v.AllowUnassociatedTargets) } @@ -9184,7 +10984,7 @@ func awsAwsjson11_serializeOpDocumentCreateMaintenanceWindowInput(v *CreateMaint ok.String(*v.ClientToken) } - if v.Cutoff != 0 { + { ok := object.Key("Cutoff") ok.Integer(v.Cutoff) } @@ -9194,9 +10994,9 @@ func awsAwsjson11_serializeOpDocumentCreateMaintenanceWindowInput(v *CreateMaint ok.String(*v.Description) } - if v.Duration != 0 { + if v.Duration != nil { ok := object.Key("Duration") - ok.Integer(v.Duration) + ok.Integer(*v.Duration) } if v.EndDate != nil { @@ -9214,9 +11014,9 @@ func awsAwsjson11_serializeOpDocumentCreateMaintenanceWindowInput(v *CreateMaint ok.String(*v.Schedule) } - if v.ScheduleOffset != 0 { + if v.ScheduleOffset != nil { ok := object.Key("ScheduleOffset") - ok.Integer(v.ScheduleOffset) + ok.Integer(*v.ScheduleOffset) } if v.ScheduleTimezone != nil { @@ -9243,6 +11043,11 @@ func awsAwsjson11_serializeOpDocumentCreateOpsItemInput(v *CreateOpsItemInput, v object := value.Object() defer object.Close() + if v.AccountId != nil { + ok := object.Key("AccountId") + ok.String(*v.AccountId) + } + if v.ActualEndTime != nil { ok := object.Key("ActualEndTime") ok.Double(smithytime.FormatEpochSeconds(*v.ActualEndTime)) @@ -9345,6 +11150,13 @@ func awsAwsjson11_serializeOpDocumentCreateOpsMetadataInput(v *CreateOpsMetadata ok.String(*v.ResourceId) } + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + return nil } @@ -9371,9 +11183,9 @@ func awsAwsjson11_serializeOpDocumentCreatePatchBaselineInput(v *CreatePatchBase ok.String(string(v.ApprovedPatchesComplianceLevel)) } - if v.ApprovedPatchesEnableNonSecurity { + if v.ApprovedPatchesEnableNonSecurity != nil { ok := object.Key("ApprovedPatchesEnableNonSecurity") - ok.Boolean(v.ApprovedPatchesEnableNonSecurity) + ok.Boolean(*v.ApprovedPatchesEnableNonSecurity) } if v.ClientToken != nil { @@ -9563,6 +11375,18 @@ func awsAwsjson11_serializeOpDocumentDeleteMaintenanceWindowInput(v *DeleteMaint return nil } +func awsAwsjson11_serializeOpDocumentDeleteOpsItemInput(v *DeleteOpsItemInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.OpsItemId != nil { + ok := object.Key("OpsItemId") + ok.String(*v.OpsItemId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDeleteOpsMetadataInput(v *DeleteOpsMetadataInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -9630,6 +11454,28 @@ func awsAwsjson11_serializeOpDocumentDeleteResourceDataSyncInput(v *DeleteResour return nil } +func awsAwsjson11_serializeOpDocumentDeleteResourcePolicyInput(v *DeleteResourcePolicyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PolicyHash != nil { + ok := object.Key("PolicyHash") + ok.String(*v.PolicyHash) + } + + if v.PolicyId != nil { + ok := object.Key("PolicyId") + ok.String(*v.PolicyId) + } + + if v.ResourceArn != nil { + ok := object.Key("ResourceArn") + ok.String(*v.ResourceArn) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDeregisterManagedInstanceInput(v *DeregisterManagedInstanceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -9663,9 +11509,9 @@ func awsAwsjson11_serializeOpDocumentDeregisterTargetFromMaintenanceWindowInput( object := value.Object() defer object.Close() - if v.Safe { + if v.Safe != nil { ok := object.Key("Safe") - ok.Boolean(v.Safe) + ok.Boolean(*v.Safe) } if v.WindowId != nil { @@ -9709,9 +11555,9 @@ func awsAwsjson11_serializeOpDocumentDescribeActivationsInput(v *DescribeActivat } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -9738,9 +11584,9 @@ func awsAwsjson11_serializeOpDocumentDescribeAssociationExecutionsInput(v *Descr } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -9772,9 +11618,9 @@ func awsAwsjson11_serializeOpDocumentDescribeAssociationExecutionTargetsInput(v } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -9823,9 +11669,9 @@ func awsAwsjson11_serializeOpDocumentDescribeAutomationExecutionsInput(v *Descri } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -9852,9 +11698,9 @@ func awsAwsjson11_serializeOpDocumentDescribeAutomationStepExecutionsInput(v *De } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -9862,9 +11708,9 @@ func awsAwsjson11_serializeOpDocumentDescribeAutomationStepExecutionsInput(v *De ok.String(*v.NextToken) } - if v.ReverseOrder { + if v.ReverseOrder != nil { ok := object.Key("ReverseOrder") - ok.Boolean(v.ReverseOrder) + ok.Boolean(*v.ReverseOrder) } return nil @@ -9881,9 +11727,9 @@ func awsAwsjson11_serializeOpDocumentDescribeAvailablePatchesInput(v *DescribeAv } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -9920,11 +11766,21 @@ func awsAwsjson11_serializeOpDocumentDescribeDocumentPermissionInput(v *Describe object := value.Object() defer object.Close() + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + if len(v.PermissionType) > 0 { ok := object.Key("PermissionType") ok.String(string(v.PermissionType)) @@ -9942,9 +11798,9 @@ func awsAwsjson11_serializeOpDocumentDescribeEffectiveInstanceAssociationsInput( ok.String(*v.InstanceId) } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -9964,9 +11820,9 @@ func awsAwsjson11_serializeOpDocumentDescribeEffectivePatchesForPatchBaselineInp ok.String(*v.BaselineId) } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -9986,9 +11842,9 @@ func awsAwsjson11_serializeOpDocumentDescribeInstanceAssociationsStatusInput(v * ok.String(*v.InstanceId) } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -10017,9 +11873,9 @@ func awsAwsjson11_serializeOpDocumentDescribeInstanceInformationInput(v *Describ } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -10046,9 +11902,9 @@ func awsAwsjson11_serializeOpDocumentDescribeInstancePatchesInput(v *DescribeIns ok.String(*v.InstanceId) } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -10070,9 +11926,9 @@ func awsAwsjson11_serializeOpDocumentDescribeInstancePatchStatesForPatchGroupInp } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -10099,9 +11955,9 @@ func awsAwsjson11_serializeOpDocumentDescribeInstancePatchStatesInput(v *Describ } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -10121,9 +11977,9 @@ func awsAwsjson11_serializeOpDocumentDescribeInventoryDeletionsInput(v *Describe ok.String(*v.DeletionId) } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -10145,9 +12001,9 @@ func awsAwsjson11_serializeOpDocumentDescribeMaintenanceWindowExecutionsInput(v } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -10174,9 +12030,9 @@ func awsAwsjson11_serializeOpDocumentDescribeMaintenanceWindowExecutionTaskInvoc } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -10208,9 +12064,9 @@ func awsAwsjson11_serializeOpDocumentDescribeMaintenanceWindowExecutionTasksInpu } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -10237,9 +12093,9 @@ func awsAwsjson11_serializeOpDocumentDescribeMaintenanceWindowScheduleInput(v *D } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -10271,9 +12127,9 @@ func awsAwsjson11_serializeOpDocumentDescribeMaintenanceWindowsForTargetInput(v object := value.Object() defer object.Close() - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -10307,9 +12163,9 @@ func awsAwsjson11_serializeOpDocumentDescribeMaintenanceWindowsInput(v *Describe } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -10331,9 +12187,9 @@ func awsAwsjson11_serializeOpDocumentDescribeMaintenanceWindowTargetsInput(v *De } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -10360,9 +12216,9 @@ func awsAwsjson11_serializeOpDocumentDescribeMaintenanceWindowTasksInput(v *Desc } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -10413,9 +12269,9 @@ func awsAwsjson11_serializeOpDocumentDescribeParametersInput(v *DescribeParamete } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -10444,9 +12300,9 @@ func awsAwsjson11_serializeOpDocumentDescribePatchBaselinesInput(v *DescribePatc } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -10468,9 +12324,9 @@ func awsAwsjson11_serializeOpDocumentDescribePatchGroupsInput(v *DescribePatchGr } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -10497,9 +12353,9 @@ func awsAwsjson11_serializeOpDocumentDescribePatchPropertiesInput(v *DescribePat object := value.Object() defer object.Close() - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -10536,9 +12392,9 @@ func awsAwsjson11_serializeOpDocumentDescribeSessionsInput(v *DescribeSessionsIn } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -10554,6 +12410,23 @@ func awsAwsjson11_serializeOpDocumentDescribeSessionsInput(v *DescribeSessionsIn return nil } +func awsAwsjson11_serializeOpDocumentDisassociateOpsItemRelatedItemInput(v *DisassociateOpsItemRelatedItemInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AssociationId != nil { + ok := object.Key("AssociationId") + ok.String(*v.AssociationId) + } + + if v.OpsItemId != nil { + ok := object.Key("OpsItemId") + ok.String(*v.OpsItemId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentGetAutomationExecutionInput(v *GetAutomationExecutionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -10635,6 +12508,13 @@ func awsAwsjson11_serializeOpDocumentGetDeployablePatchSnapshotForInstanceInput( object := value.Object() defer object.Close() + if v.BaselineOverride != nil { + ok := object.Key("BaselineOverride") + if err := awsAwsjson11_serializeDocumentBaselineOverride(v.BaselineOverride, ok); err != nil { + return err + } + } + if v.InstanceId != nil { ok := object.Key("InstanceId") ok.String(*v.InstanceId) @@ -10693,9 +12573,9 @@ func awsAwsjson11_serializeOpDocumentGetInventoryInput(v *GetInventoryInput, val } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -10722,9 +12602,9 @@ func awsAwsjson11_serializeOpDocumentGetInventorySchemaInput(v *GetInventorySche ok.Boolean(v.Aggregator) } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -10732,9 +12612,9 @@ func awsAwsjson11_serializeOpDocumentGetInventorySchemaInput(v *GetInventorySche ok.String(*v.NextToken) } - if v.SubType { + if v.SubType != nil { ok := object.Key("SubType") - ok.Boolean(v.SubType) + ok.Boolean(*v.SubType) } if v.TypeName != nil { @@ -10829,6 +12709,11 @@ func awsAwsjson11_serializeOpDocumentGetOpsItemInput(v *GetOpsItemInput, value s object := value.Object() defer object.Close() + if v.OpsItemArn != nil { + ok := object.Key("OpsItemArn") + ok.String(*v.OpsItemArn) + } + if v.OpsItemId != nil { ok := object.Key("OpsItemId") ok.String(*v.OpsItemId) @@ -10841,9 +12726,9 @@ func awsAwsjson11_serializeOpDocumentGetOpsMetadataInput(v *GetOpsMetadataInput, object := value.Object() defer object.Close() - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -10877,9 +12762,9 @@ func awsAwsjson11_serializeOpDocumentGetOpsSummaryInput(v *GetOpsSummaryInput, v } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -10906,9 +12791,9 @@ func awsAwsjson11_serializeOpDocumentGetParameterHistoryInput(v *GetParameterHis object := value.Object() defer object.Close() - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.Name != nil { @@ -10921,9 +12806,9 @@ func awsAwsjson11_serializeOpDocumentGetParameterHistoryInput(v *GetParameterHis ok.String(*v.NextToken) } - if v.WithDecryption { + if v.WithDecryption != nil { ok := object.Key("WithDecryption") - ok.Boolean(v.WithDecryption) + ok.Boolean(*v.WithDecryption) } return nil @@ -10938,9 +12823,9 @@ func awsAwsjson11_serializeOpDocumentGetParameterInput(v *GetParameterInput, val ok.String(*v.Name) } - if v.WithDecryption { + if v.WithDecryption != nil { ok := object.Key("WithDecryption") - ok.Boolean(v.WithDecryption) + ok.Boolean(*v.WithDecryption) } return nil @@ -10950,9 +12835,9 @@ func awsAwsjson11_serializeOpDocumentGetParametersByPathInput(v *GetParametersBy object := value.Object() defer object.Close() - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -10972,14 +12857,14 @@ func awsAwsjson11_serializeOpDocumentGetParametersByPathInput(v *GetParametersBy ok.String(*v.Path) } - if v.Recursive { + if v.Recursive != nil { ok := object.Key("Recursive") - ok.Boolean(v.Recursive) + ok.Boolean(*v.Recursive) } - if v.WithDecryption { + if v.WithDecryption != nil { ok := object.Key("WithDecryption") - ok.Boolean(v.WithDecryption) + ok.Boolean(*v.WithDecryption) } return nil @@ -10996,9 +12881,9 @@ func awsAwsjson11_serializeOpDocumentGetParametersInput(v *GetParametersInput, v } } - if v.WithDecryption { + if v.WithDecryption != nil { ok := object.Key("WithDecryption") - ok.Boolean(v.WithDecryption) + ok.Boolean(*v.WithDecryption) } return nil @@ -11033,6 +12918,28 @@ func awsAwsjson11_serializeOpDocumentGetPatchBaselineInput(v *GetPatchBaselineIn return nil } +func awsAwsjson11_serializeOpDocumentGetResourcePoliciesInput(v *GetResourcePoliciesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if v.ResourceArn != nil { + ok := object.Key("ResourceArn") + ok.String(*v.ResourceArn) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentGetServiceSettingInput(v *GetServiceSettingInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -11061,9 +12968,9 @@ func awsAwsjson11_serializeOpDocumentLabelParameterVersionInput(v *LabelParamete ok.String(*v.Name) } - if v.ParameterVersion != 0 { + if v.ParameterVersion != nil { ok := object.Key("ParameterVersion") - ok.Long(v.ParameterVersion) + ok.Long(*v.ParameterVersion) } return nil @@ -11080,9 +12987,9 @@ func awsAwsjson11_serializeOpDocumentListAssociationsInput(v *ListAssociationsIn } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -11102,9 +13009,9 @@ func awsAwsjson11_serializeOpDocumentListAssociationVersionsInput(v *ListAssocia ok.String(*v.AssociationId) } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -11141,9 +13048,9 @@ func awsAwsjson11_serializeOpDocumentListCommandInvocationsInput(v *ListCommandI ok.String(*v.InstanceId) } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -11175,9 +13082,9 @@ func awsAwsjson11_serializeOpDocumentListCommandsInput(v *ListCommandsInput, val ok.String(*v.InstanceId) } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -11199,9 +13106,9 @@ func awsAwsjson11_serializeOpDocumentListComplianceItemsInput(v *ListComplianceI } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -11237,9 +13144,9 @@ func awsAwsjson11_serializeOpDocumentListComplianceSummariesInput(v *ListComplia } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -11259,9 +13166,9 @@ func awsAwsjson11_serializeOpDocumentListDocumentMetadataHistoryInput(v *ListDoc ok.String(*v.DocumentVersion) } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if len(v.Metadata) > 0 { @@ -11300,9 +13207,9 @@ func awsAwsjson11_serializeOpDocumentListDocumentsInput(v *ListDocumentsInput, v } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -11317,9 +13224,9 @@ func awsAwsjson11_serializeOpDocumentListDocumentVersionsInput(v *ListDocumentVe object := value.Object() defer object.Close() - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.Name != nil { @@ -11351,9 +13258,9 @@ func awsAwsjson11_serializeOpDocumentListInventoryEntriesInput(v *ListInventoryE ok.String(*v.InstanceId) } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -11393,6 +13300,35 @@ func awsAwsjson11_serializeOpDocumentListOpsItemEventsInput(v *ListOpsItemEvents return nil } +func awsAwsjson11_serializeOpDocumentListOpsItemRelatedItemsInput(v *ListOpsItemRelatedItemsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("Filters") + if err := awsAwsjson11_serializeDocumentOpsItemRelatedItemsFilters(v.Filters, ok); err != nil { + return err + } + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if v.OpsItemId != nil { + ok := object.Key("OpsItemId") + ok.String(*v.OpsItemId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListOpsMetadataInput(v *ListOpsMetadataInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -11404,9 +13340,9 @@ func awsAwsjson11_serializeOpDocumentListOpsMetadataInput(v *ListOpsMetadataInpu } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -11428,9 +13364,9 @@ func awsAwsjson11_serializeOpDocumentListResourceComplianceSummariesInput(v *Lis } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -11445,9 +13381,9 @@ func awsAwsjson11_serializeOpDocumentListResourceDataSyncInput(v *ListResourceDa object := value.Object() defer object.Close() - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -11610,9 +13546,9 @@ func awsAwsjson11_serializeOpDocumentPutParameterInput(v *PutParameterInput, val ok.String(*v.Name) } - if v.Overwrite { + if v.Overwrite != nil { ok := object.Key("Overwrite") - ok.Boolean(v.Overwrite) + ok.Boolean(*v.Overwrite) } if v.Policies != nil { @@ -11645,6 +13581,33 @@ func awsAwsjson11_serializeOpDocumentPutParameterInput(v *PutParameterInput, val return nil } +func awsAwsjson11_serializeOpDocumentPutResourcePolicyInput(v *PutResourcePolicyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Policy != nil { + ok := object.Key("Policy") + ok.String(*v.Policy) + } + + if v.PolicyHash != nil { + ok := object.Key("PolicyHash") + ok.String(*v.PolicyHash) + } + + if v.PolicyId != nil { + ok := object.Key("PolicyId") + ok.String(*v.PolicyId) + } + + if v.ResourceArn != nil { + ok := object.Key("ResourceArn") + ok.String(*v.ResourceArn) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentRegisterDefaultPatchBaselineInput(v *RegisterDefaultPatchBaselineInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -11722,11 +13685,23 @@ func awsAwsjson11_serializeOpDocumentRegisterTaskWithMaintenanceWindowInput(v *R object := value.Object() defer object.Close() + if v.AlarmConfiguration != nil { + ok := object.Key("AlarmConfiguration") + if err := awsAwsjson11_serializeDocumentAlarmConfiguration(v.AlarmConfiguration, ok); err != nil { + return err + } + } + if v.ClientToken != nil { ok := object.Key("ClientToken") ok.String(*v.ClientToken) } + if len(v.CutoffBehavior) > 0 { + ok := object.Key("CutoffBehavior") + ok.String(string(v.CutoffBehavior)) + } + if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) @@ -11754,9 +13729,9 @@ func awsAwsjson11_serializeOpDocumentRegisterTaskWithMaintenanceWindowInput(v *R ok.String(*v.Name) } - if v.Priority != 0 { + if v.Priority != nil { ok := object.Key("Priority") - ok.Integer(v.Priority) + ok.Integer(*v.Priority) } if v.ServiceRoleArn != nil { @@ -11879,6 +13854,13 @@ func awsAwsjson11_serializeOpDocumentSendCommandInput(v *SendCommandInput, value object := value.Object() defer object.Close() + if v.AlarmConfiguration != nil { + ok := object.Key("AlarmConfiguration") + if err := awsAwsjson11_serializeDocumentAlarmConfiguration(v.AlarmConfiguration, ok); err != nil { + return err + } + } + if v.CloudWatchOutputConfig != nil { ok := object.Key("CloudWatchOutputConfig") if err := awsAwsjson11_serializeDocumentCloudWatchOutputConfig(v.CloudWatchOutputConfig, ok); err != nil { @@ -11969,9 +13951,9 @@ func awsAwsjson11_serializeOpDocumentSendCommandInput(v *SendCommandInput, value } } - if v.TimeoutSeconds != 0 { + if v.TimeoutSeconds != nil { ok := object.Key("TimeoutSeconds") - ok.Integer(v.TimeoutSeconds) + ok.Integer(*v.TimeoutSeconds) } return nil @@ -11995,6 +13977,13 @@ func awsAwsjson11_serializeOpDocumentStartAutomationExecutionInput(v *StartAutom object := value.Object() defer object.Close() + if v.AlarmConfiguration != nil { + ok := object.Key("AlarmConfiguration") + if err := awsAwsjson11_serializeDocumentAlarmConfiguration(v.AlarmConfiguration, ok); err != nil { + return err + } + } + if v.ClientToken != nil { ok := object.Key("ClientToken") ok.String(*v.ClientToken) @@ -12072,6 +14061,16 @@ func awsAwsjson11_serializeOpDocumentStartChangeRequestExecutionInput(v *StartCh object := value.Object() defer object.Close() + if v.AutoApprove { + ok := object.Key("AutoApprove") + ok.Boolean(v.AutoApprove) + } + + if v.ChangeDetails != nil { + ok := object.Key("ChangeDetails") + ok.String(*v.ChangeDetails) + } + if v.ChangeRequestName != nil { ok := object.Key("ChangeRequestName") ok.String(*v.ChangeRequestName) @@ -12106,6 +14105,11 @@ func awsAwsjson11_serializeOpDocumentStartChangeRequestExecutionInput(v *StartCh } } + if v.ScheduledEndTime != nil { + ok := object.Key("ScheduledEndTime") + ok.Double(smithytime.FormatEpochSeconds(*v.ScheduledEndTime)) + } + if v.ScheduledTime != nil { ok := object.Key("ScheduledTime") ok.Double(smithytime.FormatEpochSeconds(*v.ScheduledTime)) @@ -12137,6 +14141,11 @@ func awsAwsjson11_serializeOpDocumentStartSessionInput(v *StartSessionInput, val } } + if v.Reason != nil { + ok := object.Key("Reason") + ok.String(*v.Reason) + } + if v.Target != nil { ok := object.Key("Target") ok.String(*v.Target) @@ -12174,10 +14183,41 @@ func awsAwsjson11_serializeOpDocumentTerminateSessionInput(v *TerminateSessionIn return nil } +func awsAwsjson11_serializeOpDocumentUnlabelParameterVersionInput(v *UnlabelParameterVersionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Labels != nil { + ok := object.Key("Labels") + if err := awsAwsjson11_serializeDocumentParameterLabelList(v.Labels, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.ParameterVersion != nil { + ok := object.Key("ParameterVersion") + ok.Long(*v.ParameterVersion) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentUpdateAssociationInput(v *UpdateAssociationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() + if v.AlarmConfiguration != nil { + ok := object.Key("AlarmConfiguration") + if err := awsAwsjson11_serializeDocumentAlarmConfiguration(v.AlarmConfiguration, ok); err != nil { + return err + } + } + if v.ApplyOnlyAtCronInterval { ok := object.Key("ApplyOnlyAtCronInterval") ok.Boolean(v.ApplyOnlyAtCronInterval) @@ -12203,6 +14243,13 @@ func awsAwsjson11_serializeOpDocumentUpdateAssociationInput(v *UpdateAssociation ok.String(*v.AutomationTargetParameterName) } + if v.CalendarNames != nil { + ok := object.Key("CalendarNames") + if err := awsAwsjson11_serializeDocumentCalendarNameOrARNList(v.CalendarNames, ok); err != nil { + return err + } + } + if len(v.ComplianceSeverity) > 0 { ok := object.Key("ComplianceSeverity") ok.String(string(v.ComplianceSeverity)) @@ -12247,6 +14294,11 @@ func awsAwsjson11_serializeOpDocumentUpdateAssociationInput(v *UpdateAssociation ok.String(*v.ScheduleExpression) } + if v.ScheduleOffset != nil { + ok := object.Key("ScheduleOffset") + ok.Integer(*v.ScheduleOffset) + } + if len(v.SyncCompliance) > 0 { ok := object.Key("SyncCompliance") ok.String(string(v.SyncCompliance)) @@ -12259,6 +14311,13 @@ func awsAwsjson11_serializeOpDocumentUpdateAssociationInput(v *UpdateAssociation } } + if v.TargetMaps != nil { + ok := object.Key("TargetMaps") + if err := awsAwsjson11_serializeDocumentTargetMaps(v.TargetMaps, ok); err != nil { + return err + } + } + if v.Targets != nil { ok := object.Key("Targets") if err := awsAwsjson11_serializeDocumentTargets(v.Targets, ok); err != nil { @@ -12326,6 +14385,11 @@ func awsAwsjson11_serializeOpDocumentUpdateDocumentInput(v *UpdateDocumentInput, ok.String(*v.Content) } + if v.DisplayName != nil { + ok := object.Key("DisplayName") + ok.String(*v.DisplayName) + } + if len(v.DocumentFormat) > 0 { ok := object.Key("DocumentFormat") ok.String(string(v.DocumentFormat)) @@ -12382,14 +14446,14 @@ func awsAwsjson11_serializeOpDocumentUpdateMaintenanceWindowInput(v *UpdateMaint object := value.Object() defer object.Close() - if v.AllowUnassociatedTargets { + if v.AllowUnassociatedTargets != nil { ok := object.Key("AllowUnassociatedTargets") - ok.Boolean(v.AllowUnassociatedTargets) + ok.Boolean(*v.AllowUnassociatedTargets) } - if v.Cutoff != 0 { + if v.Cutoff != nil { ok := object.Key("Cutoff") - ok.Integer(v.Cutoff) + ok.Integer(*v.Cutoff) } if v.Description != nil { @@ -12397,14 +14461,14 @@ func awsAwsjson11_serializeOpDocumentUpdateMaintenanceWindowInput(v *UpdateMaint ok.String(*v.Description) } - if v.Duration != 0 { + if v.Duration != nil { ok := object.Key("Duration") - ok.Integer(v.Duration) + ok.Integer(*v.Duration) } - if v.Enabled { + if v.Enabled != nil { ok := object.Key("Enabled") - ok.Boolean(v.Enabled) + ok.Boolean(*v.Enabled) } if v.EndDate != nil { @@ -12417,9 +14481,9 @@ func awsAwsjson11_serializeOpDocumentUpdateMaintenanceWindowInput(v *UpdateMaint ok.String(*v.Name) } - if v.Replace { + if v.Replace != nil { ok := object.Key("Replace") - ok.Boolean(v.Replace) + ok.Boolean(*v.Replace) } if v.Schedule != nil { @@ -12427,9 +14491,9 @@ func awsAwsjson11_serializeOpDocumentUpdateMaintenanceWindowInput(v *UpdateMaint ok.String(*v.Schedule) } - if v.ScheduleOffset != 0 { + if v.ScheduleOffset != nil { ok := object.Key("ScheduleOffset") - ok.Integer(v.ScheduleOffset) + ok.Integer(*v.ScheduleOffset) } if v.ScheduleTimezone != nil { @@ -12469,9 +14533,9 @@ func awsAwsjson11_serializeOpDocumentUpdateMaintenanceWindowTargetInput(v *Updat ok.String(*v.OwnerInformation) } - if v.Replace { + if v.Replace != nil { ok := object.Key("Replace") - ok.Boolean(v.Replace) + ok.Boolean(*v.Replace) } if v.Targets != nil { @@ -12498,6 +14562,18 @@ func awsAwsjson11_serializeOpDocumentUpdateMaintenanceWindowTaskInput(v *UpdateM object := value.Object() defer object.Close() + if v.AlarmConfiguration != nil { + ok := object.Key("AlarmConfiguration") + if err := awsAwsjson11_serializeDocumentAlarmConfiguration(v.AlarmConfiguration, ok); err != nil { + return err + } + } + + if len(v.CutoffBehavior) > 0 { + ok := object.Key("CutoffBehavior") + ok.String(string(v.CutoffBehavior)) + } + if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) @@ -12525,14 +14601,14 @@ func awsAwsjson11_serializeOpDocumentUpdateMaintenanceWindowTaskInput(v *UpdateM ok.String(*v.Name) } - if v.Priority != 0 { + if v.Priority != nil { ok := object.Key("Priority") - ok.Integer(v.Priority) + ok.Integer(*v.Priority) } - if v.Replace { + if v.Replace != nil { ok := object.Key("Replace") - ok.Boolean(v.Replace) + ok.Boolean(*v.Replace) } if v.ServiceRoleArn != nil { @@ -12641,6 +14717,11 @@ func awsAwsjson11_serializeOpDocumentUpdateOpsItemInput(v *UpdateOpsItemInput, v } } + if v.OpsItemArn != nil { + ok := object.Key("OpsItemArn") + ok.String(*v.OpsItemArn) + } + if v.OpsItemId != nil { ok := object.Key("OpsItemId") ok.String(*v.OpsItemId) @@ -12735,9 +14816,9 @@ func awsAwsjson11_serializeOpDocumentUpdatePatchBaselineInput(v *UpdatePatchBase ok.String(string(v.ApprovedPatchesComplianceLevel)) } - if v.ApprovedPatchesEnableNonSecurity { + if v.ApprovedPatchesEnableNonSecurity != nil { ok := object.Key("ApprovedPatchesEnableNonSecurity") - ok.Boolean(v.ApprovedPatchesEnableNonSecurity) + ok.Boolean(*v.ApprovedPatchesEnableNonSecurity) } if v.BaselineId != nil { @@ -12774,9 +14855,9 @@ func awsAwsjson11_serializeOpDocumentUpdatePatchBaselineInput(v *UpdatePatchBase ok.String(string(v.RejectedPatchesAction)) } - if v.Replace { + if v.Replace != nil { ok := object.Key("Replace") - ok.Boolean(v.Replace) + ok.Boolean(*v.Replace) } if v.Sources != nil { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/types/enums.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/types/enums.go index fcc2197d..bb6c67ae 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/types/enums.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/types/enums.go @@ -129,8 +129,8 @@ const ( AssociationStatusNameFailed AssociationStatusName = "Failed" ) -// Values returns all known values for AssociationStatusName. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The +// Values returns all known values for AssociationStatusName. Note that this can +// be expanded in the future, and so it is only as up to date as the client. The // ordering of this slice is not guaranteed to be stable across updates. func (AssociationStatusName) Values() []AssociationStatusName { return []AssociationStatusName{ @@ -212,9 +212,10 @@ const ( AutomationExecutionFilterKeyOpsItemId AutomationExecutionFilterKey = "OpsItemId" ) -// Values returns all known values for AutomationExecutionFilterKey. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// The ordering of this slice is not guaranteed to be stable across updates. +// Values returns all known values for AutomationExecutionFilterKey. Note that +// this can be expanded in the future, and so it is only as up to date as the +// client. The ordering of this slice is not guaranteed to be stable across +// updates. func (AutomationExecutionFilterKey) Values() []AutomationExecutionFilterKey { return []AutomationExecutionFilterKey{ "DocumentNamePrefix", @@ -254,6 +255,7 @@ const ( AutomationExecutionStatusChangeCalendarOverrideRejected AutomationExecutionStatus = "ChangeCalendarOverrideRejected" AutomationExecutionStatusCompletedWithSuccess AutomationExecutionStatus = "CompletedWithSuccess" AutomationExecutionStatusCompletedWithFailure AutomationExecutionStatus = "CompletedWithFailure" + AutomationExecutionStatusExited AutomationExecutionStatus = "Exited" ) // Values returns all known values for AutomationExecutionStatus. Note that this @@ -279,6 +281,7 @@ func (AutomationExecutionStatus) Values() []AutomationExecutionStatus { "ChangeCalendarOverrideRejected", "CompletedWithSuccess", "CompletedWithFailure", + "Exited", } } @@ -532,8 +535,8 @@ type ConnectionStatus string // Enum values for ConnectionStatus const ( - ConnectionStatusConnected ConnectionStatus = "Connected" - ConnectionStatusNotConnected ConnectionStatus = "NotConnected" + ConnectionStatusConnected ConnectionStatus = "connected" + ConnectionStatusNotConnected ConnectionStatus = "notconnected" ) // Values returns all known values for ConnectionStatus. Note that this can be @@ -541,8 +544,8 @@ const ( // ordering of this slice is not guaranteed to be stable across updates. func (ConnectionStatus) Values() []ConnectionStatus { return []ConnectionStatus{ - "Connected", - "NotConnected", + "connected", + "notconnected", } } @@ -651,8 +654,8 @@ const ( DocumentParameterTypeStringList DocumentParameterType = "StringList" ) -// Values returns all known values for DocumentParameterType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The +// Values returns all known values for DocumentParameterType. Note that this can +// be expanded in the future, and so it is only as up to date as the client. The // ordering of this slice is not guaranteed to be stable across updates. func (DocumentParameterType) Values() []DocumentParameterType { return []DocumentParameterType{ @@ -753,11 +756,16 @@ const ( DocumentTypeDeploymentStrategy DocumentType = "DeploymentStrategy" DocumentTypeChangeCalendar DocumentType = "ChangeCalendar" DocumentTypeChangeTemplate DocumentType = "Automation.ChangeTemplate" + DocumentTypeProblemAnalysis DocumentType = "ProblemAnalysis" + DocumentTypeProblemAnalysisTemplate DocumentType = "ProblemAnalysisTemplate" + DocumentTypeCloudFormation DocumentType = "CloudFormation" + DocumentTypeConformancePackTemplate DocumentType = "ConformancePackTemplate" + DocumentTypeQuickSetup DocumentType = "QuickSetup" ) -// Values returns all known values for DocumentType. Note that this can be expanded -// in the future, and so it is only as up to date as the client. The ordering of -// this slice is not guaranteed to be stable across updates. +// Values returns all known values for DocumentType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. func (DocumentType) Values() []DocumentType { return []DocumentType{ "Command", @@ -770,6 +778,11 @@ func (DocumentType) Values() []DocumentType { "DeploymentStrategy", "ChangeCalendar", "Automation.ChangeTemplate", + "ProblemAnalysis", + "ProblemAnalysisTemplate", + "CloudFormation", + "ConformancePackTemplate", + "QuickSetup", } } @@ -791,6 +804,24 @@ func (ExecutionMode) Values() []ExecutionMode { } } +type ExternalAlarmState string + +// Enum values for ExternalAlarmState +const ( + ExternalAlarmStateUnknown ExternalAlarmState = "UNKNOWN" + ExternalAlarmStateAlarm ExternalAlarmState = "ALARM" +) + +// Values returns all known values for ExternalAlarmState. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (ExternalAlarmState) Values() []ExternalAlarmState { + return []ExternalAlarmState{ + "UNKNOWN", + "ALARM", + } +} + type Fault string // Enum values for Fault @@ -800,8 +831,8 @@ const ( FaultUnknown Fault = "Unknown" ) -// Values returns all known values for Fault. Note that this can be expanded in the -// future, and so it is only as up to date as the client. The ordering of this +// Values returns all known values for Fault. Note that this can be expanded in +// the future, and so it is only as up to date as the client. The ordering of this // slice is not guaranteed to be stable across updates. func (Fault) Values() []Fault { return []Fault{ @@ -825,9 +856,10 @@ const ( InstanceInformationFilterKeyAssociationStatus InstanceInformationFilterKey = "AssociationStatus" ) -// Values returns all known values for InstanceInformationFilterKey. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// The ordering of this slice is not guaranteed to be stable across updates. +// Values returns all known values for InstanceInformationFilterKey. Note that +// this can be expanded in the future, and so it is only as up to date as the +// client. The ordering of this slice is not guaranteed to be stable across +// updates. func (InstanceInformationFilterKey) Values() []InstanceInformationFilterKey { return []InstanceInformationFilterKey{ "InstanceIds", @@ -1014,6 +1046,25 @@ func (MaintenanceWindowResourceType) Values() []MaintenanceWindowResourceType { } } +type MaintenanceWindowTaskCutoffBehavior string + +// Enum values for MaintenanceWindowTaskCutoffBehavior +const ( + MaintenanceWindowTaskCutoffBehaviorContinueTask MaintenanceWindowTaskCutoffBehavior = "CONTINUE_TASK" + MaintenanceWindowTaskCutoffBehaviorCancelTask MaintenanceWindowTaskCutoffBehavior = "CANCEL_TASK" +) + +// Values returns all known values for MaintenanceWindowTaskCutoffBehavior. Note +// that this can be expanded in the future, and so it is only as up to date as the +// client. The ordering of this slice is not guaranteed to be stable across +// updates. +func (MaintenanceWindowTaskCutoffBehavior) Values() []MaintenanceWindowTaskCutoffBehavior { + return []MaintenanceWindowTaskCutoffBehavior{ + "CONTINUE_TASK", + "CANCEL_TASK", + } +} + type MaintenanceWindowTaskType string // Enum values for MaintenanceWindowTaskType @@ -1087,6 +1138,7 @@ const ( OperatingSystemWindows OperatingSystem = "WINDOWS" OperatingSystemAmazonLinux OperatingSystem = "AMAZON_LINUX" OperatingSystemAmazonLinux2 OperatingSystem = "AMAZON_LINUX_2" + OperatingSystemAmazonLinux2022 OperatingSystem = "AMAZON_LINUX_2022" OperatingSystemUbuntu OperatingSystem = "UBUNTU" OperatingSystemRedhatEnterpriseLinux OperatingSystem = "REDHAT_ENTERPRISE_LINUX" OperatingSystemSuse OperatingSystem = "SUSE" @@ -1094,6 +1146,10 @@ const ( OperatingSystemOracleLinux OperatingSystem = "ORACLE_LINUX" OperatingSystemDebian OperatingSystem = "DEBIAN" OperatingSystemMacOS OperatingSystem = "MACOS" + OperatingSystemRaspbian OperatingSystem = "RASPBIAN" + OperatingSystemRockyLinux OperatingSystem = "ROCKY_LINUX" + OperatingSystemAlmaLinux OperatingSystem = "ALMA_LINUX" + OperatingSystemAmazonLinux2023 OperatingSystem = "AMAZON_LINUX_2023" ) // Values returns all known values for OperatingSystem. Note that this can be @@ -1104,6 +1160,7 @@ func (OperatingSystem) Values() []OperatingSystem { "WINDOWS", "AMAZON_LINUX", "AMAZON_LINUX_2", + "AMAZON_LINUX_2022", "UBUNTU", "REDHAT_ENTERPRISE_LINUX", "SUSE", @@ -1111,6 +1168,10 @@ func (OperatingSystem) Values() []OperatingSystem { "ORACLE_LINUX", "DEBIAN", "MACOS", + "RASPBIAN", + "ROCKY_LINUX", + "ALMA_LINUX", + "AMAZON_LINUX_2023", } } @@ -1126,8 +1187,8 @@ const ( OpsFilterOperatorTypeExists OpsFilterOperatorType = "Exists" ) -// Values returns all known values for OpsFilterOperatorType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The +// Values returns all known values for OpsFilterOperatorType. Note that this can +// be expanded in the future, and so it is only as up to date as the client. The // ordering of this slice is not guaranteed to be stable across updates. func (OpsFilterOperatorType) Values() []OpsFilterOperatorType { return []OpsFilterOperatorType{ @@ -1165,8 +1226,8 @@ const ( OpsItemEventFilterKeyOpsitemId OpsItemEventFilterKey = "OpsItemId" ) -// Values returns all known values for OpsItemEventFilterKey. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The +// Values returns all known values for OpsItemEventFilterKey. Note that this can +// be expanded in the future, and so it is only as up to date as the client. The // ordering of this slice is not guaranteed to be stable across updates. func (OpsItemEventFilterKey) Values() []OpsItemEventFilterKey { return []OpsItemEventFilterKey{ @@ -1220,6 +1281,8 @@ const ( OpsItemFilterKeyChangeRequestApproverName OpsItemFilterKey = "ChangeRequestByApproverName" OpsItemFilterKeyChangeRequestTemplate OpsItemFilterKey = "ChangeRequestByTemplate" OpsItemFilterKeyChangeRequestTargetsResourceGroup OpsItemFilterKey = "ChangeRequestByTargetsResourceGroup" + OpsItemFilterKeyInsightType OpsItemFilterKey = "InsightByType" + OpsItemFilterKeyAccountId OpsItemFilterKey = "AccountId" ) // Values returns all known values for OpsItemFilterKey. Note that this can be @@ -1253,6 +1316,8 @@ func (OpsItemFilterKey) Values() []OpsItemFilterKey { "ChangeRequestByApproverName", "ChangeRequestByTemplate", "ChangeRequestByTargetsResourceGroup", + "InsightByType", + "AccountId", } } @@ -1266,8 +1331,8 @@ const ( OpsItemFilterOperatorLessThan OpsItemFilterOperator = "LessThan" ) -// Values returns all known values for OpsItemFilterOperator. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The +// Values returns all known values for OpsItemFilterOperator. Note that this can +// be expanded in the future, and so it is only as up to date as the client. The // ordering of this slice is not guaranteed to be stable across updates. func (OpsItemFilterOperator) Values() []OpsItemFilterOperator { return []OpsItemFilterOperator{ @@ -1278,6 +1343,44 @@ func (OpsItemFilterOperator) Values() []OpsItemFilterOperator { } } +type OpsItemRelatedItemsFilterKey string + +// Enum values for OpsItemRelatedItemsFilterKey +const ( + OpsItemRelatedItemsFilterKeyResourceType OpsItemRelatedItemsFilterKey = "ResourceType" + OpsItemRelatedItemsFilterKeyAssociationId OpsItemRelatedItemsFilterKey = "AssociationId" + OpsItemRelatedItemsFilterKeyResourceUri OpsItemRelatedItemsFilterKey = "ResourceUri" +) + +// Values returns all known values for OpsItemRelatedItemsFilterKey. Note that +// this can be expanded in the future, and so it is only as up to date as the +// client. The ordering of this slice is not guaranteed to be stable across +// updates. +func (OpsItemRelatedItemsFilterKey) Values() []OpsItemRelatedItemsFilterKey { + return []OpsItemRelatedItemsFilterKey{ + "ResourceType", + "AssociationId", + "ResourceUri", + } +} + +type OpsItemRelatedItemsFilterOperator string + +// Enum values for OpsItemRelatedItemsFilterOperator +const ( + OpsItemRelatedItemsFilterOperatorEqual OpsItemRelatedItemsFilterOperator = "Equal" +) + +// Values returns all known values for OpsItemRelatedItemsFilterOperator. Note +// that this can be expanded in the future, and so it is only as up to date as the +// client. The ordering of this slice is not guaranteed to be stable across +// updates. +func (OpsItemRelatedItemsFilterOperator) Values() []OpsItemRelatedItemsFilterOperator { + return []OpsItemRelatedItemsFilterOperator{ + "Equal", + } +} + type OpsItemStatus string // Enum values for OpsItemStatus @@ -1300,6 +1403,7 @@ const ( OpsItemStatusPendingApproval OpsItemStatus = "PendingApproval" OpsItemStatusApproved OpsItemStatus = "Approved" OpsItemStatusRejected OpsItemStatus = "Rejected" + OpsItemStatusClosed OpsItemStatus = "Closed" ) // Values returns all known values for OpsItemStatus. Note that this can be @@ -1325,6 +1429,7 @@ func (OpsItemStatus) Values() []OpsItemStatus { "PendingApproval", "Approved", "Rejected", + "Closed", } } @@ -1419,9 +1524,9 @@ const ( PatchComplianceDataStateFailed PatchComplianceDataState = "FAILED" ) -// Values returns all known values for PatchComplianceDataState. Note that this can -// be expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// Values returns all known values for PatchComplianceDataState. Note that this +// can be expanded in the future, and so it is only as up to date as the client. +// The ordering of this slice is not guaranteed to be stable across updates. func (PatchComplianceDataState) Values() []PatchComplianceDataState { return []PatchComplianceDataState{ "INSTALLED", @@ -1470,8 +1575,8 @@ const ( PatchDeploymentStatusExplicitRejected PatchDeploymentStatus = "EXPLICIT_REJECTED" ) -// Values returns all known values for PatchDeploymentStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The +// Values returns all known values for PatchDeploymentStatus. Note that this can +// be expanded in the future, and so it is only as up to date as the client. The // ordering of this slice is not guaranteed to be stable across updates. func (PatchDeploymentStatus) Values() []PatchDeploymentStatus { return []PatchDeploymentStatus{ @@ -1622,15 +1727,17 @@ type PlatformType string const ( PlatformTypeWindows PlatformType = "Windows" PlatformTypeLinux PlatformType = "Linux" + PlatformTypeMacos PlatformType = "MacOS" ) -// Values returns all known values for PlatformType. Note that this can be expanded -// in the future, and so it is only as up to date as the client. The ordering of -// this slice is not guaranteed to be stable across updates. +// Values returns all known values for PlatformType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. func (PlatformType) Values() []PlatformType { return []PlatformType{ "Windows", "Linux", + "MacOS", } } @@ -1642,9 +1749,9 @@ const ( RebootOptionNoReboot RebootOption = "NoReboot" ) -// Values returns all known values for RebootOption. Note that this can be expanded -// in the future, and so it is only as up to date as the client. The ordering of -// this slice is not guaranteed to be stable across updates. +// Values returns all known values for RebootOption. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. func (RebootOption) Values() []RebootOption { return []RebootOption{ "RebootIfNeeded", @@ -1659,9 +1766,9 @@ const ( ResourceDataSyncS3FormatJsonSerde ResourceDataSyncS3Format = "JsonSerDe" ) -// Values returns all known values for ResourceDataSyncS3Format. Note that this can -// be expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// Values returns all known values for ResourceDataSyncS3Format. Note that this +// can be expanded in the future, and so it is only as up to date as the client. +// The ordering of this slice is not guaranteed to be stable across updates. func (ResourceDataSyncS3Format) Values() []ResourceDataSyncS3Format { return []ResourceDataSyncS3Format{ "JsonSerDe", @@ -1673,17 +1780,15 @@ type ResourceType string // Enum values for ResourceType const ( ResourceTypeManagedInstance ResourceType = "ManagedInstance" - ResourceTypeDocument ResourceType = "Document" ResourceTypeEc2Instance ResourceType = "EC2Instance" ) -// Values returns all known values for ResourceType. Note that this can be expanded -// in the future, and so it is only as up to date as the client. The ordering of -// this slice is not guaranteed to be stable across updates. +// Values returns all known values for ResourceType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. func (ResourceType) Values() []ResourceType { return []ResourceType{ "ManagedInstance", - "Document", "EC2Instance", } } @@ -1698,6 +1803,9 @@ const ( ResourceTypeForTaggingParameter ResourceTypeForTagging = "Parameter" ResourceTypeForTaggingPatchBaseline ResourceTypeForTagging = "PatchBaseline" ResourceTypeForTaggingOpsItem ResourceTypeForTagging = "OpsItem" + ResourceTypeForTaggingOpsmetadata ResourceTypeForTagging = "OpsMetadata" + ResourceTypeForTaggingAutomation ResourceTypeForTagging = "Automation" + ResourceTypeForTaggingAssociation ResourceTypeForTagging = "Association" ) // Values returns all known values for ResourceTypeForTagging. Note that this can @@ -1711,6 +1819,9 @@ func (ResourceTypeForTagging) Values() []ResourceTypeForTagging { "Parameter", "PatchBaseline", "OpsItem", + "OpsMetadata", + "Automation", + "Association", } } @@ -1724,9 +1835,9 @@ const ( ReviewStatusRejected ReviewStatus = "REJECTED" ) -// Values returns all known values for ReviewStatus. Note that this can be expanded -// in the future, and so it is only as up to date as the client. The ordering of -// this slice is not guaranteed to be stable across updates. +// Values returns all known values for ReviewStatus. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. func (ReviewStatus) Values() []ReviewStatus { return []ReviewStatus{ "APPROVED", @@ -1770,9 +1881,9 @@ const ( SessionStateHistory SessionState = "History" ) -// Values returns all known values for SessionState. Note that this can be expanded -// in the future, and so it is only as up to date as the client. The ordering of -// this slice is not guaranteed to be stable across updates. +// Values returns all known values for SessionState. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. func (SessionState) Values() []SessionState { return []SessionState{ "Active", @@ -1830,16 +1941,39 @@ func (SignalType) Values() []SignalType { } } +type SourceType string + +// Enum values for SourceType +const ( + SourceTypeAwsEc2Instance SourceType = "AWS::EC2::Instance" + SourceTypeAwsIotThing SourceType = "AWS::IoT::Thing" + SourceTypeAwsSsmManagedinstance SourceType = "AWS::SSM::ManagedInstance" +) + +// Values returns all known values for SourceType. Note that this can be expanded +// in the future, and so it is only as up to date as the client. The ordering of +// this slice is not guaranteed to be stable across updates. +func (SourceType) Values() []SourceType { + return []SourceType{ + "AWS::EC2::Instance", + "AWS::IoT::Thing", + "AWS::SSM::ManagedInstance", + } +} + type StepExecutionFilterKey string // Enum values for StepExecutionFilterKey const ( - StepExecutionFilterKeyStartTimeBefore StepExecutionFilterKey = "StartTimeBefore" - StepExecutionFilterKeyStartTimeAfter StepExecutionFilterKey = "StartTimeAfter" - StepExecutionFilterKeyStepExecutionStatus StepExecutionFilterKey = "StepExecutionStatus" - StepExecutionFilterKeyStepExecutionId StepExecutionFilterKey = "StepExecutionId" - StepExecutionFilterKeyStepName StepExecutionFilterKey = "StepName" - StepExecutionFilterKeyAction StepExecutionFilterKey = "Action" + StepExecutionFilterKeyStartTimeBefore StepExecutionFilterKey = "StartTimeBefore" + StepExecutionFilterKeyStartTimeAfter StepExecutionFilterKey = "StartTimeAfter" + StepExecutionFilterKeyStepExecutionStatus StepExecutionFilterKey = "StepExecutionStatus" + StepExecutionFilterKeyStepExecutionId StepExecutionFilterKey = "StepExecutionId" + StepExecutionFilterKeyStepName StepExecutionFilterKey = "StepName" + StepExecutionFilterKeyAction StepExecutionFilterKey = "Action" + StepExecutionFilterKeyParentStepExecutionId StepExecutionFilterKey = "ParentStepExecutionId" + StepExecutionFilterKeyParentStepIteration StepExecutionFilterKey = "ParentStepIteration" + StepExecutionFilterKeyParentStepIteratorValue StepExecutionFilterKey = "ParentStepIteratorValue" ) // Values returns all known values for StepExecutionFilterKey. Note that this can @@ -1853,6 +1987,9 @@ func (StepExecutionFilterKey) Values() []StepExecutionFilterKey { "StepExecutionId", "StepName", "Action", + "ParentStepExecutionId", + "ParentStepIteration", + "ParentStepIteratorValue", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/types/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/types/errors.go index d68d6810..61ec235e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/types/errors.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/types/errors.go @@ -11,6 +11,10 @@ import ( // baseline that is already registered with a different patch baseline. type AlreadyExistsException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *AlreadyExistsException) Error() string { @@ -22,12 +26,22 @@ func (e *AlreadyExistsException) ErrorMessage() string { } return *e.Message } -func (e *AlreadyExistsException) ErrorCode() string { return "AlreadyExistsException" } +func (e *AlreadyExistsException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AlreadyExistsException" + } + return *e.ErrorCodeOverride +} func (e *AlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// You must disassociate a document from all instances before you can delete it. +// You must disassociate a document from all managed nodes before you can delete +// it. type AssociatedInstances struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *AssociatedInstances) Error() string { @@ -39,12 +53,21 @@ func (e *AssociatedInstances) ErrorMessage() string { } return *e.Message } -func (e *AssociatedInstances) ErrorCode() string { return "AssociatedInstances" } +func (e *AssociatedInstances) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AssociatedInstances" + } + return *e.ErrorCodeOverride +} func (e *AssociatedInstances) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The specified association already exists. type AssociationAlreadyExists struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *AssociationAlreadyExists) Error() string { @@ -56,12 +79,21 @@ func (e *AssociationAlreadyExists) ErrorMessage() string { } return *e.Message } -func (e *AssociationAlreadyExists) ErrorCode() string { return "AssociationAlreadyExists" } +func (e *AssociationAlreadyExists) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AssociationAlreadyExists" + } + return *e.ErrorCodeOverride +} func (e *AssociationAlreadyExists) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The specified association does not exist. +// The specified association doesn't exist. type AssociationDoesNotExist struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *AssociationDoesNotExist) Error() string { @@ -73,12 +105,21 @@ func (e *AssociationDoesNotExist) ErrorMessage() string { } return *e.Message } -func (e *AssociationDoesNotExist) ErrorCode() string { return "AssociationDoesNotExist" } +func (e *AssociationDoesNotExist) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AssociationDoesNotExist" + } + return *e.ErrorCodeOverride +} func (e *AssociationDoesNotExist) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The specified execution ID does not exist. Verify the ID number and try again. +// The specified execution ID doesn't exist. Verify the ID number and try again. type AssociationExecutionDoesNotExist struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *AssociationExecutionDoesNotExist) Error() string { @@ -91,13 +132,20 @@ func (e *AssociationExecutionDoesNotExist) ErrorMessage() string { return *e.Message } func (e *AssociationExecutionDoesNotExist) ErrorCode() string { - return "AssociationExecutionDoesNotExist" + if e == nil || e.ErrorCodeOverride == nil { + return "AssociationExecutionDoesNotExist" + } + return *e.ErrorCodeOverride } func (e *AssociationExecutionDoesNotExist) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // You can have at most 2,000 active associations. type AssociationLimitExceeded struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *AssociationLimitExceeded) Error() string { @@ -109,13 +157,22 @@ func (e *AssociationLimitExceeded) ErrorMessage() string { } return *e.Message } -func (e *AssociationLimitExceeded) ErrorCode() string { return "AssociationLimitExceeded" } +func (e *AssociationLimitExceeded) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AssociationLimitExceeded" + } + return *e.ErrorCodeOverride +} func (e *AssociationLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // You have reached the maximum number versions allowed for an association. Each // association has a limit of 1,000 versions. type AssociationVersionLimitExceeded struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *AssociationVersionLimitExceeded) Error() string { @@ -128,14 +185,21 @@ func (e *AssociationVersionLimitExceeded) ErrorMessage() string { return *e.Message } func (e *AssociationVersionLimitExceeded) ErrorCode() string { - return "AssociationVersionLimitExceeded" + if e == nil || e.ErrorCodeOverride == nil { + return "AssociationVersionLimitExceeded" + } + return *e.ErrorCodeOverride } func (e *AssociationVersionLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// Indicates that the Change Manager change template used in the change request was -// rejected or is still in a pending state. +// Indicates that the Change Manager change template used in the change request +// was rejected or is still in a pending state. type AutomationDefinitionNotApprovedException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *AutomationDefinitionNotApprovedException) Error() string { @@ -148,15 +212,22 @@ func (e *AutomationDefinitionNotApprovedException) ErrorMessage() string { return *e.Message } func (e *AutomationDefinitionNotApprovedException) ErrorCode() string { - return "AutomationDefinitionNotApprovedException" + if e == nil || e.ErrorCodeOverride == nil { + return "AutomationDefinitionNotApprovedException" + } + return *e.ErrorCodeOverride } func (e *AutomationDefinitionNotApprovedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// An Automation document with the specified name could not be found. +// An Automation runbook with the specified name couldn't be found. type AutomationDefinitionNotFoundException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *AutomationDefinitionNotFoundException) Error() string { @@ -169,15 +240,22 @@ func (e *AutomationDefinitionNotFoundException) ErrorMessage() string { return *e.Message } func (e *AutomationDefinitionNotFoundException) ErrorCode() string { - return "AutomationDefinitionNotFoundException" + if e == nil || e.ErrorCodeOverride == nil { + return "AutomationDefinitionNotFoundException" + } + return *e.ErrorCodeOverride } func (e *AutomationDefinitionNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// An Automation document with the specified name and version could not be found. +// An Automation runbook with the specified name and version couldn't be found. type AutomationDefinitionVersionNotFoundException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *AutomationDefinitionVersionNotFoundException) Error() string { @@ -190,7 +268,10 @@ func (e *AutomationDefinitionVersionNotFoundException) ErrorMessage() string { return *e.Message } func (e *AutomationDefinitionVersionNotFoundException) ErrorCode() string { - return "AutomationDefinitionVersionNotFoundException" + if e == nil || e.ErrorCodeOverride == nil { + return "AutomationDefinitionVersionNotFoundException" + } + return *e.ErrorCodeOverride } func (e *AutomationDefinitionVersionNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient @@ -200,6 +281,10 @@ func (e *AutomationDefinitionVersionNotFoundException) ErrorFault() smithy.Error // allowable limit. type AutomationExecutionLimitExceededException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *AutomationExecutionLimitExceededException) Error() string { @@ -212,7 +297,10 @@ func (e *AutomationExecutionLimitExceededException) ErrorMessage() string { return *e.Message } func (e *AutomationExecutionLimitExceededException) ErrorCode() string { - return "AutomationExecutionLimitExceededException" + if e == nil || e.ErrorCodeOverride == nil { + return "AutomationExecutionLimitExceededException" + } + return *e.ErrorCodeOverride } func (e *AutomationExecutionLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient @@ -222,6 +310,10 @@ func (e *AutomationExecutionLimitExceededException) ErrorFault() smithy.ErrorFau // execution ID. type AutomationExecutionNotFoundException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *AutomationExecutionNotFoundException) Error() string { @@ -234,16 +326,23 @@ func (e *AutomationExecutionNotFoundException) ErrorMessage() string { return *e.Message } func (e *AutomationExecutionNotFoundException) ErrorCode() string { - return "AutomationExecutionNotFoundException" + if e == nil || e.ErrorCodeOverride == nil { + return "AutomationExecutionNotFoundException" + } + return *e.ErrorCodeOverride } func (e *AutomationExecutionNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The specified step name and execution ID don't exist. Verify the information and -// try again. +// The specified step name and execution ID don't exist. Verify the information +// and try again. type AutomationStepNotFoundException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *AutomationStepNotFoundException) Error() string { @@ -256,7 +355,10 @@ func (e *AutomationStepNotFoundException) ErrorMessage() string { return *e.Message } func (e *AutomationStepNotFoundException) ErrorCode() string { - return "AutomationStepNotFoundException" + if e == nil || e.ErrorCodeOverride == nil { + return "AutomationStepNotFoundException" + } + return *e.ErrorCodeOverride } func (e *AutomationStepNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } @@ -264,6 +366,10 @@ func (e *AutomationStepNotFoundException) ErrorFault() smithy.ErrorFault { retur // different types. type ComplianceTypeCountLimitExceededException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *ComplianceTypeCountLimitExceededException) Error() string { @@ -276,7 +382,10 @@ func (e *ComplianceTypeCountLimitExceededException) ErrorMessage() string { return *e.Message } func (e *ComplianceTypeCountLimitExceededException) ErrorCode() string { - return "ComplianceTypeCountLimitExceededException" + if e == nil || e.ErrorCodeOverride == nil { + return "ComplianceTypeCountLimitExceededException" + } + return *e.ErrorCodeOverride } func (e *ComplianceTypeCountLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient @@ -286,6 +395,10 @@ func (e *ComplianceTypeCountLimitExceededException) ErrorFault() smithy.ErrorFau // schemas and try again. type CustomSchemaCountLimitExceededException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *CustomSchemaCountLimitExceededException) Error() string { @@ -298,7 +411,10 @@ func (e *CustomSchemaCountLimitExceededException) ErrorMessage() string { return *e.Message } func (e *CustomSchemaCountLimitExceededException) ErrorCode() string { - return "CustomSchemaCountLimitExceededException" + if e == nil || e.ErrorCodeOverride == nil { + return "CustomSchemaCountLimitExceededException" + } + return *e.ErrorCodeOverride } func (e *CustomSchemaCountLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient @@ -307,6 +423,10 @@ func (e *CustomSchemaCountLimitExceededException) ErrorFault() smithy.ErrorFault // The specified document already exists. type DocumentAlreadyExists struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *DocumentAlreadyExists) Error() string { @@ -318,12 +438,21 @@ func (e *DocumentAlreadyExists) ErrorMessage() string { } return *e.Message } -func (e *DocumentAlreadyExists) ErrorCode() string { return "DocumentAlreadyExists" } +func (e *DocumentAlreadyExists) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DocumentAlreadyExists" + } + return *e.ErrorCodeOverride +} func (e *DocumentAlreadyExists) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// You can have at most 500 active Systems Manager documents. +// You can have at most 500 active SSM documents. type DocumentLimitExceeded struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *DocumentLimitExceeded) Error() string { @@ -335,14 +464,26 @@ func (e *DocumentLimitExceeded) ErrorMessage() string { } return *e.Message } -func (e *DocumentLimitExceeded) ErrorCode() string { return "DocumentLimitExceeded" } +func (e *DocumentLimitExceeded) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DocumentLimitExceeded" + } + return *e.ErrorCodeOverride +} func (e *DocumentLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The document cannot be shared with more AWS user accounts. You can share a -// document with a maximum of 20 accounts. You can publicly share up to five -// documents. If you need to increase this limit, contact AWS Support. +// The document can't be shared with more Amazon Web Services accounts. You can +// specify a maximum of 20 accounts per API operation to share a private document. +// By default, you can share a private document with a maximum of 1,000 accounts +// and publicly share up to five documents. If you need to increase the quota for +// privately or publicly shared Systems Manager documents, contact Amazon Web +// Services Support. type DocumentPermissionLimit struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *DocumentPermissionLimit) Error() string { @@ -354,13 +495,22 @@ func (e *DocumentPermissionLimit) ErrorMessage() string { } return *e.Message } -func (e *DocumentPermissionLimit) ErrorCode() string { return "DocumentPermissionLimit" } +func (e *DocumentPermissionLimit) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DocumentPermissionLimit" + } + return *e.ErrorCodeOverride +} func (e *DocumentPermissionLimit) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The document has too many versions. Delete one or more document versions and try -// again. +// The document has too many versions. Delete one or more document versions and +// try again. type DocumentVersionLimitExceeded struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *DocumentVersionLimitExceeded) Error() string { @@ -372,16 +522,24 @@ func (e *DocumentVersionLimitExceeded) ErrorMessage() string { } return *e.Message } -func (e *DocumentVersionLimitExceeded) ErrorCode() string { return "DocumentVersionLimitExceeded" } +func (e *DocumentVersionLimitExceeded) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DocumentVersionLimitExceeded" + } + return *e.ErrorCodeOverride +} func (e *DocumentVersionLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Error returned when the ID specified for a resource, such as a maintenance -// window or Patch baseline, doesn't exist. For information about resource quotas -// in Systems Manager, see Systems Manager service quotas -// (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) in the AWS -// General Reference. +// window or patch baseline, doesn't exist. For information about resource quotas +// in Amazon Web Services Systems Manager, see Systems Manager service quotas (https://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the Amazon Web Services General Reference. type DoesNotExistException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *DoesNotExistException) Error() string { @@ -393,13 +551,22 @@ func (e *DoesNotExistException) ErrorMessage() string { } return *e.Message } -func (e *DoesNotExistException) ErrorCode() string { return "DoesNotExistException" } +func (e *DoesNotExistException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DoesNotExistException" + } + return *e.ErrorCodeOverride +} func (e *DoesNotExistException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The content of the association document matches another document. Change the // content of the document and try again. type DuplicateDocumentContent struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *DuplicateDocumentContent) Error() string { @@ -411,13 +578,22 @@ func (e *DuplicateDocumentContent) ErrorMessage() string { } return *e.Message } -func (e *DuplicateDocumentContent) ErrorCode() string { return "DuplicateDocumentContent" } +func (e *DuplicateDocumentContent) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DuplicateDocumentContent" + } + return *e.ErrorCodeOverride +} func (e *DuplicateDocumentContent) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The version name has already been used in this document. Specify a different // version name, and then try again. type DuplicateDocumentVersionName struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *DuplicateDocumentVersionName) Error() string { @@ -429,12 +605,21 @@ func (e *DuplicateDocumentVersionName) ErrorMessage() string { } return *e.Message } -func (e *DuplicateDocumentVersionName) ErrorCode() string { return "DuplicateDocumentVersionName" } +func (e *DuplicateDocumentVersionName) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DuplicateDocumentVersionName" + } + return *e.ErrorCodeOverride +} func (e *DuplicateDocumentVersionName) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// You cannot specify an instance ID in more than one association. +// You can't specify a managed node ID in more than one association. type DuplicateInstanceId struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *DuplicateInstanceId) Error() string { @@ -446,13 +631,22 @@ func (e *DuplicateInstanceId) ErrorMessage() string { } return *e.Message } -func (e *DuplicateInstanceId) ErrorCode() string { return "DuplicateInstanceId" } +func (e *DuplicateInstanceId) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DuplicateInstanceId" + } + return *e.ErrorCodeOverride +} func (e *DuplicateInstanceId) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // You attempted to register a LAMBDA or STEP_FUNCTIONS task in a region where the -// corresponding service is not available. +// corresponding service isn't available. type FeatureNotAvailableException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *FeatureNotAvailableException) Error() string { @@ -464,15 +658,23 @@ func (e *FeatureNotAvailableException) ErrorMessage() string { } return *e.Message } -func (e *FeatureNotAvailableException) ErrorCode() string { return "FeatureNotAvailableException" } +func (e *FeatureNotAvailableException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "FeatureNotAvailableException" + } + return *e.ErrorCodeOverride +} func (e *FeatureNotAvailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // A hierarchy can have a maximum of 15 levels. For more information, see -// Requirements and constraints for parameter names -// (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-parameter-name-constraints.html) -// in the AWS Systems Manager User Guide. +// Requirements and constraints for parameter names (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-parameter-name-constraints.html) +// in the Amazon Web Services Systems Manager User Guide. type HierarchyLevelLimitExceededException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *HierarchyLevelLimitExceededException) Error() string { @@ -485,17 +687,24 @@ func (e *HierarchyLevelLimitExceededException) ErrorMessage() string { return *e.Message } func (e *HierarchyLevelLimitExceededException) ErrorCode() string { - return "HierarchyLevelLimitExceededException" + if e == nil || e.ErrorCodeOverride == nil { + return "HierarchyLevelLimitExceededException" + } + return *e.ErrorCodeOverride } func (e *HierarchyLevelLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// Parameter Store does not support changing a parameter type in a hierarchy. For -// example, you can't change a parameter from a String type to a SecureString type. -// You must create a new, unique parameter. +// Parameter Store doesn't support changing a parameter type in a hierarchy. For +// example, you can't change a parameter from a String type to a SecureString +// type. You must create a new, unique parameter. type HierarchyTypeMismatchException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *HierarchyTypeMismatchException) Error() string { @@ -507,13 +716,22 @@ func (e *HierarchyTypeMismatchException) ErrorMessage() string { } return *e.Message } -func (e *HierarchyTypeMismatchException) ErrorCode() string { return "HierarchyTypeMismatchException" } +func (e *HierarchyTypeMismatchException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "HierarchyTypeMismatchException" + } + return *e.ErrorCodeOverride +} func (e *HierarchyTypeMismatchException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Error returned when an idempotent operation is retried and the parameters don't // match the original call to the API with the same idempotency token. type IdempotentParameterMismatch struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *IdempotentParameterMismatch) Error() string { @@ -525,14 +743,23 @@ func (e *IdempotentParameterMismatch) ErrorMessage() string { } return *e.Message } -func (e *IdempotentParameterMismatch) ErrorCode() string { return "IdempotentParameterMismatch" } +func (e *IdempotentParameterMismatch) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "IdempotentParameterMismatch" + } + return *e.ErrorCodeOverride +} func (e *IdempotentParameterMismatch) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// There is a conflict in the policies specified for this parameter. You can't, for -// example, specify two Expiration policies for a parameter. Review your policies, -// and try again. +// There is a conflict in the policies specified for this parameter. You can't, +// for example, specify two Expiration policies for a parameter. Review your +// policies, and try again. type IncompatiblePolicyException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *IncompatiblePolicyException) Error() string { @@ -544,12 +771,21 @@ func (e *IncompatiblePolicyException) ErrorMessage() string { } return *e.Message } -func (e *IncompatiblePolicyException) ErrorCode() string { return "IncompatiblePolicyException" } +func (e *IncompatiblePolicyException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "IncompatiblePolicyException" + } + return *e.ErrorCodeOverride +} func (e *IncompatiblePolicyException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // An error occurred on the server side. type InternalServerError struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InternalServerError) Error() string { @@ -561,13 +797,22 @@ func (e *InternalServerError) ErrorMessage() string { } return *e.Message } -func (e *InternalServerError) ErrorCode() string { return "InternalServerError" } +func (e *InternalServerError) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InternalServerError" + } + return *e.ErrorCodeOverride +} func (e *InternalServerError) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } -// The activation is not valid. The activation might have been deleted, or the -// ActivationId and the ActivationCode do not match. +// The activation isn't valid. The activation might have been deleted, or the +// ActivationId and the ActivationCode don't match. type InvalidActivation struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidActivation) Error() string { @@ -579,13 +824,22 @@ func (e *InvalidActivation) ErrorMessage() string { } return *e.Message } -func (e *InvalidActivation) ErrorCode() string { return "InvalidActivation" } +func (e *InvalidActivation) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidActivation" + } + return *e.ErrorCodeOverride +} func (e *InvalidActivation) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The activation ID is not valid. Verify the you entered the correct ActivationId +// The activation ID isn't valid. Verify the you entered the correct ActivationId // or ActivationCode and try again. type InvalidActivationId struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidActivationId) Error() string { @@ -597,14 +851,23 @@ func (e *InvalidActivationId) ErrorMessage() string { } return *e.Message } -func (e *InvalidActivationId) ErrorCode() string { return "InvalidActivationId" } +func (e *InvalidActivationId) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidActivationId" + } + return *e.ErrorCodeOverride +} func (e *InvalidActivationId) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The specified aggregator is not valid for inventory groups. Verify that the +// The specified aggregator isn't valid for inventory groups. Verify that the // aggregator uses a valid inventory type such as AWS:Application or -// AWS:InstanceInformation. +// AWS:InstanceInformation . type InvalidAggregatorException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidAggregatorException) Error() string { @@ -616,12 +879,21 @@ func (e *InvalidAggregatorException) ErrorMessage() string { } return *e.Message } -func (e *InvalidAggregatorException) ErrorCode() string { return "InvalidAggregatorException" } +func (e *InvalidAggregatorException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidAggregatorException" + } + return *e.ErrorCodeOverride +} func (e *InvalidAggregatorException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The request does not meet the regular expression requirement. +// The request doesn't meet the regular expression requirement. type InvalidAllowedPatternException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidAllowedPatternException) Error() string { @@ -633,12 +905,21 @@ func (e *InvalidAllowedPatternException) ErrorMessage() string { } return *e.Message } -func (e *InvalidAllowedPatternException) ErrorCode() string { return "InvalidAllowedPatternException" } +func (e *InvalidAllowedPatternException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidAllowedPatternException" + } + return *e.ErrorCodeOverride +} func (e *InvalidAllowedPatternException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The association is not valid or does not exist. +// The association isn't valid or doesn't exist. type InvalidAssociation struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidAssociation) Error() string { @@ -650,14 +931,23 @@ func (e *InvalidAssociation) ErrorMessage() string { } return *e.Message } -func (e *InvalidAssociation) ErrorCode() string { return "InvalidAssociation" } +func (e *InvalidAssociation) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidAssociation" + } + return *e.ErrorCodeOverride +} func (e *InvalidAssociation) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The version you specified is not valid. Use ListAssociationVersions to view all +// The version you specified isn't valid. Use ListAssociationVersions to view all // versions of an association according to the association ID. Or, use the $LATEST // parameter to view the latest version of the association. type InvalidAssociationVersion struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidAssociationVersion) Error() string { @@ -669,14 +959,23 @@ func (e *InvalidAssociationVersion) ErrorMessage() string { } return *e.Message } -func (e *InvalidAssociationVersion) ErrorCode() string { return "InvalidAssociationVersion" } +func (e *InvalidAssociationVersion) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidAssociationVersion" + } + return *e.ErrorCodeOverride +} func (e *InvalidAssociationVersion) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The supplied parameters for invoking the specified Automation document are +// The supplied parameters for invoking the specified Automation runbook are // incorrect. For example, they may not match the set of parameters permitted for // the specified Automation document. type InvalidAutomationExecutionParametersException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidAutomationExecutionParametersException) Error() string { @@ -689,15 +988,22 @@ func (e *InvalidAutomationExecutionParametersException) ErrorMessage() string { return *e.Message } func (e *InvalidAutomationExecutionParametersException) ErrorCode() string { - return "InvalidAutomationExecutionParametersException" + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidAutomationExecutionParametersException" + } + return *e.ErrorCodeOverride } func (e *InvalidAutomationExecutionParametersException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The signal is not valid for the current Automation execution. +// The signal isn't valid for the current Automation execution. type InvalidAutomationSignalException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidAutomationSignalException) Error() string { @@ -710,13 +1016,20 @@ func (e *InvalidAutomationSignalException) ErrorMessage() string { return *e.Message } func (e *InvalidAutomationSignalException) ErrorCode() string { - return "InvalidAutomationSignalException" + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidAutomationSignalException" + } + return *e.ErrorCodeOverride } func (e *InvalidAutomationSignalException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The specified update status operation is not valid. +// The specified update status operation isn't valid. type InvalidAutomationStatusUpdateException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidAutomationStatusUpdateException) Error() string { @@ -729,14 +1042,22 @@ func (e *InvalidAutomationStatusUpdateException) ErrorMessage() string { return *e.Message } func (e *InvalidAutomationStatusUpdateException) ErrorCode() string { - return "InvalidAutomationStatusUpdateException" + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidAutomationStatusUpdateException" + } + return *e.ErrorCodeOverride } func (e *InvalidAutomationStatusUpdateException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The specified command ID isn't valid. Verify the ID and try again. type InvalidCommandId struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidCommandId) Error() string { @@ -748,13 +1069,22 @@ func (e *InvalidCommandId) ErrorMessage() string { } return *e.Message } -func (e *InvalidCommandId) ErrorCode() string { return "InvalidCommandId" } +func (e *InvalidCommandId) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidCommandId" + } + return *e.ErrorCodeOverride +} func (e *InvalidCommandId) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// One or more of the parameters specified for the delete operation is not valid. +// One or more of the parameters specified for the delete operation isn't valid. // Verify all parameters and try again. type InvalidDeleteInventoryParametersException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidDeleteInventoryParametersException) Error() string { @@ -767,16 +1097,23 @@ func (e *InvalidDeleteInventoryParametersException) ErrorMessage() string { return *e.Message } func (e *InvalidDeleteInventoryParametersException) ErrorCode() string { - return "InvalidDeleteInventoryParametersException" + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidDeleteInventoryParametersException" + } + return *e.ErrorCodeOverride } func (e *InvalidDeleteInventoryParametersException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The ID specified for the delete operation does not exist or is not valid. Verify +// The ID specified for the delete operation doesn't exist or isn't valid. Verify // the ID and try again. type InvalidDeletionIdException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidDeletionIdException) Error() string { @@ -788,12 +1125,21 @@ func (e *InvalidDeletionIdException) ErrorMessage() string { } return *e.Message } -func (e *InvalidDeletionIdException) ErrorCode() string { return "InvalidDeletionIdException" } +func (e *InvalidDeletionIdException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidDeletionIdException" + } + return *e.ErrorCodeOverride +} func (e *InvalidDeletionIdException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The specified document does not exist. +// The specified SSM document doesn't exist. type InvalidDocument struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidDocument) Error() string { @@ -805,12 +1151,21 @@ func (e *InvalidDocument) ErrorMessage() string { } return *e.Message } -func (e *InvalidDocument) ErrorCode() string { return "InvalidDocument" } +func (e *InvalidDocument) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidDocument" + } + return *e.ErrorCodeOverride +} func (e *InvalidDocument) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The content for the document is not valid. +// The content for the document isn't valid. type InvalidDocumentContent struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidDocumentContent) Error() string { @@ -822,13 +1177,22 @@ func (e *InvalidDocumentContent) ErrorMessage() string { } return *e.Message } -func (e *InvalidDocumentContent) ErrorCode() string { return "InvalidDocumentContent" } +func (e *InvalidDocumentContent) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidDocumentContent" + } + return *e.ErrorCodeOverride +} func (e *InvalidDocumentContent) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // You attempted to delete a document while it is still shared. You must stop // sharing the document before you can delete it. type InvalidDocumentOperation struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidDocumentOperation) Error() string { @@ -840,12 +1204,21 @@ func (e *InvalidDocumentOperation) ErrorMessage() string { } return *e.Message } -func (e *InvalidDocumentOperation) ErrorCode() string { return "InvalidDocumentOperation" } +func (e *InvalidDocumentOperation) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidDocumentOperation" + } + return *e.ErrorCodeOverride +} func (e *InvalidDocumentOperation) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The version of the document schema is not supported. +// The version of the document schema isn't supported. type InvalidDocumentSchemaVersion struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidDocumentSchemaVersion) Error() string { @@ -857,13 +1230,22 @@ func (e *InvalidDocumentSchemaVersion) ErrorMessage() string { } return *e.Message } -func (e *InvalidDocumentSchemaVersion) ErrorCode() string { return "InvalidDocumentSchemaVersion" } +func (e *InvalidDocumentSchemaVersion) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidDocumentSchemaVersion" + } + return *e.ErrorCodeOverride +} func (e *InvalidDocumentSchemaVersion) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The document type is not valid. Valid document types are described in the +// The SSM document type isn't valid. Valid document types are described in the // DocumentType property. type InvalidDocumentType struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidDocumentType) Error() string { @@ -875,12 +1257,21 @@ func (e *InvalidDocumentType) ErrorMessage() string { } return *e.Message } -func (e *InvalidDocumentType) ErrorCode() string { return "InvalidDocumentType" } +func (e *InvalidDocumentType) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidDocumentType" + } + return *e.ErrorCodeOverride +} func (e *InvalidDocumentType) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The document version is not valid or does not exist. +// The document version isn't valid or doesn't exist. type InvalidDocumentVersion struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidDocumentVersion) Error() string { @@ -892,13 +1283,22 @@ func (e *InvalidDocumentVersion) ErrorMessage() string { } return *e.Message } -func (e *InvalidDocumentVersion) ErrorCode() string { return "InvalidDocumentVersion" } +func (e *InvalidDocumentVersion) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidDocumentVersion" + } + return *e.ErrorCodeOverride +} func (e *InvalidDocumentVersion) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The filter name is not valid. Verify the you entered the correct name and try +// The filter name isn't valid. Verify the you entered the correct name and try // again. type InvalidFilter struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidFilter) Error() string { @@ -910,12 +1310,21 @@ func (e *InvalidFilter) ErrorMessage() string { } return *e.Message } -func (e *InvalidFilter) ErrorCode() string { return "InvalidFilter" } +func (e *InvalidFilter) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidFilter" + } + return *e.ErrorCodeOverride +} func (e *InvalidFilter) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The specified key is not valid. +// The specified key isn't valid. type InvalidFilterKey struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidFilterKey) Error() string { @@ -927,13 +1336,22 @@ func (e *InvalidFilterKey) ErrorMessage() string { } return *e.Message } -func (e *InvalidFilterKey) ErrorCode() string { return "InvalidFilterKey" } +func (e *InvalidFilterKey) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidFilterKey" + } + return *e.ErrorCodeOverride +} func (e *InvalidFilterKey) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The specified filter option is not valid. Valid options are Equals and +// The specified filter option isn't valid. Valid options are Equals and // BeginsWith. For Path filter, valid options are Recursive and OneLevel. type InvalidFilterOption struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidFilterOption) Error() string { @@ -945,12 +1363,21 @@ func (e *InvalidFilterOption) ErrorMessage() string { } return *e.Message } -func (e *InvalidFilterOption) ErrorCode() string { return "InvalidFilterOption" } +func (e *InvalidFilterOption) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidFilterOption" + } + return *e.ErrorCodeOverride +} func (e *InvalidFilterOption) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The filter value is not valid. Verify the value and try again. +// The filter value isn't valid. Verify the value and try again. type InvalidFilterValue struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidFilterValue) Error() string { @@ -962,16 +1389,28 @@ func (e *InvalidFilterValue) ErrorMessage() string { } return *e.Message } -func (e *InvalidFilterValue) ErrorCode() string { return "InvalidFilterValue" } +func (e *InvalidFilterValue) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidFilterValue" + } + return *e.ErrorCodeOverride +} func (e *InvalidFilterValue) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The following problems can cause this exception: You do not have permission to -// access the instance. SSM Agent is not running. Verify that SSM Agent is running. -// SSM Agent is not registered with the SSM endpoint. Try reinstalling SSM Agent. -// The instance is not in valid state. Valid states are: Running, Pending, Stopped, -// Stopping. Invalid states are: Shutting-down and Terminated. +// The following problems can cause this exception: +// - You don't have permission to access the managed node. +// - Amazon Web Services Systems Manager Agent(SSM Agent) isn't running. Verify +// that SSM Agent is running. +// - SSM Agent isn't registered with the SSM endpoint. Try reinstalling SSM +// Agent. +// - The managed node isn't in valid state. Valid states are: Running , Pending , +// Stopped , and Stopping . Invalid states are: Shutting-down and Terminated . type InvalidInstanceId struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidInstanceId) Error() string { @@ -983,12 +1422,21 @@ func (e *InvalidInstanceId) ErrorMessage() string { } return *e.Message } -func (e *InvalidInstanceId) ErrorCode() string { return "InvalidInstanceId" } +func (e *InvalidInstanceId) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidInstanceId" + } + return *e.ErrorCodeOverride +} func (e *InvalidInstanceId) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The specified filter value is not valid. +// The specified filter value isn't valid. type InvalidInstanceInformationFilterValue struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidInstanceInformationFilterValue) Error() string { @@ -1001,15 +1449,22 @@ func (e *InvalidInstanceInformationFilterValue) ErrorMessage() string { return *e.Message } func (e *InvalidInstanceInformationFilterValue) ErrorCode() string { - return "InvalidInstanceInformationFilterValue" + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidInstanceInformationFilterValue" + } + return *e.ErrorCodeOverride } func (e *InvalidInstanceInformationFilterValue) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The specified inventory group is not valid. +// The specified inventory group isn't valid. type InvalidInventoryGroupException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidInventoryGroupException) Error() string { @@ -1021,13 +1476,22 @@ func (e *InvalidInventoryGroupException) ErrorMessage() string { } return *e.Message } -func (e *InvalidInventoryGroupException) ErrorCode() string { return "InvalidInventoryGroupException" } +func (e *InvalidInventoryGroupException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidInventoryGroupException" + } + return *e.ErrorCodeOverride +} func (e *InvalidInventoryGroupException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// You specified invalid keys or values in the Context attribute for InventoryItem. -// Verify the keys and values, and try again. +// You specified invalid keys or values in the Context attribute for InventoryItem +// . Verify the keys and values, and try again. type InvalidInventoryItemContextException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidInventoryItemContextException) Error() string { @@ -1040,15 +1504,22 @@ func (e *InvalidInventoryItemContextException) ErrorMessage() string { return *e.Message } func (e *InvalidInventoryItemContextException) ErrorCode() string { - return "InvalidInventoryItemContextException" + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidInventoryItemContextException" + } + return *e.ErrorCodeOverride } func (e *InvalidInventoryItemContextException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The request is not valid. +// The request isn't valid. type InvalidInventoryRequestException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidInventoryRequestException) Error() string { @@ -1061,15 +1532,22 @@ func (e *InvalidInventoryRequestException) ErrorMessage() string { return *e.Message } func (e *InvalidInventoryRequestException) ErrorCode() string { - return "InvalidInventoryRequestException" + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidInventoryRequestException" + } + return *e.ErrorCodeOverride } func (e *InvalidInventoryRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// One or more content items is not valid. +// One or more content items isn't valid. type InvalidItemContentException struct { Message *string + ErrorCodeOverride *string + TypeName *string + + noSmithyDocumentSerde } func (e *InvalidItemContentException) Error() string { @@ -1081,12 +1559,21 @@ func (e *InvalidItemContentException) ErrorMessage() string { } return *e.Message } -func (e *InvalidItemContentException) ErrorCode() string { return "InvalidItemContentException" } +func (e *InvalidItemContentException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidItemContentException" + } + return *e.ErrorCodeOverride +} func (e *InvalidItemContentException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The query key ID is not valid. +// The query key ID isn't valid. type InvalidKeyId struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidKeyId) Error() string { @@ -1098,12 +1585,21 @@ func (e *InvalidKeyId) ErrorMessage() string { } return *e.Message } -func (e *InvalidKeyId) ErrorCode() string { return "InvalidKeyId" } +func (e *InvalidKeyId) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidKeyId" + } + return *e.ErrorCodeOverride +} func (e *InvalidKeyId) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The specified token is not valid. +// The specified token isn't valid. type InvalidNextToken struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidNextToken) Error() string { @@ -1115,13 +1611,23 @@ func (e *InvalidNextToken) ErrorMessage() string { } return *e.Message } -func (e *InvalidNextToken) ErrorCode() string { return "InvalidNextToken" } +func (e *InvalidNextToken) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidNextToken" + } + return *e.ErrorCodeOverride +} func (e *InvalidNextToken) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// One or more configuration items is not valid. Verify that a valid Amazon -// Resource Name (ARN) was provided for an Amazon SNS topic. +// One or more configuration items isn't valid. Verify that a valid Amazon +// Resource Name (ARN) was provided for an Amazon Simple Notification Service +// topic. type InvalidNotificationConfig struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidNotificationConfig) Error() string { @@ -1133,13 +1639,22 @@ func (e *InvalidNotificationConfig) ErrorMessage() string { } return *e.Message } -func (e *InvalidNotificationConfig) ErrorCode() string { return "InvalidNotificationConfig" } +func (e *InvalidNotificationConfig) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidNotificationConfig" + } + return *e.ErrorCodeOverride +} func (e *InvalidNotificationConfig) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The delete inventory option specified is not valid. Verify the option and try +// The delete inventory option specified isn't valid. Verify the option and try // again. type InvalidOptionException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidOptionException) Error() string { @@ -1151,12 +1666,21 @@ func (e *InvalidOptionException) ErrorMessage() string { } return *e.Message } -func (e *InvalidOptionException) ErrorCode() string { return "InvalidOptionException" } +func (e *InvalidOptionException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidOptionException" + } + return *e.ErrorCodeOverride +} func (e *InvalidOptionException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The S3 bucket does not exist. +// The S3 bucket doesn't exist. type InvalidOutputFolder struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidOutputFolder) Error() string { @@ -1168,12 +1692,21 @@ func (e *InvalidOutputFolder) ErrorMessage() string { } return *e.Message } -func (e *InvalidOutputFolder) ErrorCode() string { return "InvalidOutputFolder" } +func (e *InvalidOutputFolder) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidOutputFolder" + } + return *e.ErrorCodeOverride +} func (e *InvalidOutputFolder) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The output location is not valid or does not exist. +// The output location isn't valid or doesn't exist. type InvalidOutputLocation struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidOutputLocation) Error() string { @@ -1185,14 +1718,23 @@ func (e *InvalidOutputLocation) ErrorMessage() string { } return *e.Message } -func (e *InvalidOutputLocation) ErrorCode() string { return "InvalidOutputLocation" } +func (e *InvalidOutputLocation) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidOutputLocation" + } + return *e.ErrorCodeOverride +} func (e *InvalidOutputLocation) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// You must specify values for all required parameters in the Systems Manager -// document. You can only supply values to parameters defined in the Systems -// Manager document. +// You must specify values for all required parameters in the Amazon Web Services +// Systems Manager document (SSM document). You can only supply values to +// parameters defined in the SSM document. type InvalidParameters struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidParameters) Error() string { @@ -1204,13 +1746,22 @@ func (e *InvalidParameters) ErrorMessage() string { } return *e.Message } -func (e *InvalidParameters) ErrorCode() string { return "InvalidParameters" } +func (e *InvalidParameters) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidParameters" + } + return *e.ErrorCodeOverride +} func (e *InvalidParameters) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The permission type is not supported. Share is the only supported permission +// The permission type isn't supported. Share is the only supported permission // type. type InvalidPermissionType struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidPermissionType) Error() string { @@ -1222,12 +1773,21 @@ func (e *InvalidPermissionType) ErrorMessage() string { } return *e.Message } -func (e *InvalidPermissionType) ErrorCode() string { return "InvalidPermissionType" } +func (e *InvalidPermissionType) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidPermissionType" + } + return *e.ErrorCodeOverride +} func (e *InvalidPermissionType) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The plugin name is not valid. +// The plugin name isn't valid. type InvalidPluginName struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidPluginName) Error() string { @@ -1239,12 +1799,21 @@ func (e *InvalidPluginName) ErrorMessage() string { } return *e.Message } -func (e *InvalidPluginName) ErrorCode() string { return "InvalidPluginName" } +func (e *InvalidPluginName) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidPluginName" + } + return *e.ErrorCodeOverride +} func (e *InvalidPluginName) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // A policy attribute or its value is invalid. type InvalidPolicyAttributeException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidPolicyAttributeException) Error() string { @@ -1257,14 +1826,21 @@ func (e *InvalidPolicyAttributeException) ErrorMessage() string { return *e.Message } func (e *InvalidPolicyAttributeException) ErrorCode() string { - return "InvalidPolicyAttributeException" + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidPolicyAttributeException" + } + return *e.ErrorCodeOverride } func (e *InvalidPolicyAttributeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The policy type is not supported. Parameter Store supports the following policy +// The policy type isn't supported. Parameter Store supports the following policy // types: Expiration, ExpirationNotification, and NoChangeNotification. type InvalidPolicyTypeException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidPolicyTypeException) Error() string { @@ -1276,13 +1852,22 @@ func (e *InvalidPolicyTypeException) ErrorMessage() string { } return *e.Message } -func (e *InvalidPolicyTypeException) ErrorCode() string { return "InvalidPolicyTypeException" } +func (e *InvalidPolicyTypeException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidPolicyTypeException" + } + return *e.ErrorCodeOverride +} func (e *InvalidPolicyTypeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The resource ID is not valid. Verify that you entered the correct ID and try +// The resource ID isn't valid. Verify that you entered the correct ID and try // again. type InvalidResourceId struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidResourceId) Error() string { @@ -1294,13 +1879,22 @@ func (e *InvalidResourceId) ErrorMessage() string { } return *e.Message } -func (e *InvalidResourceId) ErrorCode() string { return "InvalidResourceId" } +func (e *InvalidResourceId) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidResourceId" + } + return *e.ErrorCodeOverride +} func (e *InvalidResourceId) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The resource type is not valid. For example, if you are attempting to tag an -// instance, the instance must be a registered, managed instance. +// The resource type isn't valid. For example, if you are attempting to tag an EC2 +// instance, the instance must be a registered managed node. type InvalidResourceType struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidResourceType) Error() string { @@ -1312,12 +1906,21 @@ func (e *InvalidResourceType) ErrorMessage() string { } return *e.Message } -func (e *InvalidResourceType) ErrorCode() string { return "InvalidResourceType" } +func (e *InvalidResourceType) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidResourceType" + } + return *e.ErrorCodeOverride +} func (e *InvalidResourceType) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The specified inventory item result attribute is not valid. +// The specified inventory item result attribute isn't valid. type InvalidResultAttributeException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidResultAttributeException) Error() string { @@ -1330,18 +1933,24 @@ func (e *InvalidResultAttributeException) ErrorMessage() string { return *e.Message } func (e *InvalidResultAttributeException) ErrorCode() string { - return "InvalidResultAttributeException" + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidResultAttributeException" + } + return *e.ErrorCodeOverride } func (e *InvalidResultAttributeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The role name can't contain invalid characters. Also verify that you specified // an IAM role for notifications that includes the required trust policy. For // information about configuring the IAM role for Run Command notifications, see -// Configuring Amazon SNS Notifications for Run Command -// (https://docs.aws.amazon.com/systems-manager/latest/userguide/rc-sns-notifications.html) -// in the AWS Systems Manager User Guide. +// Configuring Amazon SNS Notifications for Run Command (https://docs.aws.amazon.com/systems-manager/latest/userguide/rc-sns-notifications.html) +// in the Amazon Web Services Systems Manager User Guide. type InvalidRole struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidRole) Error() string { @@ -1353,12 +1962,21 @@ func (e *InvalidRole) ErrorMessage() string { } return *e.Message } -func (e *InvalidRole) ErrorCode() string { return "InvalidRole" } +func (e *InvalidRole) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidRole" + } + return *e.ErrorCodeOverride +} func (e *InvalidRole) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The schedule is invalid. Verify your cron or rate expression and try again. type InvalidSchedule struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidSchedule) Error() string { @@ -1370,13 +1988,48 @@ func (e *InvalidSchedule) ErrorMessage() string { } return *e.Message } -func (e *InvalidSchedule) ErrorCode() string { return "InvalidSchedule" } +func (e *InvalidSchedule) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidSchedule" + } + return *e.ErrorCodeOverride +} func (e *InvalidSchedule) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The target is not valid or does not exist. It might not be configured for -// Systems Manager or you might not have permission to perform the operation. +// The specified tag key or value isn't valid. +type InvalidTag struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidTag) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidTag) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidTag) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidTag" + } + return *e.ErrorCodeOverride +} +func (e *InvalidTag) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The target isn't valid or doesn't exist. It might not be configured for Systems +// Manager or you might not have permission to perform the operation. type InvalidTarget struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidTarget) Error() string { @@ -1388,12 +2041,47 @@ func (e *InvalidTarget) ErrorMessage() string { } return *e.Message } -func (e *InvalidTarget) ErrorCode() string { return "InvalidTarget" } +func (e *InvalidTarget) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidTarget" + } + return *e.ErrorCodeOverride +} func (e *InvalidTarget) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The parameter type name is not valid. +// TargetMap parameter isn't valid. +type InvalidTargetMaps struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidTargetMaps) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidTargetMaps) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidTargetMaps) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidTargetMaps" + } + return *e.ErrorCodeOverride +} +func (e *InvalidTargetMaps) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The parameter type name isn't valid. type InvalidTypeNameException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidTypeNameException) Error() string { @@ -1405,12 +2093,21 @@ func (e *InvalidTypeNameException) ErrorMessage() string { } return *e.Message } -func (e *InvalidTypeNameException) ErrorCode() string { return "InvalidTypeNameException" } +func (e *InvalidTypeNameException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidTypeNameException" + } + return *e.ErrorCodeOverride +} func (e *InvalidTypeNameException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The update is not valid. +// The update isn't valid. type InvalidUpdate struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidUpdate) Error() string { @@ -1422,13 +2119,22 @@ func (e *InvalidUpdate) ErrorMessage() string { } return *e.Message } -func (e *InvalidUpdate) ErrorCode() string { return "InvalidUpdate" } +func (e *InvalidUpdate) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidUpdate" + } + return *e.ErrorCodeOverride +} func (e *InvalidUpdate) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The command ID and instance ID you specified did not match any invocations. -// Verify the command ID and the instance ID and try again. +// The command ID and managed node ID you specified didn't match any invocations. +// Verify the command ID and the managed node ID and try again. type InvocationDoesNotExist struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvocationDoesNotExist) Error() string { @@ -1440,14 +2146,23 @@ func (e *InvocationDoesNotExist) ErrorMessage() string { } return *e.Message } -func (e *InvocationDoesNotExist) ErrorCode() string { return "InvocationDoesNotExist" } +func (e *InvocationDoesNotExist) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvocationDoesNotExist" + } + return *e.ErrorCodeOverride +} func (e *InvocationDoesNotExist) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The inventory item has invalid content. type ItemContentMismatchException struct { Message *string + ErrorCodeOverride *string + TypeName *string + + noSmithyDocumentSerde } func (e *ItemContentMismatchException) Error() string { @@ -1459,14 +2174,23 @@ func (e *ItemContentMismatchException) ErrorMessage() string { } return *e.Message } -func (e *ItemContentMismatchException) ErrorCode() string { return "ItemContentMismatchException" } +func (e *ItemContentMismatchException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ItemContentMismatchException" + } + return *e.ErrorCodeOverride +} func (e *ItemContentMismatchException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The inventory item size has exceeded the size limit. type ItemSizeLimitExceededException struct { Message *string + ErrorCodeOverride *string + TypeName *string + + noSmithyDocumentSerde } func (e *ItemSizeLimitExceededException) Error() string { @@ -1478,12 +2202,21 @@ func (e *ItemSizeLimitExceededException) ErrorMessage() string { } return *e.Message } -func (e *ItemSizeLimitExceededException) ErrorCode() string { return "ItemSizeLimitExceededException" } +func (e *ItemSizeLimitExceededException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ItemSizeLimitExceededException" + } + return *e.ErrorCodeOverride +} func (e *ItemSizeLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The size limit of a document is 64 KB. type MaxDocumentSizeExceeded struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *MaxDocumentSizeExceeded) Error() string { @@ -1495,14 +2228,51 @@ func (e *MaxDocumentSizeExceeded) ErrorMessage() string { } return *e.Message } -func (e *MaxDocumentSizeExceeded) ErrorCode() string { return "MaxDocumentSizeExceeded" } +func (e *MaxDocumentSizeExceeded) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "MaxDocumentSizeExceeded" + } + return *e.ErrorCodeOverride +} func (e *MaxDocumentSizeExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// You don't have permission to view OpsItems in the specified account. Verify +// that your account is configured either as a Systems Manager delegated +// administrator or that you are logged into the Organizations management account. +type OpsItemAccessDeniedException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *OpsItemAccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *OpsItemAccessDeniedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *OpsItemAccessDeniedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "OpsItemAccessDeniedException" + } + return *e.ErrorCodeOverride +} +func (e *OpsItemAccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The OpsItem already exists. type OpsItemAlreadyExistsException struct { Message *string + ErrorCodeOverride *string + OpsItemId *string + + noSmithyDocumentSerde } func (e *OpsItemAlreadyExistsException) Error() string { @@ -1514,15 +2284,50 @@ func (e *OpsItemAlreadyExistsException) ErrorMessage() string { } return *e.Message } -func (e *OpsItemAlreadyExistsException) ErrorCode() string { return "OpsItemAlreadyExistsException" } +func (e *OpsItemAlreadyExistsException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "OpsItemAlreadyExistsException" + } + return *e.ErrorCodeOverride +} func (e *OpsItemAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The specified OpsItem is in the process of being deleted. +type OpsItemConflictException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *OpsItemConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *OpsItemConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *OpsItemConflictException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "OpsItemConflictException" + } + return *e.ErrorCodeOverride +} +func (e *OpsItemConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // A specified parameter argument isn't valid. Verify the available arguments and // try again. type OpsItemInvalidParameterException struct { Message *string + ErrorCodeOverride *string + ParameterNames []string + + noSmithyDocumentSerde } func (e *OpsItemInvalidParameterException) Error() string { @@ -1535,19 +2340,24 @@ func (e *OpsItemInvalidParameterException) ErrorMessage() string { return *e.Message } func (e *OpsItemInvalidParameterException) ErrorCode() string { - return "OpsItemInvalidParameterException" + if e == nil || e.ErrorCodeOverride == nil { + return "OpsItemInvalidParameterException" + } + return *e.ErrorCodeOverride } func (e *OpsItemInvalidParameterException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The request caused OpsItems to exceed one or more quotas. For information about -// OpsItem quotas, see What are the resource limits for OpsCenter? -// (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-learn-more.html#OpsCenter-learn-more-limits). +// The request caused OpsItems to exceed one or more quotas. type OpsItemLimitExceededException struct { Message *string + ErrorCodeOverride *string + ResourceTypes []string Limit int32 LimitType *string + + noSmithyDocumentSerde } func (e *OpsItemLimitExceededException) Error() string { @@ -1559,12 +2369,21 @@ func (e *OpsItemLimitExceededException) ErrorMessage() string { } return *e.Message } -func (e *OpsItemLimitExceededException) ErrorCode() string { return "OpsItemLimitExceededException" } +func (e *OpsItemLimitExceededException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "OpsItemLimitExceededException" + } + return *e.ErrorCodeOverride +} func (e *OpsItemLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The specified OpsItem ID doesn't exist. Verify the ID and try again. type OpsItemNotFoundException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *OpsItemNotFoundException) Error() string { @@ -1576,12 +2395,81 @@ func (e *OpsItemNotFoundException) ErrorMessage() string { } return *e.Message } -func (e *OpsItemNotFoundException) ErrorCode() string { return "OpsItemNotFoundException" } +func (e *OpsItemNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "OpsItemNotFoundException" + } + return *e.ErrorCodeOverride +} func (e *OpsItemNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The Amazon Resource Name (ARN) is already associated with the OpsItem. +type OpsItemRelatedItemAlreadyExistsException struct { + Message *string + + ErrorCodeOverride *string + + ResourceUri *string + OpsItemId *string + + noSmithyDocumentSerde +} + +func (e *OpsItemRelatedItemAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *OpsItemRelatedItemAlreadyExistsException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *OpsItemRelatedItemAlreadyExistsException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "OpsItemRelatedItemAlreadyExistsException" + } + return *e.ErrorCodeOverride +} +func (e *OpsItemRelatedItemAlreadyExistsException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The association wasn't found using the parameters you specified in the call. +// Verify the information and try again. +type OpsItemRelatedItemAssociationNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *OpsItemRelatedItemAssociationNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *OpsItemRelatedItemAssociationNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *OpsItemRelatedItemAssociationNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "OpsItemRelatedItemAssociationNotFoundException" + } + return *e.ErrorCodeOverride +} +func (e *OpsItemRelatedItemAssociationNotFoundException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + // An OpsMetadata object already exists for the selected resource. type OpsMetadataAlreadyExistsException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *OpsMetadataAlreadyExistsException) Error() string { @@ -1594,13 +2482,20 @@ func (e *OpsMetadataAlreadyExistsException) ErrorMessage() string { return *e.Message } func (e *OpsMetadataAlreadyExistsException) ErrorCode() string { - return "OpsMetadataAlreadyExistsException" + if e == nil || e.ErrorCodeOverride == nil { + return "OpsMetadataAlreadyExistsException" + } + return *e.ErrorCodeOverride } func (e *OpsMetadataAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // One of the arguments passed is invalid. type OpsMetadataInvalidArgumentException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *OpsMetadataInvalidArgumentException) Error() string { @@ -1613,7 +2508,10 @@ func (e *OpsMetadataInvalidArgumentException) ErrorMessage() string { return *e.Message } func (e *OpsMetadataInvalidArgumentException) ErrorCode() string { - return "OpsMetadataInvalidArgumentException" + if e == nil || e.ErrorCodeOverride == nil { + return "OpsMetadataInvalidArgumentException" + } + return *e.ErrorCodeOverride } func (e *OpsMetadataInvalidArgumentException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient @@ -1623,6 +2521,10 @@ func (e *OpsMetadataInvalidArgumentException) ErrorFault() smithy.ErrorFault { // can assign to an application in Application Manager. type OpsMetadataKeyLimitExceededException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *OpsMetadataKeyLimitExceededException) Error() string { @@ -1635,7 +2537,10 @@ func (e *OpsMetadataKeyLimitExceededException) ErrorMessage() string { return *e.Message } func (e *OpsMetadataKeyLimitExceededException) ErrorCode() string { - return "OpsMetadataKeyLimitExceededException" + if e == nil || e.ErrorCodeOverride == nil { + return "OpsMetadataKeyLimitExceededException" + } + return *e.ErrorCodeOverride } func (e *OpsMetadataKeyLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient @@ -1646,6 +2551,10 @@ func (e *OpsMetadataKeyLimitExceededException) ErrorFault() smithy.ErrorFault { // OpsMetadata object and try again. type OpsMetadataLimitExceededException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *OpsMetadataLimitExceededException) Error() string { @@ -1658,13 +2567,20 @@ func (e *OpsMetadataLimitExceededException) ErrorMessage() string { return *e.Message } func (e *OpsMetadataLimitExceededException) ErrorCode() string { - return "OpsMetadataLimitExceededException" + if e == nil || e.ErrorCodeOverride == nil { + return "OpsMetadataLimitExceededException" + } + return *e.ErrorCodeOverride } func (e *OpsMetadataLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The OpsMetadata object does not exist. +// The OpsMetadata object doesn't exist. type OpsMetadataNotFoundException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *OpsMetadataNotFoundException) Error() string { @@ -1676,13 +2592,22 @@ func (e *OpsMetadataNotFoundException) ErrorMessage() string { } return *e.Message } -func (e *OpsMetadataNotFoundException) ErrorCode() string { return "OpsMetadataNotFoundException" } +func (e *OpsMetadataNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "OpsMetadataNotFoundException" + } + return *e.ErrorCodeOverride +} func (e *OpsMetadataNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The system is processing too many concurrent updates. Wait a few moments and try -// again. +// The system is processing too many concurrent updates. Wait a few moments and +// try again. type OpsMetadataTooManyUpdatesException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *OpsMetadataTooManyUpdatesException) Error() string { @@ -1695,7 +2620,10 @@ func (e *OpsMetadataTooManyUpdatesException) ErrorMessage() string { return *e.Message } func (e *OpsMetadataTooManyUpdatesException) ErrorCode() string { - return "OpsMetadataTooManyUpdatesException" + if e == nil || e.ErrorCodeOverride == nil { + return "OpsMetadataTooManyUpdatesException" + } + return *e.ErrorCodeOverride } func (e *OpsMetadataTooManyUpdatesException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient @@ -1704,6 +2632,10 @@ func (e *OpsMetadataTooManyUpdatesException) ErrorFault() smithy.ErrorFault { // The parameter already exists. You can't create duplicate parameters. type ParameterAlreadyExists struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *ParameterAlreadyExists) Error() string { @@ -1715,13 +2647,22 @@ func (e *ParameterAlreadyExists) ErrorMessage() string { } return *e.Message } -func (e *ParameterAlreadyExists) ErrorCode() string { return "ParameterAlreadyExists" } +func (e *ParameterAlreadyExists) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ParameterAlreadyExists" + } + return *e.ErrorCodeOverride +} func (e *ParameterAlreadyExists) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// You have exceeded the number of parameters for this AWS account. Delete one or -// more parameters and try again. +// You have exceeded the number of parameters for this Amazon Web Services +// account. Delete one or more parameters and try again. type ParameterLimitExceeded struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *ParameterLimitExceeded) Error() string { @@ -1733,13 +2674,18 @@ func (e *ParameterLimitExceeded) ErrorMessage() string { } return *e.Message } -func (e *ParameterLimitExceeded) ErrorCode() string { return "ParameterLimitExceeded" } +func (e *ParameterLimitExceeded) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ParameterLimitExceeded" + } + return *e.ErrorCodeOverride +} func (e *ParameterLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Parameter Store retains the 100 most recently created versions of a parameter. // After this number of versions has been created, Parameter Store deletes the // oldest version when a new one is created. However, if the oldest version has a -// label attached to it, Parameter Store will not delete the version and instead +// label attached to it, Parameter Store won't delete the version and instead // presents this error message: An error occurred // (ParameterMaxVersionLimitExceeded) when calling the PutParameter operation: You // attempted to create a new version of parameter-name by calling the PutParameter @@ -1749,13 +2695,15 @@ func (e *ParameterLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy. // versions with mission critical labels assigned to them from being deleted. To // continue creating new parameters, first move the label from the oldest version // of the parameter to a newer one for use in your operations. For information -// about moving parameter labels, see Move a parameter label (console) -// (http://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-labels.html#sysman-paramstore-labels-console-move) -// or Move a parameter label (CLI) -// (http://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-labels.html#sysman-paramstore-labels-cli-move) -// in the AWS Systems Manager User Guide. +// about moving parameter labels, see Move a parameter label (console) (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-labels.html#sysman-paramstore-labels-console-move) +// or Move a parameter label (CLI) (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-labels.html#sysman-paramstore-labels-cli-move) +// in the Amazon Web Services Systems Manager User Guide. type ParameterMaxVersionLimitExceeded struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *ParameterMaxVersionLimitExceeded) Error() string { @@ -1768,13 +2716,20 @@ func (e *ParameterMaxVersionLimitExceeded) ErrorMessage() string { return *e.Message } func (e *ParameterMaxVersionLimitExceeded) ErrorCode() string { - return "ParameterMaxVersionLimitExceeded" + if e == nil || e.ErrorCodeOverride == nil { + return "ParameterMaxVersionLimitExceeded" + } + return *e.ErrorCodeOverride } func (e *ParameterMaxVersionLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The parameter could not be found. Verify the name and try again. +// The parameter couldn't be found. Verify the name and try again. type ParameterNotFound struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *ParameterNotFound) Error() string { @@ -1786,12 +2741,21 @@ func (e *ParameterNotFound) ErrorMessage() string { } return *e.Message } -func (e *ParameterNotFound) ErrorCode() string { return "ParameterNotFound" } +func (e *ParameterNotFound) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ParameterNotFound" + } + return *e.ErrorCodeOverride +} func (e *ParameterNotFound) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The parameter name is not valid. +// The parameter name isn't valid. type ParameterPatternMismatchException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *ParameterPatternMismatchException) Error() string { @@ -1804,13 +2768,20 @@ func (e *ParameterPatternMismatchException) ErrorMessage() string { return *e.Message } func (e *ParameterPatternMismatchException) ErrorCode() string { - return "ParameterPatternMismatchException" + if e == nil || e.ErrorCodeOverride == nil { + return "ParameterPatternMismatchException" + } + return *e.ErrorCodeOverride } func (e *ParameterPatternMismatchException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // A parameter version can have a maximum of ten labels. type ParameterVersionLabelLimitExceeded struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *ParameterVersionLabelLimitExceeded) Error() string { @@ -1823,16 +2794,23 @@ func (e *ParameterVersionLabelLimitExceeded) ErrorMessage() string { return *e.Message } func (e *ParameterVersionLabelLimitExceeded) ErrorCode() string { - return "ParameterVersionLabelLimitExceeded" + if e == nil || e.ErrorCodeOverride == nil { + return "ParameterVersionLabelLimitExceeded" + } + return *e.ErrorCodeOverride } func (e *ParameterVersionLabelLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The specified parameter version was not found. Verify the parameter name and +// The specified parameter version wasn't found. Verify the parameter name and // version, and try again. type ParameterVersionNotFound struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *ParameterVersionNotFound) Error() string { @@ -1844,13 +2822,22 @@ func (e *ParameterVersionNotFound) ErrorMessage() string { } return *e.Message } -func (e *ParameterVersionNotFound) ErrorCode() string { return "ParameterVersionNotFound" } +func (e *ParameterVersionNotFound) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ParameterVersionNotFound" + } + return *e.ErrorCodeOverride +} func (e *ParameterVersionNotFound) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // You specified more than the maximum number of allowed policies for the // parameter. The maximum is 10. type PoliciesLimitExceededException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *PoliciesLimitExceededException) Error() string { @@ -1862,14 +2849,23 @@ func (e *PoliciesLimitExceededException) ErrorMessage() string { } return *e.Message } -func (e *PoliciesLimitExceededException) ErrorCode() string { return "PoliciesLimitExceededException" } +func (e *PoliciesLimitExceededException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "PoliciesLimitExceededException" + } + return *e.ErrorCodeOverride +} func (e *PoliciesLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // A sync configuration with the same name already exists. type ResourceDataSyncAlreadyExistsException struct { Message *string + ErrorCodeOverride *string + SyncName *string + + noSmithyDocumentSerde } func (e *ResourceDataSyncAlreadyExistsException) Error() string { @@ -1882,7 +2878,10 @@ func (e *ResourceDataSyncAlreadyExistsException) ErrorMessage() string { return *e.Message } func (e *ResourceDataSyncAlreadyExistsException) ErrorCode() string { - return "ResourceDataSyncAlreadyExistsException" + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceDataSyncAlreadyExistsException" + } + return *e.ErrorCodeOverride } func (e *ResourceDataSyncAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient @@ -1892,6 +2891,10 @@ func (e *ResourceDataSyncAlreadyExistsException) ErrorFault() smithy.ErrorFault // and try again. type ResourceDataSyncConflictException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *ResourceDataSyncConflictException) Error() string { @@ -1904,13 +2907,20 @@ func (e *ResourceDataSyncConflictException) ErrorMessage() string { return *e.Message } func (e *ResourceDataSyncConflictException) ErrorCode() string { - return "ResourceDataSyncConflictException" + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceDataSyncConflictException" + } + return *e.ErrorCodeOverride } func (e *ResourceDataSyncConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // You have exceeded the allowed maximum sync configurations. type ResourceDataSyncCountExceededException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *ResourceDataSyncCountExceededException) Error() string { @@ -1923,7 +2933,10 @@ func (e *ResourceDataSyncCountExceededException) ErrorMessage() string { return *e.Message } func (e *ResourceDataSyncCountExceededException) ErrorCode() string { - return "ResourceDataSyncCountExceededException" + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceDataSyncCountExceededException" + } + return *e.ErrorCodeOverride } func (e *ResourceDataSyncCountExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient @@ -1932,6 +2945,10 @@ func (e *ResourceDataSyncCountExceededException) ErrorFault() smithy.ErrorFault // The specified sync configuration is invalid. type ResourceDataSyncInvalidConfigurationException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *ResourceDataSyncInvalidConfigurationException) Error() string { @@ -1944,18 +2961,25 @@ func (e *ResourceDataSyncInvalidConfigurationException) ErrorMessage() string { return *e.Message } func (e *ResourceDataSyncInvalidConfigurationException) ErrorCode() string { - return "ResourceDataSyncInvalidConfigurationException" + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceDataSyncInvalidConfigurationException" + } + return *e.ErrorCodeOverride } func (e *ResourceDataSyncInvalidConfigurationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The specified sync name was not found. +// The specified sync name wasn't found. type ResourceDataSyncNotFoundException struct { Message *string + ErrorCodeOverride *string + SyncName *string SyncType *string + + noSmithyDocumentSerde } func (e *ResourceDataSyncNotFoundException) Error() string { @@ -1968,7 +2992,10 @@ func (e *ResourceDataSyncNotFoundException) ErrorMessage() string { return *e.Message } func (e *ResourceDataSyncNotFoundException) ErrorCode() string { - return "ResourceDataSyncNotFoundException" + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceDataSyncNotFoundException" + } + return *e.ErrorCodeOverride } func (e *ResourceDataSyncNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } @@ -1976,6 +3003,10 @@ func (e *ResourceDataSyncNotFoundException) ErrorFault() smithy.ErrorFault { ret // registered for a patch group. type ResourceInUseException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *ResourceInUseException) Error() string { @@ -1987,17 +3018,25 @@ func (e *ResourceInUseException) ErrorMessage() string { } return *e.Message } -func (e *ResourceInUseException) ErrorCode() string { return "ResourceInUseException" } +func (e *ResourceInUseException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceInUseException" + } + return *e.ErrorCodeOverride +} func (e *ResourceInUseException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Error returned when the caller has exceeded the default resource quotas. For // example, too many maintenance windows or patch baselines have been created. For // information about resource quotas in Systems Manager, see Systems Manager -// service quotas -// (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) in the AWS -// General Reference. +// service quotas (https://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the Amazon Web Services General Reference. type ResourceLimitExceededException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *ResourceLimitExceededException) Error() string { @@ -2009,13 +3048,114 @@ func (e *ResourceLimitExceededException) ErrorMessage() string { } return *e.Message } -func (e *ResourceLimitExceededException) ErrorCode() string { return "ResourceLimitExceededException" } +func (e *ResourceLimitExceededException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceLimitExceededException" + } + return *e.ErrorCodeOverride +} func (e *ResourceLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The specified service setting was not found. Either the service name or the -// setting has not been provisioned by the AWS service team. +// The hash provided in the call doesn't match the stored hash. This exception is +// thrown when trying to update an obsolete policy version or when multiple +// requests to update a policy are sent. +type ResourcePolicyConflictException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ResourcePolicyConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourcePolicyConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourcePolicyConflictException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ResourcePolicyConflictException" + } + return *e.ErrorCodeOverride +} +func (e *ResourcePolicyConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// One or more parameters specified for the call aren't valid. Verify the +// parameters and their values and try again. +type ResourcePolicyInvalidParameterException struct { + Message *string + + ErrorCodeOverride *string + + ParameterNames []string + + noSmithyDocumentSerde +} + +func (e *ResourcePolicyInvalidParameterException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourcePolicyInvalidParameterException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourcePolicyInvalidParameterException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ResourcePolicyInvalidParameterException" + } + return *e.ErrorCodeOverride +} +func (e *ResourcePolicyInvalidParameterException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The PutResourcePolicy API action enforces two limits. A policy can't be greater +// than 1024 bytes in size. And only one policy can be attached to OpsItemGroup . +// Verify these limits and try again. +type ResourcePolicyLimitExceededException struct { + Message *string + + ErrorCodeOverride *string + + Limit int32 + LimitType *string + + noSmithyDocumentSerde +} + +func (e *ResourcePolicyLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourcePolicyLimitExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourcePolicyLimitExceededException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ResourcePolicyLimitExceededException" + } + return *e.ErrorCodeOverride +} +func (e *ResourcePolicyLimitExceededException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The specified service setting wasn't found. Either the service name or the +// setting hasn't been provisioned by the Amazon Web Services service team. type ServiceSettingNotFound struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *ServiceSettingNotFound) Error() string { @@ -2027,12 +3167,21 @@ func (e *ServiceSettingNotFound) ErrorMessage() string { } return *e.Message } -func (e *ServiceSettingNotFound) ErrorCode() string { return "ServiceSettingNotFound" } +func (e *ServiceSettingNotFound) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ServiceSettingNotFound" + } + return *e.ErrorCodeOverride +} func (e *ServiceSettingNotFound) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The updated status is the same as the current status. type StatusUnchanged struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *StatusUnchanged) Error() string { @@ -2044,12 +3193,21 @@ func (e *StatusUnchanged) ErrorMessage() string { } return *e.Message } -func (e *StatusUnchanged) ErrorCode() string { return "StatusUnchanged" } +func (e *StatusUnchanged) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "StatusUnchanged" + } + return *e.ErrorCodeOverride +} func (e *StatusUnchanged) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The sub-type count exceeded the limit for the inventory type. type SubTypeCountLimitExceededException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *SubTypeCountLimitExceededException) Error() string { @@ -2062,7 +3220,10 @@ func (e *SubTypeCountLimitExceededException) ErrorMessage() string { return *e.Message } func (e *SubTypeCountLimitExceededException) ErrorCode() string { - return "SubTypeCountLimitExceededException" + if e == nil || e.ErrorCodeOverride == nil { + return "SubTypeCountLimitExceededException" + } + return *e.ErrorCodeOverride } func (e *SubTypeCountLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient @@ -2072,6 +3233,10 @@ func (e *SubTypeCountLimitExceededException) ErrorFault() smithy.ErrorFault { // operation, but the target is still referenced in a task. type TargetInUseException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *TargetInUseException) Error() string { @@ -2083,18 +3248,26 @@ func (e *TargetInUseException) ErrorMessage() string { } return *e.Message } -func (e *TargetInUseException) ErrorCode() string { return "TargetInUseException" } +func (e *TargetInUseException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "TargetInUseException" + } + return *e.ErrorCodeOverride +} func (e *TargetInUseException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The specified target instance for the session is not fully configured for use -// with Session Manager. For more information, see Getting started with Session -// Manager -// (https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-getting-started.html) -// in the AWS Systems Manager User Guide. This error is also returned if you -// attempt to start a session on an instance that is located in a different account -// or Region +// The specified target managed node for the session isn't fully configured for +// use with Session Manager. For more information, see Getting started with +// Session Manager (https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-getting-started.html) +// in the Amazon Web Services Systems Manager User Guide. This error is also +// returned if you attempt to start a session on a managed node that is located in +// a different account or Region type TargetNotConnected struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *TargetNotConnected) Error() string { @@ -2106,13 +3279,22 @@ func (e *TargetNotConnected) ErrorMessage() string { } return *e.Message } -func (e *TargetNotConnected) ErrorCode() string { return "TargetNotConnected" } +func (e *TargetNotConnected) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "TargetNotConnected" + } + return *e.ErrorCodeOverride +} func (e *TargetNotConnected) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The Targets parameter includes too many tags. Remove one or more tags and try // the command again. type TooManyTagsError struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *TooManyTagsError) Error() string { @@ -2124,12 +3306,21 @@ func (e *TooManyTagsError) ErrorMessage() string { } return *e.Message } -func (e *TooManyTagsError) ErrorCode() string { return "TooManyTagsError" } +func (e *TooManyTagsError) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "TooManyTagsError" + } + return *e.ErrorCodeOverride +} func (e *TooManyTagsError) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // There are concurrent updates for a resource that supports one update at a time. type TooManyUpdates struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *TooManyUpdates) Error() string { @@ -2141,12 +3332,21 @@ func (e *TooManyUpdates) ErrorMessage() string { } return *e.Message } -func (e *TooManyUpdates) ErrorCode() string { return "TooManyUpdates" } +func (e *TooManyUpdates) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "TooManyUpdates" + } + return *e.ErrorCodeOverride +} func (e *TooManyUpdates) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The size of inventory data has exceeded the total size limit for the resource. type TotalSizeLimitExceededException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *TotalSizeLimitExceededException) Error() string { @@ -2159,14 +3359,20 @@ func (e *TotalSizeLimitExceededException) ErrorMessage() string { return *e.Message } func (e *TotalSizeLimitExceededException) ErrorCode() string { - return "TotalSizeLimitExceededException" + if e == nil || e.ErrorCodeOverride == nil { + return "TotalSizeLimitExceededException" + } + return *e.ErrorCodeOverride } func (e *TotalSizeLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The calendar entry contained in the specified Systems Manager document is not -// supported. +// The calendar entry contained in the specified SSM document isn't supported. type UnsupportedCalendarException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *UnsupportedCalendarException) Error() string { @@ -2178,17 +3384,25 @@ func (e *UnsupportedCalendarException) ErrorMessage() string { } return *e.Message } -func (e *UnsupportedCalendarException) ErrorCode() string { return "UnsupportedCalendarException" } +func (e *UnsupportedCalendarException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "UnsupportedCalendarException" + } + return *e.ErrorCodeOverride +} func (e *UnsupportedCalendarException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// Microsoft application patching is only available on EC2 instances and advanced -// instances. To patch Microsoft applications on on-premises servers and VMs, you -// must enable advanced instances. For more information, see Using the -// advanced-instances tier -// (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-managedinstances-advanced.html) -// in the AWS Systems Manager User Guide. +// Patching for applications released by Microsoft is only available on EC2 +// instances and advanced instances. To patch applications released by Microsoft on +// on-premises servers and VMs, you must enable advanced instances. For more +// information, see Enabling the advanced-instances tier (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-managedinstances-advanced.html) +// in the Amazon Web Services Systems Manager User Guide. type UnsupportedFeatureRequiredException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *UnsupportedFeatureRequiredException) Error() string { @@ -2201,19 +3415,26 @@ func (e *UnsupportedFeatureRequiredException) ErrorMessage() string { return *e.Message } func (e *UnsupportedFeatureRequiredException) ErrorCode() string { - return "UnsupportedFeatureRequiredException" + if e == nil || e.ErrorCodeOverride == nil { + return "UnsupportedFeatureRequiredException" + } + return *e.ErrorCodeOverride } func (e *UnsupportedFeatureRequiredException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The Context attribute that you specified for the InventoryItem is not allowed +// The Context attribute that you specified for the InventoryItem isn't allowed // for this inventory type. You can only use the Context attribute with inventory -// types like AWS:ComplianceItem. +// types like AWS:ComplianceItem . type UnsupportedInventoryItemContextException struct { Message *string + ErrorCodeOverride *string + TypeName *string + + noSmithyDocumentSerde } func (e *UnsupportedInventoryItemContextException) Error() string { @@ -2226,7 +3447,10 @@ func (e *UnsupportedInventoryItemContextException) ErrorMessage() string { return *e.Message } func (e *UnsupportedInventoryItemContextException) ErrorCode() string { - return "UnsupportedInventoryItemContextException" + if e == nil || e.ErrorCodeOverride == nil { + return "UnsupportedInventoryItemContextException" + } + return *e.ErrorCodeOverride } func (e *UnsupportedInventoryItemContextException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient @@ -2237,6 +3461,10 @@ func (e *UnsupportedInventoryItemContextException) ErrorFault() smithy.ErrorFaul // for each type. type UnsupportedInventorySchemaVersionException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *UnsupportedInventorySchemaVersionException) Error() string { @@ -2249,16 +3477,23 @@ func (e *UnsupportedInventorySchemaVersionException) ErrorMessage() string { return *e.Message } func (e *UnsupportedInventorySchemaVersionException) ErrorCode() string { - return "UnsupportedInventorySchemaVersionException" + if e == nil || e.ErrorCodeOverride == nil { + return "UnsupportedInventorySchemaVersionException" + } + return *e.ErrorCodeOverride } func (e *UnsupportedInventorySchemaVersionException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The operating systems you specified is not supported, or the operation is not +// The operating systems you specified isn't supported, or the operation isn't // supported for the operating system. type UnsupportedOperatingSystem struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *UnsupportedOperatingSystem) Error() string { @@ -2270,12 +3505,21 @@ func (e *UnsupportedOperatingSystem) ErrorMessage() string { } return *e.Message } -func (e *UnsupportedOperatingSystem) ErrorCode() string { return "UnsupportedOperatingSystem" } +func (e *UnsupportedOperatingSystem) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "UnsupportedOperatingSystem" + } + return *e.ErrorCodeOverride +} func (e *UnsupportedOperatingSystem) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The parameter type is not supported. +// The parameter type isn't supported. type UnsupportedParameterType struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *UnsupportedParameterType) Error() string { @@ -2287,13 +3531,22 @@ func (e *UnsupportedParameterType) ErrorMessage() string { } return *e.Message } -func (e *UnsupportedParameterType) ErrorCode() string { return "UnsupportedParameterType" } +func (e *UnsupportedParameterType) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "UnsupportedParameterType" + } + return *e.ErrorCodeOverride +} func (e *UnsupportedParameterType) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The document does not support the platform type of the given instance ID(s). For -// example, you sent an document for a Windows instance to a Linux instance. +// The document doesn't support the platform type of the given managed node ID(s). +// For example, you sent an document for a Windows managed node to a Linux node. type UnsupportedPlatformType struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *UnsupportedPlatformType) Error() string { @@ -2305,5 +3558,10 @@ func (e *UnsupportedPlatformType) ErrorMessage() string { } return *e.Message } -func (e *UnsupportedPlatformType) ErrorCode() string { return "UnsupportedPlatformType" } +func (e *UnsupportedPlatformType) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "UnsupportedPlatformType" + } + return *e.ErrorCodeOverride +} func (e *UnsupportedPlatformType) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/types/types.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/types/types.go index bd5e6c69..6ea901a2 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/types/types.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/types/types.go @@ -3,23 +3,27 @@ package types import ( + smithydocument "github.com/aws/smithy-go/document" "time" ) -// Information includes the AWS account ID where the current document is shared and -// the version shared with that account. +// Information includes the Amazon Web Services account ID where the current +// document is shared and the version shared with that account. type AccountSharingInfo struct { - // The AWS account ID where the current document is shared. + // The Amazon Web Services account ID where the current document is shared. AccountId *string // The version of the current document shared with the account. SharedDocumentVersion *string + + noSmithyDocumentSerde } // An activation registers one or more on-premises servers or virtual machines -// (VMs) with AWS so that you can configure those servers or VMs using Run Command. -// A server or VM that has been registered with AWS is called a managed instance. +// (VMs) with Amazon Web Services so that you can configure those servers or VMs +// using Run Command. A server or VM that has been registered with Amazon Web +// Services Systems Manager is called a managed node. type Activation struct { // The ID created by Systems Manager when you submitted the activation. @@ -28,39 +32,86 @@ type Activation struct { // The date the activation was created. CreatedDate *time.Time - // A name for the managed instance when it is created. + // A name for the managed node when it is created. DefaultInstanceName *string // A user defined description of the activation. Description *string - // The date when this activation can no longer be used to register managed - // instances. + // The date when this activation can no longer be used to register managed nodes. ExpirationDate *time.Time // Whether or not the activation is expired. Expired bool - // The Amazon Identity and Access Management (IAM) role to assign to the managed - // instance. + // The Identity and Access Management (IAM) role to assign to the managed node. IamRole *string - // The maximum number of managed instances that can be registered using this + // The maximum number of managed nodes that can be registered using this // activation. - RegistrationLimit int32 + RegistrationLimit *int32 - // The number of managed instances already registered with this activation. - RegistrationsCount int32 + // The number of managed nodes already registered with this activation. + RegistrationsCount *int32 // Tags assigned to the activation. Tags []Tag + + noSmithyDocumentSerde +} + +// A CloudWatch alarm you apply to an automation or command. +type Alarm struct { + + // The name of your CloudWatch alarm. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +// The details for the CloudWatch alarm you want to apply to an automation or +// command. +type AlarmConfiguration struct { + + // The name of the CloudWatch alarm specified in the configuration. + // + // This member is required. + Alarms []Alarm + + // When this value is true, your automation or command continues to run in cases + // where we can’t retrieve alarm status information from CloudWatch. In cases where + // we successfully retrieve an alarm status of OK or INSUFFICIENT_DATA, the + // automation or command continues to run, regardless of this value. Default is + // false. + IgnorePollAlarmFailure bool + + noSmithyDocumentSerde +} + +// The details about the state of your CloudWatch alarm. +type AlarmStateInformation struct { + + // The name of your CloudWatch alarm. + // + // This member is required. + Name *string + + // The state of your CloudWatch alarm. + // + // This member is required. + State ExternalAlarmState + + noSmithyDocumentSerde } -// Describes an association of a Systems Manager document and an instance. +// Describes an association of a Amazon Web Services Systems Manager document (SSM +// document) and a managed node. type Association struct { - // The ID created by the system when you create an association. An association is a - // binding between a document and a set of targets with a schedule. + // The ID created by the system when you create an association. An association is + // a binding between a document and a set of targets with a schedule. AssociationId *string // The association name. @@ -69,35 +120,59 @@ type Association struct { // The association version. AssociationVersion *string - // The version of the document used in the association. + // The version of the document used in the association. If you change a document + // version for a State Manager association, Systems Manager immediately runs the + // association unless you previously specifed the apply-only-at-cron-interval + // parameter. State Manager doesn't support running associations that use a new + // version of a document if that document is shared from another account. State + // Manager always runs the default version of a document if shared from another + // account, even though the Systems Manager console shows that a new version was + // processed. If you want to run an association using a new version of a document + // shared form another account, you must set the document version to default . DocumentVersion *string - // The ID of the instance. + // The managed node ID. InstanceId *string // The date on which the association was last run. LastExecutionDate *time.Time - // The name of the Systems Manager document. + // The name of the SSM document. Name *string // Information about the association. Overview *AssociationOverview - // A cron expression that specifies a schedule when the association runs. + // A cron expression that specifies a schedule when the association runs. The + // schedule runs in Coordinated Universal Time (UTC). ScheduleExpression *string - // The instances targeted by the request to create an association. + // Number of days to wait after the scheduled day to run an association. + ScheduleOffset *int32 + + // A key-value mapping of document parameters to target resources. Both Targets + // and TargetMaps can't be specified together. + TargetMaps []map[string][]string + + // The managed nodes targeted by the request to create an association. You can + // target all managed nodes in an Amazon Web Services account by specifying the + // InstanceIds key with a value of * . Targets []Target + + noSmithyDocumentSerde } // Describes the parameters for a document. type AssociationDescription struct { + // The details for the CloudWatch alarm you want to apply to an automation or + // command. + AlarmConfiguration *AlarmConfiguration + // By default, when you create a new associations, the system runs it immediately // after it is created and then according to the schedule you specified. Specify // this option if you don't want an association to run immediately after you create - // it. This parameter is not supported for rate expressions. + // it. This parameter isn't supported for rate expressions. ApplyOnlyAtCronInterval bool // The association ID. @@ -109,10 +184,19 @@ type AssociationDescription struct { // The association version. AssociationVersion *string - // Specify the target for the association. This target is required for associations - // that use an Automation document and target resources by using rate controls. + // Choose the parameter that will define how your automation will branch out. This + // target is required for associations that use an Automation runbook and target + // resources by using rate controls. Automation is a capability of Amazon Web + // Services Systems Manager. AutomationTargetParameterName *string + // The names or Amazon Resource Names (ARNs) of the Change Calendar type documents + // your associations are gated under. The associations only run when that change + // calendar is open. For more information, see Amazon Web Services Systems Manager + // Change Calendar (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-change-calendar) + // . + CalendarNames []string + // The severity level that is assigned to the association. ComplianceSeverity AssociationComplianceSeverity @@ -122,7 +206,7 @@ type AssociationDescription struct { // The document version. DocumentVersion *string - // The ID of the instance. + // The managed node ID. InstanceId *string // The date on which the association was last run. @@ -137,11 +221,11 @@ type AssociationDescription struct { // The maximum number of targets allowed to run the association at the same time. // You can specify a number, for example 10, or a percentage of the target set, for // example 10%. The default value is 100%, which means all targets run the - // association at the same time. If a new instance starts and attempts to run an - // association while Systems Manager is running MaxConcurrency associations, the - // association is allowed to run. During the next association interval, the new - // instance will process its association within the limit specified for - // MaxConcurrency. + // association at the same time. If a new managed node starts and attempts to run + // an association while Systems Manager is running MaxConcurrency associations, + // the association is allowed to run. During the next association interval, the new + // managed node will process its association within the limit specified for + // MaxConcurrency . MaxConcurrency *string // The number of errors that are allowed before the system stops sending requests @@ -150,15 +234,15 @@ type AssociationDescription struct { // 10%. If you specify 3, for example, the system stops sending requests when the // fourth error is received. If you specify 0, then the system stops sending // requests after the first error is returned. If you run an association on 50 - // instances and set MaxError to 10%, then the system stops sending the request - // when the sixth error is received. Executions that are already running an - // association when MaxErrors is reached are allowed to complete, but some of these - // executions may fail as well. If you need to ensure that there won't be more than - // max-errors failed executions, set MaxConcurrency to 1 so that executions proceed - // one at a time. + // managed nodes and set MaxError to 10%, then the system stops sending the + // request when the sixth error is received. Executions that are already running an + // association when MaxErrors is reached are allowed to complete, but some of + // these executions may fail as well. If you need to ensure that there won't be + // more than max-errors failed executions, set MaxConcurrency to 1 so that + // executions proceed one at a time. MaxErrors *string - // The name of the Systems Manager document. + // The name of the SSM document. Name *string // An S3 bucket where you want to store the output details of the request. @@ -173,31 +257,48 @@ type AssociationDescription struct { // A cron expression that specifies a schedule when the association runs. ScheduleExpression *string + // Number of days to wait after the scheduled day to run an association. + ScheduleOffset *int32 + // The association status. Status *AssociationStatus - // The mode for generating association compliance. You can specify AUTO or MANUAL. + // The mode for generating association compliance. You can specify AUTO or MANUAL . // In AUTO mode, the system uses the status of the association execution to // determine the compliance status. If the association execution runs successfully, - // then the association is COMPLIANT. If the association execution doesn't run - // successfully, the association is NON-COMPLIANT. In MANUAL mode, you must specify - // the AssociationId as a parameter for the PutComplianceItems API action. In this - // case, compliance data is not managed by State Manager. It is managed by your - // direct call to the PutComplianceItems API action. By default, all associations - // use AUTO mode. + // then the association is COMPLIANT . If the association execution doesn't run + // successfully, the association is NON-COMPLIANT . In MANUAL mode, you must + // specify the AssociationId as a parameter for the PutComplianceItems API + // operation. In this case, compliance data isn't managed by State Manager, a + // capability of Amazon Web Services Systems Manager. It is managed by your direct + // call to the PutComplianceItems API operation. By default, all associations use + // AUTO mode. SyncCompliance AssociationSyncCompliance - // The combination of AWS Regions and AWS accounts where you want to run the - // association. + // The combination of Amazon Web Services Regions and Amazon Web Services accounts + // where you want to run the association. TargetLocations []TargetLocation - // The instances targeted by the request. + // A key-value mapping of document parameters to target resources. Both Targets + // and TargetMaps can't be specified together. + TargetMaps []map[string][]string + + // The managed nodes targeted by the request. Targets []Target + + // The CloudWatch alarm that was invoked during the association. + TriggeredAlarms []AlarmStateInformation + + noSmithyDocumentSerde } // Includes information about the specified association. type AssociationExecution struct { + // The details for the CloudWatch alarm you want to apply to an automation or + // command. + AlarmConfiguration *AlarmConfiguration + // The association ID. AssociationId *string @@ -221,6 +322,11 @@ type AssociationExecution struct { // The status of the association execution. Status *string + + // The CloudWatch alarms that were invoked by the association. + TriggeredAlarms []AlarmStateInformation + + noSmithyDocumentSerde } // Filters used in the request. @@ -240,6 +346,8 @@ type AssociationExecutionFilter struct { // // This member is required. Value *string + + noSmithyDocumentSerde } // Includes information about the specified association execution. @@ -263,14 +371,16 @@ type AssociationExecutionTarget struct { // The location where the association details are saved. OutputSource *OutputSource - // The resource ID, for example, the instance ID where the association ran. + // The resource ID, for example, the managed node ID where the association ran. ResourceId *string - // The resource type, for example, instance. + // The resource type, for example, EC2. ResourceType *string // The association execution status. Status *string + + noSmithyDocumentSerde } // Filters for the association execution. @@ -285,6 +395,8 @@ type AssociationExecutionTargetsFilter struct { // // This member is required. Value *string + + noSmithyDocumentSerde } // Describes a filter. @@ -299,14 +411,16 @@ type AssociationFilter struct { // // This member is required. Value *string + + noSmithyDocumentSerde } // Information about the association. type AssociationOverview struct { // Returns the number of targets for the association status. For example, if you - // created an association with two instances, and one of them was successful, this - // would return the count of instances by status. + // created an association with two managed nodes, and one of them was successful, + // this would return the count of managed nodes by status. AssociationStatusAggregatedCount map[string]int32 // A detailed status of the association. @@ -314,6 +428,8 @@ type AssociationOverview struct { // The status of the association. Status can be: Pending, Success, or Failed. Status *string + + noSmithyDocumentSerde } // Describes an association status. @@ -336,6 +452,8 @@ type AssociationStatus struct { // A user-defined string. AdditionalInfo *string + + noSmithyDocumentSerde } // Information about the association version. @@ -344,7 +462,7 @@ type AssociationVersionInfo struct { // By default, when you create a new associations, the system runs it immediately // after it is created and then according to the schedule you specified. Specify // this option if you don't want an association to run immediately after you create - // it. This parameter is not supported for rate expressions. + // it. This parameter isn't supported for rate expressions. ApplyOnlyAtCronInterval bool // The ID created by the system when the association was created. @@ -357,24 +475,31 @@ type AssociationVersionInfo struct { // The association version. AssociationVersion *string + // The names or Amazon Resource Names (ARNs) of the Change Calendar type documents + // your associations are gated under. The associations for this version only run + // when that Change Calendar is open. For more information, see Amazon Web + // Services Systems Manager Change Calendar (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-change-calendar) + // . + CalendarNames []string + // The severity level that is assigned to the association. ComplianceSeverity AssociationComplianceSeverity // The date the association version was created. CreatedDate *time.Time - // The version of a Systems Manager document used when the association version was - // created. + // The version of an Amazon Web Services Systems Manager document (SSM document) + // used when the association version was created. DocumentVersion *string // The maximum number of targets allowed to run the association at the same time. // You can specify a number, for example 10, or a percentage of the target set, for // example 10%. The default value is 100%, which means all targets run the - // association at the same time. If a new instance starts and attempts to run an - // association while Systems Manager is running MaxConcurrency associations, the - // association is allowed to run. During the next association interval, the new - // instance will process its association within the limit specified for - // MaxConcurrency. + // association at the same time. If a new managed node starts and attempts to run + // an association while Systems Manager is running MaxConcurrency associations, + // the association is allowed to run. During the next association interval, the new + // managed node will process its association within the limit specified for + // MaxConcurrency . MaxConcurrency *string // The number of errors that are allowed before the system stops sending requests @@ -383,12 +508,12 @@ type AssociationVersionInfo struct { // 10%. If you specify 3, for example, the system stops sending requests when the // fourth error is received. If you specify 0, then the system stops sending // requests after the first error is returned. If you run an association on 50 - // instances and set MaxError to 10%, then the system stops sending the request - // when the sixth error is received. Executions that are already running an - // association when MaxErrors is reached are allowed to complete, but some of these - // executions may fail as well. If you need to ensure that there won't be more than - // max-errors failed executions, set MaxConcurrency to 1 so that executions proceed - // one at a time. + // managed nodes and set MaxError to 10%, then the system stops sending the + // request when the sixth error is received. Executions that are already running an + // association when MaxErrors is reached are allowed to complete, but some of + // these executions may fail as well. If you need to ensure that there won't be + // more than max-errors failed executions, set MaxConcurrency to 1 so that + // executions proceed one at a time. MaxErrors *string // The name specified when the association was created. @@ -405,24 +530,35 @@ type AssociationVersionInfo struct { // version was created. ScheduleExpression *string - // The mode for generating association compliance. You can specify AUTO or MANUAL. + // Number of days to wait after the scheduled day to run an association. + ScheduleOffset *int32 + + // The mode for generating association compliance. You can specify AUTO or MANUAL . // In AUTO mode, the system uses the status of the association execution to // determine the compliance status. If the association execution runs successfully, - // then the association is COMPLIANT. If the association execution doesn't run - // successfully, the association is NON-COMPLIANT. In MANUAL mode, you must specify - // the AssociationId as a parameter for the PutComplianceItems API action. In this - // case, compliance data is not managed by State Manager. It is managed by your - // direct call to the PutComplianceItems API action. By default, all associations - // use AUTO mode. + // then the association is COMPLIANT . If the association execution doesn't run + // successfully, the association is NON-COMPLIANT . In MANUAL mode, you must + // specify the AssociationId as a parameter for the PutComplianceItems API + // operation. In this case, compliance data isn't managed by State Manager, a + // capability of Amazon Web Services Systems Manager. It is managed by your direct + // call to the PutComplianceItems API operation. By default, all associations use + // AUTO mode. SyncCompliance AssociationSyncCompliance - // The combination of AWS Regions and AWS accounts where you wanted to run the - // association when this association version was created. + // The combination of Amazon Web Services Regions and Amazon Web Services accounts + // where you wanted to run the association when this association version was + // created. TargetLocations []TargetLocation + // A key-value mapping of document parameters to target resources. Both Targets + // and TargetMaps can't be specified together. + TargetMaps []map[string][]string + // The targets specified for the association when the association version was // created. Targets []Target + + noSmithyDocumentSerde } // A structure that includes attributes that describe a document attachment. @@ -442,6 +578,8 @@ type AttachmentContent struct { // The URL location of the attachment content. Url *string + + noSmithyDocumentSerde } // An attribute of an attachment, such as the attachment name. @@ -449,10 +587,13 @@ type AttachmentInformation struct { // The name of the attachment. Name *string + + noSmithyDocumentSerde } -// Identifying information about a document attachment, including the file name and -// a key-value pair that identifies the location of an attachment to a document. +// Identifying information about a document attachment, including the file name +// and a key-value pair that identifies the location of an attachment to a +// document. type AttachmentsSource struct { // The key of a key-value pair that identifies the location of an attachment to a @@ -462,33 +603,32 @@ type AttachmentsSource struct { // The name of the document attachment file. Name *string - // The value of a key-value pair that identifies the location of an attachment to a - // document. The format for Value depends on the type of key you specify. - // - // * For - // the key SourceUrl, the value is an S3 bucket location. For example: "Values": [ - // "s3://doc-example-bucket/my-folder" ] - // - // * For the key S3FileUrl, the value is a - // file in an S3 bucket. For example: "Values": [ - // "s3://doc-example-bucket/my-folder/my-file.py" ] - // - // * For the key - // AttachmentReference, the value is constructed from the name of another SSM - // document in your account, a version number of that document, and a file attached - // to that document version that you want to reuse. For example: "Values": [ - // "MyOtherDocument/3/my-other-file.py" ] However, if the SSM document is shared - // with you from another account, the full SSM document ARN must be specified - // instead of the document name only. For example: "Values": [ - // "arn:aws:ssm:us-east-2:111122223333:document/OtherAccountDocument/3/their-file.py" - // ] + // The value of a key-value pair that identifies the location of an attachment to + // a document. The format for Value depends on the type of key you specify. + // - For the key SourceUrl, the value is an S3 bucket location. For example: + // "Values": [ "s3://doc-example-bucket/my-folder" ] + // - For the key S3FileUrl, the value is a file in an S3 bucket. For example: + // "Values": [ "s3://doc-example-bucket/my-folder/my-file.py" ] + // - For the key AttachmentReference, the value is constructed from the name of + // another SSM document in your account, a version number of that document, and a + // file attached to that document version that you want to reuse. For example: + // "Values": [ "MyOtherDocument/3/my-other-file.py" ] However, if the SSM + // document is shared with you from another account, the full SSM document ARN must + // be specified instead of the document name only. For example: "Values": [ + // "arn:aws:ssm:us-east-2:111122223333:document/OtherAccountDocument/3/their-file.py" + // ] Values []string + + noSmithyDocumentSerde } // Detailed information about the current state of an individual Automation // execution. type AutomationExecution struct { + // The details for the CloudWatch alarm applied to your automation. + AlarmConfiguration *AlarmConfiguration + // The ID of a State Manager association used in the Automation operation. AssociationId *string @@ -499,7 +639,7 @@ type AutomationExecution struct { AutomationExecutionStatus AutomationExecutionStatus // The subtype of the Automation operation. Currently, the only supported value is - // ChangeRequest. + // ChangeRequest . AutomationSubtype AutomationSubtype // The name of the Change Manager change request. @@ -511,7 +651,7 @@ type AutomationExecution struct { // The name of the step that is currently running. CurrentStepName *string - // The name of the Automation document used during the execution. + // The name of the Automation runbook used during the execution. DocumentName *string // The version of the document to use during execution. @@ -543,47 +683,46 @@ type AutomationExecution struct { // request. OpsItemId *string - // The list of execution outputs as defined in the automation document. + // The list of execution outputs as defined in the Automation runbook. Outputs map[string][]string // The key-value map of execution parameters, which were supplied when calling - // StartAutomationExecution. + // StartAutomationExecution . Parameters map[string][]string // The AutomationExecutionId of the parent automation. ParentAutomationExecutionId *string - // An aggregate of step execution statuses displayed in the AWS Console for a - // multi-Region and multi-account Automation execution. + // An aggregate of step execution statuses displayed in the Amazon Web Services + // Systems Manager console for a multi-Region and multi-account Automation + // execution. ProgressCounters *ProgressCounters // A list of resolved targets in the rate control execution. ResolvedTargets *ResolvedTargets - // Information about the Automation runbooks (Automation documents) that are run as - // part of a runbook workflow. The Automation runbooks specified for the runbook - // workflow can't run until all required approvals for the change request have been - // received. + // Information about the Automation runbooks that are run as part of a runbook + // workflow. The Automation runbooks specified for the runbook workflow can't run + // until all required approvals for the change request have been received. Runbooks []Runbook // The date and time the Automation operation is scheduled to start. ScheduledTime *time.Time // A list of details about the current state of all steps that comprise an - // execution. An Automation document contains a list of steps that are run in - // order. + // execution. An Automation runbook contains a list of steps that are run in order. StepExecutions []StepExecution // A boolean value that indicates if the response contains the full list of the // Automation step executions. If true, use the DescribeAutomationStepExecutions - // API action to get the full list of step executions. + // API operation to get the full list of step executions. StepExecutionsTruncated bool // The target of the execution. Target *string - // The combination of AWS Regions and/or AWS accounts where you want to run the - // Automation. + // The combination of Amazon Web Services Regions and/or Amazon Web Services + // accounts where you want to run the Automation. TargetLocations []TargetLocation // The specified key-value mapping of document parameters to target resources. @@ -594,15 +733,21 @@ type AutomationExecution struct { // The specified targets. Targets []Target + + // The CloudWatch alarm that was invoked by the automation. + TriggeredAlarms []AlarmStateInformation + + // Variables defined for the automation. + Variables map[string][]string + + noSmithyDocumentSerde } -// A filter used to match specific automation executions. This is used to limit the -// scope of Automation execution information returned. +// A filter used to match specific automation executions. This is used to limit +// the scope of Automation execution information returned. type AutomationExecutionFilter struct { - // One or more keys to limit the results. Valid filter keys include the following: - // DocumentNamePrefix, ExecutionStatus, ExecutionId, ParentExecutionId, - // CurrentAction, StartTimeBefore, StartTimeAfter, TargetResourceGroup. + // One or more keys to limit the results. // // This member is required. Key AutomationExecutionFilterKey @@ -612,11 +757,16 @@ type AutomationExecutionFilter struct { // // This member is required. Values []string + + noSmithyDocumentSerde } // Details about a specific Automation execution. type AutomationExecutionMetadata struct { + // The details for the CloudWatch alarm applied to your automation. + AlarmConfiguration *AlarmConfiguration + // The ID of a State Manager association used in the Automation operation. AssociationId *string @@ -627,15 +777,15 @@ type AutomationExecutionMetadata struct { AutomationExecutionStatus AutomationExecutionStatus // The subtype of the Automation operation. Currently, the only supported value is - // ChangeRequest. + // ChangeRequest . AutomationSubtype AutomationSubtype - // Use this filter with DescribeAutomationExecutions. Specify either Local or - // CrossAccount. CrossAccount is an Automation that runs in multiple AWS Regions - // and accounts. For more information, see Running Automation workflows in multiple - // AWS Regions and accounts - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-automation-multiple-accounts-and-regions.html) - // in the AWS Systems Manager User Guide. + // Use this filter with DescribeAutomationExecutions . Specify either Local or + // CrossAccount. CrossAccount is an Automation that runs in multiple Amazon Web + // Services Regions and Amazon Web Services accounts. For more information, see + // Running Automation workflows in multiple Amazon Web Services Regions and + // accounts (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-automation-multiple-accounts-and-regions.html) + // in the Amazon Web Services Systems Manager User Guide. AutomationType AutomationType // The name of the Change Manager change request. @@ -647,32 +797,32 @@ type AutomationExecutionMetadata struct { // The name of the step that is currently running. CurrentStepName *string - // The name of the Automation document used during execution. + // The name of the Automation runbook used during execution. DocumentName *string // The document version used during the execution. DocumentVersion *string - // The IAM role ARN of the user who ran the Automation. + // The IAM role ARN of the user who ran the automation. ExecutedBy *string - // The time the execution finished. This is not populated if the execution is still + // The time the execution finished. This isn't populated if the execution is still // in progress. ExecutionEndTime *time.Time // The time the execution started. ExecutionStartTime *time.Time - // The list of execution outputs as defined in the Automation document. + // The list of execution outputs as defined in the Automation runbook. FailureMessage *string // An S3 bucket where execution information is stored. LogFile *string - // The MaxConcurrency value specified by the user when starting the Automation. + // The MaxConcurrency value specified by the user when starting the automation. MaxConcurrency *string - // The MaxErrors value specified by the user when starting the Automation. + // The MaxErrors value specified by the user when starting the automation. MaxErrors *string // The Automation execution mode. @@ -682,55 +832,112 @@ type AutomationExecutionMetadata struct { // request. OpsItemId *string - // The list of execution outputs as defined in the Automation document. + // The list of execution outputs as defined in the Automation runbook. Outputs map[string][]string - // The ExecutionId of the parent Automation. + // The execution ID of the parent automation. ParentAutomationExecutionId *string // A list of targets that resolved during the execution. ResolvedTargets *ResolvedTargets - // Information about the Automation runbooks (Automation documents) that are run - // during a runbook workflow in Change Manager. The Automation runbooks specified - // for the runbook workflow can't run until all required approvals for the change - // request have been received. + // Information about the Automation runbooks that are run during a runbook + // workflow in Change Manager. The Automation runbooks specified for the runbook + // workflow can't run until all required approvals for the change request have been + // received. Runbooks []Runbook // The date and time the Automation operation is scheduled to start. ScheduledTime *time.Time - // The list of execution outputs as defined in the Automation document. + // The list of execution outputs as defined in the Automation runbook. Target *string // The specified key-value mapping of document parameters to target resources. TargetMaps []map[string][]string - // The list of execution outputs as defined in the Automation document. + // The list of execution outputs as defined in the Automation runbook. TargetParameterName *string - // The targets defined by the user when starting the Automation. + // The targets defined by the user when starting the automation. Targets []Target + + // The CloudWatch alarm that was invoked by the automation. + TriggeredAlarms []AlarmStateInformation + + noSmithyDocumentSerde } -// Configuration options for sending command output to CloudWatch Logs. +// Defines the basic information about a patch baseline override. +type BaselineOverride struct { + + // A set of rules defining the approval rules for a patch baseline. + ApprovalRules *PatchRuleGroup + + // A list of explicitly approved patches for the baseline. For information about + // accepted formats for lists of approved patches and rejected patches, see About + // package name formats for approved and rejected patch lists (https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html) + // in the Amazon Web Services Systems Manager User Guide. + ApprovedPatches []string + + // Defines the compliance level for approved patches. When an approved patch is + // reported as missing, this value describes the severity of the compliance + // violation. + ApprovedPatchesComplianceLevel PatchComplianceLevel + + // Indicates whether the list of approved patches includes non-security updates + // that should be applied to the managed nodes. The default value is false . + // Applies to Linux managed nodes only. + ApprovedPatchesEnableNonSecurity bool + + // A set of patch filters, typically used for approval rules. + GlobalFilters *PatchFilterGroup + + // The operating system rule used by the patch baseline override. + OperatingSystem OperatingSystem + + // A list of explicitly rejected patches for the baseline. For information about + // accepted formats for lists of approved patches and rejected patches, see About + // package name formats for approved and rejected patch lists (https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-approved-rejected-package-name-formats.html) + // in the Amazon Web Services Systems Manager User Guide. + RejectedPatches []string + + // The action for Patch Manager to take on patches included in the RejectedPackages + // list. A patch can be allowed only if it is a dependency of another package, or + // blocked entirely along with packages that include it as a dependency. + RejectedPatchesAction PatchAction + + // Information about the patches to use to update the managed nodes, including + // target operating systems and source repositories. Applies to Linux managed nodes + // only. + Sources []PatchSource + + noSmithyDocumentSerde +} + +// Configuration options for sending command output to Amazon CloudWatch Logs. type CloudWatchOutputConfig struct { - // The name of the CloudWatch log group where you want to send command output. If - // you don't specify a group name, Systems Manager automatically creates a log - // group for you. The log group uses the following naming format: - // aws/ssm/SystemsManagerDocumentName. + // The name of the CloudWatch Logs log group where you want to send command + // output. If you don't specify a group name, Amazon Web Services Systems Manager + // automatically creates a log group for you. The log group uses the following + // naming format: aws/ssm/SystemsManagerDocumentName CloudWatchLogGroupName *string // Enables Systems Manager to send command output to CloudWatch Logs. CloudWatchOutputEnabled bool + + noSmithyDocumentSerde } // Describes a command request. type Command struct { - // CloudWatch Logs information where you want Systems Manager to send the command - // output. + // The details for the CloudWatch alarm applied to your command. + AlarmConfiguration *AlarmConfiguration + + // Amazon CloudWatch Logs information where you want Amazon Web Services Systems + // Manager to send the command output. CloudWatchOutputConfig *CloudWatchOutputConfig // A unique identifier for this command. @@ -740,9 +947,9 @@ type Command struct { // what the command should do. Comment *string - // The number of targets for which the command invocation reached a terminal state. - // Terminal states include the following: Success, Failed, Execution Timed Out, - // Delivery Timed Out, Canceled, Terminated, or Undeliverable. + // The number of targets for which the command invocation reached a terminal + // state. Terminal states include the following: Success, Failed, Execution Timed + // Out, Delivery Timed Out, Cancelled, Terminated, or Undeliverable. CompletedCount int32 // The number of targets for which the status is Delivery Timed Out. @@ -751,35 +958,36 @@ type Command struct { // The name of the document requested for execution. DocumentName *string - // The SSM document version. + // The Systems Manager document (SSM document) version. DocumentVersion *string // The number of targets for which the status is Failed or Execution Timed Out. ErrorCount int32 - // If this time is reached and the command has not already started running, it will - // not run. Calculated based on the ExpiresAfter user input provided as part of the - // SendCommand API. + // If a command expires, it changes status to DeliveryTimedOut for all invocations + // that have the status InProgress , Pending , or Delayed . ExpiresAfter is + // calculated based on the total timeout for the overall command. For more + // information, see Understanding command timeout values (https://docs.aws.amazon.com/systems-manager/latest/userguide/monitor-commands.html?icmpid=docs_ec2_console#monitor-about-status-timeouts) + // in the Amazon Web Services Systems Manager User Guide. ExpiresAfter *time.Time - // The instance IDs against which this command was requested. + // The managed node IDs against which this command was requested. InstanceIds []string - // The maximum number of instances that are allowed to run the command at the same - // time. You can specify a number of instances, such as 10, or a percentage of - // instances, such as 10%. The default value is 50. For more information about how - // to use MaxConcurrency, see Running commands using Systems Manager Run Command - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html) - // in the AWS Systems Manager User Guide. + // The maximum number of managed nodes that are allowed to run the command at the + // same time. You can specify a number of managed nodes, such as 10, or a + // percentage of nodes, such as 10%. The default value is 50. For more information + // about how to use MaxConcurrency , see Running commands using Systems Manager + // Run Command (https://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html) + // in the Amazon Web Services Systems Manager User Guide. MaxConcurrency *string - // The maximum number of errors allowed before the system stops sending the command - // to additional targets. You can specify a number of errors, such as 10, or a - // percentage or errors, such as 10%. The default value is 0. For more information - // about how to use MaxErrors, see Running commands using Systems Manager Run - // Command - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html) - // in the AWS Systems Manager User Guide. + // The maximum number of errors allowed before the system stops sending the + // command to additional targets. You can specify a number of errors, such as 10, + // or a percentage or errors, such as 10%. The default value is 0 . For more + // information about how to use MaxErrors , see Running commands using Systems + // Manager Run Command (https://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html) + // in the Amazon Web Services Systems Manager User Guide. MaxErrors *string // Configurations for sending notifications about command status changes. @@ -794,7 +1002,8 @@ type Command struct { OutputS3KeyPrefix *string // (Deprecated) You can no longer specify this parameter. The system ignores it. - // Instead, Systems Manager automatically determines the Region of the S3 bucket. + // Instead, Systems Manager automatically determines the Amazon Web Services Region + // of the S3 bucket. OutputS3Region *string // The parameter values to be inserted in the document when running the command. @@ -803,8 +1012,9 @@ type Command struct { // The date and time the command was requested. RequestedDateTime *time.Time - // The IAM service role that Run Command uses to act on your behalf when sending - // notifications about command status changes. + // The Identity and Access Management (IAM) service role that Run Command, a + // capability of Amazon Web Services Systems Manager, uses to act on your behalf + // when sending notifications about command status changes. ServiceRole *string // The status of the command. @@ -814,128 +1024,127 @@ type Command struct { // information than Status because it includes states resulting from error and // concurrency control parameters. StatusDetails can show different results than // Status. For more information about these statuses, see Understanding command - // statuses - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/monitor-commands.html) - // in the AWS Systems Manager User Guide. StatusDetails can be one of the following - // values: - // - // * Pending: The command has not been sent to any instances. - // - // * In - // Progress: The command has been sent to at least one instance but has not reached - // a final state on all instances. - // - // * Success: The command successfully ran on all - // invocations. This is a terminal state. - // - // * Delivery Timed Out: The value of - // MaxErrors or more command invocations shows a status of Delivery Timed Out. This - // is a terminal state. - // - // * Execution Timed Out: The value of MaxErrors or more - // command invocations shows a status of Execution Timed Out. This is a terminal - // state. - // - // * Failed: The value of MaxErrors or more command invocations shows a - // status of Failed. This is a terminal state. - // - // * Incomplete: The command was - // attempted on all instances and one or more invocations does not have a value of - // Success but not enough invocations failed for the status to be Failed. This is a - // terminal state. - // - // * Canceled: The command was terminated before it was completed. - // This is a terminal state. - // - // * Rate Exceeded: The number of instances targeted by - // the command exceeded the account limit for pending invocations. The system has - // canceled the command before running it on any instance. This is a terminal - // state. + // statuses (https://docs.aws.amazon.com/systems-manager/latest/userguide/monitor-commands.html) + // in the Amazon Web Services Systems Manager User Guide. StatusDetails can be one + // of the following values: + // - Pending: The command hasn't been sent to any managed nodes. + // - In Progress: The command has been sent to at least one managed node but + // hasn't reached a final state on all managed nodes. + // - Success: The command successfully ran on all invocations. This is a + // terminal state. + // - Delivery Timed Out: The value of MaxErrors or more command invocations + // shows a status of Delivery Timed Out. This is a terminal state. + // - Execution Timed Out: The value of MaxErrors or more command invocations + // shows a status of Execution Timed Out. This is a terminal state. + // - Failed: The value of MaxErrors or more command invocations shows a status + // of Failed. This is a terminal state. + // - Incomplete: The command was attempted on all managed nodes and one or more + // invocations doesn't have a value of Success but not enough invocations failed + // for the status to be Failed. This is a terminal state. + // - Cancelled: The command was terminated before it was completed. This is a + // terminal state. + // - Rate Exceeded: The number of managed nodes targeted by the command exceeded + // the account limit for pending invocations. The system has canceled the command + // before running it on any managed node. This is a terminal state. + // - Delayed: The system attempted to send the command to the managed node but + // wasn't successful. The system retries again. StatusDetails *string // The number of targets for the command. TargetCount int32 - // An array of search criteria that targets instances using a Key,Value combination - // that you specify. Targets is required if you don't provide one or more instance - // IDs in the call. + // An array of search criteria that targets managed nodes using a Key,Value + // combination that you specify. Targets is required if you don't provide one or + // more managed node IDs in the call. Targets []Target // The TimeoutSeconds value specified for a command. - TimeoutSeconds int32 + TimeoutSeconds *int32 + + // The CloudWatch alarm that was invoked by the command. + TriggeredAlarms []AlarmStateInformation + + noSmithyDocumentSerde } -// Describes a command filter. An instance ID can't be specified when a command -// status is Pending because the command hasn't run on the instance yet. +// Describes a command filter. A managed node ID can't be specified when a command +// status is Pending because the command hasn't run on the node yet. type CommandFilter struct { - // The name of the filter. + // The name of the filter. The ExecutionStage filter can't be used with the + // ListCommandInvocations operation, only with ListCommands . // // This member is required. Key CommandFilterKey // The filter value. Valid values for each filter key are as follows: - // - // * - // InvokedAfter: Specify a timestamp to limit your results. For example, specify - // 2018-07-07T00:00:00Z to see a list of command executions occurring July 7, 2018, - // and later. - // - // * InvokedBefore: Specify a timestamp to limit your results. For - // example, specify 2018-07-07T00:00:00Z to see a list of command executions from - // before July 7, 2018. - // - // * Status: Specify a valid command status to see a list of - // all command executions with that status. Status values you can specify - // include: - // - // * Pending - // - // * InProgress - // - // * Success - // - // * Cancelled - // - // * Failed - // - // * - // TimedOut - // - // * Cancelling - // - // * DocumentName: Specify name of the SSM document for - // which you want to see command execution results. For example, specify - // AWS-RunPatchBaseline to see command executions that used this SSM document to - // perform security patching operations on instances. - // - // * ExecutionStage: Specify - // one of the following values: - // - // * Executing: Returns a list of command executions - // that are currently still running. - // - // * Complete: Returns a list of command - // executions that have already completed. + // - InvokedAfter: Specify a timestamp to limit your results. For example, + // specify 2021-07-07T00:00:00Z to see a list of command executions occurring + // July 7, 2021, and later. + // - InvokedBefore: Specify a timestamp to limit your results. For example, + // specify 2021-07-07T00:00:00Z to see a list of command executions from before + // July 7, 2021. + // - Status: Specify a valid command status to see a list of all command + // executions with that status. The status choices depend on the API you call. The + // status values you can specify for ListCommands are: + // - Pending + // - InProgress + // - Success + // - Cancelled + // - Failed + // - TimedOut (this includes both Delivery and Execution time outs) + // - AccessDenied + // - DeliveryTimedOut + // - ExecutionTimedOut + // - Incomplete + // - NoInstancesInTag + // - LimitExceeded The status values you can specify for ListCommandInvocations + // are: + // - Pending + // - InProgress + // - Delayed + // - Success + // - Cancelled + // - Failed + // - TimedOut (this includes both Delivery and Execution time outs) + // - AccessDenied + // - DeliveryTimedOut + // - ExecutionTimedOut + // - Undeliverable + // - InvalidPlatform + // - Terminated + // - DocumentName: Specify name of the Amazon Web Services Systems Manager + // document (SSM document) for which you want to see command execution results. For + // example, specify AWS-RunPatchBaseline to see command executions that used this + // SSM document to perform security patching operations on managed nodes. + // - ExecutionStage: Specify one of the following values ( ListCommands + // operations only): + // - Executing : Returns a list of command executions that are currently still + // running. + // - Complete : Returns a list of command executions that have already completed. // // This member is required. Value *string + + noSmithyDocumentSerde } -// An invocation is copy of a command sent to a specific instance. A command can -// apply to one or more instances. A command invocation applies to one instance. -// For example, if a user runs SendCommand against three instances, then a command -// invocation is created for each requested instance ID. A command invocation -// returns status and detail information about a command you ran. +// An invocation is a copy of a command sent to a specific managed node. A command +// can apply to one or more managed nodes. A command invocation applies to one +// managed node. For example, if a user runs SendCommand against three managed +// nodes, then a command invocation is created for each requested managed node ID. +// A command invocation returns status and detail information about a command you +// ran. type CommandInvocation struct { - // CloudWatch Logs information where you want Systems Manager to send the command - // output. + // Amazon CloudWatch Logs information where you want Amazon Web Services Systems + // Manager to send the command output. CloudWatchOutputConfig *CloudWatchOutputConfig // The command against which this invocation was requested. CommandId *string + // Plugins processed by the command. CommandPlugins []CommandPlugin // User-specified information about the command, such as a brief description of @@ -945,102 +1154,93 @@ type CommandInvocation struct { // The document name that was requested for execution. DocumentName *string - // The SSM document version. + // The Systems Manager document (SSM document) version. DocumentVersion *string - // The instance ID in which this invocation was requested. + // The managed node ID in which this invocation was requested. InstanceId *string - // The name of the invocation target. For EC2 instances this is the value for the - // aws:Name tag. For on-premises instances, this is the name of the instance. + // The fully qualified host name of the managed node. InstanceName *string // Configurations for sending notifications about command status changes on a per - // instance basis. + // managed node basis. NotificationConfig *NotificationConfig - // The time and date the request was sent to this instance. + // The time and date the request was sent to this managed node. RequestedDateTime *time.Time - // The IAM service role that Run Command uses to act on your behalf when sending - // notifications about command status changes on a per instance basis. + // The Identity and Access Management (IAM) service role that Run Command, a + // capability of Amazon Web Services Systems Manager, uses to act on your behalf + // when sending notifications about command status changes on a per managed node + // basis. ServiceRole *string - // The URL to the plugin's StdErr file in Amazon S3, if the S3 bucket was defined - // for the parent command. For an invocation, StandardErrorUrl is populated if - // there is just one plugin defined for the command, and the S3 bucket was defined - // for the command. + // The URL to the plugin's StdErr file in Amazon Simple Storage Service (Amazon + // S3), if the S3 bucket was defined for the parent command. For an invocation, + // StandardErrorUrl is populated if there is just one plugin defined for the + // command, and the S3 bucket was defined for the command. StandardErrorUrl *string - // The URL to the plugin's StdOut file in Amazon S3, if the S3 bucket was defined - // for the parent command. For an invocation, StandardOutputUrl is populated if - // there is just one plugin defined for the command, and the S3 bucket was defined - // for the command. + // The URL to the plugin's StdOut file in Amazon Simple Storage Service (Amazon + // S3), if the S3 bucket was defined for the parent command. For an invocation, + // StandardOutputUrl is populated if there is just one plugin defined for the + // command, and the S3 bucket was defined for the command. StandardOutputUrl *string // Whether or not the invocation succeeded, failed, or is pending. Status CommandInvocationStatus - // A detailed status of the command execution for each invocation (each instance - // targeted by the command). StatusDetails includes more information than Status - // because it includes states resulting from error and concurrency control + // A detailed status of the command execution for each invocation (each managed + // node targeted by the command). StatusDetails includes more information than + // Status because it includes states resulting from error and concurrency control // parameters. StatusDetails can show different results than Status. For more - // information about these statuses, see Understanding command statuses - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/monitor-commands.html) - // in the AWS Systems Manager User Guide. StatusDetails can be one of the following - // values: - // - // * Pending: The command has not been sent to the instance. - // - // * In - // Progress: The command has been sent to the instance but has not reached a - // terminal state. - // - // * Success: The execution of the command or plugin was - // successfully completed. This is a terminal state. - // - // * Delivery Timed Out: The - // command was not delivered to the instance before the delivery timeout expired. - // Delivery timeouts do not count against the parent command's MaxErrors limit, but - // they do contribute to whether the parent command status is Success or - // Incomplete. This is a terminal state. - // - // * Execution Timed Out: Command execution - // started on the instance, but the execution was not complete before the execution - // timeout expired. Execution timeouts count against the MaxErrors limit of the - // parent command. This is a terminal state. - // - // * Failed: The command was not - // successful on the instance. For a plugin, this indicates that the result code - // was not zero. For a command invocation, this indicates that the result code for - // one or more plugins was not zero. Invocation failures count against the - // MaxErrors limit of the parent command. This is a terminal state. - // - // * Canceled: - // The command was terminated before it was completed. This is a terminal state. - // - // * - // Undeliverable: The command can't be delivered to the instance. The instance - // might not exist or might not be responding. Undeliverable invocations don't - // count against the parent command's MaxErrors limit and don't contribute to - // whether the parent command status is Success or Incomplete. This is a terminal - // state. - // - // * Terminated: The parent command exceeded its MaxErrors limit and - // subsequent command invocations were canceled by the system. This is a terminal - // state. + // information about these statuses, see Understanding command statuses (https://docs.aws.amazon.com/systems-manager/latest/userguide/monitor-commands.html) + // in the Amazon Web Services Systems Manager User Guide. StatusDetails can be one + // of the following values: + // - Pending: The command hasn't been sent to the managed node. + // - In Progress: The command has been sent to the managed node but hasn't + // reached a terminal state. + // - Success: The execution of the command or plugin was successfully completed. + // This is a terminal state. + // - Delivery Timed Out: The command wasn't delivered to the managed node before + // the delivery timeout expired. Delivery timeouts don't count against the parent + // command's MaxErrors limit, but they do contribute to whether the parent + // command status is Success or Incomplete. This is a terminal state. + // - Execution Timed Out: Command execution started on the managed node, but the + // execution wasn't complete before the execution timeout expired. Execution + // timeouts count against the MaxErrors limit of the parent command. This is a + // terminal state. + // - Failed: The command wasn't successful on the managed node. For a plugin, + // this indicates that the result code wasn't zero. For a command invocation, this + // indicates that the result code for one or more plugins wasn't zero. Invocation + // failures count against the MaxErrors limit of the parent command. This is a + // terminal state. + // - Cancelled: The command was terminated before it was completed. This is a + // terminal state. + // - Undeliverable: The command can't be delivered to the managed node. The + // managed node might not exist or might not be responding. Undeliverable + // invocations don't count against the parent command's MaxErrors limit and don't + // contribute to whether the parent command status is Success or Incomplete. This + // is a terminal state. + // - Terminated: The parent command exceeded its MaxErrors limit and subsequent + // command invocations were canceled by the system. This is a terminal state. + // - Delayed: The system attempted to send the command to the managed node but + // wasn't successful. The system retries again. StatusDetails *string // Gets the trace output sent by the agent. TraceOutput *string + + noSmithyDocumentSerde } // Describes plugin details. type CommandPlugin struct { - // The name of the plugin. Must be one of the following: aws:updateAgent, - // aws:domainjoin, aws:applications, aws:runPowerShellScript, aws:psmodule, - // aws:cloudWatch, aws:runShellScript, or aws:updateSSMAgent. + // The name of the plugin. Must be one of the following: aws:updateAgent , + // aws:domainjoin , aws:applications , aws:runPowerShellScript , aws:psmodule , + // aws:cloudWatch , aws:runShellScript , or aws:updateSSMAgent . Name *string // Output of the plugin execution. @@ -1052,8 +1252,8 @@ type CommandPlugin struct { // doc-example-bucket/ab19cb99-a030-46dd-9dfc-8eSAMPLEPre-Fix/i-02573cafcfEXAMPLE/awsrunShellScript // doc-example-bucket is the name of the S3 bucket; // ab19cb99-a030-46dd-9dfc-8eSAMPLEPre-Fix is the name of the S3 prefix; - // i-02573cafcfEXAMPLE is the instance ID; awsrunShellScript is the name of the - // plugin. + // i-02573cafcfEXAMPLE is the managed node ID; awsrunShellScript is the name of + // the plugin. OutputS3BucketName *string // The S3 directory path inside the bucket where the responses to the command @@ -1062,12 +1262,13 @@ type CommandPlugin struct { // doc-example-bucket/ab19cb99-a030-46dd-9dfc-8eSAMPLEPre-Fix/i-02573cafcfEXAMPLE/awsrunShellScript // doc-example-bucket is the name of the S3 bucket; // ab19cb99-a030-46dd-9dfc-8eSAMPLEPre-Fix is the name of the S3 prefix; - // i-02573cafcfEXAMPLE is the instance ID; awsrunShellScript is the name of the - // plugin. + // i-02573cafcfEXAMPLE is the managed node ID; awsrunShellScript is the name of + // the plugin. OutputS3KeyPrefix *string // (Deprecated) You can no longer specify this parameter. The system ignores it. - // Instead, Systems Manager automatically determines the S3 bucket region. + // Instead, Amazon Web Services Systems Manager automatically determines the S3 + // bucket region. OutputS3Region *string // A numeric response code generated after running the plugin. @@ -1080,12 +1281,12 @@ type CommandPlugin struct { // The time the plugin started running. ResponseStartDateTime *time.Time - // The URL for the complete text written by the plugin to stderr. If execution is - // not yet complete, then this string is empty. + // The URL for the complete text written by the plugin to stderr. If execution + // isn't yet complete, then this string is empty. StandardErrorUrl *string // The URL for the complete text written by the plugin to stdout in Amazon S3. If - // the S3 bucket for the command was not specified, then this string is empty. + // the S3 bucket for the command wasn't specified, then this string is empty. StandardOutputUrl *string // The status of this plugin. You can run a document with multiple plugins. @@ -1095,55 +1296,43 @@ type CommandPlugin struct { // information than Status because it includes states resulting from error and // concurrency control parameters. StatusDetails can show different results than // Status. For more information about these statuses, see Understanding command - // statuses - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/monitor-commands.html) - // in the AWS Systems Manager User Guide. StatusDetails can be one of the following - // values: - // - // * Pending: The command has not been sent to the instance. - // - // * In - // Progress: The command has been sent to the instance but has not reached a - // terminal state. - // - // * Success: The execution of the command or plugin was - // successfully completed. This is a terminal state. - // - // * Delivery Timed Out: The - // command was not delivered to the instance before the delivery timeout expired. - // Delivery timeouts do not count against the parent command's MaxErrors limit, but - // they do contribute to whether the parent command status is Success or - // Incomplete. This is a terminal state. - // - // * Execution Timed Out: Command execution - // started on the instance, but the execution was not complete before the execution - // timeout expired. Execution timeouts count against the MaxErrors limit of the - // parent command. This is a terminal state. - // - // * Failed: The command was not - // successful on the instance. For a plugin, this indicates that the result code - // was not zero. For a command invocation, this indicates that the result code for - // one or more plugins was not zero. Invocation failures count against the - // MaxErrors limit of the parent command. This is a terminal state. - // - // * Canceled: - // The command was terminated before it was completed. This is a terminal state. - // - // * - // Undeliverable: The command can't be delivered to the instance. The instance - // might not exist, or it might not be responding. Undeliverable invocations don't - // count against the parent command's MaxErrors limit, and they don't contribute to - // whether the parent command status is Success or Incomplete. This is a terminal - // state. - // - // * Terminated: The parent command exceeded its MaxErrors limit and - // subsequent command invocations were canceled by the system. This is a terminal - // state. + // statuses (https://docs.aws.amazon.com/systems-manager/latest/userguide/monitor-commands.html) + // in the Amazon Web Services Systems Manager User Guide. StatusDetails can be one + // of the following values: + // - Pending: The command hasn't been sent to the managed node. + // - In Progress: The command has been sent to the managed node but hasn't + // reached a terminal state. + // - Success: The execution of the command or plugin was successfully completed. + // This is a terminal state. + // - Delivery Timed Out: The command wasn't delivered to the managed node before + // the delivery timeout expired. Delivery timeouts don't count against the parent + // command's MaxErrors limit, but they do contribute to whether the parent + // command status is Success or Incomplete. This is a terminal state. + // - Execution Timed Out: Command execution started on the managed node, but the + // execution wasn't complete before the execution timeout expired. Execution + // timeouts count against the MaxErrors limit of the parent command. This is a + // terminal state. + // - Failed: The command wasn't successful on the managed node. For a plugin, + // this indicates that the result code wasn't zero. For a command invocation, this + // indicates that the result code for one or more plugins wasn't zero. Invocation + // failures count against the MaxErrors limit of the parent command. This is a + // terminal state. + // - Cancelled: The command was terminated before it was completed. This is a + // terminal state. + // - Undeliverable: The command can't be delivered to the managed node. The + // managed node might not exist, or it might not be responding. Undeliverable + // invocations don't count against the parent command's MaxErrors limit, and they + // don't contribute to whether the parent command status is Success or Incomplete. + // This is a terminal state. + // - Terminated: The parent command exceeded its MaxErrors limit and subsequent + // command invocations were canceled by the system. This is a terminal state. StatusDetails *string + + noSmithyDocumentSerde } // A summary of the call execution that includes an execution ID, the type of -// execution (for example, Command), and the date/time of the execution using a +// execution (for example, Command ), and the date/time of the execution using a // datetime object that is saved in the following format: yyyy-MM-dd'T'HH:mm:ss'Z'. type ComplianceExecutionSummary struct { @@ -1159,6 +1348,8 @@ type ComplianceExecutionSummary struct { // The type of execution. For example, Command is a valid execution type. ExecutionType *string + + noSmithyDocumentSerde } // Information about the compliance as defined by the resource type. For example, @@ -1166,8 +1357,8 @@ type ComplianceExecutionSummary struct { // Classification, and so on. type ComplianceItem struct { - // The compliance type. For example, Association (for a State Manager association), - // Patch, or Custom:string are all valid compliance types. + // The compliance type. For example, Association (for a State Manager + // association), Patch, or Custom: string are all valid compliance types. ComplianceType *string // A "Key": "Value" tag combination for the compliance item. @@ -1181,7 +1372,7 @@ type ComplianceItem struct { // patch, the ID could be the number of the KB article; for example: KB4010320. Id *string - // An ID for the resource. For a managed instance, this is the instance ID. + // An ID for the resource. For a managed node, this is the node ID. ResourceId *string // The type of resource. ManagedInstance is currently the only supported resource @@ -1200,6 +1391,8 @@ type ComplianceItem struct { // Windows patch, the title could be the title of the KB article for the patch; for // example: Security Update for Active Directory Federation Services. Title *string + + noSmithyDocumentSerde } // Information about a compliance item. @@ -1227,6 +1420,8 @@ type ComplianceItemEntry struct { // Windows patch, the title could be the title of the KB article for the patch; for // example: Security Update for Active Directory Federation Services. Title *string + + noSmithyDocumentSerde } // One or more filters. Use a filter to return a more specific list of results. @@ -1241,6 +1436,8 @@ type ComplianceStringFilter struct { // The value for which to search. Values []string + + noSmithyDocumentSerde } // A summary of compliance information by compliance type. @@ -1255,10 +1452,12 @@ type ComplianceSummaryItem struct { // A list of NON_COMPLIANT items for the specified compliance type. NonCompliantSummary *NonCompliantSummary + + noSmithyDocumentSerde } -// A summary of resources that are compliant. The summary is organized according to -// the resource count for each compliance type. +// A summary of resources that are compliant. The summary is organized according +// to the resource count for each compliance type. type CompliantSummary struct { // The total number of resources that are compliant. @@ -1266,55 +1465,77 @@ type CompliantSummary struct { // A summary of the compliance severity by compliance type. SeveritySummary *SeveritySummary + + noSmithyDocumentSerde } -// Describes the association of a Systems Manager SSM document and an instance. +// Describes the association of a Amazon Web Services Systems Manager document +// (SSM document) and a managed node. type CreateAssociationBatchRequestEntry struct { - // The name of the SSM document that contains the configuration information for the - // instance. You can specify Command or Automation documents. You can specify - // AWS-predefined documents, documents you created, or a document that is shared - // with you from another account. For SSM documents that are shared with you from - // other AWS accounts, you must specify the complete SSM document ARN, in the - // following format: arn:aws:ssm:region:account-id:document/document-name For - // example: arn:aws:ssm:us-east-2:12345678912:document/My-Shared-Document For - // AWS-predefined documents and SSM documents you created in your account, you only - // need to specify the document name. For example, AWS-ApplyPatchBaseline or - // My-Document. + // The name of the SSM document that contains the configuration information for + // the managed node. You can specify Command or Automation runbooks. You can + // specify Amazon Web Services-predefined documents, documents you created, or a + // document that is shared with you from another account. For SSM documents that + // are shared with you from other Amazon Web Services accounts, you must specify + // the complete SSM document ARN, in the following format: + // arn:aws:ssm:region:account-id:document/document-name For example: + // arn:aws:ssm:us-east-2:12345678912:document/My-Shared-Document For Amazon Web + // Services-predefined documents and SSM documents you created in your account, you + // only need to specify the document name. For example, AWS-ApplyPatchBaseline or + // My-Document . // // This member is required. Name *string + // The details for the CloudWatch alarm you want to apply to an automation or + // command. + AlarmConfiguration *AlarmConfiguration + // By default, when you create a new associations, the system runs it immediately // after it is created and then according to the schedule you specified. Specify // this option if you don't want an association to run immediately after you create - // it. This parameter is not supported for rate expressions. + // it. This parameter isn't supported for rate expressions. ApplyOnlyAtCronInterval bool // Specify a descriptive name for the association. AssociationName *string - // Specify the target for the association. This target is required for associations - // that use an Automation document and target resources by using rate controls. + // Specify the target for the association. This target is required for + // associations that use an Automation runbook and target resources by using rate + // controls. Automation is a capability of Amazon Web Services Systems Manager. AutomationTargetParameterName *string + // The names or Amazon Resource Names (ARNs) of the Change Calendar type documents + // your associations are gated under. The associations only run when that Change + // Calendar is open. For more information, see Amazon Web Services Systems Manager + // Change Calendar (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-change-calendar) + // . + CalendarNames []string + // The severity level to assign to the association. ComplianceSeverity AssociationComplianceSeverity // The document version. DocumentVersion *string - // The ID of the instance. + // The managed node ID. InstanceId has been deprecated. To specify a managed node + // ID for an association, use the Targets parameter. Requests that include the + // parameter InstanceID with Systems Manager documents (SSM documents) that use + // schema version 2.0 or later will fail. In addition, if you use the parameter + // InstanceId , you can't use the parameters AssociationName , DocumentVersion , + // MaxErrors , MaxConcurrency , OutputLocation , or ScheduleExpression . To use + // these parameters, you must use the Targets parameter. InstanceId *string // The maximum number of targets allowed to run the association at the same time. // You can specify a number, for example 10, or a percentage of the target set, for // example 10%. The default value is 100%, which means all targets run the - // association at the same time. If a new instance starts and attempts to run an - // association while Systems Manager is running MaxConcurrency associations, the - // association is allowed to run. During the next association interval, the new - // instance will process its association within the limit specified for - // MaxConcurrency. + // association at the same time. If a new managed node starts and attempts to run + // an association while Systems Manager is running MaxConcurrency associations, + // the association is allowed to run. During the next association interval, the new + // managed node will process its association within the limit specified for + // MaxConcurrency . MaxConcurrency *string // The number of errors that are allowed before the system stops sending requests @@ -1323,12 +1544,12 @@ type CreateAssociationBatchRequestEntry struct { // 10%. If you specify 3, for example, the system stops sending requests when the // fourth error is received. If you specify 0, then the system stops sending // requests after the first error is returned. If you run an association on 50 - // instances and set MaxError to 10%, then the system stops sending the request - // when the sixth error is received. Executions that are already running an - // association when MaxErrors is reached are allowed to complete, but some of these - // executions may fail as well. If you need to ensure that there won't be more than - // max-errors failed executions, set MaxConcurrency to 1 so that executions proceed - // one at a time. + // managed nodes and set MaxError to 10%, then the system stops sending the + // request when the sixth error is received. Executions that are already running an + // association when MaxErrors is reached are allowed to complete, but some of + // these executions may fail as well. If you need to ensure that there won't be + // more than max-errors failed executions, set MaxConcurrency to 1 so that + // executions proceed one at a time. MaxErrors *string // An S3 bucket where you want to store the results of this request. @@ -1340,23 +1561,33 @@ type CreateAssociationBatchRequestEntry struct { // A cron expression that specifies a schedule when the association runs. ScheduleExpression *string - // The mode for generating association compliance. You can specify AUTO or MANUAL. + // Number of days to wait after the scheduled day to run an association. + ScheduleOffset *int32 + + // The mode for generating association compliance. You can specify AUTO or MANUAL . // In AUTO mode, the system uses the status of the association execution to // determine the compliance status. If the association execution runs successfully, - // then the association is COMPLIANT. If the association execution doesn't run - // successfully, the association is NON-COMPLIANT. In MANUAL mode, you must specify - // the AssociationId as a parameter for the PutComplianceItems API action. In this - // case, compliance data is not managed by State Manager. It is managed by your - // direct call to the PutComplianceItems API action. By default, all associations - // use AUTO mode. + // then the association is COMPLIANT . If the association execution doesn't run + // successfully, the association is NON-COMPLIANT . In MANUAL mode, you must + // specify the AssociationId as a parameter for the PutComplianceItems API + // operation. In this case, compliance data isn't managed by State Manager, a + // capability of Amazon Web Services Systems Manager. It is managed by your direct + // call to the PutComplianceItems API operation. By default, all associations use + // AUTO mode. SyncCompliance AssociationSyncCompliance // Use this action to create an association in multiple Regions and multiple // accounts. TargetLocations []TargetLocation - // The instances targeted by the request. + // A key-value mapping of document parameters to target resources. Both Targets + // and TargetMaps can't be specified together. + TargetMaps []map[string][]string + + // The managed nodes targeted by the request. Targets []Target + + noSmithyDocumentSerde } // Filter for the DescribeActivation API. @@ -1367,6 +1598,8 @@ type DescribeActivationsFilter struct { // The filter values. FilterValues []string + + noSmithyDocumentSerde } // A default version of a document. @@ -1380,9 +1613,11 @@ type DocumentDefaultVersionDescription struct { // The name of the document. Name *string + + noSmithyDocumentSerde } -// Describes a Systems Manager document. +// Describes an Amazon Web Services Systems Manager document (SSM document). type DocumentDescription struct { // The version of the document currently approved for use in the organization. @@ -1395,6 +1630,12 @@ type DocumentDescription struct { // The user in your organization who created the document. Author *string + // The classification of a document to help you identify and categorize its use. + Category []string + + // The value that identifies a document's category. + CategoryEnum []string + // The date when the document was created. CreatedDate *time.Time @@ -1404,6 +1645,10 @@ type DocumentDescription struct { // A description of the document. Description *string + // The friendly name of the SSM document. This value can differ for each version + // of the document. If you want to update this value, see UpdateDocument . + DisplayName *string + // The document format, either JSON or YAML. DocumentFormat DocumentFormat @@ -1417,17 +1662,17 @@ type DocumentDescription struct { // Sha1 hashes have been deprecated. Hash *string - // The hash type of the document. Valid values include Sha256 or Sha1. Sha1 hashes + // The hash type of the document. Valid values include Sha256 or Sha1 . Sha1 hashes // have been deprecated. HashType DocumentHashType // The latest version of the document. LatestVersion *string - // The name of the Systems Manager document. + // The name of the SSM document. Name *string - // The AWS user account that created the document. + // The Amazon Web Services user that created the document. Owner *string // A description of the parameters for a document. @@ -1436,7 +1681,7 @@ type DocumentDescription struct { // The version of the document that is currently under review. PendingReviewVersion *string - // The list of OS platforms compatible with this Systems Manager document. + // The list of operating system (OS) platforms compatible with this SSM document. PlatformTypes []PlatformType // A list of SSM documents required by a document. For example, an @@ -1456,30 +1701,31 @@ type DocumentDescription struct { // The SHA1 hash of the document, which you can use for verification. Sha1 *string - // The status of the Systems Manager document. + // The status of the SSM document. Status DocumentStatus - // A message returned by AWS Systems Manager that explains the Status value. For - // example, a Failed status might be explained by the StatusInformation message, - // "The specified S3 bucket does not exist. Verify that the URL of the S3 bucket is - // correct." + // A message returned by Amazon Web Services Systems Manager that explains the + // Status value. For example, a Failed status might be explained by the + // StatusInformation message, "The specified S3 bucket doesn't exist. Verify that + // the URL of the S3 bucket is correct." StatusInformation *string // The tags, or metadata, that have been applied to the document. Tags []Tag // The target type which defines the kinds of resources the document can run on. - // For example, /AWS::EC2::Instance. For a list of valid resource types, see AWS - // resource and property types reference - // (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) - // in the AWS CloudFormation User Guide. + // For example, /AWS::EC2::Instance . For a list of valid resource types, see + // Amazon Web Services resource and property types reference (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) + // in the CloudFormation User Guide. TargetType *string // The version of the artifact associated with the document. VersionName *string + + noSmithyDocumentSerde } -// This data type is deprecated. Instead, use DocumentKeyValuesFilter. +// This data type is deprecated. Instead, use DocumentKeyValuesFilter . type DocumentFilter struct { // The name of the filter. @@ -1491,14 +1737,24 @@ type DocumentFilter struct { // // This member is required. Value *string + + noSmithyDocumentSerde } -// Describes the name of a Systems Manager document. +// Describes the name of a SSM document. type DocumentIdentifier struct { // The user in your organization who created the document. Author *string + // The date the SSM document was created. + CreatedDate *time.Time + + // An optional field where you can specify a friendly name for the SSM document. + // This value can differ for each version of the document. If you want to update + // this value, see UpdateDocument . + DisplayName *string + // The document format, either JSON or YAML. DocumentFormat DocumentFormat @@ -1508,10 +1764,10 @@ type DocumentIdentifier struct { // The document version. DocumentVersion *string - // The name of the Systems Manager document. + // The name of the SSM document. Name *string - // The AWS user account that created the document. + // The Amazon Web Services user that created the document. Owner *string // The operating system platform. @@ -1532,80 +1788,60 @@ type DocumentIdentifier struct { Tags []Tag // The target type which defines the kinds of resources the document can run on. - // For example, /AWS::EC2::Instance. For a list of valid resource types, see AWS - // resource and property types reference - // (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) - // in the AWS CloudFormation User Guide. + // For example, /AWS::EC2::Instance . For a list of valid resource types, see + // Amazon Web Services resource and property types reference (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) + // in the CloudFormation User Guide. TargetType *string // An optional field specifying the version of the artifact associated with the // document. For example, "Release 12, Update 6". This value is unique across all - // versions of a document, and cannot be changed. + // versions of a document, and can't be changed. VersionName *string + + noSmithyDocumentSerde } // One or more filters. Use a filter to return a more specific list of documents. // For keys, you can specify one or more tags that have been applied to a document. -// You can also use AWS-provided keys, some of which have specific allowed values. -// These keys and their associated values are as follows: DocumentType -// -// * -// ApplicationConfiguration -// -// * ApplicationConfigurationSchema -// -// * Automation -// -// * -// ChangeCalendar -// -// * Command +// You can also use Amazon Web Services-provided keys, some of which have specific +// allowed values. These keys and their associated values are as follows: +// DocumentType +// - ApplicationConfiguration +// - ApplicationConfigurationSchema +// - Automation +// - ChangeCalendar +// - Command +// - Package +// - Policy +// - Session // -// * DeploymentStrategy -// -// * Package -// -// * Policy -// -// * -// Session -// -// Owner Note that only one Owner can be specified in a request. For -// example: Key=Owner,Values=Self. -// -// * Amazon -// -// * Private -// -// * Public -// -// * Self -// -// * -// ThirdParty +// Owner Note that only one Owner can be specified in a request. For example: +// Key=Owner,Values=Self . +// - Amazon +// - Private +// - Public +// - Self +// - ThirdParty // // PlatformTypes +// - Linux +// - Windows // -// * Linux -// -// * Windows -// -// Name is another AWS-provided key. -// If you use Name as a key, you can use a name prefix to return a list of -// documents. For example, in the AWS CLI, to return a list of all documents that -// begin with Te, run the following command: aws ssm list-documents --filters -// Key=Name,Values=Te You can also use the TargetType AWS-provided key. For a list -// of valid resource type values that can be used with this key, see AWS resource -// and property types reference -// (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) -// in the AWS CloudFormation User Guide. If you specify more than two keys, only +// Name is another Amazon Web Services-provided key. If you use Name as a key, you +// can use a name prefix to return a list of documents. For example, in the Amazon +// Web Services CLI, to return a list of all documents that begin with Te , run the +// following command: aws ssm list-documents --filters Key=Name,Values=Te You can +// also use the TargetType Amazon Web Services-provided key. For a list of valid +// resource type values that can be used with this key, see Amazon Web Services +// resource and property types reference (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) +// in the CloudFormation User Guide. If you specify more than two keys, only // documents that are identified by all the tags are returned in the results. If // you specify more than two values for a key, documents that are identified by any -// of the values are returned in the results. To specify a custom key and value -// pair, use the format Key=tag:tagName,Values=valueName. For example, if you -// created a key called region and are using the AWS CLI to call the list-documents -// command: aws ssm list-documents --filters Key=tag:region,Values=east,west -// Key=Owner,Values=Self +// of the values are returned in the results. To specify a custom key-value pair, +// use the format Key=tag:tagName,Values=valueName . For example, if you created a +// key called region and are using the Amazon Web Services CLI to call the +// list-documents command: aws ssm list-documents --filters +// Key=tag:region,Values=east,west Key=Owner,Values=Self type DocumentKeyValuesFilter struct { // The name of the filter key. @@ -1613,6 +1849,8 @@ type DocumentKeyValuesFilter struct { // The value for the filter key. Values []string + + noSmithyDocumentSerde } // Details about the response to a document review request. @@ -1620,9 +1858,11 @@ type DocumentMetadataResponseInfo struct { // Details about a reviewer's response to a document review request. ReviewerResponse []DocumentReviewerResponseSource + + noSmithyDocumentSerde } -// Parameters specified in a System Manager document that run on the server when +// Parameters specified in a Systems Manager document that run on the server when // the command is run. type DocumentParameter struct { @@ -1639,6 +1879,8 @@ type DocumentParameter struct { // The type of parameter. The type can be either String or StringList. Type DocumentParameterType + + noSmithyDocumentSerde } // An SSM document required by the current document. @@ -1650,8 +1892,18 @@ type DocumentRequires struct { // This member is required. Name *string + // The document type of the required SSM document. + RequireType *string + // The document version required by the current document. Version *string + + // An optional field specifying the version of the artifact associated with the + // document. For example, "Release 12, Update 6". This value is unique across all + // versions of a document, and can't be changed. + VersionName *string + + noSmithyDocumentSerde } // Information about comments added to a document review request. @@ -1664,6 +1916,8 @@ type DocumentReviewCommentSource struct { // The type of information added to a review request. Currently, only the value // Comment is supported. Type DocumentReviewCommentType + + noSmithyDocumentSerde } // Information about a reviewer's response to a document review request. @@ -1689,6 +1943,8 @@ type DocumentReviewerResponseSource struct { // The date and time that a reviewer last updated a response to a document review // request. UpdatedTime *time.Time + + noSmithyDocumentSerde } // Information about a document approval review. @@ -1702,6 +1958,8 @@ type DocumentReviews struct { // A comment entered by a user in your organization about the document review // request. Comment []DocumentReviewCommentSource + + noSmithyDocumentSerde } // Version information about the document. @@ -1710,6 +1968,10 @@ type DocumentVersionInfo struct { // The date the document was created. CreatedDate *time.Time + // The friendly name of the SSM document. This value can differ for each version + // of the document. If you want to update this value, see UpdateDocument . + DisplayName *string + // The document format, either JSON or YAML. DocumentFormat DocumentFormat @@ -1726,20 +1988,22 @@ type DocumentVersionInfo struct { // document. ReviewStatus ReviewStatus - // The status of the Systems Manager document, such as Creating, Active, Failed, - // and Deleting. + // The status of the SSM document, such as Creating , Active , Failed , and + // Deleting . Status DocumentStatus - // A message returned by AWS Systems Manager that explains the Status value. For - // example, a Failed status might be explained by the StatusInformation message, - // "The specified S3 bucket does not exist. Verify that the URL of the S3 bucket is - // correct." + // A message returned by Amazon Web Services Systems Manager that explains the + // Status value. For example, a Failed status might be explained by the + // StatusInformation message, "The specified S3 bucket doesn't exist. Verify that + // the URL of the S3 bucket is correct." StatusInformation *string // The version of the artifact associated with the document. For example, "Release - // 12, Update 6". This value is unique across all versions of a document, and - // cannot be changed. + // 12, Update 6". This value is unique across all versions of a document, and can't + // be changed. VersionName *string + + noSmithyDocumentSerde } // The EffectivePatch structure defines metadata about a patch along with the @@ -1759,6 +2023,8 @@ type EffectivePatch struct { // explicitly approved, or explicitly rejected and the date the patch was or will // be approved. PatchStatus *PatchStatus + + noSmithyDocumentSerde } // Describes a failed association. @@ -1772,6 +2038,8 @@ type FailedCreateAssociation struct { // A description of the failure. Message *string + + noSmithyDocumentSerde } // Information about an Automation failure. @@ -1788,6 +2056,33 @@ type FailureDetails struct { // The type of Automation failure. Failure types include the following: Action, // Permission, Throttling, Verification, Internal. FailureType *string + + noSmithyDocumentSerde +} + +// A resource policy helps you to define the IAM entity (for example, an Amazon +// Web Services account) that can manage your Systems Manager resources. Currently, +// OpsItemGroup is the only resource that supports Systems Manager resource +// policies. The resource policy for OpsItemGroup enables Amazon Web Services +// accounts to view and interact with OpsCenter operational work items (OpsItems). +type GetResourcePoliciesResponseEntry struct { + + // A resource policy helps you to define the IAM entity (for example, an Amazon + // Web Services account) that can manage your Systems Manager resources. Currently, + // OpsItemGroup is the only resource that supports Systems Manager resource + // policies. The resource policy for OpsItemGroup enables Amazon Web Services + // accounts to view and interact with OpsCenter operational work items (OpsItems). + Policy *string + + // ID of the current policy version. The hash helps to prevent a situation where + // multiple users attempt to overwrite a policy. You must provide this hash when + // updating or deleting a policy. + PolicyHash *string + + // A policy ID. + PolicyId *string + + noSmithyDocumentSerde } // Status information about the aggregated associations. @@ -1796,31 +2091,40 @@ type InstanceAggregatedAssociationOverview struct { // Detailed status information about the aggregated associations. DetailedStatus *string - // The number of associations for the instance(s). + // The number of associations for the managed node(s). InstanceAssociationStatusAggregatedCount map[string]int32 + + noSmithyDocumentSerde } -// One or more association documents on the instance. +// One or more association documents on the managed node. type InstanceAssociation struct { // The association ID. AssociationId *string - // Version information for the association on the instance. + // Version information for the association on the managed node. AssociationVersion *string - // The content of the association document for the instance(s). + // The content of the association document for the managed node(s). Content *string - // The instance ID. + // The managed node ID. InstanceId *string + + noSmithyDocumentSerde } -// An S3 bucket where you want to store the results of this request. +// An S3 bucket where you want to store the results of this request. For the +// minimal permissions required to enable Amazon S3 output for an association, see +// Creating associations (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-state-assoc.html) +// in the Systems Manager User Guide. type InstanceAssociationOutputLocation struct { // An S3 bucket where you want to store the results of this request. S3Location *S3OutputLocation + + noSmithyDocumentSerde } // The URL of S3 bucket where you want to store the results of this request. @@ -1828,21 +2132,23 @@ type InstanceAssociationOutputUrl struct { // The URL of S3 bucket where you want to store the results of this request. S3OutputUrl *S3OutputUrl + + noSmithyDocumentSerde } -// Status information about the instance association. +// Status information about the association. type InstanceAssociationStatusInfo struct { // The association ID. AssociationId *string - // The name of the association applied to the instance. + // The name of the association applied to the managed node. AssociationName *string - // The version of the association applied to the instance. + // The version of the association applied to the managed node. AssociationVersion *string - // Detailed status information about the instance association. + // Detailed status information about the association. DetailedStatus *string // The association document versions. @@ -1851,13 +2157,13 @@ type InstanceAssociationStatusInfo struct { // An error code returned by the request to create the association. ErrorCode *string - // The date the instance association ran. + // The date the association ran. ExecutionDate *time.Time // Summary information about association execution. ExecutionSummary *string - // The instance ID where the association was created. + // The managed node ID where the association was created. InstanceId *string // The name of the association. @@ -1866,18 +2172,20 @@ type InstanceAssociationStatusInfo struct { // A URL for an S3 bucket where you want to store the results of this request. OutputUrl *InstanceAssociationOutputUrl - // Status information about the instance association. + // Status information about the association. Status *string + + noSmithyDocumentSerde } -// Describes a filter for a specific list of instances. +// Describes a filter for a specific list of managed nodes. type InstanceInformation struct { - // The activation ID created by Systems Manager when the server or VM was - // registered. + // The activation ID created by Amazon Web Services Systems Manager when the + // server or virtual machine (VM) was registered. ActivationId *string - // The version of SSM Agent running on your Linux instance. + // The version of SSM Agent running on your Linux managed node. AgentVersion *string // Information about the association. @@ -1886,30 +2194,29 @@ type InstanceInformation struct { // The status of the association. AssociationStatus *string - // The fully qualified host name of the managed instance. + // The fully qualified host name of the managed node. ComputerName *string - // The IP address of the managed instance. + // The IP address of the managed node. IPAddress *string - // The Amazon Identity and Access Management (IAM) role assigned to the on-premises - // Systems Manager managed instance. This call does not return the IAM role for EC2 - // instances. To retrieve the IAM role for an EC2 instance, use the Amazon EC2 - // DescribeInstances action. For information, see DescribeInstances - // (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html) - // in the Amazon EC2 API Reference or describe-instances - // (http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html) in - // the AWS CLI Command Reference. + // The Identity and Access Management (IAM) role assigned to the on-premises + // Systems Manager managed node. This call doesn't return the IAM role for Amazon + // Elastic Compute Cloud (Amazon EC2) instances. To retrieve the IAM role for an + // EC2 instance, use the Amazon EC2 DescribeInstances operation. For information, + // see DescribeInstances (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html) + // in the Amazon EC2 API Reference or describe-instances (https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html) + // in the Amazon Web Services CLI Command Reference. IamRole *string - // The instance ID. + // The managed node ID. InstanceId *string // Indicates whether the latest version of SSM Agent is running on your Linux - // Managed Instance. This field does not indicate whether or not the latest version - // is installed on Windows managed instances, because some older versions of - // Windows Server use the EC2Config service to process SSM requests. - IsLatestVersion bool + // managed node. This field doesn't indicate whether or not the latest version is + // installed on Windows managed nodes, because some older versions of Windows + // Server use the EC2Config service to process Systems Manager requests. + IsLatestVersion *bool // The date the association was last run. LastAssociationExecutionDate *time.Time @@ -1920,49 +2227,55 @@ type InstanceInformation struct { // The last date the association was successfully run. LastSuccessfulAssociationExecutionDate *time.Time - // The name assigned to an on-premises server or virtual machine (VM) when it is - // activated as a Systems Manager managed instance. The name is specified as the - // DefaultInstanceName property using the CreateActivation command. It is applied - // to the managed instance by specifying the Activation Code and Activation ID when - // you install SSM Agent on the instance, as explained in Install SSM Agent for a - // hybrid environment (Linux) - // (http://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-install-managed-linux.html) - // and Install SSM Agent for a hybrid environment (Windows) - // (http://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-install-managed-win.html). - // To retrieve the Name tag of an EC2 instance, use the Amazon EC2 - // DescribeInstances action. For information, see DescribeInstances - // (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html) - // in the Amazon EC2 API Reference or describe-instances - // (http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html) in - // the AWS CLI Command Reference. + // The name assigned to an on-premises server, edge device, or virtual machine + // (VM) when it is activated as a Systems Manager managed node. The name is + // specified as the DefaultInstanceName property using the CreateActivation + // command. It is applied to the managed node by specifying the Activation Code and + // Activation ID when you install SSM Agent on the node, as explained in Install + // SSM Agent for a hybrid environment (Linux) (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-install-managed-linux.html) + // and Install SSM Agent for a hybrid environment (Windows) (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-install-managed-win.html) + // . To retrieve the Name tag of an EC2 instance, use the Amazon EC2 + // DescribeInstances operation. For information, see DescribeInstances (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html) + // in the Amazon EC2 API Reference or describe-instances (https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html) + // in the Amazon Web Services CLI Command Reference. Name *string // Connection status of SSM Agent. The status Inactive has been deprecated and is // no longer in use. PingStatus PingStatus - // The name of the operating system platform running on your instance. + // The name of the operating system platform running on your managed node. PlatformName *string // The operating system platform type. PlatformType PlatformType - // The version of the OS platform running on your instance. + // The version of the OS platform running on your managed node. PlatformVersion *string - // The date the server or VM was registered with AWS as a managed instance. + // The date the server or VM was registered with Amazon Web Services as a managed + // node. RegistrationDate *time.Time // The type of instance. Instances are either EC2 instances or managed instances. ResourceType ResourceType + + // The ID of the source resource. For IoT Greengrass devices, SourceId is the + // Thing name. + SourceId *string + + // The type of the source resource. For IoT Greengrass devices, SourceType is + // AWS::IoT::Thing . + SourceType SourceType + + noSmithyDocumentSerde } -// Describes a filter for a specific list of instances. You can filter instances +// Describes a filter for a specific list of managed nodes. You can filter node // information by using tags. You specify tags by using a key-value mapping. Use -// this action instead of the +// this operation instead of the // DescribeInstanceInformationRequest$InstanceInformationFilterList method. The -// InstanceInformationFilterList method is a legacy method and does not support -// tags. +// InstanceInformationFilterList method is a legacy method and doesn't support tags. type InstanceInformationFilter struct { // The name of the filter. @@ -1974,14 +2287,27 @@ type InstanceInformationFilter struct { // // This member is required. ValueSet []string + + noSmithyDocumentSerde } -// The filters to describe or get information about your managed instances. +// The filters to describe or get information about your managed nodes. type InstanceInformationStringFilter struct { - // The filter key name to describe your instances. For example: - // "InstanceIds"|"AgentVersion"|"PingStatus"|"PlatformTypes"|"ActivationIds"|"IamRole"|"ResourceType"|"AssociationStatus"|"Tag - // Key" + // The filter key name to describe your managed nodes. Valid filter key values: + // ActivationIds | AgentVersion | AssociationStatus | IamRole | InstanceIds | + // PingStatus | PlatformTypes | ResourceType | SourceIds | SourceTypes | "tag-key" + // | "tag: {keyname} + // - Valid values for the AssociationStatus filter key: Success | Pending | + // Failed + // - Valid values for the PingStatus filter key: Online | ConnectionLost | + // Inactive (deprecated) + // - Valid values for the PlatformType filter key: Windows | Linux | MacOS + // - Valid values for the ResourceType filter key: EC2Instance | ManagedInstance + // - Valid values for the SourceType filter key: AWS::EC2::Instance | + // AWS::SSM::ManagedInstance | AWS::IoT::Thing + // - Valid tag examples: Key=tag-key,Values=Purpose | Key=tag:Purpose,Values=Test + // . // // This member is required. Key *string @@ -1990,139 +2316,174 @@ type InstanceInformationStringFilter struct { // // This member is required. Values []string + + noSmithyDocumentSerde } -// Defines the high-level patch compliance state for a managed instance, providing +// Defines the high-level patch compliance state for a managed node, providing // information about the number of installed, missing, not applicable, and failed // patches along with metadata about the operation when this information was -// gathered for the instance. +// gathered for the managed node. type InstancePatchState struct { - // The ID of the patch baseline used to patch the instance. + // The ID of the patch baseline used to patch the managed node. // // This member is required. BaselineId *string - // The ID of the managed instance the high-level patch compliance information was + // The ID of the managed node the high-level patch compliance information was // collected for. // // This member is required. InstanceId *string - // The type of patching operation that was performed: SCAN (assess patch compliance - // state) or INSTALL (install missing patches). + // The type of patching operation that was performed: or + // - SCAN assesses the patch compliance state. + // - INSTALL installs missing patches. // // This member is required. Operation PatchOperationType - // The time the most recent patching operation completed on the instance. + // The time the most recent patching operation completed on the managed node. // // This member is required. OperationEndTime *time.Time - // The time the most recent patching operation was started on the instance. + // The time the most recent patching operation was started on the managed node. // // This member is required. OperationStartTime *time.Time - // The name of the patch group the managed instance belongs to. + // The name of the patch group the managed node belongs to. // // This member is required. PatchGroup *string + // The number of patches per node that are specified as Critical for compliance + // reporting in the patch baseline aren't installed. These patches might be + // missing, have failed installation, were rejected, or were installed but awaiting + // a required managed node reboot. The status of these managed nodes is + // NON_COMPLIANT . + CriticalNonCompliantCount *int32 + // The number of patches from the patch baseline that were attempted to be // installed during the last patching operation, but failed to install. FailedCount int32 - // An https URL or an Amazon S3 path-style URL to a list of patches to be - // installed. This patch installation list, which you maintain in an S3 bucket in - // YAML format and specify in the SSM document AWS-RunPatchBaseline, overrides the - // patches specified by the default patch baseline. For more information about the - // InstallOverrideList parameter, see About the SSM document AWS-RunPatchBaseline - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-about-aws-runpatchbaseline.html) - // in the AWS Systems Manager User Guide. + // An https URL or an Amazon Simple Storage Service (Amazon S3) path-style URL to + // a list of patches to be installed. This patch installation list, which you + // maintain in an S3 bucket in YAML format and specify in the SSM document + // AWS-RunPatchBaseline , overrides the patches specified by the default patch + // baseline. For more information about the InstallOverrideList parameter, see + // About the AWS-RunPatchBaseline (https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-about-aws-runpatchbaseline.html) + // SSM document in the Amazon Web Services Systems Manager User Guide. InstallOverrideList *string - // The number of patches from the patch baseline that are installed on the - // instance. + // The number of patches from the patch baseline that are installed on the managed + // node. InstalledCount int32 // The number of patches not specified in the patch baseline that are installed on - // the instance. + // the managed node. InstalledOtherCount int32 // The number of patches installed by Patch Manager since the last time the - // instance was rebooted. - InstalledPendingRebootCount int32 + // managed node was rebooted. + InstalledPendingRebootCount *int32 - // The number of patches installed on an instance that are specified in a + // The number of patches installed on a managed node that are specified in a // RejectedPatches list. Patches with a status of InstalledRejected were typically // installed before they were added to a RejectedPatches list. If - // ALLOW_AS_DEPENDENCY is the specified option for RejectedPatchesAction, the value - // of InstalledRejectedCount will always be 0 (zero). - InstalledRejectedCount int32 + // ALLOW_AS_DEPENDENCY is the specified option for RejectedPatchesAction , the + // value of InstalledRejectedCount will always be 0 (zero). + InstalledRejectedCount *int32 - // The time of the last attempt to patch the instance with NoReboot specified as - // the reboot option. + // The time of the last attempt to patch the managed node with NoReboot specified + // as the reboot option. LastNoRebootInstallOperationTime *time.Time // The number of patches from the patch baseline that are applicable for the - // instance but aren't currently installed. + // managed node but aren't currently installed. MissingCount int32 // The number of patches from the patch baseline that aren't applicable for the - // instance and therefore aren't installed on the instance. This number may be + // managed node and therefore aren't installed on the node. This number may be // truncated if the list of patch names is very large. The number of patches beyond - // this limit are reported in UnreportedNotApplicableCount. + // this limit are reported in UnreportedNotApplicableCount . NotApplicableCount int32 + // The number of patches per node that are specified as other than Critical or + // Security but aren't compliant with the patch baseline. The status of these + // managed nodes is NON_COMPLIANT . + OtherNonCompliantCount *int32 + // Placeholder information. This field will always be empty in the current release // of the service. OwnerInformation *string // Indicates the reboot option specified in the patch baseline. Reboot options - // apply to Install operations only. Reboots are not attempted for Patch Manager + // apply to Install operations only. Reboots aren't attempted for Patch Manager // Scan operations. - // - // * RebootIfNeeded: Patch Manager tries to reboot the instance - // if it installed any patches, or if any patches are detected with a status of - // InstalledPendingReboot. - // - // * NoReboot: Patch Manager attempts to install missing - // packages without trying to reboot the system. Patches installed with this option - // are assigned a status of InstalledPendingReboot. These patches might not be in - // effect until a reboot is performed. + // - RebootIfNeeded : Patch Manager tries to reboot the managed node if it + // installed any patches, or if any patches are detected with a status of + // InstalledPendingReboot . + // - NoReboot : Patch Manager attempts to install missing packages without trying + // to reboot the system. Patches installed with this option are assigned a status + // of InstalledPendingReboot . These patches might not be in effect until a + // reboot is performed. RebootOption RebootOption + // The number of patches per node that are specified as Security in a patch + // advisory aren't installed. These patches might be missing, have failed + // installation, were rejected, or were installed but awaiting a required managed + // node reboot. The status of these managed nodes is NON_COMPLIANT . + SecurityNonCompliantCount *int32 + // The ID of the patch baseline snapshot used during the patching operation when // this compliance data was collected. SnapshotId *string - // The number of patches beyond the supported limit of NotApplicableCount that are - // not reported by name to Systems Manager Inventory. - UnreportedNotApplicableCount int32 + // The number of patches beyond the supported limit of NotApplicableCount that + // aren't reported by name to Inventory. Inventory is a capability of Amazon Web + // Services Systems Manager. + UnreportedNotApplicableCount *int32 + + noSmithyDocumentSerde } -// Defines a filter used in DescribeInstancePatchStatesForPatchGroup used to scope -// down the information returned by the API. +// Defines a filter used in DescribeInstancePatchStatesForPatchGroup to scope down +// the information returned by the API. Example: To filter for all managed nodes in +// a patch group having more than three patches with a FailedCount status, use the +// following for the filter: +// - Value for Key : FailedCount +// - Value for Type : GreaterThan +// - Value for Values : 3 type InstancePatchStateFilter struct { - // The key for the filter. Supported values are FailedCount, InstalledCount, - // InstalledOtherCount, MissingCount and NotApplicableCount. + // The key for the filter. Supported values include the following: + // - InstalledCount + // - InstalledOtherCount + // - InstalledPendingRebootCount + // - InstalledRejectedCount + // - MissingCount + // - FailedCount + // - UnreportedNotApplicableCount + // - NotApplicableCount // // This member is required. Key *string - // The type of comparison that should be performed for the value: Equal, NotEqual, - // LessThan or GreaterThan. + // The type of comparison that should be performed for the value. // // This member is required. Type InstancePatchStateOperatorType - // The value for the filter, must be an integer greater than or equal to 0. + // The value for the filter. Must be an integer greater than or equal to 0. // // This member is required. Values []string + + noSmithyDocumentSerde } // Specifies the inventory type and attribute for the aggregation execution. @@ -2138,21 +2499,22 @@ type InventoryAggregator struct { // Groups return a count of resources that match and don't match the specified // criteria. Groups []InventoryGroup + + noSmithyDocumentSerde } -// Status information returned by the DeleteInventory action. +// Status information returned by the DeleteInventory operation. type InventoryDeletionStatusItem struct { - // The deletion ID returned by the DeleteInventory action. + // The deletion ID returned by the DeleteInventory operation. DeletionId *string // The UTC timestamp when the delete operation started. DeletionStartTime *time.Time - // Information about the delete operation. For more information about this summary, - // see Understanding the delete inventory summary - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-inventory-custom.html#sysman-inventory-delete) - // in the AWS Systems Manager User Guide. + // Information about the delete operation. For more information about this + // summary, see Understanding the delete inventory summary (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-inventory-custom.html#sysman-inventory-delete) + // in the Amazon Web Services Systems Manager User Guide. DeletionSummary *InventoryDeletionSummary // The status of the operation. Possible values are InProgress and Complete. @@ -2166,6 +2528,8 @@ type InventoryDeletionStatusItem struct { // The name of the inventory data type. TypeName *string + + noSmithyDocumentSerde } // Information about the delete operation. @@ -2177,9 +2541,11 @@ type InventoryDeletionSummary struct { // A list of counts and versions for deleted items. SummaryItems []InventoryDeletionSummaryItem - // The total number of items to delete. This count does not change during the + // The total number of items to delete. This count doesn't change during the // delete operation. TotalCount int32 + + noSmithyDocumentSerde } // Either a count, remaining count, or a version number in a delete inventory @@ -2194,6 +2560,8 @@ type InventoryDeletionSummaryItem struct { // The inventory type version. Version *string + + noSmithyDocumentSerde } // One or more filters. Use a filter to return a more specific list of results. @@ -2204,18 +2572,19 @@ type InventoryFilter struct { // This member is required. Key *string - // Inventory filter values. Example: inventory filter where instance IDs are + // Inventory filter values. Example: inventory filter where managed node IDs are // specified as values Key=AWS:InstanceInformation.InstanceId,Values= - // i-a12b3c4d5e6g, i-1a2b3c4d5e6,Type=Equal + // i-a12b3c4d5e6g, i-1a2b3c4d5e6,Type=Equal . // // This member is required. Values []string // The type of filter. The Exists filter must be used with aggregators. For more - // information, see Aggregating inventory data - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-inventory-aggregate.html) - // in the AWS Systems Manager User Guide. + // information, see Aggregating inventory data (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-inventory-aggregate.html) + // in the Amazon Web Services Systems Manager User Guide. Type InventoryQueryOperatorType + + noSmithyDocumentSerde } // A user-defined set of one or more filters on which to aggregate inventory data. @@ -2224,8 +2593,8 @@ type InventoryFilter struct { type InventoryGroup struct { // Filters define the criteria for the group. The matchingCount field displays the - // number of resources that match the criteria. The notMatchingCount field displays - // the number of resources that don't match the criteria. + // number of resources that match the criteria. The notMatchingCount field + // displays the number of resources that don't match the criteria. // // This member is required. Filters []InventoryFilter @@ -2234,10 +2603,11 @@ type InventoryGroup struct { // // This member is required. Name *string + + noSmithyDocumentSerde } -// Information collected from managed instances based on your inventory policy -// document +// Information collected from managed nodes based on your inventory policy document type InventoryItem struct { // The time the inventory information was collected. @@ -2250,10 +2620,10 @@ type InventoryItem struct { // This member is required. SchemaVersion *string - // The name of the inventory type. Default inventory item type names start with - // AWS. Custom inventory type names will start with Custom. Default inventory item - // types include the following: AWS:AWSComponent, AWS:Application, - // AWS:InstanceInformation, AWS:Network, and AWS:WindowsUpdate. + // The name of the inventory type. Default inventory item type names start with AWS + // . Custom inventory type names will start with Custom. Default inventory item + // types include the following: AWS:AWSComponent , AWS:Application , + // AWS:InstanceInformation , AWS:Network , and AWS:WindowsUpdate . // // This member is required. TypeName *string @@ -2262,15 +2632,17 @@ type InventoryItem struct { Content []map[string]string // MD5 hash of the inventory item type contents. The content hash is used to - // determine whether to update inventory information. The PutInventory API does not - // update the inventory item type contents if the MD5 hash has not changed since + // determine whether to update inventory information. The PutInventory API doesn't + // update the inventory item type contents if the MD5 hash hasn't changed since // last update. ContentHash *string - // A map of associated properties for a specified inventory type. For example, with - // this attribute, you can specify the ExecutionId, ExecutionType, ComplianceType - // properties of the AWS:ComplianceItem type. + // A map of associated properties for a specified inventory type. For example, + // with this attribute, you can specify the ExecutionId , ExecutionType , + // ComplianceType properties of the AWS:ComplianceItem type. Context map[string]string + + noSmithyDocumentSerde } // Attributes are the entries within the inventory item content. It contains name @@ -2286,6 +2658,8 @@ type InventoryItemAttribute struct { // // This member is required. Name *string + + noSmithyDocumentSerde } // The inventory item schema definition. Users can use this to compose inventory @@ -2298,9 +2672,9 @@ type InventoryItemSchema struct { Attributes []InventoryItemAttribute // The name of the inventory type. Default inventory item type names start with - // AWS. Custom inventory type names will start with Custom. Default inventory item - // types include the following: AWS:AWSComponent, AWS:Application, - // AWS:InstanceInformation, AWS:Network, and AWS:WindowsUpdate. + // Amazon Web Services. Custom inventory type names will start with Custom. Default + // inventory item types include the following: AWS:AWSComponent , AWS:Application , + // AWS:InstanceInformation , AWS:Network , and AWS:WindowsUpdate . // // This member is required. TypeName *string @@ -2311,6 +2685,8 @@ type InventoryItemSchema struct { // The schema version for the inventory item. Version *string + + noSmithyDocumentSerde } // Inventory query results. @@ -2319,10 +2695,12 @@ type InventoryResultEntity struct { // The data section in the inventory result entity JSON. Data map[string]InventoryResultItem - // ID of the inventory result entity. For example, for managed instance inventory - // the result will be the managed instance ID. For EC2 instance inventory, the - // result will be the instance ID. + // ID of the inventory result entity. For example, for managed node inventory the + // result will be the managed node ID. For EC2 instance inventory, the result will + // be the instance ID. Id *string + + noSmithyDocumentSerde } // The inventory result item. @@ -2348,53 +2726,62 @@ type InventoryResultItem struct { CaptureTime *string // MD5 hash of the inventory item type contents. The content hash is used to - // determine whether to update inventory information. The PutInventory API does not - // update the inventory item type contents if the MD5 hash has not changed since + // determine whether to update inventory information. The PutInventory API doesn't + // update the inventory item type contents if the MD5 hash hasn't changed since // last update. ContentHash *string + + noSmithyDocumentSerde } -// Information about an S3 bucket to write instance-level logs to. LoggingInfo has -// been deprecated. To specify an S3 bucket to contain logs, instead use the -// OutputS3BucketName and OutputS3KeyPrefix options in the TaskInvocationParameters -// structure. For information about how Systems Manager handles these options for -// the supported maintenance window task types, see -// MaintenanceWindowTaskInvocationParameters. +// Information about an Amazon Simple Storage Service (Amazon S3) bucket to write +// managed node-level logs to. LoggingInfo has been deprecated. To specify an +// Amazon Simple Storage Service (Amazon S3) bucket to contain logs, instead use +// the OutputS3BucketName and OutputS3KeyPrefix options in the +// TaskInvocationParameters structure. For information about how Amazon Web +// Services Systems Manager handles these options for the supported maintenance +// window task types, see MaintenanceWindowTaskInvocationParameters . type LoggingInfo struct { - // The name of an S3 bucket where execution logs are stored . + // The name of an S3 bucket where execution logs are stored. // // This member is required. S3BucketName *string - // The Region where the S3 bucket is located. + // The Amazon Web Services Region where the S3 bucket is located. // // This member is required. S3Region *string // (Optional) The S3 bucket subfolder. S3KeyPrefix *string + + noSmithyDocumentSerde } // The parameters for an AUTOMATION task type. type MaintenanceWindowAutomationParameters struct { - // The version of an Automation document to use during task execution. + // The version of an Automation runbook to use during task execution. DocumentVersion *string // The parameters for the AUTOMATION task. For information about specifying and // updating task parameters, see RegisterTaskWithMaintenanceWindow and - // UpdateMaintenanceWindowTask. LoggingInfo has been deprecated. To specify an S3 - // bucket to contain logs, instead use the OutputS3BucketName and OutputS3KeyPrefix - // options in the TaskInvocationParameters structure. For information about how - // Systems Manager handles these options for the supported maintenance window task - // types, see MaintenanceWindowTaskInvocationParameters. TaskParameters has been - // deprecated. To specify parameters to pass to a task when it runs, instead use - // the Parameters option in the TaskInvocationParameters structure. For information - // about how Systems Manager handles these options for the supported maintenance - // window task types, see MaintenanceWindowTaskInvocationParameters. For AUTOMATION - // task types, Systems Manager ignores any values specified for these parameters. + // UpdateMaintenanceWindowTask . LoggingInfo has been deprecated. To specify an + // Amazon Simple Storage Service (Amazon S3) bucket to contain logs, instead use + // the OutputS3BucketName and OutputS3KeyPrefix options in the + // TaskInvocationParameters structure. For information about how Amazon Web + // Services Systems Manager handles these options for the supported maintenance + // window task types, see MaintenanceWindowTaskInvocationParameters . + // TaskParameters has been deprecated. To specify parameters to pass to a task when + // it runs, instead use the Parameters option in the TaskInvocationParameters + // structure. For information about how Systems Manager handles these options for + // the supported maintenance window task types, see + // MaintenanceWindowTaskInvocationParameters . For AUTOMATION task types, Amazon + // Web Services Systems Manager ignores any values specified for these parameters. Parameters map[string][]string + + noSmithyDocumentSerde } // Describes the information about an execution of a maintenance window. @@ -2409,7 +2796,7 @@ type MaintenanceWindowExecution struct { // The status of the execution. Status MaintenanceWindowExecutionStatus - // The details explaining the Status. Only available for certain status values. + // The details explaining the status. Not available for all status values. StatusDetails *string // The ID of the maintenance window execution. @@ -2417,12 +2804,17 @@ type MaintenanceWindowExecution struct { // The ID of the maintenance window. WindowId *string + + noSmithyDocumentSerde } // Information about a task execution performed as part of a maintenance window // execution. type MaintenanceWindowExecutionTaskIdentity struct { + // The details for the CloudWatch alarm applied to your maintenance window task. + AlarmConfiguration *AlarmConfiguration + // The time the task execution finished. EndTime *time.Time @@ -2432,11 +2824,11 @@ type MaintenanceWindowExecutionTaskIdentity struct { // The status of the task execution. Status MaintenanceWindowExecutionStatus - // The details explaining the status of the task execution. Only available for - // certain status values. + // The details explaining the status of the task execution. Not available for all + // status values. StatusDetails *string - // The ARN of the task that ran. + // The Amazon Resource Name (ARN) of the task that ran. TaskArn *string // The ID of the specific task execution in the maintenance window execution. @@ -2445,8 +2837,13 @@ type MaintenanceWindowExecutionTaskIdentity struct { // The type of task that ran. TaskType MaintenanceWindowTaskType + // The CloudWatch alarm that was invoked by the maintenance window task. + TriggeredAlarms []AlarmStateInformation + // The ID of the maintenance window execution that ran the task. WindowExecutionId *string + + noSmithyDocumentSerde } // Describes the information about a task invocation for a particular target as @@ -2457,15 +2854,15 @@ type MaintenanceWindowExecutionTaskInvocationIdentity struct { EndTime *time.Time // The ID of the action performed in the service that actually handled the task - // invocation. If the task type is RUN_COMMAND, this value is the command ID. + // invocation. If the task type is RUN_COMMAND , this value is the command ID. ExecutionId *string // The ID of the task invocation. InvocationId *string // User-provided value that was specified when the target was registered with the - // maintenance window. This was also included in any CloudWatch events raised - // during the task invocation. + // maintenance window. This was also included in any Amazon CloudWatch Events + // events raised during the task invocation. OwnerInformation *string // The parameters that were provided for the invocation when it was run. @@ -2477,8 +2874,8 @@ type MaintenanceWindowExecutionTaskInvocationIdentity struct { // The status of the task invocation. Status MaintenanceWindowExecutionStatus - // The details explaining the status of the task invocation. Only available for - // certain Status values. + // The details explaining the status of the task invocation. Not available for all + // status values. StatusDetails *string // The ID of the specific task execution in the maintenance window execution. @@ -2493,9 +2890,19 @@ type MaintenanceWindowExecutionTaskInvocationIdentity struct { // The ID of the target definition in this maintenance window the invocation was // performed for. WindowTargetId *string + + noSmithyDocumentSerde } -// Filter used in the request. Supported filter keys are Name and Enabled. +// Filter used in the request. Supported filter keys depend on the API operation +// that includes the filter. API operations that use MaintenanceWindowFilter> +// include the following: +// - DescribeMaintenanceWindowExecutions +// - DescribeMaintenanceWindowExecutionTaskInvocations +// - DescribeMaintenanceWindowExecutionTasks +// - DescribeMaintenanceWindows +// - DescribeMaintenanceWindowTargets +// - DescribeMaintenanceWindowTasks type MaintenanceWindowFilter struct { // The name of the filter. @@ -2503,20 +2910,22 @@ type MaintenanceWindowFilter struct { // The filter values. Values []string + + noSmithyDocumentSerde } // Information about the maintenance window. type MaintenanceWindowIdentity struct { - // The number of hours before the end of the maintenance window that Systems - // Manager stops scheduling new tasks for execution. + // The number of hours before the end of the maintenance window that Amazon Web + // Services Systems Manager stops scheduling new tasks for execution. Cutoff int32 // A description of the maintenance window. Description *string // The duration of the maintenance window in hours. - Duration int32 + Duration *int32 // Indicates whether the maintenance window is enabled. Enabled bool @@ -2535,9 +2944,9 @@ type MaintenanceWindowIdentity struct { // The schedule of the maintenance window in the form of a cron or rate expression. Schedule *string - // The number of days to wait to run a maintenance window after the scheduled CRON + // The number of days to wait to run a maintenance window after the scheduled cron // expression date and time. - ScheduleOffset int32 + ScheduleOffset *int32 // The time zone that the scheduled maintenance window executions are based on, in // Internet Assigned Numbers Authority (IANA) format. @@ -2549,6 +2958,8 @@ type MaintenanceWindowIdentity struct { // The ID of the maintenance window. WindowId *string + + noSmithyDocumentSerde } // The maintenance window to which the specified target belongs. @@ -2559,21 +2970,24 @@ type MaintenanceWindowIdentityForTarget struct { // The ID of the maintenance window. WindowId *string + + noSmithyDocumentSerde } // The parameters for a LAMBDA task type. For information about specifying and // updating task parameters, see RegisterTaskWithMaintenanceWindow and -// UpdateMaintenanceWindowTask. LoggingInfo has been deprecated. To specify an S3 -// bucket to contain logs, instead use the OutputS3BucketName and OutputS3KeyPrefix -// options in the TaskInvocationParameters structure. For information about how -// Systems Manager handles these options for the supported maintenance window task -// types, see MaintenanceWindowTaskInvocationParameters. TaskParameters has been -// deprecated. To specify parameters to pass to a task when it runs, instead use -// the Parameters option in the TaskInvocationParameters structure. For information -// about how Systems Manager handles these options for the supported maintenance -// window task types, see MaintenanceWindowTaskInvocationParameters. For Lambda -// tasks, Systems Manager ignores any values specified for TaskParameters and -// LoggingInfo. +// UpdateMaintenanceWindowTask . LoggingInfo has been deprecated. To specify an +// Amazon Simple Storage Service (Amazon S3) bucket to contain logs, instead use +// the OutputS3BucketName and OutputS3KeyPrefix options in the +// TaskInvocationParameters structure. For information about how Amazon Web +// Services Systems Manager handles these options for the supported maintenance +// window task types, see MaintenanceWindowTaskInvocationParameters . +// TaskParameters has been deprecated. To specify parameters to pass to a task when +// it runs, instead use the Parameters option in the TaskInvocationParameters +// structure. For information about how Systems Manager handles these options for +// the supported maintenance window task types, see +// MaintenanceWindowTaskInvocationParameters . For Lambda tasks, Systems Manager +// ignores any values specified for TaskParameters and LoggingInfo. type MaintenanceWindowLambdaParameters struct { // Pass client-specific information to the Lambda function that you are invoking. @@ -2584,29 +2998,34 @@ type MaintenanceWindowLambdaParameters struct { // JSON to provide to your Lambda function as input. Payload []byte - // (Optional) Specify a Lambda function version or alias name. If you specify a - // function version, the action uses the qualified function ARN to invoke a - // specific Lambda function. If you specify an alias name, the action uses the - // alias ARN to invoke the Lambda function version to which the alias points. + // (Optional) Specify an Lambda function version or alias name. If you specify a + // function version, the operation uses the qualified function Amazon Resource Name + // (ARN) to invoke a specific Lambda function. If you specify an alias name, the + // operation uses the alias ARN to invoke the Lambda function version to which the + // alias points. Qualifier *string + + noSmithyDocumentSerde } -// The parameters for a RUN_COMMAND task type. For information about specifying and -// updating task parameters, see RegisterTaskWithMaintenanceWindow and -// UpdateMaintenanceWindowTask. LoggingInfo has been deprecated. To specify an S3 -// bucket to contain logs, instead use the OutputS3BucketName and OutputS3KeyPrefix -// options in the TaskInvocationParameters structure. For information about how -// Systems Manager handles these options for the supported maintenance window task -// types, see MaintenanceWindowTaskInvocationParameters. TaskParameters has been -// deprecated. To specify parameters to pass to a task when it runs, instead use -// the Parameters option in the TaskInvocationParameters structure. For information -// about how Systems Manager handles these options for the supported maintenance -// window task types, see MaintenanceWindowTaskInvocationParameters. For Run -// Command tasks, Systems Manager uses specified values for TaskParameters and -// LoggingInfo only if no values are specified for TaskInvocationParameters. +// The parameters for a RUN_COMMAND task type. For information about specifying +// and updating task parameters, see RegisterTaskWithMaintenanceWindow and +// UpdateMaintenanceWindowTask . LoggingInfo has been deprecated. To specify an +// Amazon Simple Storage Service (Amazon S3) bucket to contain logs, instead use +// the OutputS3BucketName and OutputS3KeyPrefix options in the +// TaskInvocationParameters structure. For information about how Amazon Web +// Services Systems Manager handles these options for the supported maintenance +// window task types, see MaintenanceWindowTaskInvocationParameters . +// TaskParameters has been deprecated. To specify parameters to pass to a task when +// it runs, instead use the Parameters option in the TaskInvocationParameters +// structure. For information about how Systems Manager handles these options for +// the supported maintenance window task types, see +// MaintenanceWindowTaskInvocationParameters . For RUN_COMMAND tasks, Systems +// Manager uses specified values for TaskParameters and LoggingInfo only if no +// values are specified for TaskInvocationParameters . type MaintenanceWindowRunCommandParameters struct { - // Configuration options for sending command output to CloudWatch Logs. + // Configuration options for sending command output to Amazon CloudWatch Logs. CloudWatchOutputConfig *CloudWatchOutputConfig // Information about the commands to run. @@ -2619,19 +3038,22 @@ type MaintenanceWindowRunCommandParameters struct { // SHA-256 or SHA-1. SHA-1 hashes have been deprecated. DocumentHashType DocumentHashType - // The SSM document version to use in the request. You can specify $DEFAULT, - // $LATEST, or a specific version number. If you run commands by using the AWS CLI, - // then you must escape the first two options by using a backslash. If you specify - // a version number, then you don't need to use the backslash. For example: - // --document-version "\$DEFAULT" --document-version "\$LATEST" --document-version - // "3" + // The Amazon Web Services Systems Manager document (SSM document) version to use + // in the request. You can specify $DEFAULT , $LATEST , or a specific version + // number. If you run commands by using the Amazon Web Services CLI, then you must + // escape the first two options by using a backslash. If you specify a version + // number, then you don't need to use the backslash. For example: + // --document-version "\$DEFAULT" + // --document-version "\$LATEST" + // + // --document-version "3" DocumentVersion *string // Configurations for sending notifications about command status changes on a - // per-instance basis. + // per-managed node basis. NotificationConfig *NotificationConfig - // The name of the S3 bucket. + // The name of the Amazon Simple Storage Service (Amazon S3) bucket. OutputS3BucketName *string // The S3 bucket subfolder. @@ -2640,28 +3062,32 @@ type MaintenanceWindowRunCommandParameters struct { // The parameters for the RUN_COMMAND task execution. Parameters map[string][]string - // The ARN of the IAM service role to use to publish Amazon Simple Notification - // Service (Amazon SNS) notifications for maintenance window Run Command tasks. + // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) + // service role to use to publish Amazon Simple Notification Service (Amazon SNS) + // notifications for maintenance window Run Command tasks. ServiceRoleArn *string - // If this time is reached and the command has not already started running, it + // If this time is reached and the command hasn't already started running, it // doesn't run. - TimeoutSeconds int32 + TimeoutSeconds *int32 + + noSmithyDocumentSerde } // The parameters for a STEP_FUNCTIONS task. For information about specifying and // updating task parameters, see RegisterTaskWithMaintenanceWindow and -// UpdateMaintenanceWindowTask. LoggingInfo has been deprecated. To specify an S3 -// bucket to contain logs, instead use the OutputS3BucketName and OutputS3KeyPrefix -// options in the TaskInvocationParameters structure. For information about how -// Systems Manager handles these options for the supported maintenance window task -// types, see MaintenanceWindowTaskInvocationParameters. TaskParameters has been -// deprecated. To specify parameters to pass to a task when it runs, instead use -// the Parameters option in the TaskInvocationParameters structure. For information -// about how Systems Manager handles these options for the supported maintenance -// window task types, see MaintenanceWindowTaskInvocationParameters. For Step -// Functions tasks, Systems Manager ignores any values specified for TaskParameters -// and LoggingInfo. +// UpdateMaintenanceWindowTask . LoggingInfo has been deprecated. To specify an +// Amazon Simple Storage Service (Amazon S3) bucket to contain logs, instead use +// the OutputS3BucketName and OutputS3KeyPrefix options in the +// TaskInvocationParameters structure. For information about how Amazon Web +// Services Systems Manager handles these options for the supported maintenance +// window task types, see MaintenanceWindowTaskInvocationParameters . +// TaskParameters has been deprecated. To specify parameters to pass to a task when +// it runs, instead use the Parameters option in the TaskInvocationParameters +// structure. For information about how Systems Manager handles these options for +// the supported maintenance window task types, see +// MaintenanceWindowTaskInvocationParameters . For Step Functions tasks, Systems +// Manager ignores any values specified for TaskParameters and LoggingInfo . type MaintenanceWindowStepFunctionsParameters struct { // The inputs for the STEP_FUNCTIONS task. @@ -2669,6 +3095,8 @@ type MaintenanceWindowStepFunctionsParameters struct { // The name of the STEP_FUNCTIONS task. Name *string + + noSmithyDocumentSerde } // The target registered with the maintenance window. @@ -2680,16 +3108,17 @@ type MaintenanceWindowTarget struct { // The name for the maintenance window target. Name *string - // A user-provided value that will be included in any CloudWatch events that are - // raised while running tasks for these targets in this maintenance window. + // A user-provided value that will be included in any Amazon CloudWatch Events + // events that are raised while running tasks for these targets in this maintenance + // window. OwnerInformation *string // The type of target that is being registered with the maintenance window. ResourceType MaintenanceWindowResourceType - // The targets, either instances or tags. Specify instances using the following - // format: Key=instanceids,Values=, Tags are specified using the following format: - // Key=,Values=. + // The targets, either managed nodes or tags. Specify managed nodes using the + // following format: Key=instanceids,Values=, Tags are specified using the + // following format: Key=,Values= . Targets []Target // The ID of the maintenance window to register the target with. @@ -2697,26 +3126,47 @@ type MaintenanceWindowTarget struct { // The ID of the target. WindowTargetId *string + + noSmithyDocumentSerde } // Information about a task defined for a maintenance window. type MaintenanceWindowTask struct { + // The details for the CloudWatch alarm applied to your maintenance window task. + AlarmConfiguration *AlarmConfiguration + + // The specification for whether tasks should continue to run after the cutoff + // time specified in the maintenance windows is reached. + CutoffBehavior MaintenanceWindowTaskCutoffBehavior + // A description of the task. Description *string - // Information about an S3 bucket to write task-level logs to. LoggingInfo has been - // deprecated. To specify an S3 bucket to contain logs, instead use the - // OutputS3BucketName and OutputS3KeyPrefix options in the TaskInvocationParameters - // structure. For information about how Systems Manager handles these options for - // the supported maintenance window task types, see - // MaintenanceWindowTaskInvocationParameters. + // Information about an S3 bucket to write task-level logs to. LoggingInfo has + // been deprecated. To specify an Amazon Simple Storage Service (Amazon S3) bucket + // to contain logs, instead use the OutputS3BucketName and OutputS3KeyPrefix + // options in the TaskInvocationParameters structure. For information about how + // Amazon Web Services Systems Manager handles these options for the supported + // maintenance window task types, see MaintenanceWindowTaskInvocationParameters . LoggingInfo *LoggingInfo - // The maximum number of targets this task can be run for, in parallel. + // The maximum number of targets this task can be run for, in parallel. Although + // this element is listed as "Required: No", a value can be omitted only when you + // are registering or updating a targetless task (https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html) + // You must provide a value in all other cases. For maintenance window tasks + // without a target specified, you can't supply a value for this option. Instead, + // the system inserts a placeholder value of 1 . This value doesn't affect the + // running of your task. MaxConcurrency *string // The maximum number of errors allowed before this task stops being scheduled. + // Although this element is listed as "Required: No", a value can be omitted only + // when you are registering or updating a targetless task (https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html) + // You must provide a value in all other cases. For maintenance window tasks + // without a target specified, you can't supply a value for this option. Instead, + // the system inserts a placeholder value of 1 . This value doesn't affect the + // running of your task. MaxErrors *string // The task name. @@ -2727,29 +3177,30 @@ type MaintenanceWindowTask struct { // parallel. Priority int32 - // The ARN of the IAM service role to use to publish Amazon Simple Notification - // Service (Amazon SNS) notifications for maintenance window Run Command tasks. + // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) + // service role to use to publish Amazon Simple Notification Service (Amazon SNS) + // notifications for maintenance window Run Command tasks. ServiceRoleArn *string - // The targets (either instances or tags). Instances are specified using - // Key=instanceids,Values=,. Tags are specified using Key=,Values=. + // The targets (either managed nodes or tags). Managed nodes are specified using + // Key=instanceids,Values=, . Tags are specified using Key=,Values= . Targets []Target // The resource that the task uses during execution. For RUN_COMMAND and AUTOMATION - // task types, TaskArn is the Systems Manager document name or ARN. For LAMBDA - // tasks, it's the function name or ARN. For STEP_FUNCTIONS tasks, it's the state - // machine ARN. + // task types, TaskArn is the Amazon Web Services Systems Manager (SSM document) + // name or ARN. For LAMBDA tasks, it's the function name or ARN. For STEP_FUNCTIONS + // tasks, it's the state machine ARN. TaskArn *string // The parameters that should be passed to the task when it is run. TaskParameters // has been deprecated. To specify parameters to pass to a task when it runs, - // instead use the Parameters option in the TaskInvocationParameters structure. For - // information about how Systems Manager handles these options for the supported - // maintenance window task types, see MaintenanceWindowTaskInvocationParameters. + // instead use the Parameters option in the TaskInvocationParameters structure. + // For information about how Systems Manager handles these options for the + // supported maintenance window task types, see + // MaintenanceWindowTaskInvocationParameters . TaskParameters map[string]MaintenanceWindowTaskParameterValueExpression - // The type of task. The type can be one of the following: RUN_COMMAND, AUTOMATION, - // LAMBDA, or STEP_FUNCTIONS. + // The type of task. Type MaintenanceWindowTaskType // The ID of the maintenance window where the task is registered. @@ -2757,6 +3208,8 @@ type MaintenanceWindowTask struct { // The task ID. WindowTaskId *string + + noSmithyDocumentSerde } // The parameters for task execution. @@ -2773,6 +3226,8 @@ type MaintenanceWindowTaskInvocationParameters struct { // The parameters for a STEP_FUNCTIONS task type. StepFunctions *MaintenanceWindowStepFunctionsParameters + + noSmithyDocumentSerde } // Defines the values for a task parameter. @@ -2781,6 +3236,8 @@ type MaintenanceWindowTaskParameterValueExpression struct { // This field contains an array of 0 or more strings, each 1 to 255 characters in // length. Values []string + + noSmithyDocumentSerde } // Metadata to assign to an Application Manager application. @@ -2788,17 +3245,21 @@ type MetadataValue struct { // Metadata value to assign to an Application Manager application. Value *string + + noSmithyDocumentSerde } -// A summary of resources that are not compliant. The summary is organized +// A summary of resources that aren't compliant. The summary is organized // according to resource type. type NonCompliantSummary struct { - // The total number of compliance items that are not compliant. + // The total number of compliance items that aren't compliant. NonCompliantCount int32 // A summary of the non-compliance severity by compliance type SeveritySummary *SeveritySummary + + noSmithyDocumentSerde } // Configurations for sending notifications. @@ -2809,42 +3270,45 @@ type NotificationConfig struct { // this topic. NotificationArn *string - // The different events for which you can receive notifications. These events - // include the following: All (events), InProgress, Success, TimedOut, Cancelled, - // Failed. To learn more about these events, see Monitoring Systems Manager status - // changes using Amazon SNS notifications - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/monitoring-sns-notifications.html) - // in the AWS Systems Manager User Guide. + // The different events for which you can receive notifications. To learn more + // about these events, see Monitoring Systems Manager status changes using Amazon + // SNS notifications (https://docs.aws.amazon.com/systems-manager/latest/userguide/monitoring-sns-notifications.html) + // in the Amazon Web Services Systems Manager User Guide. NotificationEvents []NotificationEvent - // Command: Receive notification when the status of a command changes. Invocation: - // For commands sent to multiple instances, receive notification on a per-instance - // basis when the status of a command changes. + // The type of notification. + // - Command : Receive notification when the status of a command changes. + // - Invocation : For commands sent to multiple managed nodes, receive + // notification on a per-node basis when the status of a command changes. NotificationType NotificationType + + noSmithyDocumentSerde } -// One or more aggregators for viewing counts of OpsItems using different -// dimensions such as Source, CreatedTime, or Source and CreatedTime, to name a +// One or more aggregators for viewing counts of OpsData using different +// dimensions such as Source , CreatedTime , or Source and CreatedTime , to name a // few. type OpsAggregator struct { - // Either a Range or Count aggregator for limiting an OpsItem summary. + // Either a Range or Count aggregator for limiting an OpsData summary. AggregatorType *string - // A nested aggregator for viewing counts of OpsItems. + // A nested aggregator for viewing counts of OpsData. Aggregators []OpsAggregator - // The name of an OpsItem attribute on which to limit the count of OpsItems. + // The name of an OpsData attribute on which to limit the count of OpsData. AttributeName *string // The aggregator filters. Filters []OpsFilter - // The data type name to use for viewing counts of OpsItems. + // The data type name to use for viewing counts of OpsData. TypeName *string // The aggregator value. Values map[string]string + + noSmithyDocumentSerde } // The result of the query. @@ -2855,19 +3319,23 @@ type OpsEntity struct { // The query ID. Id *string + + noSmithyDocumentSerde } -// The OpsItem summaries result item. +// The OpsData summary. type OpsEntityItem struct { - // The time OpsItem data was captured. + // The time the OpsData was captured. CaptureTime *string - // The detailed data content for an OpsItem summaries result item. + // The details of an OpsData summary. Content []map[string]string + + noSmithyDocumentSerde } -// A filter for viewing OpsItem summaries. +// A filter for viewing OpsData summaries. type OpsFilter struct { // The name of the filter. @@ -2882,28 +3350,42 @@ type OpsFilter struct { // The type of filter. Type OpsFilterOperatorType -} -// Operations engineers and IT professionals use OpsCenter to view, investigate, -// and remediate operational issues impacting the performance and health of their -// AWS resources. For more information, see AWS Systems Manager OpsCenter -// (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter.html) in -// the AWS Systems Manager User Guide. + noSmithyDocumentSerde +} + +// Operations engineers and IT professionals use Amazon Web Services Systems +// Manager OpsCenter to view, investigate, and remediate operational work items +// (OpsItems) impacting the performance and health of their Amazon Web Services +// resources. OpsCenter is integrated with Amazon EventBridge and Amazon +// CloudWatch. This means you can configure these services to automatically create +// an OpsItem in OpsCenter when a CloudWatch alarm enters the ALARM state or when +// EventBridge processes an event from any Amazon Web Services service that +// publishes events. Configuring Amazon CloudWatch alarms and EventBridge events to +// automatically create OpsItems allows you to quickly diagnose and remediate +// issues with Amazon Web Services resources from a single console. To help you +// diagnose issues, each OpsItem includes contextually relevant information such as +// the name and ID of the Amazon Web Services resource that generated the OpsItem, +// alarm or event details, alarm history, and an alarm timeline graph. For the +// Amazon Web Services resource, OpsCenter aggregates information from Config, +// CloudTrail logs, and EventBridge, so you don't have to navigate across multiple +// console pages during your investigation. For more information, see OpsCenter (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter.html) +// in the Amazon Web Services Systems Manager User Guide. type OpsItem struct { // The time a runbook workflow ended. Currently reported only for the OpsItem type - // /aws/changerequest. + // /aws/changerequest . ActualEndTime *time.Time // The time a runbook workflow started. Currently reported only for the OpsItem - // type /aws/changerequest. + // type /aws/changerequest . ActualStartTime *time.Time // An OpsItem category. Category options include: Availability, Cost, Performance, // Recovery, Security. Category *string - // The ARN of the AWS account that created the OpsItem. + // The ARN of the Amazon Web Services account that created the OpsItem. CreatedBy *string // The date and time the OpsItem was created. @@ -2912,48 +3394,56 @@ type OpsItem struct { // The OpsItem description. Description *string - // The ARN of the AWS account that last updated the OpsItem. + // The ARN of the Amazon Web Services account that last updated the OpsItem. LastModifiedBy *string // The date and time the OpsItem was last updated. LastModifiedTime *time.Time - // The Amazon Resource Name (ARN) of an SNS topic where notifications are sent when - // this OpsItem is edited or changed. + // The Amazon Resource Name (ARN) of an Amazon Simple Notification Service (Amazon + // SNS) topic where notifications are sent when this OpsItem is edited or changed. Notifications []OpsItemNotification - // Operational data is custom data that provides useful reference details about the - // OpsItem. For example, you can specify log files, error strings, license keys, - // troubleshooting tips, or other relevant data. You enter operational data as - // key-value pairs. The key has a maximum length of 128 characters. The value has a - // maximum size of 20 KB. Operational data keys can't begin with the following: - // amazon, aws, amzn, ssm, /amazon, /aws, /amzn, /ssm. You can choose to make the - // data searchable by other users in the account or you can restrict search access. - // Searchable data means that all users with access to the OpsItem Overview page - // (as provided by the DescribeOpsItems API action) can view and search on the - // specified data. Operational data that is not searchable is only viewable by - // users who have access to the OpsItem (as provided by the GetOpsItem API action). - // Use the /aws/resources key in OperationalData to specify a related resource in - // the request. Use the /aws/automations key in OperationalData to associate an - // Automation runbook with the OpsItem. To view AWS CLI example commands that use - // these keys, see Creating OpsItems manually - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-creating-OpsItems.html#OpsCenter-manually-create-OpsItems) - // in the AWS Systems Manager User Guide. + // Operational data is custom data that provides useful reference details about + // the OpsItem. For example, you can specify log files, error strings, license + // keys, troubleshooting tips, or other relevant data. You enter operational data + // as key-value pairs. The key has a maximum length of 128 characters. The value + // has a maximum size of 20 KB. Operational data keys can't begin with the + // following: amazon , aws , amzn , ssm , /amazon , /aws , /amzn , /ssm . You can + // choose to make the data searchable by other users in the account or you can + // restrict search access. Searchable data means that all users with access to the + // OpsItem Overview page (as provided by the DescribeOpsItems API operation) can + // view and search on the specified data. Operational data that isn't searchable is + // only viewable by users who have access to the OpsItem (as provided by the + // GetOpsItem API operation). Use the /aws/resources key in OperationalData to + // specify a related resource in the request. Use the /aws/automations key in + // OperationalData to associate an Automation runbook with the OpsItem. To view + // Amazon Web Services CLI example commands that use these keys, see Creating + // OpsItems manually (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-manually-create-OpsItems.html) + // in the Amazon Web Services Systems Manager User Guide. OperationalData map[string]OpsItemDataValue + // The OpsItem Amazon Resource Name (ARN). + OpsItemArn *string + // The ID of the OpsItem. OpsItemId *string - // The type of OpsItem. Currently, the only valid values are /aws/changerequest and - // /aws/issue. + // The type of OpsItem. Systems Manager supports the following types of OpsItems: + // - /aws/issue This type of OpsItem is used for default OpsItems created by + // OpsCenter. + // - /aws/changerequest This type of OpsItem is used by Change Manager for + // reviewing and approving or rejecting change requests. + // - /aws/insight This type of OpsItem is used by OpsCenter for aggregating and + // reporting on duplicate OpsItems. OpsItemType *string // The time specified in a change request for a runbook workflow to end. Currently - // supported only for the OpsItem type /aws/changerequest. + // supported only for the OpsItem type /aws/changerequest . PlannedEndTime *time.Time // The time specified in a change request for a runbook workflow to start. - // Currently supported only for the OpsItem type /aws/changerequest. + // Currently supported only for the OpsItem type /aws/changerequest . PlannedStartTime *time.Time // The importance of this OpsItem in relation to other OpsItems in the system. @@ -2971,10 +3461,9 @@ type OpsItem struct { // resource is a subset of source. Source *string - // The OpsItem status. Status can be Open, In Progress, or Resolved. For more - // information, see Editing OpsItem details - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-working-with-OpsItems-editing-details.html) - // in the AWS Systems Manager User Guide. + // The OpsItem status. Status can be Open , In Progress , or Resolved . For more + // information, see Editing OpsItem details (https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-working-with-OpsItems-editing-details.html) + // in the Amazon Web Services Systems Manager User Guide. Status OpsItemStatus // A short heading that describes the nature of the OpsItem and the impacted @@ -2984,30 +3473,34 @@ type OpsItem struct { // The version of this OpsItem. Each time the OpsItem is edited the version number // increments by one. Version *string + + noSmithyDocumentSerde } // An object that defines the value of the key and its type in the OperationalData // map. type OpsItemDataValue struct { - // The type of key-value pair. Valid types include SearchableString and String. + // The type of key-value pair. Valid types include SearchableString and String . Type OpsItemDataType // The value of the OperationalData key. Value *string + + noSmithyDocumentSerde } // Describes a filter for a specific list of OpsItem events. You can filter event // information by using tags. You specify tags by using a key-value pair mapping. type OpsItemEventFilter struct { - // The name of the filter key. Currently, the only supported value is OpsItemId. + // The name of the filter key. Currently, the only supported value is OpsItemId . // // This member is required. Key OpsItemEventFilterKey // The operator used by the filter call. Currently, the only supported value is - // Equal. + // Equal . // // This member is required. Operator OpsItemEventFilterOperator @@ -3016,9 +3509,12 @@ type OpsItemEventFilter struct { // // This member is required. Values []string + + noSmithyDocumentSerde } -// Summary information about an OpsItem event. +// Summary information about an OpsItem event or that associated an OpsItem with a +// related item. type OpsItemEventSummary struct { // Information about the user or resource that created the OpsItem event. @@ -3041,6 +3537,8 @@ type OpsItemEventSummary struct { // The source of the OpsItem event. Source *string + + noSmithyDocumentSerde } // Describes an OpsItem filter. @@ -3060,6 +3558,8 @@ type OpsItemFilter struct { // // This member is required. Values []string + + noSmithyDocumentSerde } // Information about the user or resource that created an OpsItem event. @@ -3067,25 +3567,84 @@ type OpsItemIdentity struct { // The Amazon Resource Name (ARN) of the IAM entity that created the OpsItem event. Arn *string + + noSmithyDocumentSerde } // A notification about the OpsItem. type OpsItemNotification struct { - // The Amazon Resource Name (ARN) of an SNS topic where notifications are sent when - // this OpsItem is edited or changed. + // The Amazon Resource Name (ARN) of an Amazon Simple Notification Service (Amazon + // SNS) topic where notifications are sent when this OpsItem is edited or changed. Arn *string + + noSmithyDocumentSerde +} + +// Describes a filter for a specific list of related-item resources. +type OpsItemRelatedItemsFilter struct { + + // The name of the filter key. Supported values include ResourceUri , ResourceType + // , or AssociationId . + // + // This member is required. + Key OpsItemRelatedItemsFilterKey + + // The operator used by the filter call. The only supported operator is EQUAL . + // + // This member is required. + Operator OpsItemRelatedItemsFilterOperator + + // The values for the filter. + // + // This member is required. + Values []string + + noSmithyDocumentSerde +} + +// Summary information about related-item resources for an OpsItem. +type OpsItemRelatedItemSummary struct { + + // The association ID. + AssociationId *string + + // The association type. + AssociationType *string + + // Information about the user or resource that created an OpsItem event. + CreatedBy *OpsItemIdentity + + // The time the related-item association was created. + CreatedTime *time.Time + + // Information about the user or resource that created an OpsItem event. + LastModifiedBy *OpsItemIdentity + + // The time the related-item association was last updated. + LastModifiedTime *time.Time + + // The OpsItem ID. + OpsItemId *string + + // The resource type. + ResourceType *string + + // The Amazon Resource Name (ARN) of the related-item resource. + ResourceUri *string + + noSmithyDocumentSerde } // A count of OpsItems. type OpsItemSummary struct { // The time a runbook workflow ended. Currently reported only for the OpsItem type - // /aws/changerequest. + // /aws/changerequest . ActualEndTime *time.Time // The time a runbook workflow started. Currently reported only for the OpsItem - // type /aws/changerequest. + // type /aws/changerequest . ActualStartTime *time.Time // A list of OpsItems by category. @@ -3103,23 +3662,28 @@ type OpsItemSummary struct { // The date and time the OpsItem was last updated. LastModifiedTime *time.Time - // Operational data is custom data that provides useful reference details about the - // OpsItem. + // Operational data is custom data that provides useful reference details about + // the OpsItem. OperationalData map[string]OpsItemDataValue // The ID of the OpsItem. OpsItemId *string - // The type of OpsItem. Currently, the only valid values are /aws/changerequest and - // /aws/issue. + // The type of OpsItem. Systems Manager supports the following types of OpsItems: + // - /aws/issue This type of OpsItem is used for default OpsItems created by + // OpsCenter. + // - /aws/changerequest This type of OpsItem is used by Change Manager for + // reviewing and approving or rejecting change requests. + // - /aws/insight This type of OpsItem is used by OpsCenter for aggregating and + // reporting on duplicate OpsItems. OpsItemType *string // The time specified in a change request for a runbook workflow to end. Currently - // supported only for the OpsItem type /aws/changerequest. + // supported only for the OpsItem type /aws/changerequest . PlannedEndTime *time.Time // The time specified in a change request for a runbook workflow to start. - // Currently supported only for the OpsItem type /aws/changerequest. + // Currently supported only for the OpsItem type /aws/changerequest . PlannedStartTime *time.Time // The importance of this OpsItem in relation to other OpsItems in the system. @@ -3128,15 +3692,17 @@ type OpsItemSummary struct { // A list of OpsItems by severity. Severity *string - // The impacted AWS resource. + // The impacted Amazon Web Services resource. Source *string - // The OpsItem status. Status can be Open, In Progress, or Resolved. + // The OpsItem status. Status can be Open , In Progress , or Resolved . Status OpsItemStatus // A short heading that describes the nature of the OpsItem and the impacted // resource. Title *string + + noSmithyDocumentSerde } // Operational metadata for an application in Application Manager. @@ -3156,6 +3722,8 @@ type OpsMetadata struct { // The ID of the Application Manager application. ResourceId *string + + noSmithyDocumentSerde } // A filter to limit the number of OpsMetadata objects displayed. @@ -3170,16 +3738,20 @@ type OpsMetadataFilter struct { // // This member is required. Values []string + + noSmithyDocumentSerde } // The OpsItem data type to return. type OpsResultAttribute struct { - // Name of the data type. Valid value: AWS:OpsItem, AWS:EC2InstanceInformation, - // AWS:OpsItemTrendline, or AWS:ComplianceSummary. + // Name of the data type. Valid value: AWS:OpsItem , AWS:EC2InstanceInformation , + // AWS:OpsItemTrendline , or AWS:ComplianceSummary . // // This member is required. TypeName *string + + noSmithyDocumentSerde } // Information about the source where the association execution details are stored. @@ -3191,16 +3763,18 @@ type OutputSource struct { // The type of source where the association execution details are stored, for // example, Amazon S3. OutputSourceType *string + + noSmithyDocumentSerde } -// An Systems Manager parameter in Parameter Store. +// An Amazon Web Services Systems Manager parameter in Parameter Store. type Parameter struct { // The Amazon Resource Name (ARN) of the parameter. ARN *string - // The data type of the parameter, such as text or aws:ec2:image. The default is - // text. + // The data type of the parameter, such as text or aws:ec2:image . The default is + // text . DataType *string // Date the parameter was last changed or updated and the parameter version was @@ -3215,19 +3789,23 @@ type Parameter struct { // parameter_name:label Selector *string - // Applies to parameters that reference information in other AWS services. - // SourceResult is the raw result or response from the source. + // Applies to parameters that reference information in other Amazon Web Services + // services. SourceResult is the raw result or response from the source. SourceResult *string - // The type of parameter. Valid values include the following: String, StringList, - // and SecureString. + // The type of parameter. Valid values include the following: String , StringList , + // and SecureString . If type is StringList , the system returns a comma-separated + // string with no spaces between commas in the Value field. Type ParameterType - // The parameter value. + // The parameter value. If type is StringList , the system returns a + // comma-separated string with no spaces between commas in the Value field. Value *string // The parameter version. Version int64 + + noSmithyDocumentSerde } // Information about parameter usage. @@ -3236,8 +3814,8 @@ type ParameterHistory struct { // Parameter names can include the following letters and symbols. a-zA-Z0-9_.- AllowedPattern *string - // The data type of the parameter, such as text or aws:ec2:image. The default is - // text. + // The data type of the parameter, such as text or aws:ec2:image . The default is + // text . DataType *string // Information about the parameter. @@ -3252,16 +3830,16 @@ type ParameterHistory struct { // Date the parameter was last changed or updated. LastModifiedDate *time.Time - // Amazon Resource Name (ARN) of the AWS user who last changed the parameter. + // Amazon Resource Name (ARN) of the Amazon Web Services user who last changed the + // parameter. LastModifiedUser *string // The name of the parameter. Name *string // Information about the policies assigned to a parameter. Assigning parameter - // policies - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-policies.html) - // in the AWS Systems Manager User Guide. + // policies (https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-policies.html) + // in the Amazon Web Services Systems Manager User Guide. Policies []ParameterInlinePolicy // The parameter tier. @@ -3275,23 +3853,28 @@ type ParameterHistory struct { // The parameter version. Version int64 + + noSmithyDocumentSerde } // One or more policies assigned to a parameter. type ParameterInlinePolicy struct { // The status of the policy. Policies report the following statuses: Pending (the - // policy has not been enforced or applied yet), Finished (the policy was applied), - // Failed (the policy was not applied), or InProgress (the policy is being applied + // policy hasn't been enforced or applied yet), Finished (the policy was applied), + // Failed (the policy wasn't applied), or InProgress (the policy is being applied // now). PolicyStatus *string // The JSON text of the policy. PolicyText *string - // The type of policy. Parameter Store supports the following policy types: - // Expiration, ExpirationNotification, and NoChangeNotification. + // The type of policy. Parameter Store, a capability of Amazon Web Services + // Systems Manager, supports the following policy types: Expiration, + // ExpirationNotification, and NoChangeNotification. PolicyType *string + + noSmithyDocumentSerde } // Metadata includes information like the ARN of the last user and the date/time @@ -3302,8 +3885,8 @@ type ParameterMetadata struct { // a-zA-Z0-9_.- AllowedPattern *string - // The data type of the parameter, such as text or aws:ec2:image. The default is - // text. + // The data type of the parameter, such as text or aws:ec2:image . The default is + // text . DataType *string // Description of the parameter actions. @@ -3315,7 +3898,8 @@ type ParameterMetadata struct { // Date the parameter was last changed or updated. LastModifiedDate *time.Time - // Amazon Resource Name (ARN) of the AWS user who last changed the parameter. + // Amazon Resource Name (ARN) of the Amazon Web Services user who last changed the + // parameter. LastModifiedUser *string // The parameter name. @@ -3327,15 +3911,17 @@ type ParameterMetadata struct { // The parameter tier. Tier ParameterTier - // The type of parameter. Valid parameter types include the following: String, - // StringList, and SecureString. + // The type of parameter. Valid parameter types include the following: String , + // StringList , and SecureString . Type ParameterType // The parameter version. Version int64 + + noSmithyDocumentSerde } -// This data type is deprecated. Instead, use ParameterStringFilter. +// This data type is deprecated. Instead, use ParameterStringFilter . type ParametersFilter struct { // The name of the filter. @@ -3347,59 +3933,83 @@ type ParametersFilter struct { // // This member is required. Values []string + + noSmithyDocumentSerde } // One or more filters. Use a filter to return a more specific list of results. type ParameterStringFilter struct { // The name of the filter. The ParameterStringFilter object is used by the - // DescribeParameters and GetParametersByPath API actions. However, not all of the - // pattern values listed for Key can be used with both actions. For - // DescribeActions, all of the listed patterns are valid, with the exception of - // Label. For GetParametersByPath, the following patterns listed for Key are not - // valid: tag, Name, Path, and Tier. For examples of CLI commands demonstrating - // valid parameter filter constructions, see Searching for Systems Manager - // parameters - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-search.html) - // in the AWS Systems Manager User Guide. + // DescribeParameters and GetParametersByPath API operations. However, not all of + // the pattern values listed for Key can be used with both operations. For + // DescribeParameters , all of the listed patterns are valid except Label . For + // GetParametersByPath , the following patterns listed for Key aren't valid: tag , + // DataType , Name , Path , and Tier . For examples of Amazon Web Services CLI + // commands demonstrating valid parameter filter constructions, see Searching for + // Systems Manager parameters (https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-search.html) + // in the Amazon Web Services Systems Manager User Guide. // // This member is required. Key *string - // For all filters used with DescribeParameters, valid options include Equals and - // BeginsWith. The Name filter additionally supports the Contains option. - // (Exception: For filters using the key Path, valid options include Recursive and - // OneLevel.) For filters used with GetParametersByPath, valid options include - // Equals and BeginsWith. (Exception: For filters using Label as the Key name, the - // only valid option is Equals.) + // For all filters used with DescribeParameters , valid options include Equals and + // BeginsWith . The Name filter additionally supports the Contains option. + // (Exception: For filters using the key Path , valid options include Recursive + // and OneLevel .) For filters used with GetParametersByPath , valid options + // include Equals and BeginsWith . (Exception: For filters using Label as the Key + // name, the only valid option is Equals .) Option *string // The value you want to search for. Values []string + + noSmithyDocumentSerde +} + +// A detailed status of the parent step. +type ParentStepDetails struct { + + // The name of the automation action. + Action *string + + // The current repetition of the loop represented by an integer. + Iteration *int32 + + // The current value of the specified iterator in the loop. + IteratorValue *string + + // The unique ID of a step execution. + StepExecutionId *string + + // The name of the step. + StepName *string + + noSmithyDocumentSerde } // Represents metadata about a patch. type Patch struct { - // The Advisory ID of the patch. For example, RHSA-2020:3779. Applies to - // Linux-based instances only. + // The Advisory ID of the patch. For example, RHSA-2020:3779 . Applies to + // Linux-based managed nodes only. AdvisoryIds []string // The architecture of the patch. For example, in - // example-pkg-0.710.10-2.7.abcd.x86_64, the architecture is indicated by x86_64. - // Applies to Linux-based instances only. + // example-pkg-0.710.10-2.7.abcd.x86_64 , the architecture is indicated by x86_64 . + // Applies to Linux-based managed nodes only. Arch *string - // The Bugzilla ID of the patch. For example, 1600646. Applies to Linux-based - // instances only. + // The Bugzilla ID of the patch. For example, 1600646 . Applies to Linux-based + // managed nodes only. BugzillaIds []string // The Common Vulnerabilities and Exposures (CVE) ID of the patch. For example, - // CVE-2011-3192. Applies to Linux-based instances only. + // CVE-2011-3192 . Applies to Linux-based managed nodes only. CVEIds []string - // The classification of the patch. For example, SecurityUpdates, Updates, or - // CriticalUpdates. + // The classification of the patch. For example, SecurityUpdates , Updates , or + // CriticalUpdates . Classification *string // The URL where more information can be obtained about the patch. @@ -3408,11 +4018,11 @@ type Patch struct { // The description of the patch. Description *string - // The epoch of the patch. For example in pkg-example-EE-20180914-2.2.amzn1.noarch, - // the epoch value is 20180914-2. Applies to Linux-based instances only. + // The epoch of the patch. For example in pkg-example-EE-20180914-2.2.amzn1.noarch + // , the epoch value is 20180914-2 . Applies to Linux-based managed nodes only. Epoch int32 - // The ID of the patch. Applies to Windows patches only. This ID is not the same as + // The ID of the patch. Applies to Windows patches only. This ID isn't the same as // the Microsoft Knowledge Base ID. Id *string @@ -3423,38 +4033,38 @@ type Patch struct { Language *string // The ID of the Microsoft Security Response Center (MSRC) bulletin the patch is - // related to. For example, MS14-045. Applies to Windows patches only. + // related to. For example, MS14-045 . Applies to Windows patches only. MsrcNumber *string - // The severity of the patch, such as Critical, Important, or Moderate. Applies to - // Windows patches only. + // The severity of the patch, such as Critical , Important , or Moderate . Applies + // to Windows patches only. MsrcSeverity *string - // The name of the patch. Applies to Linux-based instances only. + // The name of the patch. Applies to Linux-based managed nodes only. Name *string // The specific product the patch is applicable for. For example, WindowsServer2016 - // or AmazonLinux2018.03. + // or AmazonLinux2018.03 . Product *string // The product family the patch is applicable for. For example, Windows or Amazon - // Linux 2. + // Linux 2 . ProductFamily *string // The particular release of a patch. For example, in - // pkg-example-EE-20180914-2.2.amzn1.noarch, the release is 2.amaz1. Applies to - // Linux-based instances only. + // pkg-example-EE-20180914-2.2.amzn1.noarch , the release is 2.amaz1 . Applies to + // Linux-based managed nodes only. Release *string // The date the patch was released. ReleaseDate *time.Time // The source patch repository for the operating system and version, such as - // trusty-security for Ubuntu Server 14.04 LTE and focal-security for Ubuntu Server - // 20.04 LTE. Applies to Linux-based instances only. + // trusty-security for Ubuntu Server 14.04 LTE and focal-security for Ubuntu + // Server 20.04 LTE. Applies to Linux-based managed nodes only. Repository *string - // The severity level of the patch. For example, CRITICAL or MODERATE. + // The severity level of the patch. For example, CRITICAL or MODERATE . Severity *string // The title of the patch. @@ -3464,9 +4074,11 @@ type Patch struct { Vendor *string // The version number of the patch. For example, in - // example-pkg-1.710.10-2.7.abcd.x86_64, the version number is indicated by -1. - // Applies to Linux-based instances only. + // example-pkg-1.710.10-2.7.abcd.x86_64 , the version number is indicated by -1 . + // Applies to Linux-based managed nodes only. Version *string + + noSmithyDocumentSerde } // Defines the basic information about a patch baseline. @@ -3481,28 +4093,30 @@ type PatchBaselineIdentity struct { // The name of the patch baseline. BaselineName *string - // Whether this is the default baseline. Note that Systems Manager supports - // creating multiple default patch baselines. For example, you can create a default - // patch baseline for each operating system. + // Whether this is the default baseline. Amazon Web Services Systems Manager + // supports creating multiple default patch baselines. For example, you can create + // a default patch baseline for each operating system. DefaultBaseline bool - // Defines the operating system the patch baseline applies to. The Default value is - // WINDOWS. + // Defines the operating system the patch baseline applies to. The default value + // is WINDOWS . OperatingSystem OperatingSystem + + noSmithyDocumentSerde } -// Information about the state of a patch on a particular instance as it relates to -// the patch baseline used to patch the instance. +// Information about the state of a patch on a particular managed node as it +// relates to the patch baseline used to patch the node. type PatchComplianceData struct { - // The classification of the patch (for example, SecurityUpdates, Updates, - // CriticalUpdates). + // The classification of the patch, such as SecurityUpdates , Updates , and + // CriticalUpdates . // // This member is required. Classification *string - // The date/time the patch was installed on the instance. Note that not all - // operating systems provide this level of information. + // The date/time the patch was installed on the managed node. Not all operating + // systems provide this level of information. // // This member is required. InstalledTime *time.Time @@ -3512,15 +4126,14 @@ type PatchComplianceData struct { // This member is required. KBId *string - // The severity of the patch (for example, Critical, Important, Moderate). + // The severity of the patch such as Critical , Important , and Moderate . // // This member is required. Severity *string - // The state of the patch on the instance, such as INSTALLED or FAILED. For - // descriptions of each patch state, see About patch compliance - // (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-compliance-about.html#sysman-compliance-monitor-patch) - // in the AWS Systems Manager User Guide. + // The state of the patch on the managed node, such as INSTALLED or FAILED. For + // descriptions of each patch state, see About patch compliance (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-compliance-about.html#sysman-compliance-monitor-patch) + // in the Amazon Web Services Systems Manager User Guide. // // This member is required. State PatchComplianceDataState @@ -3530,27 +4143,29 @@ type PatchComplianceData struct { // This member is required. Title *string - // The IDs of one or more Common Vulnerabilities and Exposure (CVE) issues that are - // resolved by the patch. + // The IDs of one or more Common Vulnerabilities and Exposure (CVE) issues that + // are resolved by the patch. CVEIds *string + + noSmithyDocumentSerde } // Defines which patches should be included in a patch baseline. A patch filter // consists of a key and a set of values. The filter key is a patch property. For -// example, the available filter keys for WINDOWS are PATCH_SET, PRODUCT, -// PRODUCT_FAMILY, CLASSIFICATION, and MSRC_SEVERITY. The filter values define a +// example, the available filter keys for WINDOWS are PATCH_SET , PRODUCT , +// PRODUCT_FAMILY , CLASSIFICATION , and MSRC_SEVERITY . The filter values define a // matching criterion for the patch property indicated by the key. For example, if // the filter key is PRODUCT and the filter values are ["Office 2013", "Office -// 2016"], then the filter accepts all patches where product name is either "Office -// 2013" or "Office 2016". The filter values can be exact values for the patch -// property given as a key, or a wildcard (*), which matches all values. You can -// view lists of valid values for the patch properties by running the +// 2016"] , then the filter accepts all patches where product name is either +// "Office 2013" or "Office 2016". The filter values can be exact values for the +// patch property given as a key, or a wildcard (*), which matches all values. You +// can view lists of valid values for the patch properties by running the // DescribePatchProperties command. For information about which patch properties -// can be used with each major operating system, see DescribePatchProperties. +// can be used with each major operating system, see DescribePatchProperties . type PatchFilter struct { - // The key for the filter. Run the DescribePatchProperties command to view lists of - // valid keys for each operating system type. + // The key for the filter. Run the DescribePatchProperties command to view lists + // of valid keys for each operating system type. // // This member is required. Key PatchFilterKey @@ -3560,6 +4175,8 @@ type PatchFilter struct { // // This member is required. Values []string + + noSmithyDocumentSerde } // A set of patch filters, typically used for approval rules. @@ -3569,6 +4186,8 @@ type PatchFilterGroup struct { // // This member is required. PatchFilters []PatchFilter + + noSmithyDocumentSerde } // The mapping between a patch group and the patch baseline the patch group is @@ -3580,9 +4199,17 @@ type PatchGroupPatchBaselineMapping struct { // The name of the patch group registered with the patch baseline. PatchGroup *string + + noSmithyDocumentSerde } -// Defines a filter used in Patch Manager APIs. +// Defines a filter used in Patch Manager APIs. Supported filter keys depend on +// the API operation that includes the filter. Patch Manager API operations that +// use PatchOrchestratorFilter include the following: +// - DescribeAvailablePatches +// - DescribeInstancePatches +// - DescribePatchBaselines +// - DescribePatchGroups type PatchOrchestratorFilter struct { // The key for the filter. @@ -3590,6 +4217,8 @@ type PatchOrchestratorFilter struct { // The value for the filter. Values []string + + noSmithyDocumentSerde } // Defines an approval rule for a patch baseline. @@ -3600,24 +4229,27 @@ type PatchRule struct { // This member is required. PatchFilterGroup *PatchFilterGroup - // The number of days after the release date of each patch matched by the rule that - // the patch is marked as approved in the patch baseline. For example, a value of 7 - // means that patches are approved seven days after they are released. Not - // supported on Ubuntu Server. - ApproveAfterDays int32 + // The number of days after the release date of each patch matched by the rule + // that the patch is marked as approved in the patch baseline. For example, a value + // of 7 means that patches are approved seven days after they are released. Not + // supported on Debian Server or Ubuntu Server. + ApproveAfterDays *int32 // The cutoff date for auto approval of released patches. Any patches released on - // or before this date are installed automatically. Not supported on Ubuntu Server. - // Enter dates in the format YYYY-MM-DD. For example, 2020-12-31. + // or before this date are installed automatically. Not supported on Debian Server + // or Ubuntu Server. Enter dates in the format YYYY-MM-DD . For example, 2021-12-31 + // . ApproveUntilDate *string // A compliance severity level for all approved patches in a patch baseline. ComplianceLevel PatchComplianceLevel - // For instances identified by the approval rule filters, enables a patch baseline - // to apply non-security updates available in the specified repository. The default - // value is 'false'. Applies to Linux instances only. - EnableNonSecurity bool + // For managed nodes identified by the approval rule filters, enables a patch + // baseline to apply non-security updates available in the specified repository. + // The default value is false . Applies to Linux managed nodes only. + EnableNonSecurity *bool + + noSmithyDocumentSerde } // A set of rules defining the approval rules for a patch baseline. @@ -3627,20 +4259,22 @@ type PatchRuleGroup struct { // // This member is required. PatchRules []PatchRule + + noSmithyDocumentSerde } -// Information about the patches to use to update the instances, including target -// operating systems and source repository. Applies to Linux instances only. +// Information about the patches to use to update the managed nodes, including +// target operating systems and source repository. Applies to Linux managed nodes +// only. type PatchSource struct { // The value of the yum repo configuration. For example: [main] + // name=MyCustomRepository // - // cachedir=/var/cache/yum/$basesearch$releasever - // - // keepcache=0 - // - // - // debuglevel=2 + // baseurl=https://my-custom-repository + // enabled=1 For information about other options available for your yum repository + // configuration, see dnf.conf(5) (https://man7.org/linux/man-pages/man5/dnf.conf.5.html) + // . // // This member is required. Configuration *string @@ -3652,50 +4286,75 @@ type PatchSource struct { // The specific operating system versions a patch repository applies to, such as // "Ubuntu16.04", "AmazonLinux2016.09", "RedhatEnterpriseLinux7.2" or "Suse12.7". - // For lists of supported product values, see PatchFilter. + // For lists of supported product values, see PatchFilter . // // This member is required. Products []string + + noSmithyDocumentSerde } // Information about the approval status of a patch. type PatchStatus struct { // The date the patch was approved (or will be approved if the status is - // PENDING_APPROVAL). + // PENDING_APPROVAL ). ApprovalDate *time.Time // The compliance severity level for a patch. ComplianceLevel PatchComplianceLevel - // The approval status of a patch (APPROVED, PENDING_APPROVAL, EXPLICIT_APPROVED, - // EXPLICIT_REJECTED). + // The approval status of a patch. DeploymentStatus PatchDeploymentStatus + + noSmithyDocumentSerde } -// An aggregate of step execution statuses displayed in the AWS Console for a -// multi-Region and multi-account Automation execution. +// An aggregate of step execution statuses displayed in the Amazon Web Services +// Systems Manager console for a multi-Region and multi-account Automation +// execution. type ProgressCounters struct { - // The total number of steps that the system cancelled in all specified AWS Regions - // and accounts for the current Automation execution. + // The total number of steps that the system cancelled in all specified Amazon Web + // Services Regions and Amazon Web Services accounts for the current Automation + // execution. CancelledSteps int32 - // The total number of steps that failed to run in all specified AWS Regions and - // accounts for the current Automation execution. + // The total number of steps that failed to run in all specified Amazon Web + // Services Regions and Amazon Web Services accounts for the current Automation + // execution. FailedSteps int32 - // The total number of steps that successfully completed in all specified AWS - // Regions and accounts for the current Automation execution. + // The total number of steps that successfully completed in all specified Amazon + // Web Services Regions and Amazon Web Services accounts for the current Automation + // execution. SuccessSteps int32 - // The total number of steps that timed out in all specified AWS Regions and - // accounts for the current Automation execution. + // The total number of steps that timed out in all specified Amazon Web Services + // Regions and Amazon Web Services accounts for the current Automation execution. TimedOutSteps int32 - // The total number of steps run in all specified AWS Regions and accounts for the - // current Automation execution. + // The total number of steps run in all specified Amazon Web Services Regions and + // Amazon Web Services accounts for the current Automation execution. TotalSteps int32 + + noSmithyDocumentSerde +} + +// Reserved for internal use. +type RegistrationMetadataItem struct { + + // Reserved for internal use. + // + // This member is required. + Key *string + + // Reserved for internal use. + // + // This member is required. + Value *string + + noSmithyDocumentSerde } // An OpsItems that shares something in common with the current OpsItem. For @@ -3707,6 +4366,8 @@ type RelatedOpsItem struct { // // This member is required. OpsItemId *string + + noSmithyDocumentSerde } // Information about targets that resolved during the Automation execution. @@ -3718,6 +4379,8 @@ type ResolvedTargets struct { // A boolean value indicating whether the resolved target list is truncated. Truncated bool + + noSmithyDocumentSerde } // Compliance summary information for a specific resource. @@ -3747,36 +4410,42 @@ type ResourceComplianceSummaryItem struct { // The compliance status for the resource. Status ComplianceStatus + + noSmithyDocumentSerde } // Information about the AwsOrganizationsSource resource data sync source. A sync -// source of this type can synchronize data from AWS Organizations or, if an AWS -// Organization is not present, from multiple AWS Regions. +// source of this type can synchronize data from Organizations or, if an Amazon Web +// Services organization isn't present, from multiple Amazon Web Services Regions. type ResourceDataSyncAwsOrganizationsSource struct { - // If an AWS Organization is present, this is either OrganizationalUnits or - // EntireOrganization. For OrganizationalUnits, the data is aggregated from a set - // of organization units. For EntireOrganization, the data is aggregated from the - // entire AWS Organization. + // If an Amazon Web Services organization is present, this is either + // OrganizationalUnits or EntireOrganization . For OrganizationalUnits , the data + // is aggregated from a set of organization units. For EntireOrganization , the + // data is aggregated from the entire Amazon Web Services organization. // // This member is required. OrganizationSourceType *string - // The AWS Organizations organization units included in the sync. + // The Organizations organization units included in the sync. OrganizationalUnits []ResourceDataSyncOrganizationalUnit + + noSmithyDocumentSerde } -// Synchronize Systems Manager Inventory data from multiple AWS accounts defined in -// AWS Organizations to a centralized S3 bucket. Data is synchronized to individual -// key prefixes in the central bucket. Each key prefix represents a different AWS -// account ID. +// Synchronize Amazon Web Services Systems Manager Inventory data from multiple +// Amazon Web Services accounts defined in Organizations to a centralized Amazon S3 +// bucket. Data is synchronized to individual key prefixes in the central bucket. +// Each key prefix represents a different Amazon Web Services account ID. type ResourceDataSyncDestinationDataSharing struct { // The sharing data type. Only Organization is supported. DestinationDataSharingType *string + + noSmithyDocumentSerde } -// Information about a Resource Data Sync configuration, including its current +// Information about a resource data sync configuration, including its current // status and last successful sync. type ResourceDataSyncItem struct { @@ -3801,27 +4470,31 @@ type ResourceDataSyncItem struct { // The date and time the resource data sync was changed. SyncLastModifiedTime *time.Time - // The name of the Resource Data Sync. + // The name of the resource data sync. SyncName *string // Information about the source where the data was synchronized. SyncSource *ResourceDataSyncSourceWithState - // The type of resource data sync. If SyncType is SyncToDestination, then the + // The type of resource data sync. If SyncType is SyncToDestination , then the // resource data sync synchronizes data to an S3 bucket. If the SyncType is - // SyncFromSource then the resource data sync synchronizes data from AWS - // Organizations or from multiple AWS Regions. + // SyncFromSource then the resource data sync synchronizes data from Organizations + // or from multiple Amazon Web Services Regions. SyncType *string + + noSmithyDocumentSerde } -// The AWS Organizations organizational unit data source for the sync. +// The Organizations organizational unit data source for the sync. type ResourceDataSyncOrganizationalUnit struct { - // The AWS Organization unit ID data source for the sync. + // The Organizations unit ID data source for the sync. OrganizationalUnitId *string + + noSmithyDocumentSerde } -// Information about the target S3 bucket for the Resource Data Sync. +// Information about the target S3 bucket for the resource data sync. type ResourceDataSyncS3Destination struct { // The name of the S3 bucket where the aggregated data is stored. @@ -3829,7 +4502,8 @@ type ResourceDataSyncS3Destination struct { // This member is required. BucketName *string - // The AWS Region with the S3 bucket targeted by the Resource Data Sync. + // The Amazon Web Services Region with the S3 bucket targeted by the resource data + // sync. // // This member is required. Region *string @@ -3843,80 +4517,104 @@ type ResourceDataSyncS3Destination struct { // same Region as the destination S3 bucket. AWSKMSKeyARN *string - // Enables destination data sharing. By default, this field is null. + // Enables destination data sharing. By default, this field is null . DestinationDataSharing *ResourceDataSyncDestinationDataSharing // An Amazon S3 prefix for the bucket. Prefix *string + + noSmithyDocumentSerde } // Information about the source of the data included in the resource data sync. type ResourceDataSyncSource struct { - // The SyncSource AWS Regions included in the resource data sync. + // The SyncSource Amazon Web Services Regions included in the resource data sync. // // This member is required. SourceRegions []string // The type of data source for the resource data sync. SourceType is either - // AwsOrganizations (if an organization is present in AWS Organizations) or - // singleAccountMultiRegions. + // AwsOrganizations (if an organization is present in Organizations) or + // SingleAccountMultiRegions . // // This member is required. SourceType *string // Information about the AwsOrganizationsSource resource data sync source. A sync - // source of this type can synchronize data from AWS Organizations. + // source of this type can synchronize data from Organizations. AwsOrganizationsSource *ResourceDataSyncAwsOrganizationsSource - // Whether to automatically synchronize and aggregate data from new AWS Regions - // when those Regions come online. + // When you create a resource data sync, if you choose one of the Organizations + // options, then Systems Manager automatically enables all OpsData sources in the + // selected Amazon Web Services Regions for all Amazon Web Services accounts in + // your organization (or in the selected organization units). For more information, + // see About multiple account and Region resource data syncs (https://docs.aws.amazon.com/systems-manager/latest/userguide/Explorer-resouce-data-sync-multiple-accounts-and-regions.html) + // in the Amazon Web Services Systems Manager User Guide. + EnableAllOpsDataSources bool + + // Whether to automatically synchronize and aggregate data from new Amazon Web + // Services Regions when those Regions come online. IncludeFutureRegions bool + + noSmithyDocumentSerde } // The data type name for including resource data sync state. There are four sync // states: OrganizationNotExists (Your organization doesn't exist) NoPermissions // (The system can't locate the service-linked role. This role is automatically -// created when a user creates a resource data sync in Explorer.) -// InvalidOrganizationalUnit (You specified or selected an invalid unit in the -// resource data sync configuration.) TrustedAccessDisabled (You disabled Systems -// Manager access in the organization in AWS Organizations.) +// created when a user creates a resource data sync in Amazon Web Services Systems +// Manager Explorer.) InvalidOrganizationalUnit (You specified or selected an +// invalid unit in the resource data sync configuration.) TrustedAccessDisabled +// (You disabled Systems Manager access in the organization in Organizations.) type ResourceDataSyncSourceWithState struct { // The field name in SyncSource for the ResourceDataSyncAwsOrganizationsSource // type. AwsOrganizationsSource *ResourceDataSyncAwsOrganizationsSource - // Whether to automatically synchronize and aggregate data from new AWS Regions - // when those Regions come online. + // When you create a resource data sync, if you choose one of the Organizations + // options, then Systems Manager automatically enables all OpsData sources in the + // selected Amazon Web Services Regions for all Amazon Web Services accounts in + // your organization (or in the selected organization units). For more information, + // see About multiple account and Region resource data syncs (https://docs.aws.amazon.com/systems-manager/latest/userguide/Explorer-resouce-data-sync-multiple-accounts-and-regions.html) + // in the Amazon Web Services Systems Manager User Guide. + EnableAllOpsDataSources bool + + // Whether to automatically synchronize and aggregate data from new Amazon Web + // Services Regions when those Regions come online. IncludeFutureRegions bool - // The SyncSource AWS Regions included in the resource data sync. + // The SyncSource Amazon Web Services Regions included in the resource data sync. SourceRegions []string // The type of data source for the resource data sync. SourceType is either - // AwsOrganizations (if an organization is present in AWS Organizations) or - // singleAccountMultiRegions. + // AwsOrganizations (if an organization is present in Organizations) or + // singleAccountMultiRegions . SourceType *string // The data type name for including resource data sync state. There are four sync - // states: OrganizationNotExists: Your organization doesn't exist. NoPermissions: + // states: OrganizationNotExists : Your organization doesn't exist. NoPermissions : // The system can't locate the service-linked role. This role is automatically // created when a user creates a resource data sync in Explorer. - // InvalidOrganizationalUnit: You specified or selected an invalid unit in the - // resource data sync configuration. TrustedAccessDisabled: You disabled Systems - // Manager access in the organization in AWS Organizations. + // InvalidOrganizationalUnit : You specified or selected an invalid unit in the + // resource data sync configuration. TrustedAccessDisabled : You disabled Systems + // Manager access in the organization in Organizations. State *string + + noSmithyDocumentSerde } // The inventory item result attribute. type ResultAttribute struct { - // Name of the inventory item type. Valid value: AWS:InstanceInformation. Default - // Value: AWS:InstanceInformation. + // Name of the inventory item type. Valid value: AWS:InstanceInformation . Default + // Value: AWS:InstanceInformation . // // This member is required. TypeName *string + + noSmithyDocumentSerde } // Information about the result of a document review request. @@ -3930,22 +4628,21 @@ type ReviewInformation struct { // The current status of the document review request. Status ReviewStatus + + noSmithyDocumentSerde } -// Information about an Automation runbook (Automation document) used in a runbook -// workflow in Change Manager. The Automation runbooks specified for the runbook -// workflow can't run until all required approvals for the change request have been -// received. +// Information about an Automation runbook used in a runbook workflow in Change +// Manager. The Automation runbooks specified for the runbook workflow can't run +// until all required approvals for the change request have been received. type Runbook struct { - // The name of the Automation runbook (Automation document) used in a runbook - // workflow. + // The name of the Automation runbook used in a runbook workflow. // // This member is required. DocumentName *string - // The version of the Automation runbook (Automation document) used in a runbook - // workflow. + // The version of the Automation runbook used in a runbook workflow. DocumentVersion *string // The MaxConcurrency value specified by the user when the operation started, @@ -3953,26 +4650,32 @@ type Runbook struct { // at the same time. MaxConcurrency *string - // The MaxErrors value specified by the user when the execution started, indicating - // the maximum number of errors that can occur during the operation before the - // updates are stopped or rolled back. + // The MaxErrors value specified by the user when the execution started, + // indicating the maximum number of errors that can occur during the operation + // before the updates are stopped or rolled back. MaxErrors *string // The key-value map of execution parameters, which were supplied when calling - // StartChangeRequestExecution. + // StartChangeRequestExecution . Parameters map[string][]string - // Information about the AWS Regions and accounts targeted by the current Runbook - // operation. + // Information about the Amazon Web Services Regions and Amazon Web Services + // accounts targeted by the current Runbook operation. TargetLocations []TargetLocation + // A key-value mapping of runbook parameters to target resources. Both Targets and + // TargetMaps can't be specified together. + TargetMaps []map[string][]string + // The name of the parameter used as the target resource for the rate-controlled - // runbook workflow. Required if you specify Targets. + // runbook workflow. Required if you specify Targets . TargetParameterName *string - // A key-value mapping to target resources that the Runbook operation performs - // tasks on. Required if you specify TargetParameterName. + // A key-value mapping to target resources that the runbook operation performs + // tasks on. Required if you specify TargetParameterName . Targets []Target + + noSmithyDocumentSerde } // An S3 bucket where you want to store the results of this request. @@ -3984,16 +4687,20 @@ type S3OutputLocation struct { // The S3 bucket subfolder. OutputS3KeyPrefix *string - // (Deprecated) You can no longer specify this parameter. The system ignores it. - // Instead, Systems Manager automatically determines the Region of the S3 bucket. + // The Amazon Web Services Region of the S3 bucket. OutputS3Region *string + + noSmithyDocumentSerde } -// A URL for the S3 bucket where you want to store the results of this request. +// A URL for the Amazon Web Services Systems Manager (Systems Manager) bucket +// where you want to store the results of this request. type S3OutputUrl struct { // A URL for an S3 bucket where you want to store the results of this request. OutputUrl *string + + noSmithyDocumentSerde } // Information about a scheduled execution for a maintenance window. @@ -4008,21 +4715,23 @@ type ScheduledWindowExecution struct { // The ID of the maintenance window to be run. WindowId *string + + noSmithyDocumentSerde } // The service setting data structure. ServiceSetting is an account-level setting -// for an AWS service. This setting defines how a user interacts with or uses a -// service or a feature of a service. For example, if an AWS service charges money -// to the account based on feature or service usage, then the AWS service team -// might create a default setting of "false". This means the user can't use this -// feature unless they change the setting to "true" and intentionally opt in for a -// paid feature. Services map a SettingId object to a setting value. AWS services -// teams define the default value for a SettingId. You can't create a new -// SettingId, but you can overwrite the default value if you have the -// ssm:UpdateServiceSetting permission for the setting. Use the -// UpdateServiceSetting API action to change the default setting. Or, use the -// ResetServiceSetting to change the value back to the original value defined by -// the AWS service team. +// for an Amazon Web Services service. This setting defines how a user interacts +// with or uses a service or a feature of a service. For example, if an Amazon Web +// Services service charges money to the account based on feature or service usage, +// then the Amazon Web Services service team might create a default setting of +// "false". This means the user can't use this feature unless they change the +// setting to "true" and intentionally opt in for a paid feature. Services map a +// SettingId object to a setting value. Amazon Web Services services teams define +// the default value for a SettingId . You can't create a new SettingId , but you +// can overwrite the default value if you have the ssm:UpdateServiceSetting +// permission for the setting. Use the UpdateServiceSetting API operation to +// change the default setting. Or, use the ResetServiceSetting to change the value +// back to the original value defined by the Amazon Web Services service team. type ServiceSetting struct { // The ARN of the service setting. @@ -4043,37 +4752,42 @@ type ServiceSetting struct { // The status of the service setting. The value can be Default, Customized or // PendingUpdate. - // - // * Default: The current setting uses a default value provisioned - // by the AWS service team. - // - // * Customized: The current setting use a custom value - // specified by the customer. - // - // * PendingUpdate: The current setting uses a default - // or custom value, but a setting change request is pending approval. + // - Default: The current setting uses a default value provisioned by the Amazon + // Web Services service team. + // - Customized: The current setting use a custom value specified by the + // customer. + // - PendingUpdate: The current setting uses a default or custom value, but a + // setting change request is pending approval. Status *string + + noSmithyDocumentSerde } -// Information about a Session Manager connection to an instance. +// Information about a Session Manager connection to a managed node. type Session struct { // Reserved for future use. Details *string // The name of the Session Manager SSM document used to define the parameters and - // plugin settings for the session. For example, SSM-SessionManagerRunShell. + // plugin settings for the session. For example, SSM-SessionManagerRunShell . DocumentName *string // The date and time, in ISO-8601 Extended format, when the session was terminated. EndDate *time.Time + // The maximum duration of a session before it terminates. + MaxSessionDuration *string + // Reserved for future use. OutputUrl *SessionManagerOutputUrl - // The ID of the AWS user account that started the session. + // The ID of the Amazon Web Services user that started the session. Owner *string + // The reason for connecting to the instance. + Reason *string + // The ID of the session. SessionId *string @@ -4083,8 +4797,10 @@ type Session struct { // The status of the session. For example, "Connected" or "Terminated". Status SessionStatus - // The instance that the Session Manager session connected to. + // The managed node that the Session Manager session connected to. Target *string + + noSmithyDocumentSerde } // Describes a filter for Session Manager information. @@ -4096,43 +4812,29 @@ type SessionFilter struct { Key SessionFilterKey // The filter value. Valid values for each filter key are as follows: - // - // * - // InvokedAfter: Specify a timestamp to limit your results. For example, specify - // 2018-08-29T00:00:00Z to see sessions that started August 29, 2018, and later. - // - // * - // InvokedBefore: Specify a timestamp to limit your results. For example, specify - // 2018-08-29T00:00:00Z to see sessions that started before August 29, 2018. - // - // * - // Target: Specify an instance to which session connections have been made. - // - // * - // Owner: Specify an AWS user account to see a list of sessions started by that - // user. - // - // * Status: Specify a valid session status to see a list of all sessions - // with that status. Status values you can specify include: - // - // * Connected - // - // * - // Connecting - // - // * Disconnected - // - // * Terminated - // - // * Terminating - // - // * Failed - // - // * SessionId: - // Specify a session ID to return details about the session. + // - InvokedAfter: Specify a timestamp to limit your results. For example, + // specify 2018-08-29T00:00:00Z to see sessions that started August 29, 2018, and + // later. + // - InvokedBefore: Specify a timestamp to limit your results. For example, + // specify 2018-08-29T00:00:00Z to see sessions that started before August 29, + // 2018. + // - Target: Specify a managed node to which session connections have been made. + // - Owner: Specify an Amazon Web Services user to see a list of sessions + // started by that user. + // - Status: Specify a valid session status to see a list of all sessions with + // that status. Status values you can specify include: + // - Connected + // - Connecting + // - Disconnected + // - Terminated + // - Terminating + // - Failed + // - SessionId: Specify a session ID to return details about the session. // // This member is required. Value *string + + noSmithyDocumentSerde } // Reserved for future use. @@ -4143,15 +4845,17 @@ type SessionManagerOutputUrl struct { // Reserved for future use. S3OutputUrl *string + + noSmithyDocumentSerde } -// The number of managed instances found for each patch severity level defined in -// the request filter. +// The number of managed nodes found for each patch severity level defined in the +// request filter. type SeveritySummary struct { // The total number of resources or compliance items that have a severity level of - // critical. Critical severity is determined by the organization that published the - // compliance items. + // Critical . Critical severity is determined by the organization that published + // the compliance items. CriticalCount int32 // The total number of resources or compliance items that have a severity level of @@ -4178,6 +4882,8 @@ type SeveritySummary struct { // unspecified. Unspecified severity is determined by the organization that // published the compliance items. UnspecifiedCount int32 + + noSmithyDocumentSerde } // Detailed information about an the execution state of an Automation step. @@ -4186,12 +4892,12 @@ type StepExecution struct { // The action this step performs. The action determines the behavior of the step. Action *string - // If a step has finished execution, this contains the time the execution ended. If - // the step has not yet concluded, this field is not populated. + // If a step has finished execution, this contains the time the execution ended. + // If the step hasn't yet concluded, this field isn't populated. ExecutionEndTime *time.Time // If a step has begun execution, this contains the time the step started. If the - // step is in Pending status, this field is not populated. + // step is in Pending status, this field isn't populated. ExecutionStartTime *time.Time // Information about the Automation failure. @@ -4205,20 +4911,20 @@ type StepExecution struct { // The flag which can be used to help decide whether the failure of current step // leads to the Automation failure. - IsCritical bool + IsCritical *bool - // The flag which can be used to end automation no matter whether the step succeeds - // or fails. - IsEnd bool + // The flag which can be used to end automation no matter whether the step + // succeeds or fails. + IsEnd *bool // The maximum number of tries to run the action of the step. The default value is - // 1. - MaxAttempts int32 + // 1 . + MaxAttempts *int32 // The next step after the step succeeds. NextStep *string - // The action to take if the step fails. The default value is Abort. + // The action to take if the step fails. The default value is Abort . OnFailure *string // Returned values from the execution of the step. @@ -4227,6 +4933,9 @@ type StepExecution struct { // A user-specified list of parameters to override when running a step. OverriddenParameters map[string][]string + // Information about the parent step. + ParentStepDetails *ParentStepDetails + // A message associated with the response code for an execution. Response *string @@ -4242,29 +4951,32 @@ type StepExecution struct { // The execution status for this step. StepStatus AutomationExecutionStatus - // The combination of AWS Regions and accounts targeted by the current Automation - // execution. + // The combination of Amazon Web Services Regions and Amazon Web Services accounts + // targeted by the current Automation execution. TargetLocation *TargetLocation // The targets for the step execution. Targets []Target // The timeout seconds of the step. - TimeoutSeconds int64 + TimeoutSeconds *int64 + + // The CloudWatch alarms that were invoked by the automation. + TriggeredAlarms []AlarmStateInformation // Strategies used when step fails, we support Continue and Abort. Abort will fail // the automation when the step fails. Continue will ignore the failure of current // step and allow automation to run the next step. With conditional branching, we // add step:stepName to support the automation to go to another specific step. ValidNextSteps []string + + noSmithyDocumentSerde } // A filter to limit the amount of step execution information returned by the call. type StepExecutionFilter struct { - // One or more keys to limit the results. Valid filter keys include the following: - // StepName, Action, StepExecutionId, StepExecutionStatus, StartTimeBefore, - // StartTimeAfter. + // One or more keys to limit the results. // // This member is required. Key StepExecutionFilterKey @@ -4273,12 +4985,15 @@ type StepExecutionFilter struct { // // This member is required. Values []string + + noSmithyDocumentSerde } -// Metadata that you assign to your AWS resources. Tags enable you to categorize -// your resources in different ways, for example, by purpose, owner, or -// environment. In Systems Manager, you can apply tags to documents, managed -// instances, maintenance windows, Parameter Store parameters, and patch baselines. +// Metadata that you assign to your Amazon Web Services resources. Tags enable you +// to categorize your resources in different ways, for example, by purpose, owner, +// or environment. In Amazon Web Services Systems Manager, you can apply tags to +// Systems Manager documents (SSM documents), managed nodes, maintenance windows, +// parameters, patch baselines, OpsItems, and OpsMetadata. type Tag struct { // The name of the tag. @@ -4290,103 +5005,92 @@ type Tag struct { // // This member is required. Value *string + + noSmithyDocumentSerde } -// An array of search criteria that targets instances using a Key,Value combination +// An array of search criteria that targets managed nodes using a key-value pair // that you specify. One or more targets must be specified for maintenance window // Run Command-type tasks. Depending on the task, targets are optional for other -// maintenance window task types (Automation, AWS Lambda, and AWS Step Functions). -// For more information about running tasks that do not specify targets, see see -// Registering maintenance window tasks without targets -// (https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html) -// in the AWS Systems Manager User Guide. Supported formats include the -// following. -// -// * -// Key=InstanceIds,Values=instance-id-1,instance-id-2,instance-id-3 -// -// * -// Key=tag:my-tag-key,Values=my-tag-value-1,my-tag-value-2 -// -// * -// Key=tag-key,Values=my-tag-key-1,my-tag-key-2 -// -// * Run Command and Maintenance -// window targets only: Key=resource-groups:Name,Values=resource-group-name -// -// * -// Maintenance window targets only: -// Key=resource-groups:ResourceTypeFilters,Values=resource-type-1,resource-type-2 +// maintenance window task types (Automation, Lambda, and Step Functions). For more +// information about running tasks that don't specify targets, see Registering +// maintenance window tasks without targets (https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html) +// in the Amazon Web Services Systems Manager User Guide. Supported formats include +// the following. +// - Key=InstanceIds,Values=,, +// - Key=tag:,Values=, +// - Key=tag-key,Values=, +// - Run Command and Maintenance window targets only: +// Key=resource-groups:Name,Values= +// - Maintenance window targets only: +// Key=resource-groups:ResourceTypeFilters,Values=, +// - Automation targets only: Key=ResourceGroup;Values= // -// * -// Automation targets only: Key=ResourceGroup;Values=resource-group-name +// For example: // -// For -// example: +// - +// Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE +// - Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3 +// - Key=tag-key,Values=Name,Instance-Type,CostCenter +// - Run Command and Maintenance window targets only: +// Key=resource-groups:Name,Values=ProductionResourceGroup This example +// demonstrates how to target all resources in the resource group +// ProductionResourceGroup in your maintenance window. +// - Maintenance window targets only: +// Key=resource-groups:ResourceTypeFilters,Values=AWS::EC2::INSTANCE,AWS::EC2::VPC +// This example demonstrates how to target only Amazon Elastic Compute Cloud +// (Amazon EC2) instances and VPCs in your maintenance window. +// - Automation targets only: Key=ResourceGroup,Values=MyResourceGroup +// - State Manager association targets only: Key=InstanceIds,Values=* This +// example demonstrates how to target all managed instances in the Amazon Web +// Services Region where the association was created. // -// * -// Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE -// -// * -// Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3 -// -// * -// Key=tag-key,Values=Name,Instance-Type,CostCenter -// -// * Run Command and Maintenance -// window targets only: Key=resource-groups:Name,Values=ProductionResourceGroup -// This example demonstrates how to target all resources in the resource group -// ProductionResourceGroup in your maintenance window. -// -// * Maintenance window -// targets only: -// Key=resource-groups:ResourceTypeFilters,Values=AWS::EC2::INSTANCE,AWS::EC2::VPC -// This example demonstrates how to target only EC2 instances and VPCs in your -// maintenance window. -// -// * Automation targets only: -// Key=ResourceGroup,Values=MyResourceGroup -// -// * State Manager association targets -// only: Key=InstanceIds,Values=* This example demonstrates how to target all -// managed instances in the AWS Region where the association was created. -// -// For more -// information about how to send commands that target instances using Key,Value -// parameters, see Targeting multiple instances -// (https://docs.aws.amazon.com/systems-manager/latest/userguide/send-commands-multiple.html#send-commands-targeting) -// in the AWS Systems Manager User Guide. +// For more information about how to send commands that target managed nodes using +// Key,Value parameters, see Targeting multiple instances (https://docs.aws.amazon.com/systems-manager/latest/userguide/send-commands-multiple.html#send-commands-targeting) +// in the Amazon Web Services Systems Manager User Guide. type Target struct { - // User-defined criteria for sending commands that target instances that meet the - // criteria. + // User-defined criteria for sending commands that target managed nodes that meet + // the criteria. Key *string - // User-defined criteria that maps to Key. For example, if you specified - // tag:ServerRole, you could specify value:WebServer to run a command on instances - // that include EC2 tags of ServerRole,WebServer. + // User-defined criteria that maps to Key . For example, if you specified + // tag:ServerRole , you could specify value:WebServer to run a command on + // instances that include EC2 tags of ServerRole,WebServer . Depending on the type + // of target, the maximum number of values for a key might be lower than the global + // maximum of 50. Values []string + + noSmithyDocumentSerde } -// The combination of AWS Regions and accounts targeted by the current Automation -// execution. +// The combination of Amazon Web Services Regions and Amazon Web Services accounts +// targeted by the current Automation execution. type TargetLocation struct { - // The AWS accounts targeted by the current Automation execution. + // The Amazon Web Services accounts targeted by the current Automation execution. Accounts []string // The Automation execution role used by the currently running Automation. If not - // specified, the default value is AWS-SystemsManager-AutomationExecutionRole. + // specified, the default value is AWS-SystemsManager-AutomationExecutionRole . ExecutionRoleName *string - // The AWS Regions targeted by the current Automation execution. + // The Amazon Web Services Regions targeted by the current Automation execution. Regions []string - // The maximum number of AWS accounts and AWS regions allowed to run the Automation - // concurrently. + // The details for the CloudWatch alarm you want to apply to an automation or + // command. + TargetLocationAlarmConfiguration *AlarmConfiguration + + // The maximum number of Amazon Web Services Regions and Amazon Web Services + // accounts allowed to run the Automation concurrently. TargetLocationMaxConcurrency *string - // The maximum number of errors allowed before the system stops queueing additional - // Automation executions for the currently running Automation. + // The maximum number of errors allowed before the system stops queueing + // additional Automation executions for the currently running Automation. TargetLocationMaxErrors *string + + noSmithyDocumentSerde } + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/validators.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/validators.go index 792a8c97..37cb33aa 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/validators.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssm/validators.go @@ -30,6 +30,26 @@ func (m *validateOpAddTagsToResource) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpAssociateOpsItemRelatedItem struct { +} + +func (*validateOpAssociateOpsItemRelatedItem) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAssociateOpsItemRelatedItem) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AssociateOpsItemRelatedItemInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAssociateOpsItemRelatedItemInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCancelCommand struct { } @@ -330,6 +350,26 @@ func (m *validateOpDeleteMaintenanceWindow) HandleInitialize(ctx context.Context return next.HandleInitialize(ctx, in) } +type validateOpDeleteOpsItem struct { +} + +func (*validateOpDeleteOpsItem) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteOpsItem) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteOpsItemInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteOpsItemInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteOpsMetadata struct { } @@ -430,6 +470,26 @@ func (m *validateOpDeleteResourceDataSync) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpDeleteResourcePolicy struct { +} + +func (*validateOpDeleteResourcePolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteResourcePolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteResourcePolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeregisterManagedInstance struct { } @@ -990,6 +1050,26 @@ func (m *validateOpDescribeSessions) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpDisassociateOpsItemRelatedItem struct { +} + +func (*validateOpDisassociateOpsItemRelatedItem) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDisassociateOpsItemRelatedItem) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DisassociateOpsItemRelatedItemInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDisassociateOpsItemRelatedItemInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetAutomationExecution struct { } @@ -1410,6 +1490,26 @@ func (m *validateOpGetPatchBaseline) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpGetResourcePolicies struct { +} + +func (*validateOpGetResourcePolicies) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetResourcePolicies) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetResourcePoliciesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetResourcePoliciesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetServiceSetting struct { } @@ -1630,6 +1730,26 @@ func (m *validateOpListOpsItemEvents) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpListOpsItemRelatedItems struct { +} + +func (*validateOpListOpsItemRelatedItems) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListOpsItemRelatedItems) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListOpsItemRelatedItemsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListOpsItemRelatedItemsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListOpsMetadata struct { } @@ -1750,6 +1870,26 @@ func (m *validateOpPutParameter) HandleInitialize(ctx context.Context, in middle return next.HandleInitialize(ctx, in) } +type validateOpPutResourcePolicy struct { +} + +func (*validateOpPutResourcePolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutResourcePolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutResourcePolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpRegisterDefaultPatchBaseline struct { } @@ -2050,6 +2190,26 @@ func (m *validateOpTerminateSession) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpUnlabelParameterVersion struct { +} + +func (*validateOpUnlabelParameterVersion) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUnlabelParameterVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UnlabelParameterVersionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUnlabelParameterVersionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateAssociation struct { } @@ -2334,6 +2494,10 @@ func addOpAddTagsToResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAddTagsToResource{}, middleware.After) } +func addOpAssociateOpsItemRelatedItemValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAssociateOpsItemRelatedItem{}, middleware.After) +} + func addOpCancelCommandValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCancelCommand{}, middleware.After) } @@ -2394,6 +2558,10 @@ func addOpDeleteMaintenanceWindowValidationMiddleware(stack *middleware.Stack) e return stack.Initialize.Add(&validateOpDeleteMaintenanceWindow{}, middleware.After) } +func addOpDeleteOpsItemValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteOpsItem{}, middleware.After) +} + func addOpDeleteOpsMetadataValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteOpsMetadata{}, middleware.After) } @@ -2414,6 +2582,10 @@ func addOpDeleteResourceDataSyncValidationMiddleware(stack *middleware.Stack) er return stack.Initialize.Add(&validateOpDeleteResourceDataSync{}, middleware.After) } +func addOpDeleteResourcePolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteResourcePolicy{}, middleware.After) +} + func addOpDeregisterManagedInstanceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeregisterManagedInstance{}, middleware.After) } @@ -2526,6 +2698,10 @@ func addOpDescribeSessionsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeSessions{}, middleware.After) } +func addOpDisassociateOpsItemRelatedItemValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDisassociateOpsItemRelatedItem{}, middleware.After) +} + func addOpGetAutomationExecutionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetAutomationExecution{}, middleware.After) } @@ -2610,6 +2786,10 @@ func addOpGetPatchBaselineValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetPatchBaseline{}, middleware.After) } +func addOpGetResourcePoliciesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetResourcePolicies{}, middleware.After) +} + func addOpGetServiceSettingValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetServiceSetting{}, middleware.After) } @@ -2654,6 +2834,10 @@ func addOpListOpsItemEventsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListOpsItemEvents{}, middleware.After) } +func addOpListOpsItemRelatedItemsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListOpsItemRelatedItems{}, middleware.After) +} + func addOpListOpsMetadataValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListOpsMetadata{}, middleware.After) } @@ -2678,6 +2862,10 @@ func addOpPutParameterValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutParameter{}, middleware.After) } +func addOpPutResourcePolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutResourcePolicy{}, middleware.After) +} + func addOpRegisterDefaultPatchBaselineValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRegisterDefaultPatchBaseline{}, middleware.After) } @@ -2738,6 +2926,10 @@ func addOpTerminateSessionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTerminateSession{}, middleware.After) } +func addOpUnlabelParameterVersionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUnlabelParameterVersion{}, middleware.After) +} + func addOpUpdateAssociationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateAssociation{}, middleware.After) } @@ -2794,6 +2986,57 @@ func addOpUpdateServiceSettingValidationMiddleware(stack *middleware.Stack) erro return stack.Initialize.Add(&validateOpUpdateServiceSetting{}, middleware.After) } +func validateAlarm(v *types.Alarm) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Alarm"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateAlarmConfiguration(v *types.AlarmConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AlarmConfiguration"} + if v.Alarms == nil { + invalidParams.Add(smithy.NewErrParamRequired("Alarms")) + } else if v.Alarms != nil { + if err := validateAlarmList(v.Alarms); err != nil { + invalidParams.AddNested("Alarms", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateAlarmList(v []types.Alarm) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AlarmList"} + for i := range v { + if err := validateAlarm(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateAssociationExecutionFilter(v *types.AssociationExecutionFilter) error { if v == nil { return nil @@ -2958,6 +3201,33 @@ func validateAutomationExecutionFilterList(v []types.AutomationExecutionFilter) } } +func validateBaselineOverride(v *types.BaselineOverride) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BaselineOverride"} + if v.GlobalFilters != nil { + if err := validatePatchFilterGroup(v.GlobalFilters); err != nil { + invalidParams.AddNested("GlobalFilters", err.(smithy.InvalidParamsError)) + } + } + if v.ApprovalRules != nil { + if err := validatePatchRuleGroup(v.ApprovalRules); err != nil { + invalidParams.AddNested("ApprovalRules", err.(smithy.InvalidParamsError)) + } + } + if v.Sources != nil { + if err := validatePatchSourceList(v.Sources); err != nil { + invalidParams.AddNested("Sources", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateCommandFilter(v *types.CommandFilter) error { if v == nil { return nil @@ -3068,6 +3338,16 @@ func validateCreateAssociationBatchRequestEntry(v *types.CreateAssociationBatchR if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } + if v.TargetLocations != nil { + if err := validateTargetLocations(v.TargetLocations); err != nil { + invalidParams.AddNested("TargetLocations", err.(smithy.InvalidParamsError)) + } + } + if v.AlarmConfiguration != nil { + if err := validateAlarmConfiguration(v.AlarmConfiguration); err != nil { + invalidParams.AddNested("AlarmConfiguration", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -3584,6 +3864,44 @@ func validateOpsItemFilters(v []types.OpsItemFilter) error { } } +func validateOpsItemRelatedItemsFilter(v *types.OpsItemRelatedItemsFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "OpsItemRelatedItemsFilter"} + if len(v.Key) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Key")) + } + if v.Values == nil { + invalidParams.Add(smithy.NewErrParamRequired("Values")) + } + if len(v.Operator) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Operator")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpsItemRelatedItemsFilters(v []types.OpsItemRelatedItemsFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "OpsItemRelatedItemsFilters"} + for i := range v { + if err := validateOpsItemRelatedItemsFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpsMetadataFilter(v *types.OpsMetadataFilter) error { if v == nil { return nil @@ -3865,6 +4183,41 @@ func validatePatchSourceList(v []types.PatchSource) error { } } +func validateRegistrationMetadataItem(v *types.RegistrationMetadataItem) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RegistrationMetadataItem"} + if v.Key == nil { + invalidParams.Add(smithy.NewErrParamRequired("Key")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRegistrationMetadataList(v []types.RegistrationMetadataItem) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RegistrationMetadataList"} + for i := range v { + if err := validateRegistrationMetadataItem(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateRelatedOpsItem(v *types.RelatedOpsItem) error { if v == nil { return nil @@ -3996,6 +4349,11 @@ func validateRunbook(v *types.Runbook) error { if v.DocumentName == nil { invalidParams.Add(smithy.NewErrParamRequired("DocumentName")) } + if v.TargetLocations != nil { + if err := validateTargetLocations(v.TargetLocations); err != nil { + invalidParams.AddNested("TargetLocations", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -4125,6 +4483,40 @@ func validateTagList(v []types.Tag) error { } } +func validateTargetLocation(v *types.TargetLocation) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TargetLocation"} + if v.TargetLocationAlarmConfiguration != nil { + if err := validateAlarmConfiguration(v.TargetLocationAlarmConfiguration); err != nil { + invalidParams.AddNested("TargetLocationAlarmConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTargetLocations(v []types.TargetLocation) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TargetLocations"} + for i := range v { + if err := validateTargetLocation(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpAddTagsToResourceInput(v *AddTagsToResourceInput) error { if v == nil { return nil @@ -4150,6 +4542,30 @@ func validateOpAddTagsToResourceInput(v *AddTagsToResourceInput) error { } } +func validateOpAssociateOpsItemRelatedItemInput(v *AssociateOpsItemRelatedItemInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AssociateOpsItemRelatedItemInput"} + if v.OpsItemId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OpsItemId")) + } + if v.AssociationType == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssociationType")) + } + if v.ResourceType == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceType")) + } + if v.ResourceUri == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceUri")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCancelCommandInput(v *CancelCommandInput) error { if v == nil { return nil @@ -4193,6 +4609,11 @@ func validateOpCreateActivationInput(v *CreateActivationInput) error { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } + if v.RegistrationMetadata != nil { + if err := validateRegistrationMetadataList(v.RegistrationMetadata); err != nil { + invalidParams.AddNested("RegistrationMetadata", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -4227,6 +4648,21 @@ func validateOpCreateAssociationInput(v *CreateAssociationInput) error { if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } + if v.TargetLocations != nil { + if err := validateTargetLocations(v.TargetLocations); err != nil { + invalidParams.AddNested("TargetLocations", err.(smithy.InvalidParamsError)) + } + } + if v.Tags != nil { + if err := validateTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if v.AlarmConfiguration != nil { + if err := validateAlarmConfiguration(v.AlarmConfiguration); err != nil { + invalidParams.AddNested("AlarmConfiguration", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -4273,6 +4709,9 @@ func validateOpCreateMaintenanceWindowInput(v *CreateMaintenanceWindowInput) err if v.Schedule == nil { invalidParams.Add(smithy.NewErrParamRequired("Schedule")) } + if v.Duration == nil { + invalidParams.Add(smithy.NewErrParamRequired("Duration")) + } if v.Tags != nil { if err := validateTagList(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) @@ -4324,6 +4763,11 @@ func validateOpCreateOpsMetadataInput(v *CreateOpsMetadataInput) error { if v.ResourceId == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceId")) } + if v.Tags != nil { + if err := validateTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -4451,6 +4895,21 @@ func validateOpDeleteMaintenanceWindowInput(v *DeleteMaintenanceWindowInput) err } } +func validateOpDeleteOpsItemInput(v *DeleteOpsItemInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteOpsItemInput"} + if v.OpsItemId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OpsItemId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteOpsMetadataInput(v *DeleteOpsMetadataInput) error { if v == nil { return nil @@ -4526,6 +4985,27 @@ func validateOpDeleteResourceDataSyncInput(v *DeleteResourceDataSyncInput) error } } +func validateOpDeleteResourcePolicyInput(v *DeleteResourcePolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteResourcePolicyInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.PolicyId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyId")) + } + if v.PolicyHash == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyHash")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeregisterManagedInstanceInput(v *DeregisterManagedInstanceInput) error { if v == nil { return nil @@ -5013,6 +5493,24 @@ func validateOpDescribeSessionsInput(v *DescribeSessionsInput) error { } } +func validateOpDisassociateOpsItemRelatedItemInput(v *DisassociateOpsItemRelatedItemInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DisassociateOpsItemRelatedItemInput"} + if v.OpsItemId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OpsItemId")) + } + if v.AssociationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AssociationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetAutomationExecutionInput(v *GetAutomationExecutionInput) error { if v == nil { return nil @@ -5087,6 +5585,11 @@ func validateOpGetDeployablePatchSnapshotForInstanceInput(v *GetDeployablePatchS if v.SnapshotId == nil { invalidParams.Add(smithy.NewErrParamRequired("SnapshotId")) } + if v.BaselineOverride != nil { + if err := validateBaselineOverride(v.BaselineOverride); err != nil { + invalidParams.AddNested("BaselineOverride", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -5375,6 +5878,21 @@ func validateOpGetPatchBaselineInput(v *GetPatchBaselineInput) error { } } +func validateOpGetResourcePoliciesInput(v *GetResourcePoliciesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetResourcePoliciesInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetServiceSettingInput(v *GetServiceSettingInput) error { if v == nil { return nil @@ -5564,6 +6082,23 @@ func validateOpListOpsItemEventsInput(v *ListOpsItemEventsInput) error { } } +func validateOpListOpsItemRelatedItemsInput(v *ListOpsItemRelatedItemsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListOpsItemRelatedItemsInput"} + if v.Filters != nil { + if err := validateOpsItemRelatedItemsFilters(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListOpsMetadataInput(v *ListOpsMetadataInput) error { if v == nil { return nil @@ -5697,6 +6232,24 @@ func validateOpPutParameterInput(v *PutParameterInput) error { } } +func validateOpPutResourcePolicyInput(v *PutResourcePolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutResourcePolicyInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.Policy == nil { + invalidParams.Add(smithy.NewErrParamRequired("Policy")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpRegisterDefaultPatchBaselineInput(v *RegisterDefaultPatchBaselineInput) error { if v == nil { return nil @@ -5770,6 +6323,11 @@ func validateOpRegisterTaskWithMaintenanceWindowInput(v *RegisterTaskWithMainten invalidParams.AddNested("LoggingInfo", err.(smithy.InvalidParamsError)) } } + if v.AlarmConfiguration != nil { + if err := validateAlarmConfiguration(v.AlarmConfiguration); err != nil { + invalidParams.AddNested("AlarmConfiguration", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -5854,6 +6412,11 @@ func validateOpSendCommandInput(v *SendCommandInput) error { if v.DocumentName == nil { invalidParams.Add(smithy.NewErrParamRequired("DocumentName")) } + if v.AlarmConfiguration != nil { + if err := validateAlarmConfiguration(v.AlarmConfiguration); err != nil { + invalidParams.AddNested("AlarmConfiguration", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -5884,11 +6447,21 @@ func validateOpStartAutomationExecutionInput(v *StartAutomationExecutionInput) e if v.DocumentName == nil { invalidParams.Add(smithy.NewErrParamRequired("DocumentName")) } + if v.TargetLocations != nil { + if err := validateTargetLocations(v.TargetLocations); err != nil { + invalidParams.AddNested("TargetLocations", err.(smithy.InvalidParamsError)) + } + } if v.Tags != nil { if err := validateTagList(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } + if v.AlarmConfiguration != nil { + if err := validateAlarmConfiguration(v.AlarmConfiguration); err != nil { + invalidParams.AddNested("AlarmConfiguration", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -5968,6 +6541,27 @@ func validateOpTerminateSessionInput(v *TerminateSessionInput) error { } } +func validateOpUnlabelParameterVersionInput(v *UnlabelParameterVersionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UnlabelParameterVersionInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.ParameterVersion == nil { + invalidParams.Add(smithy.NewErrParamRequired("ParameterVersion")) + } + if v.Labels == nil { + invalidParams.Add(smithy.NewErrParamRequired("Labels")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateAssociationInput(v *UpdateAssociationInput) error { if v == nil { return nil @@ -5976,6 +6570,16 @@ func validateOpUpdateAssociationInput(v *UpdateAssociationInput) error { if v.AssociationId == nil { invalidParams.Add(smithy.NewErrParamRequired("AssociationId")) } + if v.TargetLocations != nil { + if err := validateTargetLocations(v.TargetLocations); err != nil { + invalidParams.AddNested("TargetLocations", err.(smithy.InvalidParamsError)) + } + } + if v.AlarmConfiguration != nil { + if err := validateAlarmConfiguration(v.AlarmConfiguration); err != nil { + invalidParams.AddNested("AlarmConfiguration", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -6115,6 +6719,11 @@ func validateOpUpdateMaintenanceWindowTaskInput(v *UpdateMaintenanceWindowTaskIn invalidParams.AddNested("LoggingInfo", err.(smithy.InvalidParamsError)) } } + if v.AlarmConfiguration != nil { + if err := validateAlarmConfiguration(v.AlarmConfiguration); err != nil { + invalidParams.AddNested("AlarmConfiguration", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md new file mode 100644 index 00000000..46dea1b5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md @@ -0,0 +1,378 @@ +# v1.18.7 (2024-01-18) + +* No change notes available for this release. + +# v1.18.6 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.5 (2023-12-08) + +* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. + +# v1.18.4 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.3 (2023-12-06) + +* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. + +# v1.18.2 (2023-12-01) + +* **Bug Fix**: Correct wrapping of errors in authentication workflow. +* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.1 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.0 (2023-11-29) + +* **Feature**: Expose Options() accessor on service clients. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.5 (2023-11-28.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.4 (2023-11-28) + +* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction. + +# v1.17.3 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.2 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# 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 + +# v1.15.1 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.0 (2023-10-02) + +* **Feature**: Fix FIPS Endpoints in aws-us-gov. + +# v1.14.1 (2023-09-22) + +* No change notes available for this release. + +# v1.14.0 (2023-09-18) + +* **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* **Feature**: Adds several endpoint ruleset changes across all models: smaller rulesets, removed non-unique regional endpoints, fixes FIPS and DualStack endpoints, and make region not required in SDK::Endpoint. Additional breakfix to cognito-sync field. + +# v1.13.6 (2023-08-31) + +* No change notes available for this release. + +# v1.13.5 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.4 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.3 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.2 (2023-08-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.1 (2023-08-01) + +* No change notes available for this release. + +# v1.13.0 (2023-07-31) + +* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.14 (2023-07-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.13 (2023-07-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.12 (2023-06-15) + +* No change notes available for this release. + +# v1.12.11 (2023-06-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.10 (2023-05-04) + +* No change notes available for this release. + +# v1.12.9 (2023-04-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.8 (2023-04-10) + +* No change notes available for this release. + +# v1.12.7 (2023-04-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.6 (2023-03-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.5 (2023-03-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.4 (2023-02-22) + +* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes. + +# v1.12.3 (2023-02-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.2 (2023-02-15) + +* **Announcement**: When receiving an error response in restJson-based services, an incorrect error type may have been returned based on the content of the response. This has been fixed via PR #2012 tracked in issue #1910. +* **Bug Fix**: Correct error type parsing for restJson services. + +# v1.12.1 (2023-02-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.0 (2023-01-05) + +* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401). + +# v1.11.28 (2022-12-20) + +* No change notes available for this release. + +# v1.11.27 (2022-12-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.26 (2022-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.25 (2022-10-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.24 (2022-10-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.23 (2022-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.22 (2022-09-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.21 (2022-09-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.20 (2022-08-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.19 (2022-08-30) + +* **Documentation**: Documentation updates for the AWS IAM Identity Center Portal CLI Reference. + +# v1.11.18 (2022-08-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.17 (2022-08-15) + +* **Documentation**: Documentation updates to reflect service rename - AWS IAM Identity Center (successor to AWS Single Sign-On) + +# v1.11.16 (2022-08-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.15 (2022-08-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.14 (2022-08-08) + +* **Documentation**: Documentation updates to reflect service rename - AWS IAM Identity Center (successor to AWS Single Sign-On) +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.13 (2022-08-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.12 (2022-07-11) + +* No change notes available for this release. + +# v1.11.11 (2022-07-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.10 (2022-06-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.9 (2022-06-16) + +* No change notes available for this release. + +# v1.11.8 (2022-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.7 (2022-05-26) + +* No change notes available for this release. + +# v1.11.6 (2022-05-25) + +* No change notes available for this release. + +# v1.11.5 (2022-05-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.4 (2022-04-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.3 (2022-03-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.2 (2022-03-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.1 (2022-03-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.0 (2022-03-08) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.0 (2022-02-24) + +* **Feature**: API client updated +* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.0 (2022-01-14) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Documentation**: Updated API models +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.0 (2022-01-07) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.7.0 (2021-12-21) + +* **Feature**: API Paginators now support specifying the initial starting token, and support stopping on empty string tokens. + +# v1.6.2 (2021-12-02) + +* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514)) +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.1 (2021-11-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.0 (2021-11-06) + +* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Feature**: Updated service to latest API model. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.0 (2021-10-21) + +* **Feature**: Updated to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.2 (2021-10-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.1 (2021-09-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.0 (2021-08-27) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.3 (2021-08-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.2 (2021-08-04) + +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.1 (2021-07-15) + +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.0 (2021-06-25) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.1 (2021-05-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.0 (2021-05-14) + +* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. +* **Dependency Update**: Updated to the latest SDK module versions + diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go index b435c591..e4396992 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go @@ -4,15 +4,22 @@ package sso import ( "context" + "fmt" "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/retry" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" smithy "github.com/aws/smithy-go" + smithydocument "github.com/aws/smithy-go/document" "github.com/aws/smithy-go/logging" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" + "net" "net/http" "time" ) @@ -33,96 +40,59 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveDefaultLogger(&options) + setResolvedDefaultsMode(&options) + resolveRetryer(&options) resolveHTTPClient(&options) resolveHTTPSignerV4(&options) - resolveDefaultEndpointConfiguration(&options) + resolveEndpointResolverV2(&options) + + resolveAuthSchemeResolver(&options) for _, fn := range optFns { fn(&options) } - client := &Client{ - options: options, - } - - return client -} - -type Options struct { - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - APIOptions []func(*middleware.Stack) error + finalizeRetryMaxAttempts(&options) - // Configures the events that will be sent to the configured logger. - ClientLogMode aws.ClientLogMode + ignoreAnonymousAuth(&options) - // The credentials object to use when signing requests. - Credentials aws.CredentialsProvider + wrapWithAnonymousAuth(&options) - // The endpoint options to be used when attempting to resolve an endpoint. - EndpointOptions EndpointResolverOptions + resolveAuthSchemes(&options) - // The service endpoint resolver. - EndpointResolver EndpointResolver - - // Signature Version 4 (SigV4) Signer - HTTPSignerV4 HTTPSignerV4 - - // The logger writer interface to write logging messages to. - Logger logging.Logger - - // The region to send requests to. (Required) - Region string - - // Retryer guides how HTTP requests should be retried in case of recoverable - // failures. When nil the API client will use a default retryer. - Retryer aws.Retryer - - // The HTTP client to invoke API calls with. Defaults to client's default HTTP - // implementation if nil. - HTTPClient HTTPClient -} - -// WithAPIOptions returns a functional option for setting the Client's APIOptions -// option. -func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { - return func(o *Options) { - o.APIOptions = append(o.APIOptions, optFns...) + client := &Client{ + options: options, } -} -// WithEndpointResolver returns a functional option for setting the Client's -// EndpointResolver option. -func WithEndpointResolver(v EndpointResolver) func(*Options) { - return func(o *Options) { - o.EndpointResolver = v - } + return client } -type HTTPClient interface { - Do(*http.Request) (*http.Response, error) +// Options returns a copy of the client configuration. +// +// Callers SHOULD NOT perform mutations on any inner structures within client +// config. Config overrides should instead be made on a per-operation basis through +// functional options. +func (c *Client) Options() Options { + return c.options.Copy() } -// Copy creates a clone where the APIOptions list is deep copied. -func (o Options) Copy() Options { - to := o - to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) - copy(to.APIOptions, o.APIOptions) - return to -} func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { ctx = middleware.ClearStackValues(ctx) stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) options := c.options.Copy() + for _, fn := range optFns { fn(&options) } + finalizeOperationRetryMaxAttempts(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + for _, fn := range stackFns { if err := fn(stack, options); err != nil { return nil, metadata, err @@ -147,6 +117,89 @@ func (c *Client) invokeOperation(ctx context.Context, opID string, params interf return result, metadata, err } +type operationInputKey struct{} + +func setOperationInput(ctx context.Context, input interface{}) context.Context { + return middleware.WithStackValue(ctx, operationInputKey{}, input) +} + +func getOperationInput(ctx context.Context) interface{} { + return middleware.GetStackValue(ctx, operationInputKey{}) +} + +type setOperationInputMiddleware struct { +} + +func (*setOperationInputMiddleware) ID() string { + return "setOperationInput" +} + +func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + ctx = setOperationInput(ctx, in.Parameters) + return next.HandleSerialize(ctx, in) +} + +func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %w", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %v", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %v", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{}, "ResolveEndpointV2", middleware.After); err != nil { + return fmt.Errorf("add Signing: %w", err) + } + return nil +} +func resolveAuthSchemeResolver(options *Options) { + if options.AuthSchemeResolver == nil { + options.AuthSchemeResolver = &defaultAuthSchemeResolver{} + } +} + +func resolveAuthSchemes(options *Options) { + if options.AuthSchemes == nil { + options.AuthSchemes = []smithyhttp.AuthScheme{ + internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ + Signer: options.HTTPSignerV4, + Logger: options.Logger, + LogSigning: options.ClientLogMode.IsSigning(), + }), + } + } +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +type legacyEndpointContextSetter struct { + LegacyResolver EndpointResolver +} + +func (*legacyEndpointContextSetter) ID() string { + return "legacyEndpointContextSetter" +} + +func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.LegacyResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) + } + + return next.HandleInitialize(ctx, in) + +} +func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { + return stack.Initialize.Add(&legacyEndpointContextSetter{ + LegacyResolver: o.EndpointResolver, + }, middleware.Before) +} + func resolveDefaultLogger(o *Options) { if o.Logger != nil { return @@ -158,33 +211,110 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { return middleware.AddSetLoggerMiddleware(stack, o.Logger) } +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + // NewFromConfig returns a new client from the provided config. func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ - Region: cfg.Region, - HTTPClient: cfg.HTTPClient, - Credentials: cfg.Credentials, - APIOptions: cfg.APIOptions, - Logger: cfg.Logger, - ClientLogMode: cfg.ClientLogMode, + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + AppID: cfg.AppID, } resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) return New(opts, optFns...) } func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + if o.HTTPClient != nil { - return + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) } - o.HTTPClient = awshttp.NewBuildableClient() + + o.HTTPClient = buildable } func resolveRetryer(o *Options) { if o.Retryer != nil { return } - o.Retryer = retry.NewStandard() + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } } func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { @@ -194,24 +324,52 @@ func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { o.Retryer = cfg.Retryer() } -func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { - if cfg.EndpointResolver == nil { +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttempts(o *Options) { + if o.RetryMaxAttempts == 0 { return } - o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, NewDefaultEndpointResolver()) + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) } -func addClientUserAgent(stack *middleware.Stack) error { - return awsmiddleware.AddRequestUserAgentMiddleware(stack) +func finalizeOperationRetryMaxAttempts(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) } -func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { - mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ - CredentialsProvider: o.Credentials, - Signer: o.HTTPSignerV4, - LogSigning: o.ClientLogMode.IsSigning(), - }) - return stack.Finalize.Add(mw, middleware.After) +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) +} + +func addClientUserAgent(stack *middleware.Stack, options Options) error { + if err := awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "sso", goModuleVersion)(stack); err != nil { + return err + } + + if len(options.AppID) > 0 { + return awsmiddleware.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID)(stack) + } + + return nil } type HTTPSignerV4 interface { @@ -240,6 +398,36 @@ func addRetryMiddlewares(stack *middleware.Stack, o Options) error { return retry.AddRetryMiddlewares(stack, mo) } +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) } @@ -256,3 +444,32 @@ func addRequestResponseLogging(stack *middleware.Stack, o Options) error { LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), }, middleware.After) } + +type disableHTTPSMiddleware struct { + DisableHTTPS bool +} + +func (*disableHTTPSMiddleware) ID() string { + return "disableHTTPS" +} + +func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { + req.URL.Scheme = "http" + } + + return next.HandleFinalize(ctx, in) +} + +func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { + return stack.Finalize.Insert(&disableHTTPSMiddleware{ + DisableHTTPS: o.EndpointOptions.DisableHTTPS, + }, "ResolveEndpointV2", middleware.After) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_GetRoleCredentials.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_GetRoleCredentials.go index 3190c7dc..436eadc8 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_GetRoleCredentials.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_GetRoleCredentials.go @@ -4,20 +4,21 @@ package sso import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/service/sso/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns the STS short-term credentials for a given role name that is assigned to -// the user. +// Returns the STS short-term credentials for a given role name that is assigned +// to the user. func (c *Client) GetRoleCredentials(ctx context.Context, params *GetRoleCredentialsInput, optFns ...func(*Options)) (*GetRoleCredentialsOutput, error) { if params == nil { params = &GetRoleCredentialsInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetRoleCredentials", params, optFns, addOperationGetRoleCredentialsMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetRoleCredentials", params, optFns, c.addOperationGetRoleCredentialsMiddlewares) if err != nil { return nil, err } @@ -30,9 +31,8 @@ func (c *Client) GetRoleCredentials(ctx context.Context, params *GetRoleCredenti type GetRoleCredentialsInput struct { // The token issued by the CreateToken API call. For more information, see - // CreateToken - // (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html) - // in the AWS SSO OIDC API Reference Guide. + // CreateToken (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html) + // in the IAM Identity Center OIDC API Reference Guide. // // This member is required. AccessToken *string @@ -46,6 +46,8 @@ type GetRoleCredentialsInput struct { // // This member is required. RoleName *string + + noSmithyDocumentSerde } type GetRoleCredentialsOutput struct { @@ -55,9 +57,14 @@ type GetRoleCredentialsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetRoleCredentialsMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetRoleCredentialsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestjson1_serializeOpGetRoleCredentials{}, middleware.After) if err != nil { return err @@ -66,6 +73,13 @@ func addOperationGetRoleCredentialsMiddlewares(stack *middleware.Stack, options if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetRoleCredentials"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -87,7 +101,7 @@ func addOperationGetRoleCredentialsMiddlewares(stack *middleware.Stack, options if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -96,12 +110,18 @@ func addOperationGetRoleCredentialsMiddlewares(stack *middleware.Stack, options if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpGetRoleCredentialsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRoleCredentials(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -111,6 +131,9 @@ func addOperationGetRoleCredentialsMiddlewares(stack *middleware.Stack, options if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccountRoles.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccountRoles.go index 6f65fb74..d81b0677 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccountRoles.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccountRoles.go @@ -17,7 +17,7 @@ func (c *Client) ListAccountRoles(ctx context.Context, params *ListAccountRolesI params = &ListAccountRolesInput{} } - result, metadata, err := c.invokeOperation(ctx, "ListAccountRoles", params, optFns, addOperationListAccountRolesMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "ListAccountRoles", params, optFns, c.addOperationListAccountRolesMiddlewares) if err != nil { return nil, err } @@ -30,9 +30,8 @@ func (c *Client) ListAccountRoles(ctx context.Context, params *ListAccountRolesI type ListAccountRolesInput struct { // The token issued by the CreateToken API call. For more information, see - // CreateToken - // (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html) - // in the AWS SSO OIDC API Reference Guide. + // CreateToken (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html) + // in the IAM Identity Center OIDC API Reference Guide. // // This member is required. AccessToken *string @@ -48,6 +47,8 @@ type ListAccountRolesInput struct { // The page token from the previous response output when you request subsequent // pages. NextToken *string + + noSmithyDocumentSerde } type ListAccountRolesOutput struct { @@ -61,9 +62,14 @@ type ListAccountRolesOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationListAccountRolesMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationListAccountRolesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestjson1_serializeOpListAccountRoles{}, middleware.After) if err != nil { return err @@ -72,6 +78,13 @@ func addOperationListAccountRolesMiddlewares(stack *middleware.Stack, options Op if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListAccountRoles"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -93,7 +106,7 @@ func addOperationListAccountRolesMiddlewares(stack *middleware.Stack, options Op if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -102,12 +115,18 @@ func addOperationListAccountRolesMiddlewares(stack *middleware.Stack, options Op if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpListAccountRolesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccountRoles(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -117,6 +136,9 @@ func addOperationListAccountRolesMiddlewares(stack *middleware.Stack, options Op if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -149,6 +171,10 @@ type ListAccountRolesPaginator struct { // NewListAccountRolesPaginator returns a new ListAccountRolesPaginator func NewListAccountRolesPaginator(client ListAccountRolesAPIClient, params *ListAccountRolesInput, optFns ...func(*ListAccountRolesPaginatorOptions)) *ListAccountRolesPaginator { + if params == nil { + params = &ListAccountRolesInput{} + } + options := ListAccountRolesPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults @@ -158,21 +184,18 @@ func NewListAccountRolesPaginator(client ListAccountRolesAPIClient, params *List fn(&options) } - if params == nil { - params = &ListAccountRolesInput{} - } - return &ListAccountRolesPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListAccountRolesPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListAccountRoles page. @@ -199,7 +222,10 @@ func (p *ListAccountRolesPaginator) NextPage(ctx context.Context, optFns ...func prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccounts.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccounts.go index b224d250..38f8472a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccounts.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccounts.go @@ -12,15 +12,15 @@ import ( ) // Lists all AWS accounts assigned to the user. These AWS accounts are assigned by -// the administrator of the account. For more information, see Assign User Access -// (https://docs.aws.amazon.com/singlesignon/latest/userguide/useraccess.html#assignusers) -// in the AWS SSO User Guide. This operation returns a paginated response. +// the administrator of the account. For more information, see Assign User Access (https://docs.aws.amazon.com/singlesignon/latest/userguide/useraccess.html#assignusers) +// in the IAM Identity Center User Guide. This operation returns a paginated +// response. func (c *Client) ListAccounts(ctx context.Context, params *ListAccountsInput, optFns ...func(*Options)) (*ListAccountsOutput, error) { if params == nil { params = &ListAccountsInput{} } - result, metadata, err := c.invokeOperation(ctx, "ListAccounts", params, optFns, addOperationListAccountsMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "ListAccounts", params, optFns, c.addOperationListAccountsMiddlewares) if err != nil { return nil, err } @@ -33,9 +33,8 @@ func (c *Client) ListAccounts(ctx context.Context, params *ListAccountsInput, op type ListAccountsInput struct { // The token issued by the CreateToken API call. For more information, see - // CreateToken - // (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html) - // in the AWS SSO OIDC API Reference Guide. + // CreateToken (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html) + // in the IAM Identity Center OIDC API Reference Guide. // // This member is required. AccessToken *string @@ -46,6 +45,8 @@ type ListAccountsInput struct { // (Optional) When requesting subsequent pages, this is the page token from the // previous response output. NextToken *string + + noSmithyDocumentSerde } type ListAccountsOutput struct { @@ -59,9 +60,14 @@ type ListAccountsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationListAccountsMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationListAccountsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestjson1_serializeOpListAccounts{}, middleware.After) if err != nil { return err @@ -70,6 +76,13 @@ func addOperationListAccountsMiddlewares(stack *middleware.Stack, options Option if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListAccounts"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -91,7 +104,7 @@ func addOperationListAccountsMiddlewares(stack *middleware.Stack, options Option if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -100,12 +113,18 @@ func addOperationListAccountsMiddlewares(stack *middleware.Stack, options Option if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpListAccountsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccounts(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -115,6 +134,9 @@ func addOperationListAccountsMiddlewares(stack *middleware.Stack, options Option if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -146,6 +168,10 @@ type ListAccountsPaginator struct { // NewListAccountsPaginator returns a new ListAccountsPaginator func NewListAccountsPaginator(client ListAccountsAPIClient, params *ListAccountsInput, optFns ...func(*ListAccountsPaginatorOptions)) *ListAccountsPaginator { + if params == nil { + params = &ListAccountsInput{} + } + options := ListAccountsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults @@ -155,21 +181,18 @@ func NewListAccountsPaginator(client ListAccountsAPIClient, params *ListAccounts fn(&options) } - if params == nil { - params = &ListAccountsInput{} - } - return &ListAccountsPaginator{ options: options, client: client, params: params, firstPage: true, + nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListAccountsPaginator) HasMorePages() bool { - return p.firstPage || p.nextToken != nil + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListAccounts page. @@ -196,7 +219,10 @@ func (p *ListAccountsPaginator) NextPage(ctx context.Context, optFns ...func(*Op prevToken := p.nextToken p.nextToken = result.NextToken - if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { p.nextToken = nil } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_Logout.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_Logout.go index 2a4f90a4..82e98a89 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_Logout.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_Logout.go @@ -4,18 +4,30 @@ package sso import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Removes the client- and server-side session that is associated with the user. +// Removes the locally stored SSO tokens from the client-side cache and sends an +// API call to the IAM Identity Center service to invalidate the corresponding +// server-side IAM Identity Center sign in session. If a user uses IAM Identity +// Center to access the AWS CLI, the user’s IAM Identity Center sign in session is +// used to obtain an IAM session, as specified in the corresponding IAM Identity +// Center permission set. More specifically, IAM Identity Center assumes an IAM +// role in the target account on behalf of the user, and the corresponding +// temporary AWS credentials are returned to the client. After user logout, any +// existing IAM role sessions that were created by using IAM Identity Center +// permission sets continue based on the duration configured in the permission set. +// For more information, see User authentications (https://docs.aws.amazon.com/singlesignon/latest/userguide/authconcept.html) +// in the IAM Identity Center User Guide. func (c *Client) Logout(ctx context.Context, params *LogoutInput, optFns ...func(*Options)) (*LogoutOutput, error) { if params == nil { params = &LogoutInput{} } - result, metadata, err := c.invokeOperation(ctx, "Logout", params, optFns, addOperationLogoutMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "Logout", params, optFns, c.addOperationLogoutMiddlewares) if err != nil { return nil, err } @@ -28,20 +40,26 @@ func (c *Client) Logout(ctx context.Context, params *LogoutInput, optFns ...func type LogoutInput struct { // The token issued by the CreateToken API call. For more information, see - // CreateToken - // (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html) - // in the AWS SSO OIDC API Reference Guide. + // CreateToken (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html) + // in the IAM Identity Center OIDC API Reference Guide. // // This member is required. AccessToken *string + + noSmithyDocumentSerde } type LogoutOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationLogoutMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationLogoutMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestjson1_serializeOpLogout{}, middleware.After) if err != nil { return err @@ -50,6 +68,13 @@ func addOperationLogoutMiddlewares(stack *middleware.Stack, options Options) (er if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "Logout"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -71,7 +96,7 @@ func addOperationLogoutMiddlewares(stack *middleware.Stack, options Options) (er if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -80,12 +105,18 @@ func addOperationLogoutMiddlewares(stack *middleware.Stack, options Options) (er if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpLogoutValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opLogout(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -95,6 +126,9 @@ func addOperationLogoutMiddlewares(stack *middleware.Stack, options Options) (er if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/auth.go new file mode 100644 index 00000000..3b28e825 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/auth.go @@ -0,0 +1,308 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sso + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func bindAuthParamsRegion(params *AuthResolverParameters, _ interface{}, options Options) { + params.Region = options.Region +} + +type setLegacyContextSigningOptionsMiddleware struct { +} + +func (*setLegacyContextSigningOptionsMiddleware) ID() string { + return "setLegacyContextSigningOptions" +} + +func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + schemeID := rscheme.Scheme.SchemeID() + + if sn := awsmiddleware.GetSigningName(ctx); sn != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) + } + } + + if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) + } + } + + return next.HandleFinalize(ctx, in) +} + +func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) +} + +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + +// AuthResolverParameters contains the set of inputs necessary for auth scheme +// resolution. +type AuthResolverParameters struct { + // The name of the operation being invoked. + Operation string + + // The region in which the operation is being invoked. + Region string +} + +func bindAuthResolverParams(operation string, input interface{}, options Options) *AuthResolverParameters { + params := &AuthResolverParameters{ + Operation: operation, + } + + bindAuthParamsRegion(params, input, options) + + return params +} + +// AuthSchemeResolver returns a set of possible authentication options for an +// operation. +type AuthSchemeResolver interface { + ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) +} + +type defaultAuthSchemeResolver struct{} + +var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) + +func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + if overrides, ok := operationAuthOptions[params.Operation]; ok { + return overrides(params), nil + } + return serviceAuthOptions(params), nil +} + +var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{ + "GetRoleCredentials": func(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + {SchemeID: smithyauth.SchemeIDAnonymous}, + } + }, + + "ListAccountRoles": func(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + {SchemeID: smithyauth.SchemeIDAnonymous}, + } + }, + + "ListAccounts": func(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + {SchemeID: smithyauth.SchemeIDAnonymous}, + } + }, + + "Logout": func(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + {SchemeID: smithyauth.SchemeIDAnonymous}, + } + }, +} + +func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + { + SchemeID: smithyauth.SchemeIDSigV4, + SignerProperties: func() smithy.Properties { + var props smithy.Properties + smithyhttp.SetSigV4SigningName(&props, "awsssoportal") + smithyhttp.SetSigV4SigningRegion(&props, params.Region) + return props + }(), + }, + } +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + params := bindAuthResolverParams(m.operation, getOperationInput(ctx), m.options) + options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) + } + + scheme, ok := m.selectScheme(options) + if !ok { + return out, metadata, fmt.Errorf("could not select an auth scheme") + } + + ctx = setResolvedAuthScheme(ctx, scheme) + return next.HandleFinalize(ctx, in) +} + +func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { + for _, option := range options { + if option.SchemeID == smithyauth.SchemeIDAnonymous { + return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true + } + + for _, scheme := range m.options.AuthSchemes { + if scheme.SchemeID() != option.SchemeID { + continue + } + + if scheme.IdentityResolver(m.options) != nil { + return newResolvedAuthScheme(scheme, option), true + } + } + } + + return nil, false +} + +type resolvedAuthSchemeKey struct{} + +type resolvedAuthScheme struct { + Scheme smithyhttp.AuthScheme + IdentityProperties smithy.Properties + SignerProperties smithy.Properties +} + +func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { + return &resolvedAuthScheme{ + Scheme: scheme, + IdentityProperties: option.IdentityProperties, + SignerProperties: option.SignerProperties, + } +} + +func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { + return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) +} + +func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { + v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) + return v +} + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + resolver := rscheme.Scheme.IdentityResolver(m.options) + if resolver == nil { + return out, metadata, fmt.Errorf("no identity resolver") + } + + identity, err := resolver.GetIdentity(ctx, rscheme.IdentityProperties) + if err != nil { + return out, metadata, fmt.Errorf("get identity: %w", err) + } + + ctx = setIdentity(ctx, identity) + return next.HandleFinalize(ctx, in) +} + +type identityKey struct{} + +func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { + return middleware.WithStackValue(ctx, identityKey{}, identity) +} + +func getIdentity(ctx context.Context) smithyauth.Identity { + v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) + return v +} + +type signRequestMiddleware struct { +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + signer := rscheme.Scheme.Signer() + if signer == nil { + return out, metadata, fmt.Errorf("no signer") + } + + if err := signer.SignRequest(ctx, req, identity, rscheme.SignerProperties); err != nil { + return out, metadata, fmt.Errorf("sign request: %w", err) + } + + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/deserializers.go index 6a1851da..8bba205f 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/deserializers.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/deserializers.go @@ -86,9 +86,9 @@ func awsRestjson1_deserializeOpErrorGetRoleCredentials(response *smithyhttp.Resp errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -97,7 +97,7 @@ func awsRestjson1_deserializeOpErrorGetRoleCredentials(response *smithyhttp.Resp body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -109,8 +109,8 @@ func awsRestjson1_deserializeOpErrorGetRoleCredentials(response *smithyhttp.Resp } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -242,9 +242,9 @@ func awsRestjson1_deserializeOpErrorListAccountRoles(response *smithyhttp.Respon errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -253,7 +253,7 @@ func awsRestjson1_deserializeOpErrorListAccountRoles(response *smithyhttp.Respon body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -265,8 +265,8 @@ func awsRestjson1_deserializeOpErrorListAccountRoles(response *smithyhttp.Respon } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -407,9 +407,9 @@ func awsRestjson1_deserializeOpErrorListAccounts(response *smithyhttp.Response, errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -418,7 +418,7 @@ func awsRestjson1_deserializeOpErrorListAccounts(response *smithyhttp.Response, body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -430,8 +430,8 @@ func awsRestjson1_deserializeOpErrorListAccounts(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message @@ -550,9 +550,9 @@ func awsRestjson1_deserializeOpErrorLogout(response *smithyhttp.Response, metada errorCode := "UnknownError" errorMessage := errorCode - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte @@ -561,7 +561,7 @@ func awsRestjson1_deserializeOpErrorLogout(response *smithyhttp.Response, metada body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -573,8 +573,8 @@ func awsRestjson1_deserializeOpErrorLogout(response *smithyhttp.Response, metada } errorBody.Seek(0, io.SeekStart) - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/doc.go index c5d03d8e..59456d5d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/doc.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/doc.go @@ -3,18 +3,19 @@ // Package sso provides the API client, operations, and parameter types for AWS // Single Sign-On. // -// AWS Single Sign-On Portal is a web service that makes it easy for you to assign -// user access to AWS SSO resources such as the user portal. Users can get AWS -// account applications and roles assigned to them and get federated into the -// application. For general information about AWS SSO, see What is AWS Single -// Sign-On? -// (https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html) in the -// AWS SSO User Guide. This API reference guide describes the AWS SSO Portal -// operations that you can call programatically and includes detailed information -// on data types and errors. AWS provides SDKs that consist of libraries and sample -// code for various programming languages and platforms, such as Java, Ruby, .Net, -// iOS, or Android. The SDKs provide a convenient way to create programmatic access -// to AWS SSO and other AWS services. For more information about the AWS SDKs, -// including how to download and install them, see Tools for Amazon Web Services -// (http://aws.amazon.com/tools/). +// AWS IAM Identity Center (successor to AWS Single Sign-On) Portal is a web +// service that makes it easy for you to assign user access to IAM Identity Center +// resources such as the AWS access portal. Users can get AWS account applications +// and roles assigned to them and get federated into the application. Although AWS +// Single Sign-On was renamed, the sso and identitystore API namespaces will +// continue to retain their original name for backward compatibility purposes. For +// more information, see IAM Identity Center rename (https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html#renamed) +// . This reference guide describes the IAM Identity Center Portal operations that +// you can call programatically and includes detailed information on data types and +// errors. AWS provides SDKs that consist of libraries and sample code for various +// programming languages and platforms, such as Java, Ruby, .Net, iOS, or Android. +// The SDKs provide a convenient way to create programmatic access to IAM Identity +// Center and other AWS services. For more information about the AWS SDKs, +// including how to download and install them, see Tools for Amazon Web Services (http://aws.amazon.com/tools/) +// . package sso diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go index 761a3a79..d31380cf 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go @@ -8,10 +8,19 @@ 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" + "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" internalendpoints "github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints" + smithyauth "github.com/aws/smithy-go/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" "net/url" + "os" + "strings" ) // EndpointResolverOptions is the service endpoint resolver options @@ -38,13 +47,6 @@ func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointRe return fn(region, options) } -func resolveDefaultEndpointConfiguration(o *Options) { - if o.EndpointResolver != nil { - return - } - o.EndpointResolver = NewDefaultEndpointResolver() -} - // EndpointResolverFromURL returns an EndpointResolver configured using the // provided endpoint url. By default, the resolved endpoint resolver uses the // client region as signing region, and the endpoint source is set to @@ -78,6 +80,10 @@ func (*ResolveEndpoint) ID() string { func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -87,9 +93,17 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") } + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + var endpoint aws.Endpoint - endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), m.Options) + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) if err != nil { + nf := (&aws.EndpointNotFoundError{}) + if errors.As(err, &nf) { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) + return next.HandleSerialize(ctx, in) + } return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) } @@ -124,37 +138,391 @@ func removeResolveEndpointMiddleware(stack *middleware.Stack) error { } type wrappedEndpointResolver struct { - awsResolver aws.EndpointResolver - resolver EndpointResolver + awsResolver aws.EndpointResolverWithOptions } func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { - if w.awsResolver == nil { - goto fallback + return w.awsResolver.ResolveEndpoint(ServiceID, region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, +// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked +// via its middleware. +// +// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) } - endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region) - if err == nil { - return endpoint, nil + + return &wrappedEndpointResolver{ + awsResolver: resolver, } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() - if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { - return endpoint, err + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } } -fallback: - if w.resolver == nil { - return endpoint, fmt.Errorf("default endpoint resolver provided was nil") +} + +func resolveEndpointResolverV2(options *Options) { + if options.EndpointResolverV2 == nil { + options.EndpointResolverV2 = NewDefaultEndpointResolverV2() } - return w.resolver.ResolveEndpoint(region, options) } -// withEndpointResolver returns an EndpointResolver that first delegates endpoint -// resolution to the awsResolver. If awsResolver returns aws.EndpointNotFoundError -// error, the resolver will use the the provided fallbackResolver for resolution. -// awsResolver and fallbackResolver must not be nil -func withEndpointResolver(awsResolver aws.EndpointResolver, fallbackResolver EndpointResolver) EndpointResolver { - return &wrappedEndpointResolver{ - awsResolver: awsResolver, - resolver: fallbackResolver, +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 + } +} + +// EndpointParameters provides the parameters that influence how endpoints are +// resolved. +type EndpointParameters struct { + // The AWS region used to dispatch the request. + // + // Parameter is + // required. + // + // AWS::Region + Region *string + + // When true, use the dual-stack endpoint. If the configured endpoint does not + // support dual-stack, dispatching the request MAY return an error. + // + // Defaults to + // false if no value is provided. + // + // AWS::UseDualStack + UseDualStack *bool + + // When true, send this request to the FIPS-compliant regional endpoint. If the + // configured endpoint does not have a FIPS compliant endpoint, dispatching the + // request will return an error. + // + // Defaults to false if no value is + // provided. + // + // AWS::UseFIPS + UseFIPS *bool + + // Override the endpoint used to send this request + // + // Parameter is + // required. + // + // SDK::Endpoint + Endpoint *string +} + +// ValidateRequired validates required parameters are set. +func (p EndpointParameters) ValidateRequired() error { + if p.UseDualStack == nil { + return fmt.Errorf("parameter UseDualStack is required") + } + + if p.UseFIPS == nil { + return fmt.Errorf("parameter UseFIPS is required") + } + + return nil +} + +// WithDefaults returns a shallow copy of EndpointParameterswith default values +// applied to members where applicable. +func (p EndpointParameters) WithDefaults() EndpointParameters { + if p.UseDualStack == nil { + p.UseDualStack = ptr.Bool(false) } + + if p.UseFIPS == nil { + p.UseFIPS = ptr.Bool(false) + } + return p +} + +// EndpointResolverV2 provides the interface for resolving service endpoints. +type EndpointResolverV2 interface { + // ResolveEndpoint attempts to resolve the endpoint with the provided options, + // returning the endpoint if found. Otherwise an error is returned. + ResolveEndpoint(ctx context.Context, params EndpointParameters) ( + smithyendpoints.Endpoint, error, + ) +} + +// resolver provides the implementation for resolving endpoints. +type resolver struct{} + +func NewDefaultEndpointResolverV2() EndpointResolverV2 { + return &resolver{} +} + +// ResolveEndpoint attempts to resolve the endpoint with the provided options, +// returning the endpoint if found. Otherwise an error is returned. +func (r *resolver) ResolveEndpoint( + ctx context.Context, params EndpointParameters, +) ( + endpoint smithyendpoints.Endpoint, err error, +) { + params = params.WithDefaults() + if err = params.ValidateRequired(); err != nil { + return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) + } + _UseDualStack := *params.UseDualStack + _UseFIPS := *params.UseFIPS + + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if _UseFIPS == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") + } + if _UseDualStack == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") + } + uriString := _Endpoint + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if exprVal := params.Region; exprVal != nil { + _Region := *exprVal + _ = _Region + if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { + _PartitionResult := *exprVal + _ = _PartitionResult + if _UseFIPS == true { + if _UseDualStack == true { + if true == _PartitionResult.SupportsFIPS { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://portal.sso-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") + } + } + if _UseFIPS == true { + if true == _PartitionResult.SupportsFIPS { + if "aws-us-gov" == _PartitionResult.Name { + uriString := func() string { + var out strings.Builder + out.WriteString("https://portal.sso.") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://portal.sso-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") + } + if _UseDualStack == true { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://portal.sso.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://portal.sso.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") +} + +type endpointParamsBinder interface { + bindEndpointParams(*EndpointParameters) +} + +func bindEndpointParams(input interface{}, options Options) *EndpointParameters { + params := &EndpointParameters{} + + params.Region = aws.String(endpoints.MapFIPSRegion(options.Region)) + params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) + params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) + params.Endpoint = options.BaseEndpoint + + if b, ok := input.(endpointParamsBinder); ok { + b.bindEndpointParams(params) + } + + return params +} + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.options.EndpointResolverV2 == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := bindEndpointParams(getOperationInput(ctx), m.options) + endpt, err := m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + if endpt.URI.RawPath == "" && req.URL.RawPath != "" { + endpt.URI.RawPath = endpt.URI.Path + } + req.URL.Scheme = endpt.URI.Scheme + req.URL.Host = endpt.URI.Host + req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) + req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) + for k := range endpt.Headers { + req.Header.Set(k, endpt.Headers.Get(k)) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) + for _, o := range opts { + rscheme.SignerProperties.SetAll(&o.SignerProperties) + } + + return next.HandleFinalize(ctx, in) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/generated.json new file mode 100644 index 00000000..53060bcc --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/generated.json @@ -0,0 +1,35 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", + "github.com/aws/smithy-go": "v1.4.0", + "github.com/google/go-cmp": "v0.5.4" + }, + "files": [ + "api_client.go", + "api_client_test.go", + "api_op_GetRoleCredentials.go", + "api_op_ListAccountRoles.go", + "api_op_ListAccounts.go", + "api_op_Logout.go", + "auth.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "endpoints_config_test.go", + "endpoints_test.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "options.go", + "protocol_test.go", + "serializers.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/sso", + "unstable": false +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go new file mode 100644 index 00000000..857a6af7 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package sso + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "1.18.7" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go index 697414b8..c8f7c09e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go @@ -4,13 +4,62 @@ package endpoints import ( "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/internal/endpoints" + endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" + "github.com/aws/smithy-go/logging" "regexp" ) // Options is the endpoint resolver configuration options type Options struct { + // Logger is a logging implementation that log events should be sent to. + Logger logging.Logger + + // LogDeprecated indicates that deprecated endpoints should be logged to the + // provided logger. + LogDeprecated bool + + // ResolvedRegion is used to override the region to be resolved, rather then the + // using the value passed to the ResolveEndpoint method. This value is used by the + // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative + // name. You must not set this value directly in your application. + ResolvedRegion string + + // DisableHTTPS informs the resolver to return an endpoint that does not use the + // HTTPS scheme. DisableHTTPS bool + + // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. + UseDualStackEndpoint aws.DualStackEndpointState + + // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. + UseFIPSEndpoint aws.FIPSEndpointState +} + +func (o Options) GetResolvedRegion() string { + return o.ResolvedRegion +} + +func (o Options) GetDisableHTTPS() bool { + return o.DisableHTTPS +} + +func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { + return o.UseDualStackEndpoint +} + +func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { + return o.UseFIPSEndpoint +} + +func transformToSharedOptions(options Options) endpoints.Options { + return endpoints.Options{ + Logger: options.Logger, + LogDeprecated: options.LogDeprecated, + ResolvedRegion: options.ResolvedRegion, + DisableHTTPS: options.DisableHTTPS, + UseDualStackEndpoint: options.UseDualStackEndpoint, + UseFIPSEndpoint: options.UseFIPSEndpoint, + } } // Resolver SSO endpoint resolver @@ -24,9 +73,7 @@ func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws return endpoint, &aws.MissingRegionError{} } - opt := endpoints.Options{ - DisableHTTPS: options.DisableHTTPS, - } + opt := transformToSharedOptions(options) return r.partitions.ResolveEndpoint(region, opt) } @@ -37,66 +84,256 @@ func New() *Resolver { } } +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsIsoE *regexp.Regexp + AwsIsoF *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), + AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + var defaultPartitions = endpoints.Partitions{ { ID: "aws", - Defaults: endpoints.Endpoint{ - Hostname: "portal.sso.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "portal.sso.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "portal.sso-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "portal.sso-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "portal.sso.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, }, - RegionRegex: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), + RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ - "ap-southeast-1": endpoints.Endpoint{ + endpoints.EndpointKey{ + Region: "af-south-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.af-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "af-south-1", + }, + }, + endpoints.EndpointKey{ + Region: "ap-east-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.ap-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "ap-northeast-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.ap-northeast-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-northeast-1", + }, + }, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + }: endpoints.Endpoint{ + Hostname: "portal.sso.ap-northeast-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-northeast-2", + }, + }, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + }: endpoints.Endpoint{ + Hostname: "portal.sso.ap-northeast-3.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-northeast-3", + }, + }, + endpoints.EndpointKey{ + Region: "ap-south-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.ap-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-south-1", + }, + }, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + }: endpoints.Endpoint{ Hostname: "portal.sso.ap-southeast-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "ap-southeast-1", }, }, - "ap-southeast-2": endpoints.Endpoint{ + endpoints.EndpointKey{ + Region: "ap-southeast-2", + }: endpoints.Endpoint{ Hostname: "portal.sso.ap-southeast-2.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "ap-southeast-2", }, }, - "ca-central-1": endpoints.Endpoint{ + endpoints.EndpointKey{ + Region: "ap-southeast-3", + }: endpoints.Endpoint{ + Hostname: "portal.sso.ap-southeast-3.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-3", + }, + }, + endpoints.EndpointKey{ + Region: "ca-central-1", + }: endpoints.Endpoint{ Hostname: "portal.sso.ca-central-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "ca-central-1", }, }, - "eu-central-1": endpoints.Endpoint{ + endpoints.EndpointKey{ + Region: "eu-central-1", + }: endpoints.Endpoint{ Hostname: "portal.sso.eu-central-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "eu-central-1", }, }, - "eu-west-1": endpoints.Endpoint{ + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{ + Hostname: "portal.sso.eu-central-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-central-2", + }, + }, + endpoints.EndpointKey{ + Region: "eu-north-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.eu-north-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-north-1", + }, + }, + endpoints.EndpointKey{ + Region: "eu-south-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.eu-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-south-1", + }, + }, + endpoints.EndpointKey{ + Region: "eu-west-1", + }: endpoints.Endpoint{ Hostname: "portal.sso.eu-west-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "eu-west-1", }, }, - "eu-west-2": endpoints.Endpoint{ + endpoints.EndpointKey{ + Region: "eu-west-2", + }: endpoints.Endpoint{ Hostname: "portal.sso.eu-west-2.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "eu-west-2", }, }, - "us-east-1": endpoints.Endpoint{ + endpoints.EndpointKey{ + Region: "eu-west-3", + }: endpoints.Endpoint{ + Hostname: "portal.sso.eu-west-3.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-west-3", + }, + }, + endpoints.EndpointKey{ + Region: "il-central-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.il-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "il-central-1", + }, + }, + endpoints.EndpointKey{ + Region: "me-central-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.me-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "me-central-1", + }, + }, + endpoints.EndpointKey{ + Region: "me-south-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.me-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "me-south-1", + }, + }, + endpoints.EndpointKey{ + Region: "sa-east-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.sa-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "sa-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "us-east-1", + }: endpoints.Endpoint{ Hostname: "portal.sso.us-east-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-east-1", }, }, - "us-east-2": endpoints.Endpoint{ + endpoints.EndpointKey{ + Region: "us-east-2", + }: endpoints.Endpoint{ Hostname: "portal.sso.us-east-2.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-east-2", }, }, - "us-west-2": endpoints.Endpoint{ + endpoints.EndpointKey{ + Region: "us-west-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.us-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-1", + }, + }, + endpoints.EndpointKey{ + Region: "us-west-2", + }: endpoints.Endpoint{ Hostname: "portal.sso.us-west-2.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-west-2", @@ -106,42 +343,192 @@ var defaultPartitions = endpoints.Partitions{ }, { ID: "aws-cn", - Defaults: endpoints.Endpoint{ - Hostname: "portal.sso.{region}.amazonaws.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "portal.sso.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "portal.sso-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "portal.sso-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "portal.sso.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, }, - RegionRegex: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + RegionRegex: partitionRegexp.AwsCn, IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "cn-north-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.cn-north-1.amazonaws.com.cn", + CredentialScope: endpoints.CredentialScope{ + Region: "cn-north-1", + }, + }, + endpoints.EndpointKey{ + Region: "cn-northwest-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.cn-northwest-1.amazonaws.com.cn", + CredentialScope: endpoints.CredentialScope{ + Region: "cn-northwest-1", + }, + }, + }, }, { ID: "aws-iso", - Defaults: endpoints.Endpoint{ - Hostname: "portal.sso.{region}.c2s.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "portal.sso-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "portal.sso.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, }, - RegionRegex: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + RegionRegex: partitionRegexp.AwsIso, IsRegionalized: true, }, { ID: "aws-iso-b", - Defaults: endpoints.Endpoint{ - Hostname: "portal.sso.{region}.sc2s.sgov.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "portal.sso-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "portal.sso.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-iso-e", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "portal.sso-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "portal.sso.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoE, + IsRegionalized: true, + }, + { + ID: "aws-iso-f", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "portal.sso-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "portal.sso.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, }, - RegionRegex: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + RegionRegex: partitionRegexp.AwsIsoF, IsRegionalized: true, }, { ID: "aws-us-gov", - Defaults: endpoints.Endpoint{ - Hostname: "portal.sso.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "portal.sso.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "portal.sso-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "portal.sso-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "portal.sso.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, }, - RegionRegex: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), + RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-gov-east-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.us-gov-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.us-gov-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-west-1", + }, + }, + }, }, } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/options.go new file mode 100644 index 00000000..5dee7e53 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/options.go @@ -0,0 +1,217 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sso + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" +) + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // The optional application specific identifier appended to the User-Agent header. + AppID string + + // This endpoint will be given as input to an EndpointResolverV2. It is used for + // providing a custom base endpoint that is subject to modifications by the + // processing EndpointResolverV2. + BaseEndpoint *string + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + // + // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a + // value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. To migrate an EndpointResolver implementation that uses a custom + // endpoint, set the client option BaseEndpoint instead. + EndpointResolver EndpointResolver + + // Resolves the endpoint used for a particular service operation. This should be + // used over the deprecated EndpointResolver. + EndpointResolverV2 EndpointResolverV2 + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. If specified in an operation call's + // functional options with a value that is different than the constructed client's + // Options, the Client's Retryer will be wrapped to use the operation's specific + // RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. Currently does not support per operation call + // overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. Currently does not support per operation call + // overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient + + // The auth scheme resolver which determines how to authenticate for each + // operation. + AuthSchemeResolver AuthSchemeResolver + + // The list of auth schemes supported by the client. + AuthSchemes []smithyhttp.AuthScheme +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} + +func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { + if schemeID == "aws.auth#sigv4" { + return getSigV4IdentityResolver(o) + } + if schemeID == "smithy.api#noAuth" { + return &smithyauth.AnonymousIdentityResolver{} + } + return nil +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for +// this field will likely prevent you from using any endpoint-related service +// features released after the introduction of EndpointResolverV2 and BaseEndpoint. +// To migrate an EndpointResolver implementation that uses a custom endpoint, set +// the client option BaseEndpoint instead. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +// WithEndpointResolverV2 returns a functional option for setting the Client's +// EndpointResolverV2 option. +func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { + return func(o *Options) { + o.EndpointResolverV2 = v + } +} + +func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { + if o.Credentials != nil { + return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} + } + return nil +} + +// WithSigV4SigningName applies an override to the authentication workflow to +// use the given signing name for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing name from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningName(name string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), + middleware.Before, + ) + }) + } +} + +// WithSigV4SigningRegion applies an override to the authentication workflow to +// use the given signing region for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing region from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningRegion(region string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), + middleware.Before, + ) + }) + } +} + +func ignoreAnonymousAuth(options *Options) { + if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { + options.Credentials = nil + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/serializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/serializers.go index ea20305b..02e31411 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/serializers.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/serializers.go @@ -33,15 +33,17 @@ func (m *awsRestjson1_serializeOpGetRoleCredentials) HandleSerialize(ctx context } opPath, opQuery := httpbinding.SplitURI("/federation/credentials") - request.URL.Path = opPath - if len(request.URL.RawQuery) > 0 { - request.URL.RawQuery = "&" + opQuery + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { - request.URL.RawQuery = opQuery + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } - request.Method = "GET" - restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -100,15 +102,17 @@ func (m *awsRestjson1_serializeOpListAccountRoles) HandleSerialize(ctx context.C } opPath, opQuery := httpbinding.SplitURI("/assignment/roles") - request.URL.Path = opPath - if len(request.URL.RawQuery) > 0 { - request.URL.RawQuery = "&" + opQuery + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { - request.URL.RawQuery = opQuery + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } - request.Method = "GET" - restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -171,15 +175,17 @@ func (m *awsRestjson1_serializeOpListAccounts) HandleSerialize(ctx context.Conte } opPath, opQuery := httpbinding.SplitURI("/assignment/accounts") - request.URL.Path = opPath - if len(request.URL.RawQuery) > 0 { - request.URL.RawQuery = "&" + opQuery + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { - request.URL.RawQuery = opQuery + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } - request.Method = "GET" - restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -238,15 +244,17 @@ func (m *awsRestjson1_serializeOpLogout) HandleSerialize(ctx context.Context, in } opPath, opQuery := httpbinding.SplitURI("/logout") - request.URL.Path = opPath - if len(request.URL.RawQuery) > 0 { - request.URL.RawQuery = "&" + opQuery + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { - request.URL.RawQuery = opQuery + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } - request.Method = "POST" - restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/errors.go index 26b8d1b4..e97a126e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/errors.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/errors.go @@ -11,6 +11,10 @@ import ( // required parameter might be missing or out of range. type InvalidRequestException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidRequestException) Error() string { @@ -22,12 +26,21 @@ func (e *InvalidRequestException) ErrorMessage() string { } return *e.Message } -func (e *InvalidRequestException) ErrorCode() string { return "InvalidRequestException" } +func (e *InvalidRequestException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidRequestException" + } + return *e.ErrorCodeOverride +} func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The specified resource doesn't exist. type ResourceNotFoundException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *ResourceNotFoundException) Error() string { @@ -39,13 +52,22 @@ func (e *ResourceNotFoundException) ErrorMessage() string { } return *e.Message } -func (e *ResourceNotFoundException) ErrorCode() string { return "ResourceNotFoundException" } +func (e *ResourceNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceNotFoundException" + } + return *e.ErrorCodeOverride +} func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Indicates that the request is being made too frequently and is more than what // the server can handle. type TooManyRequestsException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *TooManyRequestsException) Error() string { @@ -57,13 +79,22 @@ func (e *TooManyRequestsException) ErrorMessage() string { } return *e.Message } -func (e *TooManyRequestsException) ErrorCode() string { return "TooManyRequestsException" } +func (e *TooManyRequestsException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "TooManyRequestsException" + } + return *e.ErrorCodeOverride +} func (e *TooManyRequestsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Indicates that the request is not authorized. This can happen due to an invalid // access token in the request. type UnauthorizedException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *UnauthorizedException) Error() string { @@ -75,5 +106,10 @@ func (e *UnauthorizedException) ErrorMessage() string { } return *e.Message } -func (e *UnauthorizedException) ErrorCode() string { return "UnauthorizedException" } +func (e *UnauthorizedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "UnauthorizedException" + } + return *e.ErrorCodeOverride +} func (e *UnauthorizedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/types.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/types.go index 8d43acf4..8dc02296 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/types.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/types.go @@ -2,6 +2,10 @@ package types +import ( + smithydocument "github.com/aws/smithy-go/document" +) + // Provides information about your AWS account. type AccountInfo struct { @@ -13,6 +17,8 @@ type AccountInfo struct { // The email address of the AWS account that is assigned to the user. EmailAddress *string + + noSmithyDocumentSerde } // Provides information about the role credentials that are assigned to the user. @@ -20,8 +26,7 @@ type RoleCredentials struct { // The identifier used for the temporary security credentials. For more // information, see Using Temporary Security Credentials to Request Access to AWS - // Resources - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html) + // Resources (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html) // in the AWS IAM User Guide. AccessKeyId *string @@ -29,16 +34,16 @@ type RoleCredentials struct { Expiration int64 // The key that is used to sign the request. For more information, see Using - // Temporary Security Credentials to Request Access to AWS Resources - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html) + // Temporary Security Credentials to Request Access to AWS Resources (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html) // in the AWS IAM User Guide. SecretAccessKey *string // The token used for temporary credentials. For more information, see Using - // Temporary Security Credentials to Request Access to AWS Resources - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html) + // Temporary Security Credentials to Request Access to AWS Resources (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html) // in the AWS IAM User Guide. SessionToken *string + + noSmithyDocumentSerde } // Provides information about the role that is assigned to the user. @@ -49,4 +54,8 @@ type RoleInfo struct { // The friendly name of the role that is assigned to the user. RoleName *string + + noSmithyDocumentSerde } + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md new file mode 100644 index 00000000..f77c4785 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md @@ -0,0 +1,372 @@ +# v1.21.7 (2024-01-16) + +* No change notes available for this release. + +# v1.21.6 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.5 (2023-12-08) + +* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. + +# v1.21.4 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.3 (2023-12-06) + +* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. + +# v1.21.2 (2023-12-01) + +* **Bug Fix**: Correct wrapping of errors in authentication workflow. +* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.1 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.0 (2023-11-29) + +* **Feature**: Expose Options() accessor on service clients. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.3 (2023-11-28.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.2 (2023-11-28) + +* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction. + +# v1.20.1 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.0 (2023-11-17) + +* **Feature**: Adding support for `sso-oauth:CreateTokenWithIAM`. + +# v1.19.2 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# 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 + +# v1.17.2 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.1 (2023-09-22) + +* No change notes available for this release. + +# v1.17.0 (2023-09-20) + +* **Feature**: Update FIPS endpoints in aws-us-gov. + +# v1.16.0 (2023-09-18) + +* **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* **Feature**: Adds several endpoint ruleset changes across all models: smaller rulesets, removed non-unique regional endpoints, fixes FIPS and DualStack endpoints, and make region not required in SDK::Endpoint. Additional breakfix to cognito-sync field. + +# v1.15.6 (2023-09-05) + +* No change notes available for this release. + +# v1.15.5 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.4 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.3 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.2 (2023-08-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.1 (2023-08-01) + +* No change notes available for this release. + +# v1.15.0 (2023-07-31) + +* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.14 (2023-07-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.13 (2023-07-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.12 (2023-06-15) + +* No change notes available for this release. + +# v1.14.11 (2023-06-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.10 (2023-05-04) + +* No change notes available for this release. + +# v1.14.9 (2023-04-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.8 (2023-04-10) + +* No change notes available for this release. + +# v1.14.7 (2023-04-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.6 (2023-03-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.5 (2023-03-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.4 (2023-02-22) + +* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes. + +# v1.14.3 (2023-02-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.2 (2023-02-15) + +* **Announcement**: When receiving an error response in restJson-based services, an incorrect error type may have been returned based on the content of the response. This has been fixed via PR #2012 tracked in issue #1910. +* **Bug Fix**: Correct error type parsing for restJson services. + +# v1.14.1 (2023-02-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.0 (2023-01-05) + +* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401). + +# v1.13.11 (2022-12-19) + +* No change notes available for this release. + +# v1.13.10 (2022-12-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.9 (2022-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.8 (2022-10-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.7 (2022-10-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.6 (2022-09-30) + +* **Documentation**: Documentation updates for the IAM Identity Center OIDC CLI Reference. + +# v1.13.5 (2022-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.4 (2022-09-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.3 (2022-09-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.2 (2022-08-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.1 (2022-08-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.0 (2022-08-25) + +* **Feature**: Updated required request parameters on IAM Identity Center's OIDC CreateToken action. + +# v1.12.14 (2022-08-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.13 (2022-08-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.12 (2022-08-08) + +* **Documentation**: Documentation updates to reflect service rename - AWS IAM Identity Center (successor to AWS Single Sign-On) +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.11 (2022-08-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.10 (2022-07-11) + +* No change notes available for this release. + +# v1.12.9 (2022-07-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.8 (2022-06-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.7 (2022-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.6 (2022-05-27) + +* No change notes available for this release. + +# v1.12.5 (2022-05-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.4 (2022-04-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.3 (2022-03-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.2 (2022-03-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.1 (2022-03-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.0 (2022-03-08) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.0 (2022-02-24) + +* **Feature**: API client updated +* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.0 (2022-01-14) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.0 (2022-01-07) + +* **Feature**: API client updated +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.2 (2021-12-02) + +* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514)) +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.1 (2021-11-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.0 (2021-11-06) + +* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.7.0 (2021-10-21) + +* **Feature**: Updated to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.0 (2021-10-11) + +* **Feature**: API client updated +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.0 (2021-09-17) + +* **Feature**: Updated API client and endpoints to latest revision. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.0 (2021-08-27) + +* **Feature**: Updated API model to latest revision. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.3 (2021-08-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.2 (2021-08-04) + +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.1 (2021-07-15) + +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.0 (2021-06-25) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.1 (2021-05-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.0 (2021-05-14) + +* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. +* **Dependency Update**: Updated to the latest SDK module versions + diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/LICENSE.txt new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go new file mode 100644 index 00000000..fed08973 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go @@ -0,0 +1,475 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssooidc + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + smithy "github.com/aws/smithy-go" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "time" +) + +const ServiceID = "SSO OIDC" +const ServiceAPIVersion = "2019-06-10" + +// Client provides the API client to make operations call for AWS SSO OIDC. +type Client struct { + options Options +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + setResolvedDefaultsMode(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveEndpointResolverV2(&options) + + resolveAuthSchemeResolver(&options) + + for _, fn := range optFns { + fn(&options) + } + + finalizeRetryMaxAttempts(&options) + + ignoreAnonymousAuth(&options) + + wrapWithAnonymousAuth(&options) + + resolveAuthSchemes(&options) + + client := &Client{ + options: options, + } + + return client +} + +// Options returns a copy of the client configuration. +// +// Callers SHOULD NOT perform mutations on any inner structures within client +// config. Config overrides should instead be made on a per-operation basis through +// functional options. +func (c *Client) Options() Options { + return c.options.Copy() +} + +func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { + ctx = middleware.ClearStackValues(ctx) + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + + for _, fn := range optFns { + fn(&options) + } + + finalizeOperationRetryMaxAttempts(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) + result, metadata, err = handler.Handle(ctx, params) + if err != nil { + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + return result, metadata, err +} + +type operationInputKey struct{} + +func setOperationInput(ctx context.Context, input interface{}) context.Context { + return middleware.WithStackValue(ctx, operationInputKey{}, input) +} + +func getOperationInput(ctx context.Context) interface{} { + return middleware.GetStackValue(ctx, operationInputKey{}) +} + +type setOperationInputMiddleware struct { +} + +func (*setOperationInputMiddleware) ID() string { + return "setOperationInput" +} + +func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + ctx = setOperationInput(ctx, in.Parameters) + return next.HandleSerialize(ctx, in) +} + +func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %w", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %v", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %v", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{}, "ResolveEndpointV2", middleware.After); err != nil { + return fmt.Errorf("add Signing: %w", err) + } + return nil +} +func resolveAuthSchemeResolver(options *Options) { + if options.AuthSchemeResolver == nil { + options.AuthSchemeResolver = &defaultAuthSchemeResolver{} + } +} + +func resolveAuthSchemes(options *Options) { + if options.AuthSchemes == nil { + options.AuthSchemes = []smithyhttp.AuthScheme{ + internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ + Signer: options.HTTPSignerV4, + Logger: options.Logger, + LogSigning: options.ClientLogMode.IsSigning(), + }), + } + } +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +type legacyEndpointContextSetter struct { + LegacyResolver EndpointResolver +} + +func (*legacyEndpointContextSetter) ID() string { + return "legacyEndpointContextSetter" +} + +func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.LegacyResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) + } + + return next.HandleInitialize(ctx, in) + +} +func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { + return stack.Initialize.Add(&legacyEndpointContextSetter{ + LegacyResolver: o.EndpointResolver, + }, middleware.Before) +} + +func resolveDefaultLogger(o *Options) { + if o.Logger != nil { + return + } + o.Logger = logging.Nop{} +} + +func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { + return middleware.AddSetLoggerMiddleware(stack, o.Logger) +} + +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + AppID: cfg.AppID, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + + if o.HTTPClient != nil { + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) + } + + o.HTTPClient = buildable +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttempts(o *Options) { + if o.RetryMaxAttempts == 0 { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func finalizeOperationRetryMaxAttempts(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) +} + +func addClientUserAgent(stack *middleware.Stack, options Options) error { + if err := awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "ssooidc", goModuleVersion)(stack); err != nil { + return err + } + + if len(options.AppID) > 0 { + return awsmiddleware.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID)(stack) + } + + return nil +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func addRetryMiddlewares(stack *middleware.Stack, o Options) error { + mo := retry.AddRetryMiddlewaresOptions{ + Retryer: o.Retryer, + LogRetryAttempts: o.ClientLogMode.IsRetries(), + } + return retry.AddRetryMiddlewares(stack, mo) +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return awshttp.AddResponseErrorMiddleware(stack) +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} + +type disableHTTPSMiddleware struct { + DisableHTTPS bool +} + +func (*disableHTTPSMiddleware) ID() string { + return "disableHTTPS" +} + +func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { + req.URL.Scheme = "http" + } + + return next.HandleFinalize(ctx, in) +} + +func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { + return stack.Finalize.Insert(&disableHTTPSMiddleware{ + DisableHTTPS: o.EndpointOptions.DisableHTTPS, + }, "ResolveEndpointV2", middleware.After) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateToken.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateToken.go new file mode 100644 index 00000000..42464294 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateToken.go @@ -0,0 +1,203 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssooidc + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates and returns access and refresh tokens for clients that are +// authenticated using client secrets. The access token can be used to fetch +// short-term credentials for the assigned AWS accounts or to access application +// APIs using bearer authentication. +func (c *Client) CreateToken(ctx context.Context, params *CreateTokenInput, optFns ...func(*Options)) (*CreateTokenOutput, error) { + if params == nil { + params = &CreateTokenInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateToken", params, optFns, c.addOperationCreateTokenMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateTokenOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateTokenInput struct { + + // The unique identifier string for the client or application. This value comes + // from the result of the RegisterClient API. + // + // This member is required. + ClientId *string + + // A secret string generated for the client. This value should come from the + // persisted result of the RegisterClient API. + // + // This member is required. + ClientSecret *string + + // Supports the following OAuth grant types: Device Code and Refresh Token. + // Specify either of the following values, depending on the grant type that you + // want: * Device Code - urn:ietf:params:oauth:grant-type:device_code * Refresh + // Token - refresh_token For information about how to obtain the device code, see + // the StartDeviceAuthorization topic. + // + // This member is required. + GrantType *string + + // Used only when calling this API for the Authorization Code grant type. The + // short-term code is used to identify this authorization request. This grant type + // is currently unsupported for the CreateToken API. + Code *string + + // Used only when calling this API for the Device Code grant type. This short-term + // code is used to identify this authorization request. This comes from the result + // of the StartDeviceAuthorization API. + DeviceCode *string + + // Used only when calling this API for the Authorization Code grant type. This + // value specifies the location of the client or application that has registered to + // receive the authorization code. + RedirectUri *string + + // Used only when calling this API for the Refresh Token grant type. This token is + // used to refresh short-term tokens, such as the access token, that might expire. + // For more information about the features and limitations of the current IAM + // Identity Center OIDC implementation, see Considerations for Using this Guide in + // the IAM Identity Center OIDC API Reference (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html) + // . + RefreshToken *string + + // The list of scopes for which authorization is requested. The access token that + // is issued is limited to the scopes that are granted. If this value is not + // specified, IAM Identity Center authorizes all scopes that are configured for the + // client during the call to RegisterClient . + Scope []string + + noSmithyDocumentSerde +} + +type CreateTokenOutput struct { + + // A bearer token to access AWS accounts and applications assigned to a user. + AccessToken *string + + // Indicates the time in seconds when an access token will expire. + ExpiresIn int32 + + // The idToken is not implemented or supported. For more information about the + // features and limitations of the current IAM Identity Center OIDC implementation, + // see Considerations for Using this Guide in the IAM Identity Center OIDC API + // Reference (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html) + // . A JSON Web Token (JWT) that identifies who is associated with the issued + // access token. + IdToken *string + + // A token that, if present, can be used to refresh a previously issued access + // token that might have expired. For more information about the features and + // limitations of the current IAM Identity Center OIDC implementation, see + // Considerations for Using this Guide in the IAM Identity Center OIDC API + // Reference (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html) + // . + RefreshToken *string + + // Used to notify the client that the returned token is an access token. The + // supported token type is Bearer . + TokenType *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateTokenMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateToken{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateToken{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateToken"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpCreateTokenValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateToken(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateToken(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateToken", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateTokenWithIAM.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateTokenWithIAM.go new file mode 100644 index 00000000..ed4b98f7 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateTokenWithIAM.go @@ -0,0 +1,230 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssooidc + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates and returns access and refresh tokens for clients and applications that +// are authenticated using IAM entities. The access token can be used to fetch +// short-term credentials for the assigned AWS accounts or to access application +// APIs using bearer authentication. +func (c *Client) CreateTokenWithIAM(ctx context.Context, params *CreateTokenWithIAMInput, optFns ...func(*Options)) (*CreateTokenWithIAMOutput, error) { + if params == nil { + params = &CreateTokenWithIAMInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateTokenWithIAM", params, optFns, c.addOperationCreateTokenWithIAMMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateTokenWithIAMOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateTokenWithIAMInput struct { + + // The unique identifier string for the client or application. This value is an + // application ARN that has OAuth grants configured. + // + // This member is required. + ClientId *string + + // Supports the following OAuth grant types: Authorization Code, Refresh Token, + // JWT Bearer, and Token Exchange. Specify one of the following values, depending + // on the grant type that you want: * Authorization Code - authorization_code * + // Refresh Token - refresh_token * JWT Bearer - + // urn:ietf:params:oauth:grant-type:jwt-bearer * Token Exchange - + // urn:ietf:params:oauth:grant-type:token-exchange + // + // This member is required. + GrantType *string + + // Used only when calling this API for the JWT Bearer grant type. This value + // specifies the JSON Web Token (JWT) issued by a trusted token issuer. To + // authorize a trusted token issuer, configure the JWT Bearer GrantOptions for the + // application. + Assertion *string + + // Used only when calling this API for the Authorization Code grant type. This + // short-term code is used to identify this authorization request. The code is + // obtained through a redirect from IAM Identity Center to a redirect URI persisted + // in the Authorization Code GrantOptions for the application. + Code *string + + // Used only when calling this API for the Authorization Code grant type. This + // value specifies the location of the client or application that has registered to + // receive the authorization code. + RedirectUri *string + + // Used only when calling this API for the Refresh Token grant type. This token is + // used to refresh short-term tokens, such as the access token, that might expire. + // For more information about the features and limitations of the current IAM + // Identity Center OIDC implementation, see Considerations for Using this Guide in + // the IAM Identity Center OIDC API Reference (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html) + // . + RefreshToken *string + + // Used only when calling this API for the Token Exchange grant type. This value + // specifies the type of token that the requester can receive. The following values + // are supported: * Access Token - urn:ietf:params:oauth:token-type:access_token * + // Refresh Token - urn:ietf:params:oauth:token-type:refresh_token + RequestedTokenType *string + + // The list of scopes for which authorization is requested. The access token that + // is issued is limited to the scopes that are granted. If the value is not + // specified, IAM Identity Center authorizes all scopes configured for the + // application, including the following default scopes: openid , aws , + // sts:identity_context . + Scope []string + + // Used only when calling this API for the Token Exchange grant type. This value + // specifies the subject of the exchange. The value of the subject token must be an + // access token issued by IAM Identity Center to a different client or application. + // The access token must have authorized scopes that indicate the requested + // application as a target audience. + SubjectToken *string + + // Used only when calling this API for the Token Exchange grant type. This value + // specifies the type of token that is passed as the subject of the exchange. The + // following value is supported: * Access Token - + // urn:ietf:params:oauth:token-type:access_token + SubjectTokenType *string + + noSmithyDocumentSerde +} + +type CreateTokenWithIAMOutput struct { + + // A bearer token to access AWS accounts and applications assigned to a user. + AccessToken *string + + // Indicates the time in seconds when an access token will expire. + ExpiresIn int32 + + // A JSON Web Token (JWT) that identifies the user associated with the issued + // access token. + IdToken *string + + // Indicates the type of tokens that are issued by IAM Identity Center. The + // following values are supported: * Access Token - + // urn:ietf:params:oauth:token-type:access_token * Refresh Token - + // urn:ietf:params:oauth:token-type:refresh_token + IssuedTokenType *string + + // A token that, if present, can be used to refresh a previously issued access + // token that might have expired. For more information about the features and + // limitations of the current IAM Identity Center OIDC implementation, see + // Considerations for Using this Guide in the IAM Identity Center OIDC API + // Reference (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html) + // . + RefreshToken *string + + // The list of scopes for which authorization is granted. The access token that is + // issued is limited to the scopes that are granted. + Scope []string + + // Used to notify the requester that the returned token is an access token. The + // supported token type is Bearer . + TokenType *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateTokenWithIAMMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateTokenWithIAM{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateTokenWithIAM{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateTokenWithIAM"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpCreateTokenWithIAMValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTokenWithIAM(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateTokenWithIAM(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateTokenWithIAM", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_RegisterClient.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_RegisterClient.go new file mode 100644 index 00000000..7aee9049 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_RegisterClient.go @@ -0,0 +1,161 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssooidc + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Registers a client with IAM Identity Center. This allows clients to initiate +// device authorization. The output should be persisted for reuse through many +// authentication requests. +func (c *Client) RegisterClient(ctx context.Context, params *RegisterClientInput, optFns ...func(*Options)) (*RegisterClientOutput, error) { + if params == nil { + params = &RegisterClientInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RegisterClient", params, optFns, c.addOperationRegisterClientMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RegisterClientOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RegisterClientInput struct { + + // The friendly name of the client. + // + // This member is required. + ClientName *string + + // The type of client. The service supports only public as a client type. Anything + // other than public will be rejected by the service. + // + // This member is required. + ClientType *string + + // The list of scopes that are defined by the client. Upon authorization, this + // list is used to restrict permissions when granting an access token. + Scopes []string + + noSmithyDocumentSerde +} + +type RegisterClientOutput struct { + + // An endpoint that the client can use to request authorization. + AuthorizationEndpoint *string + + // The unique identifier string for each client. This client uses this identifier + // to get authenticated by the service in subsequent calls. + ClientId *string + + // Indicates the time at which the clientId and clientSecret were issued. + ClientIdIssuedAt int64 + + // A secret string generated for the client. The client will use this string to + // get authenticated by the service in subsequent calls. + ClientSecret *string + + // Indicates the time at which the clientId and clientSecret will become invalid. + ClientSecretExpiresAt int64 + + // An endpoint that the client can use to create tokens. + TokenEndpoint *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRegisterClientMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpRegisterClient{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRegisterClient{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RegisterClient"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpRegisterClientValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterClient(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRegisterClient(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RegisterClient", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_StartDeviceAuthorization.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_StartDeviceAuthorization.go new file mode 100644 index 00000000..d30349e6 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_StartDeviceAuthorization.go @@ -0,0 +1,169 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssooidc + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Initiates device authorization by requesting a pair of verification codes from +// the authorization service. +func (c *Client) StartDeviceAuthorization(ctx context.Context, params *StartDeviceAuthorizationInput, optFns ...func(*Options)) (*StartDeviceAuthorizationOutput, error) { + if params == nil { + params = &StartDeviceAuthorizationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartDeviceAuthorization", params, optFns, c.addOperationStartDeviceAuthorizationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartDeviceAuthorizationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartDeviceAuthorizationInput struct { + + // The unique identifier string for the client that is registered with IAM + // Identity Center. This value should come from the persisted result of the + // RegisterClient API operation. + // + // This member is required. + ClientId *string + + // A secret string that is generated for the client. This value should come from + // the persisted result of the RegisterClient API operation. + // + // This member is required. + ClientSecret *string + + // The URL for the Amazon Web Services access portal. For more information, see + // Using the Amazon Web Services access portal (https://docs.aws.amazon.com/singlesignon/latest/userguide/using-the-portal.html) + // in the IAM Identity Center User Guide. + // + // This member is required. + StartUrl *string + + noSmithyDocumentSerde +} + +type StartDeviceAuthorizationOutput struct { + + // The short-lived code that is used by the device when polling for a session + // token. + DeviceCode *string + + // Indicates the number of seconds in which the verification code will become + // invalid. + ExpiresIn int32 + + // Indicates the number of seconds the client must wait between attempts when + // polling for a session. + Interval int32 + + // A one-time user verification code. This is needed to authorize an in-use device. + UserCode *string + + // The URI of the verification page that takes the userCode to authorize the + // device. + VerificationUri *string + + // An alternate URL that the client can use to automatically launch a browser. + // This process skips the manual step in which the user visits the verification + // page and enters their code. + VerificationUriComplete *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartDeviceAuthorizationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpStartDeviceAuthorization{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartDeviceAuthorization{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StartDeviceAuthorization"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addOpStartDeviceAuthorizationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartDeviceAuthorization(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStartDeviceAuthorization(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StartDeviceAuthorization", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/auth.go new file mode 100644 index 00000000..40b3becb --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/auth.go @@ -0,0 +1,302 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssooidc + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func bindAuthParamsRegion(params *AuthResolverParameters, _ interface{}, options Options) { + params.Region = options.Region +} + +type setLegacyContextSigningOptionsMiddleware struct { +} + +func (*setLegacyContextSigningOptionsMiddleware) ID() string { + return "setLegacyContextSigningOptions" +} + +func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + schemeID := rscheme.Scheme.SchemeID() + + if sn := awsmiddleware.GetSigningName(ctx); sn != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) + } + } + + if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) + } + } + + return next.HandleFinalize(ctx, in) +} + +func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) +} + +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + +// AuthResolverParameters contains the set of inputs necessary for auth scheme +// resolution. +type AuthResolverParameters struct { + // The name of the operation being invoked. + Operation string + + // The region in which the operation is being invoked. + Region string +} + +func bindAuthResolverParams(operation string, input interface{}, options Options) *AuthResolverParameters { + params := &AuthResolverParameters{ + Operation: operation, + } + + bindAuthParamsRegion(params, input, options) + + return params +} + +// AuthSchemeResolver returns a set of possible authentication options for an +// operation. +type AuthSchemeResolver interface { + ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) +} + +type defaultAuthSchemeResolver struct{} + +var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) + +func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + if overrides, ok := operationAuthOptions[params.Operation]; ok { + return overrides(params), nil + } + return serviceAuthOptions(params), nil +} + +var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{ + "CreateToken": func(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + {SchemeID: smithyauth.SchemeIDAnonymous}, + } + }, + + "RegisterClient": func(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + {SchemeID: smithyauth.SchemeIDAnonymous}, + } + }, + + "StartDeviceAuthorization": func(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + {SchemeID: smithyauth.SchemeIDAnonymous}, + } + }, +} + +func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + { + SchemeID: smithyauth.SchemeIDSigV4, + SignerProperties: func() smithy.Properties { + var props smithy.Properties + smithyhttp.SetSigV4SigningName(&props, "sso-oauth") + smithyhttp.SetSigV4SigningRegion(&props, params.Region) + return props + }(), + }, + } +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + params := bindAuthResolverParams(m.operation, getOperationInput(ctx), m.options) + options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) + } + + scheme, ok := m.selectScheme(options) + if !ok { + return out, metadata, fmt.Errorf("could not select an auth scheme") + } + + ctx = setResolvedAuthScheme(ctx, scheme) + return next.HandleFinalize(ctx, in) +} + +func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { + for _, option := range options { + if option.SchemeID == smithyauth.SchemeIDAnonymous { + return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true + } + + for _, scheme := range m.options.AuthSchemes { + if scheme.SchemeID() != option.SchemeID { + continue + } + + if scheme.IdentityResolver(m.options) != nil { + return newResolvedAuthScheme(scheme, option), true + } + } + } + + return nil, false +} + +type resolvedAuthSchemeKey struct{} + +type resolvedAuthScheme struct { + Scheme smithyhttp.AuthScheme + IdentityProperties smithy.Properties + SignerProperties smithy.Properties +} + +func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { + return &resolvedAuthScheme{ + Scheme: scheme, + IdentityProperties: option.IdentityProperties, + SignerProperties: option.SignerProperties, + } +} + +func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { + return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) +} + +func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { + v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) + return v +} + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + resolver := rscheme.Scheme.IdentityResolver(m.options) + if resolver == nil { + return out, metadata, fmt.Errorf("no identity resolver") + } + + identity, err := resolver.GetIdentity(ctx, rscheme.IdentityProperties) + if err != nil { + return out, metadata, fmt.Errorf("get identity: %w", err) + } + + ctx = setIdentity(ctx, identity) + return next.HandleFinalize(ctx, in) +} + +type identityKey struct{} + +func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { + return middleware.WithStackValue(ctx, identityKey{}, identity) +} + +func getIdentity(ctx context.Context) smithyauth.Identity { + v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) + return v +} + +type signRequestMiddleware struct { +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + signer := rscheme.Scheme.Signer() + if signer == nil { + return out, metadata, fmt.Errorf("no signer") + } + + if err := signer.SignRequest(ctx, req, identity, rscheme.SignerProperties); err != nil { + return out, metadata, fmt.Errorf("sign request: %w", err) + } + + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go new file mode 100644 index 00000000..76a1160e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go @@ -0,0 +1,2066 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssooidc + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/ssooidc/types" + smithy "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "strings" +) + +type awsRestjson1_deserializeOpCreateToken struct { +} + +func (*awsRestjson1_deserializeOpCreateToken) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateToken) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateToken(response, &metadata) + } + output := &CreateTokenOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentCreateTokenOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateToken(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("AuthorizationPendingException", errorCode): + return awsRestjson1_deserializeErrorAuthorizationPendingException(response, errorBody) + + case strings.EqualFold("ExpiredTokenException", errorCode): + return awsRestjson1_deserializeErrorExpiredTokenException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidClientException", errorCode): + return awsRestjson1_deserializeErrorInvalidClientException(response, errorBody) + + case strings.EqualFold("InvalidGrantException", errorCode): + return awsRestjson1_deserializeErrorInvalidGrantException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("InvalidScopeException", errorCode): + return awsRestjson1_deserializeErrorInvalidScopeException(response, errorBody) + + case strings.EqualFold("SlowDownException", errorCode): + return awsRestjson1_deserializeErrorSlowDownException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + case strings.EqualFold("UnsupportedGrantTypeException", errorCode): + return awsRestjson1_deserializeErrorUnsupportedGrantTypeException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateTokenOutput(v **CreateTokenOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateTokenOutput + if *v == nil { + sv = &CreateTokenOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accessToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccessToken to be of type string, got %T instead", value) + } + sv.AccessToken = ptr.String(jtv) + } + + case "expiresIn": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ExpirationInSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ExpiresIn = int32(i64) + } + + case "idToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IdToken to be of type string, got %T instead", value) + } + sv.IdToken = ptr.String(jtv) + } + + case "refreshToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RefreshToken to be of type string, got %T instead", value) + } + sv.RefreshToken = ptr.String(jtv) + } + + case "tokenType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TokenType to be of type string, got %T instead", value) + } + sv.TokenType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateTokenWithIAM struct { +} + +func (*awsRestjson1_deserializeOpCreateTokenWithIAM) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateTokenWithIAM) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateTokenWithIAM(response, &metadata) + } + output := &CreateTokenWithIAMOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentCreateTokenWithIAMOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateTokenWithIAM(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("AuthorizationPendingException", errorCode): + return awsRestjson1_deserializeErrorAuthorizationPendingException(response, errorBody) + + case strings.EqualFold("ExpiredTokenException", errorCode): + return awsRestjson1_deserializeErrorExpiredTokenException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidClientException", errorCode): + return awsRestjson1_deserializeErrorInvalidClientException(response, errorBody) + + case strings.EqualFold("InvalidGrantException", errorCode): + return awsRestjson1_deserializeErrorInvalidGrantException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("InvalidRequestRegionException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestRegionException(response, errorBody) + + case strings.EqualFold("InvalidScopeException", errorCode): + return awsRestjson1_deserializeErrorInvalidScopeException(response, errorBody) + + case strings.EqualFold("SlowDownException", errorCode): + return awsRestjson1_deserializeErrorSlowDownException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + case strings.EqualFold("UnsupportedGrantTypeException", errorCode): + return awsRestjson1_deserializeErrorUnsupportedGrantTypeException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateTokenWithIAMOutput(v **CreateTokenWithIAMOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateTokenWithIAMOutput + if *v == nil { + sv = &CreateTokenWithIAMOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accessToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccessToken to be of type string, got %T instead", value) + } + sv.AccessToken = ptr.String(jtv) + } + + case "expiresIn": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ExpirationInSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ExpiresIn = int32(i64) + } + + case "idToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IdToken to be of type string, got %T instead", value) + } + sv.IdToken = ptr.String(jtv) + } + + case "issuedTokenType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TokenTypeURI to be of type string, got %T instead", value) + } + sv.IssuedTokenType = ptr.String(jtv) + } + + case "refreshToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RefreshToken to be of type string, got %T instead", value) + } + sv.RefreshToken = ptr.String(jtv) + } + + case "scope": + if err := awsRestjson1_deserializeDocumentScopes(&sv.Scope, value); err != nil { + return err + } + + case "tokenType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TokenType to be of type string, got %T instead", value) + } + sv.TokenType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpRegisterClient struct { +} + +func (*awsRestjson1_deserializeOpRegisterClient) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpRegisterClient) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorRegisterClient(response, &metadata) + } + output := &RegisterClientOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentRegisterClientOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorRegisterClient(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidClientMetadataException", errorCode): + return awsRestjson1_deserializeErrorInvalidClientMetadataException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("InvalidScopeException", errorCode): + return awsRestjson1_deserializeErrorInvalidScopeException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentRegisterClientOutput(v **RegisterClientOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *RegisterClientOutput + if *v == nil { + sv = &RegisterClientOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "authorizationEndpoint": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected URI to be of type string, got %T instead", value) + } + sv.AuthorizationEndpoint = ptr.String(jtv) + } + + case "clientId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClientId to be of type string, got %T instead", value) + } + sv.ClientId = ptr.String(jtv) + } + + case "clientIdIssuedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected LongTimeStampType to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ClientIdIssuedAt = i64 + } + + case "clientSecret": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClientSecret to be of type string, got %T instead", value) + } + sv.ClientSecret = ptr.String(jtv) + } + + case "clientSecretExpiresAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected LongTimeStampType to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ClientSecretExpiresAt = i64 + } + + case "tokenEndpoint": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected URI to be of type string, got %T instead", value) + } + sv.TokenEndpoint = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpStartDeviceAuthorization struct { +} + +func (*awsRestjson1_deserializeOpStartDeviceAuthorization) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpStartDeviceAuthorization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorStartDeviceAuthorization(response, &metadata) + } + output := &StartDeviceAuthorizationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentStartDeviceAuthorizationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorStartDeviceAuthorization(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidClientException", errorCode): + return awsRestjson1_deserializeErrorInvalidClientException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("SlowDownException", errorCode): + return awsRestjson1_deserializeErrorSlowDownException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentStartDeviceAuthorizationOutput(v **StartDeviceAuthorizationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *StartDeviceAuthorizationOutput + if *v == nil { + sv = &StartDeviceAuthorizationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "deviceCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeviceCode to be of type string, got %T instead", value) + } + sv.DeviceCode = ptr.String(jtv) + } + + case "expiresIn": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ExpirationInSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ExpiresIn = int32(i64) + } + + case "interval": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected IntervalInSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Interval = int32(i64) + } + + case "userCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UserCode to be of type string, got %T instead", value) + } + sv.UserCode = ptr.String(jtv) + } + + case "verificationUri": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected URI to be of type string, got %T instead", value) + } + sv.VerificationUri = ptr.String(jtv) + } + + case "verificationUriComplete": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected URI to be of type string, got %T instead", value) + } + sv.VerificationUriComplete = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AccessDeniedException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorAuthorizationPendingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AuthorizationPendingException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentAuthorizationPendingException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorExpiredTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ExpiredTokenException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentExpiredTokenException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InternalServerException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorInvalidClientException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidClientException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentInvalidClientException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorInvalidClientMetadataException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidClientMetadataException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentInvalidClientMetadataException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorInvalidGrantException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidGrantException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentInvalidGrantException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidRequestException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentInvalidRequestException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorInvalidRequestRegionException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidRequestRegionException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentInvalidRequestRegionException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorInvalidScopeException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidScopeException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentInvalidScopeException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorSlowDownException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.SlowDownException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentSlowDownException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorUnauthorizedClientException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.UnauthorizedClientException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentUnauthorizedClientException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorUnsupportedGrantTypeException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.UnsupportedGrantTypeException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentUnsupportedGrantTypeException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "error": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Error to be of type string, got %T instead", value) + } + sv.Error_ = ptr.String(jtv) + } + + case "error_description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) + } + sv.Error_description = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAuthorizationPendingException(v **types.AuthorizationPendingException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AuthorizationPendingException + if *v == nil { + sv = &types.AuthorizationPendingException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "error": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Error to be of type string, got %T instead", value) + } + sv.Error_ = ptr.String(jtv) + } + + case "error_description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) + } + sv.Error_description = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentExpiredTokenException(v **types.ExpiredTokenException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ExpiredTokenException + if *v == nil { + sv = &types.ExpiredTokenException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "error": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Error to be of type string, got %T instead", value) + } + sv.Error_ = ptr.String(jtv) + } + + case "error_description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) + } + sv.Error_description = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InternalServerException + if *v == nil { + sv = &types.InternalServerException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "error": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Error to be of type string, got %T instead", value) + } + sv.Error_ = ptr.String(jtv) + } + + case "error_description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) + } + sv.Error_description = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInvalidClientException(v **types.InvalidClientException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidClientException + if *v == nil { + sv = &types.InvalidClientException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "error": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Error to be of type string, got %T instead", value) + } + sv.Error_ = ptr.String(jtv) + } + + case "error_description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) + } + sv.Error_description = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInvalidClientMetadataException(v **types.InvalidClientMetadataException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidClientMetadataException + if *v == nil { + sv = &types.InvalidClientMetadataException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "error": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Error to be of type string, got %T instead", value) + } + sv.Error_ = ptr.String(jtv) + } + + case "error_description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) + } + sv.Error_description = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInvalidGrantException(v **types.InvalidGrantException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidGrantException + if *v == nil { + sv = &types.InvalidGrantException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "error": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Error to be of type string, got %T instead", value) + } + sv.Error_ = ptr.String(jtv) + } + + case "error_description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) + } + sv.Error_description = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidRequestException + if *v == nil { + sv = &types.InvalidRequestException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "error": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Error to be of type string, got %T instead", value) + } + sv.Error_ = ptr.String(jtv) + } + + case "error_description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) + } + sv.Error_description = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInvalidRequestRegionException(v **types.InvalidRequestRegionException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidRequestRegionException + if *v == nil { + sv = &types.InvalidRequestRegionException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "endpoint": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Location to be of type string, got %T instead", value) + } + sv.Endpoint = ptr.String(jtv) + } + + case "error": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Error to be of type string, got %T instead", value) + } + sv.Error_ = ptr.String(jtv) + } + + case "error_description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) + } + sv.Error_description = ptr.String(jtv) + } + + case "region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Region to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInvalidScopeException(v **types.InvalidScopeException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidScopeException + if *v == nil { + sv = &types.InvalidScopeException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "error": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Error to be of type string, got %T instead", value) + } + sv.Error_ = ptr.String(jtv) + } + + case "error_description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) + } + sv.Error_description = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentScopes(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Scope to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSlowDownException(v **types.SlowDownException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SlowDownException + if *v == nil { + sv = &types.SlowDownException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "error": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Error to be of type string, got %T instead", value) + } + sv.Error_ = ptr.String(jtv) + } + + case "error_description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) + } + sv.Error_description = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentUnauthorizedClientException(v **types.UnauthorizedClientException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.UnauthorizedClientException + if *v == nil { + sv = &types.UnauthorizedClientException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "error": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Error to be of type string, got %T instead", value) + } + sv.Error_ = ptr.String(jtv) + } + + case "error_description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) + } + sv.Error_description = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentUnsupportedGrantTypeException(v **types.UnsupportedGrantTypeException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.UnsupportedGrantTypeException + if *v == nil { + sv = &types.UnsupportedGrantTypeException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "error": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Error to be of type string, got %T instead", value) + } + sv.Error_ = ptr.String(jtv) + } + + case "error_description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) + } + sv.Error_description = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/doc.go new file mode 100644 index 00000000..53cd4f55 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/doc.go @@ -0,0 +1,38 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package ssooidc provides the API client, operations, and parameter types for +// AWS SSO OIDC. +// +// IAM Identity Center OpenID Connect (OIDC) is a web service that enables a +// client (such as CLI or a native application) to register with IAM Identity +// Center. The service also enables the client to fetch the user’s access token +// upon successful authentication and authorization with IAM Identity Center. IAM +// Identity Center uses the sso and identitystore API namespaces. Considerations +// for Using This Guide Before you begin using this guide, we recommend that you +// first review the following important information about how the IAM Identity +// Center OIDC service works. +// - The IAM Identity Center OIDC service currently implements only the portions +// of the OAuth 2.0 Device Authorization Grant standard ( +// https://tools.ietf.org/html/rfc8628 (https://tools.ietf.org/html/rfc8628) ) +// that are necessary to enable single sign-on authentication with the CLI. +// - With older versions of the CLI, the service only emits OIDC access tokens, +// so to obtain a new token, users must explicitly re-authenticate. To access the +// OIDC flow that supports token refresh and doesn’t require re-authentication, +// update to the latest CLI version (1.27.10 for CLI V1 and 2.9.0 for CLI V2) with +// support for OIDC token refresh and configurable IAM Identity Center session +// durations. For more information, see Configure Amazon Web Services access +// portal session duration (https://docs.aws.amazon.com/singlesignon/latest/userguide/configure-user-session.html) +// . +// - The access tokens provided by this service grant access to all Amazon Web +// Services account entitlements assigned to an IAM Identity Center user, not just +// a particular application. +// - The documentation in this guide does not describe the mechanism to convert +// the access token into Amazon Web Services Auth (“sigv4”) credentials for use +// with IAM-protected Amazon Web Services service endpoints. For more information, +// see GetRoleCredentials (https://docs.aws.amazon.com/singlesignon/latest/PortalAPIReference/API_GetRoleCredentials.html) +// in the IAM Identity Center Portal API Reference Guide. +// +// For general information about IAM Identity Center, see What is IAM Identity +// Center? (https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html) +// in the IAM Identity Center User Guide. +package ssooidc diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go new file mode 100644 index 00000000..85b87089 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go @@ -0,0 +1,528 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssooidc + +import ( + "context" + "errors" + "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" + "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints" + smithyauth "github.com/aws/smithy-go/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "net/url" + "os" + "strings" +) + +// EndpointResolverOptions is the service endpoint resolver options +type EndpointResolverOptions = internalendpoints.Options + +// EndpointResolver interface for resolving service endpoints. +type EndpointResolver interface { + ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) +} + +var _ EndpointResolver = &internalendpoints.Resolver{} + +// NewDefaultEndpointResolver constructs a new service endpoint resolver +func NewDefaultEndpointResolver() *internalendpoints.Resolver { + return internalendpoints.New() +} + +// EndpointResolverFunc is a helper utility that wraps a function so it satisfies +// the EndpointResolver interface. This is useful when you want to add additional +// endpoint resolving logic, or stub out specific endpoints with custom values. +type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) + +func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return fn(region, options) +} + +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + +type ResolveEndpoint struct { + Resolver EndpointResolver + Options EndpointResolverOptions +} + +func (*ResolveEndpoint) ID() string { + return "ResolveEndpoint" +} + +func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.Resolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) + if err != nil { + nf := (&aws.EndpointNotFoundError{}) + if errors.As(err, &nf) { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) + return next.HandleSerialize(ctx, in) + } + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL, err = url.Parse(endpoint.URL) + if err != nil { + return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) + } + + if len(awsmiddleware.GetSigningName(ctx)) == 0 { + signingName := endpoint.SigningName + if len(signingName) == 0 { + signingName = "sso-oauth" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) + ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) + return next.HandleSerialize(ctx, in) +} +func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&ResolveEndpoint{ + Resolver: o.EndpointResolver, + Options: o.EndpointOptions, + }, "OperationSerializer", middleware.Before) +} + +func removeResolveEndpointMiddleware(stack *middleware.Stack) error { + _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) + return err +} + +type wrappedEndpointResolver struct { + awsResolver aws.EndpointResolverWithOptions +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return w.awsResolver.ResolveEndpoint(ServiceID, region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, +// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked +// via its middleware. +// +// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } + } + +} + +func resolveEndpointResolverV2(options *Options) { + if options.EndpointResolverV2 == nil { + options.EndpointResolverV2 = NewDefaultEndpointResolverV2() + } +} + +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 + } +} + +// EndpointParameters provides the parameters that influence how endpoints are +// resolved. +type EndpointParameters struct { + // The AWS region used to dispatch the request. + // + // Parameter is + // required. + // + // AWS::Region + Region *string + + // When true, use the dual-stack endpoint. If the configured endpoint does not + // support dual-stack, dispatching the request MAY return an error. + // + // Defaults to + // false if no value is provided. + // + // AWS::UseDualStack + UseDualStack *bool + + // When true, send this request to the FIPS-compliant regional endpoint. If the + // configured endpoint does not have a FIPS compliant endpoint, dispatching the + // request will return an error. + // + // Defaults to false if no value is + // provided. + // + // AWS::UseFIPS + UseFIPS *bool + + // Override the endpoint used to send this request + // + // Parameter is + // required. + // + // SDK::Endpoint + Endpoint *string +} + +// ValidateRequired validates required parameters are set. +func (p EndpointParameters) ValidateRequired() error { + if p.UseDualStack == nil { + return fmt.Errorf("parameter UseDualStack is required") + } + + if p.UseFIPS == nil { + return fmt.Errorf("parameter UseFIPS is required") + } + + return nil +} + +// WithDefaults returns a shallow copy of EndpointParameterswith default values +// applied to members where applicable. +func (p EndpointParameters) WithDefaults() EndpointParameters { + if p.UseDualStack == nil { + p.UseDualStack = ptr.Bool(false) + } + + if p.UseFIPS == nil { + p.UseFIPS = ptr.Bool(false) + } + return p +} + +// EndpointResolverV2 provides the interface for resolving service endpoints. +type EndpointResolverV2 interface { + // ResolveEndpoint attempts to resolve the endpoint with the provided options, + // returning the endpoint if found. Otherwise an error is returned. + ResolveEndpoint(ctx context.Context, params EndpointParameters) ( + smithyendpoints.Endpoint, error, + ) +} + +// resolver provides the implementation for resolving endpoints. +type resolver struct{} + +func NewDefaultEndpointResolverV2() EndpointResolverV2 { + return &resolver{} +} + +// ResolveEndpoint attempts to resolve the endpoint with the provided options, +// returning the endpoint if found. Otherwise an error is returned. +func (r *resolver) ResolveEndpoint( + ctx context.Context, params EndpointParameters, +) ( + endpoint smithyendpoints.Endpoint, err error, +) { + params = params.WithDefaults() + if err = params.ValidateRequired(); err != nil { + return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) + } + _UseDualStack := *params.UseDualStack + _UseFIPS := *params.UseFIPS + + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if _UseFIPS == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") + } + if _UseDualStack == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") + } + uriString := _Endpoint + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if exprVal := params.Region; exprVal != nil { + _Region := *exprVal + _ = _Region + if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { + _PartitionResult := *exprVal + _ = _PartitionResult + if _UseFIPS == true { + if _UseDualStack == true { + if true == _PartitionResult.SupportsFIPS { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://oidc-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") + } + } + if _UseFIPS == true { + if _PartitionResult.SupportsFIPS == true { + if _PartitionResult.Name == "aws-us-gov" { + uriString := func() string { + var out strings.Builder + out.WriteString("https://oidc.") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://oidc-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") + } + if _UseDualStack == true { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://oidc.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://oidc.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") +} + +type endpointParamsBinder interface { + bindEndpointParams(*EndpointParameters) +} + +func bindEndpointParams(input interface{}, options Options) *EndpointParameters { + params := &EndpointParameters{} + + params.Region = aws.String(endpoints.MapFIPSRegion(options.Region)) + params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) + params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) + params.Endpoint = options.BaseEndpoint + + if b, ok := input.(endpointParamsBinder); ok { + b.bindEndpointParams(params) + } + + return params +} + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.options.EndpointResolverV2 == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := bindEndpointParams(getOperationInput(ctx), m.options) + endpt, err := m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + if endpt.URI.RawPath == "" && req.URL.RawPath != "" { + endpt.URI.RawPath = endpt.URI.Path + } + req.URL.Scheme = endpt.URI.Scheme + req.URL.Host = endpt.URI.Host + req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) + req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) + for k := range endpt.Headers { + req.Header.Set(k, endpt.Headers.Get(k)) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) + for _, o := range opts { + rscheme.SignerProperties.SetAll(&o.SignerProperties) + } + + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json new file mode 100644 index 00000000..0a6b3493 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json @@ -0,0 +1,35 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", + "github.com/aws/smithy-go": "v1.4.0", + "github.com/google/go-cmp": "v0.5.4" + }, + "files": [ + "api_client.go", + "api_client_test.go", + "api_op_CreateToken.go", + "api_op_CreateTokenWithIAM.go", + "api_op_RegisterClient.go", + "api_op_StartDeviceAuthorization.go", + "auth.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "endpoints_config_test.go", + "endpoints_test.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "options.go", + "protocol_test.go", + "serializers.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/ssooidc", + "unstable": false +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go new file mode 100644 index 00000000..474a574e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package ssooidc + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "1.21.7" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go new file mode 100644 index 00000000..cbd77fd2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go @@ -0,0 +1,534 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" + "github.com/aws/smithy-go/logging" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + // Logger is a logging implementation that log events should be sent to. + Logger logging.Logger + + // LogDeprecated indicates that deprecated endpoints should be logged to the + // provided logger. + LogDeprecated bool + + // ResolvedRegion is used to override the region to be resolved, rather then the + // using the value passed to the ResolveEndpoint method. This value is used by the + // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative + // name. You must not set this value directly in your application. + ResolvedRegion string + + // DisableHTTPS informs the resolver to return an endpoint that does not use the + // HTTPS scheme. + DisableHTTPS bool + + // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. + UseDualStackEndpoint aws.DualStackEndpointState + + // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. + UseFIPSEndpoint aws.FIPSEndpointState +} + +func (o Options) GetResolvedRegion() string { + return o.ResolvedRegion +} + +func (o Options) GetDisableHTTPS() bool { + return o.DisableHTTPS +} + +func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { + return o.UseDualStackEndpoint +} + +func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { + return o.UseFIPSEndpoint +} + +func transformToSharedOptions(options Options) endpoints.Options { + return endpoints.Options{ + Logger: options.Logger, + LogDeprecated: options.LogDeprecated, + ResolvedRegion: options.ResolvedRegion, + DisableHTTPS: options.DisableHTTPS, + UseDualStackEndpoint: options.UseDualStackEndpoint, + UseFIPSEndpoint: options.UseFIPSEndpoint, + } +} + +// Resolver SSO OIDC endpoint resolver +type Resolver struct { + partitions endpoints.Partitions +} + +// ResolveEndpoint resolves the service endpoint for the given region and options +func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { + if len(region) == 0 { + return endpoint, &aws.MissingRegionError{} + } + + opt := transformToSharedOptions(options) + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsIsoE *regexp.Regexp + AwsIsoF *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), + AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "oidc.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "oidc-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "oidc-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "oidc.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "af-south-1", + }: endpoints.Endpoint{ + Hostname: "oidc.af-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "af-south-1", + }, + }, + endpoints.EndpointKey{ + Region: "ap-east-1", + }: endpoints.Endpoint{ + Hostname: "oidc.ap-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "ap-northeast-1", + }: endpoints.Endpoint{ + Hostname: "oidc.ap-northeast-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-northeast-1", + }, + }, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + }: endpoints.Endpoint{ + Hostname: "oidc.ap-northeast-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-northeast-2", + }, + }, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + }: endpoints.Endpoint{ + Hostname: "oidc.ap-northeast-3.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-northeast-3", + }, + }, + endpoints.EndpointKey{ + Region: "ap-south-1", + }: endpoints.Endpoint{ + Hostname: "oidc.ap-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-south-1", + }, + }, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + }: endpoints.Endpoint{ + Hostname: "oidc.ap-southeast-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-1", + }, + }, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + }: endpoints.Endpoint{ + Hostname: "oidc.ap-southeast-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-2", + }, + }, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + }: endpoints.Endpoint{ + Hostname: "oidc.ap-southeast-3.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-3", + }, + }, + endpoints.EndpointKey{ + Region: "ca-central-1", + }: endpoints.Endpoint{ + Hostname: "oidc.ca-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ca-central-1", + }, + }, + endpoints.EndpointKey{ + Region: "eu-central-1", + }: endpoints.Endpoint{ + Hostname: "oidc.eu-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-central-1", + }, + }, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{ + Hostname: "oidc.eu-central-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-central-2", + }, + }, + endpoints.EndpointKey{ + Region: "eu-north-1", + }: endpoints.Endpoint{ + Hostname: "oidc.eu-north-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-north-1", + }, + }, + endpoints.EndpointKey{ + Region: "eu-south-1", + }: endpoints.Endpoint{ + Hostname: "oidc.eu-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-south-1", + }, + }, + endpoints.EndpointKey{ + Region: "eu-west-1", + }: endpoints.Endpoint{ + Hostname: "oidc.eu-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-west-1", + }, + }, + endpoints.EndpointKey{ + Region: "eu-west-2", + }: endpoints.Endpoint{ + Hostname: "oidc.eu-west-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-west-2", + }, + }, + endpoints.EndpointKey{ + Region: "eu-west-3", + }: endpoints.Endpoint{ + Hostname: "oidc.eu-west-3.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-west-3", + }, + }, + endpoints.EndpointKey{ + Region: "il-central-1", + }: endpoints.Endpoint{ + Hostname: "oidc.il-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "il-central-1", + }, + }, + endpoints.EndpointKey{ + Region: "me-central-1", + }: endpoints.Endpoint{ + Hostname: "oidc.me-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "me-central-1", + }, + }, + endpoints.EndpointKey{ + Region: "me-south-1", + }: endpoints.Endpoint{ + Hostname: "oidc.me-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "me-south-1", + }, + }, + endpoints.EndpointKey{ + Region: "sa-east-1", + }: endpoints.Endpoint{ + Hostname: "oidc.sa-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "sa-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "us-east-1", + }: endpoints.Endpoint{ + Hostname: "oidc.us-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "us-east-2", + }: endpoints.Endpoint{ + Hostname: "oidc.us-east-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-2", + }, + }, + endpoints.EndpointKey{ + Region: "us-west-1", + }: endpoints.Endpoint{ + Hostname: "oidc.us-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-1", + }, + }, + endpoints.EndpointKey{ + Region: "us-west-2", + }: endpoints.Endpoint{ + Hostname: "oidc.us-west-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-2", + }, + }, + }, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "oidc.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "oidc-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "oidc-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "oidc.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "cn-north-1", + }: endpoints.Endpoint{ + Hostname: "oidc.cn-north-1.amazonaws.com.cn", + CredentialScope: endpoints.CredentialScope{ + Region: "cn-north-1", + }, + }, + endpoints.EndpointKey{ + Region: "cn-northwest-1", + }: endpoints.Endpoint{ + Hostname: "oidc.cn-northwest-1.amazonaws.com.cn", + CredentialScope: endpoints.CredentialScope{ + Region: "cn-northwest-1", + }, + }, + }, + }, + { + ID: "aws-iso", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "oidc-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "oidc.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIso, + IsRegionalized: true, + }, + { + ID: "aws-iso-b", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "oidc-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "oidc.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-iso-e", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "oidc-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "oidc.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoE, + IsRegionalized: true, + }, + { + ID: "aws-iso-f", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "oidc-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "oidc.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoF, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "oidc.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "oidc-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "oidc-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "oidc.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-gov-east-1", + }: endpoints.Endpoint{ + Hostname: "oidc.us-gov-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + }: endpoints.Endpoint{ + Hostname: "oidc.us-gov-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/options.go new file mode 100644 index 00000000..b964e7e1 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/options.go @@ -0,0 +1,217 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssooidc + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" +) + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // The optional application specific identifier appended to the User-Agent header. + AppID string + + // This endpoint will be given as input to an EndpointResolverV2. It is used for + // providing a custom base endpoint that is subject to modifications by the + // processing EndpointResolverV2. + BaseEndpoint *string + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + // + // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a + // value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. To migrate an EndpointResolver implementation that uses a custom + // endpoint, set the client option BaseEndpoint instead. + EndpointResolver EndpointResolver + + // Resolves the endpoint used for a particular service operation. This should be + // used over the deprecated EndpointResolver. + EndpointResolverV2 EndpointResolverV2 + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. If specified in an operation call's + // functional options with a value that is different than the constructed client's + // Options, the Client's Retryer will be wrapped to use the operation's specific + // RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. Currently does not support per operation call + // overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. Currently does not support per operation call + // overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient + + // The auth scheme resolver which determines how to authenticate for each + // operation. + AuthSchemeResolver AuthSchemeResolver + + // The list of auth schemes supported by the client. + AuthSchemes []smithyhttp.AuthScheme +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} + +func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { + if schemeID == "aws.auth#sigv4" { + return getSigV4IdentityResolver(o) + } + if schemeID == "smithy.api#noAuth" { + return &smithyauth.AnonymousIdentityResolver{} + } + return nil +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for +// this field will likely prevent you from using any endpoint-related service +// features released after the introduction of EndpointResolverV2 and BaseEndpoint. +// To migrate an EndpointResolver implementation that uses a custom endpoint, set +// the client option BaseEndpoint instead. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +// WithEndpointResolverV2 returns a functional option for setting the Client's +// EndpointResolverV2 option. +func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { + return func(o *Options) { + o.EndpointResolverV2 = v + } +} + +func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { + if o.Credentials != nil { + return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} + } + return nil +} + +// WithSigV4SigningName applies an override to the authentication workflow to +// use the given signing name for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing name from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningName(name string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), + middleware.Before, + ) + }) + } +} + +// WithSigV4SigningRegion applies an override to the authentication workflow to +// use the given signing region for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing region from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningRegion(region string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), + middleware.Before, + ) + }) + } +} + +func ignoreAnonymousAuth(options *Options) { + if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { + options.Credentials = nil + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/serializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/serializers.go new file mode 100644 index 00000000..754218b7 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/serializers.go @@ -0,0 +1,431 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssooidc + +import ( + "bytes" + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +type awsRestjson1_serializeOpCreateToken struct { +} + +func (*awsRestjson1_serializeOpCreateToken) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateToken) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateTokenInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/token") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateTokenInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateTokenInput(v *CreateTokenInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateTokenInput(v *CreateTokenInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientId != nil { + ok := object.Key("clientId") + ok.String(*v.ClientId) + } + + if v.ClientSecret != nil { + ok := object.Key("clientSecret") + ok.String(*v.ClientSecret) + } + + if v.Code != nil { + ok := object.Key("code") + ok.String(*v.Code) + } + + if v.DeviceCode != nil { + ok := object.Key("deviceCode") + ok.String(*v.DeviceCode) + } + + if v.GrantType != nil { + ok := object.Key("grantType") + ok.String(*v.GrantType) + } + + if v.RedirectUri != nil { + ok := object.Key("redirectUri") + ok.String(*v.RedirectUri) + } + + if v.RefreshToken != nil { + ok := object.Key("refreshToken") + ok.String(*v.RefreshToken) + } + + if v.Scope != nil { + ok := object.Key("scope") + if err := awsRestjson1_serializeDocumentScopes(v.Scope, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateTokenWithIAM struct { +} + +func (*awsRestjson1_serializeOpCreateTokenWithIAM) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateTokenWithIAM) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateTokenWithIAMInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/token?aws_iam=t") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateTokenWithIAMInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateTokenWithIAMInput(v *CreateTokenWithIAMInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateTokenWithIAMInput(v *CreateTokenWithIAMInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Assertion != nil { + ok := object.Key("assertion") + ok.String(*v.Assertion) + } + + if v.ClientId != nil { + ok := object.Key("clientId") + ok.String(*v.ClientId) + } + + if v.Code != nil { + ok := object.Key("code") + ok.String(*v.Code) + } + + if v.GrantType != nil { + ok := object.Key("grantType") + ok.String(*v.GrantType) + } + + if v.RedirectUri != nil { + ok := object.Key("redirectUri") + ok.String(*v.RedirectUri) + } + + if v.RefreshToken != nil { + ok := object.Key("refreshToken") + ok.String(*v.RefreshToken) + } + + if v.RequestedTokenType != nil { + ok := object.Key("requestedTokenType") + ok.String(*v.RequestedTokenType) + } + + if v.Scope != nil { + ok := object.Key("scope") + if err := awsRestjson1_serializeDocumentScopes(v.Scope, ok); err != nil { + return err + } + } + + if v.SubjectToken != nil { + ok := object.Key("subjectToken") + ok.String(*v.SubjectToken) + } + + if v.SubjectTokenType != nil { + ok := object.Key("subjectTokenType") + ok.String(*v.SubjectTokenType) + } + + return nil +} + +type awsRestjson1_serializeOpRegisterClient struct { +} + +func (*awsRestjson1_serializeOpRegisterClient) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpRegisterClient) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RegisterClientInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/client/register") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentRegisterClientInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsRegisterClientInput(v *RegisterClientInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentRegisterClientInput(v *RegisterClientInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientName != nil { + ok := object.Key("clientName") + ok.String(*v.ClientName) + } + + if v.ClientType != nil { + ok := object.Key("clientType") + ok.String(*v.ClientType) + } + + if v.Scopes != nil { + ok := object.Key("scopes") + if err := awsRestjson1_serializeDocumentScopes(v.Scopes, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpStartDeviceAuthorization struct { +} + +func (*awsRestjson1_serializeOpStartDeviceAuthorization) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStartDeviceAuthorization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StartDeviceAuthorizationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/device_authorization") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentStartDeviceAuthorizationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsStartDeviceAuthorizationInput(v *StartDeviceAuthorizationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentStartDeviceAuthorizationInput(v *StartDeviceAuthorizationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientId != nil { + ok := object.Key("clientId") + ok.String(*v.ClientId) + } + + if v.ClientSecret != nil { + ok := object.Key("clientSecret") + ok.String(*v.ClientSecret) + } + + if v.StartUrl != nil { + ok := object.Key("startUrl") + ok.String(*v.StartUrl) + } + + return nil +} + +func awsRestjson1_serializeDocumentScopes(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/errors.go new file mode 100644 index 00000000..86b62049 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/errors.go @@ -0,0 +1,398 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// You do not have sufficient access to perform this action. +type AccessDeniedException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *string + Error_description *string + + noSmithyDocumentSerde +} + +func (e *AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AccessDeniedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AccessDeniedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AccessDeniedException" + } + return *e.ErrorCodeOverride +} +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that a request to authorize a client with an access user session +// token is pending. +type AuthorizationPendingException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *string + Error_description *string + + noSmithyDocumentSerde +} + +func (e *AuthorizationPendingException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AuthorizationPendingException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AuthorizationPendingException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AuthorizationPendingException" + } + return *e.ErrorCodeOverride +} +func (e *AuthorizationPendingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that the token issued by the service is expired and is no longer +// valid. +type ExpiredTokenException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *string + Error_description *string + + noSmithyDocumentSerde +} + +func (e *ExpiredTokenException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ExpiredTokenException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ExpiredTokenException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ExpiredTokenException" + } + return *e.ErrorCodeOverride +} +func (e *ExpiredTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that an error from the service occurred while trying to process a +// request. +type InternalServerException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *string + Error_description *string + + noSmithyDocumentSerde +} + +func (e *InternalServerException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InternalServerException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InternalServerException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InternalServerException" + } + return *e.ErrorCodeOverride +} +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// Indicates that the clientId or clientSecret in the request is invalid. For +// example, this can occur when a client sends an incorrect clientId or an expired +// clientSecret . +type InvalidClientException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *string + Error_description *string + + noSmithyDocumentSerde +} + +func (e *InvalidClientException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidClientException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidClientException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidClientException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidClientException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that the client information sent in the request during registration +// is invalid. +type InvalidClientMetadataException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *string + Error_description *string + + noSmithyDocumentSerde +} + +func (e *InvalidClientMetadataException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidClientMetadataException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidClientMetadataException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidClientMetadataException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidClientMetadataException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that a request contains an invalid grant. This can occur if a client +// makes a CreateToken request with an invalid grant type. +type InvalidGrantException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *string + Error_description *string + + noSmithyDocumentSerde +} + +func (e *InvalidGrantException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidGrantException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidGrantException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidGrantException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidGrantException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that something is wrong with the input to the request. For example, a +// required parameter might be missing or out of range. +type InvalidRequestException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *string + Error_description *string + + noSmithyDocumentSerde +} + +func (e *InvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidRequestException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidRequestException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidRequestException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that a token provided as input to the request was issued by and is +// only usable by calling IAM Identity Center endpoints in another region. +type InvalidRequestRegionException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *string + Error_description *string + Endpoint *string + Region *string + + noSmithyDocumentSerde +} + +func (e *InvalidRequestRegionException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidRequestRegionException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidRequestRegionException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidRequestRegionException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidRequestRegionException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that the scope provided in the request is invalid. +type InvalidScopeException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *string + Error_description *string + + noSmithyDocumentSerde +} + +func (e *InvalidScopeException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidScopeException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidScopeException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidScopeException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidScopeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that the client is making the request too frequently and is more than +// the service can handle. +type SlowDownException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *string + Error_description *string + + noSmithyDocumentSerde +} + +func (e *SlowDownException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *SlowDownException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *SlowDownException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "SlowDownException" + } + return *e.ErrorCodeOverride +} +func (e *SlowDownException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that the client is not currently authorized to make the request. This +// can happen when a clientId is not issued for a public client. +type UnauthorizedClientException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *string + Error_description *string + + noSmithyDocumentSerde +} + +func (e *UnauthorizedClientException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *UnauthorizedClientException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *UnauthorizedClientException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "UnauthorizedClientException" + } + return *e.ErrorCodeOverride +} +func (e *UnauthorizedClientException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that the grant type in the request is not supported by the service. +type UnsupportedGrantTypeException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *string + Error_description *string + + noSmithyDocumentSerde +} + +func (e *UnsupportedGrantTypeException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *UnsupportedGrantTypeException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *UnsupportedGrantTypeException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "UnsupportedGrantTypeException" + } + return *e.ErrorCodeOverride +} +func (e *UnsupportedGrantTypeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/types.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/types.go new file mode 100644 index 00000000..0ec0789f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/types.go @@ -0,0 +1,9 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" +) + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/validators.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/validators.go new file mode 100644 index 00000000..9c17e4c8 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/validators.go @@ -0,0 +1,184 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssooidc + +import ( + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpCreateToken struct { +} + +func (*validateOpCreateToken) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateToken) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateTokenInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateTokenInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateTokenWithIAM struct { +} + +func (*validateOpCreateTokenWithIAM) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateTokenWithIAM) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateTokenWithIAMInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateTokenWithIAMInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRegisterClient struct { +} + +func (*validateOpRegisterClient) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRegisterClient) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RegisterClientInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRegisterClientInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpStartDeviceAuthorization struct { +} + +func (*validateOpStartDeviceAuthorization) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartDeviceAuthorization) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartDeviceAuthorizationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartDeviceAuthorizationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpCreateTokenValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateToken{}, middleware.After) +} + +func addOpCreateTokenWithIAMValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateTokenWithIAM{}, middleware.After) +} + +func addOpRegisterClientValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRegisterClient{}, middleware.After) +} + +func addOpStartDeviceAuthorizationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartDeviceAuthorization{}, middleware.After) +} + +func validateOpCreateTokenInput(v *CreateTokenInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateTokenInput"} + if v.ClientId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientId")) + } + if v.ClientSecret == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientSecret")) + } + if v.GrantType == nil { + invalidParams.Add(smithy.NewErrParamRequired("GrantType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateTokenWithIAMInput(v *CreateTokenWithIAMInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateTokenWithIAMInput"} + if v.ClientId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientId")) + } + if v.GrantType == nil { + invalidParams.Add(smithy.NewErrParamRequired("GrantType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRegisterClientInput(v *RegisterClientInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RegisterClientInput"} + if v.ClientName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientName")) + } + if v.ClientType == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpStartDeviceAuthorizationInput(v *StartDeviceAuthorizationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartDeviceAuthorizationInput"} + if v.ClientId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientId")) + } + if v.ClientSecret == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientSecret")) + } + if v.StartUrl == nil { + invalidParams.Add(smithy.NewErrParamRequired("StartUrl")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md new file mode 100644 index 00000000..f9b6404d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md @@ -0,0 +1,395 @@ +# v1.26.7 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.6 (2023-12-20) + +* No change notes available for this release. + +# v1.26.5 (2023-12-08) + +* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. + +# v1.26.4 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.3 (2023-12-06) + +* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. +* **Bug Fix**: STS `AssumeRoleWithSAML` and `AssumeRoleWithWebIdentity` would incorrectly attempt to use SigV4 authentication. + +# v1.26.2 (2023-12-01) + +* **Bug Fix**: Correct wrapping of errors in authentication workflow. +* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.1 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.0 (2023-11-29) + +* **Feature**: Expose Options() accessor on service clients. +* **Documentation**: Documentation updates for AWS Security Token Service. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.6 (2023-11-28.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.5 (2023-11-28) + +* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction. + +# v1.25.4 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.3 (2023-11-17) + +* **Documentation**: API updates for the AWS Security Token Service + +# v1.25.2 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.1 (2023-11-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# 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 + +# v1.23.1 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.0 (2023-10-02) + +* **Feature**: STS API updates for assumeRole + +# v1.22.0 (2023-09-18) + +* **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* **Feature**: Adds several endpoint ruleset changes across all models: smaller rulesets, removed non-unique regional endpoints, fixes FIPS and DualStack endpoints, and make region not required in SDK::Endpoint. Additional breakfix to cognito-sync field. + +# v1.21.5 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.4 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.3 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.2 (2023-08-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.1 (2023-08-01) + +* No change notes available for this release. + +# v1.21.0 (2023-07-31) + +* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.1 (2023-07-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.0 (2023-07-25) + +* **Feature**: API updates for the AWS Security Token Service + +# v1.19.3 (2023-07-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.2 (2023-06-15) + +* No change notes available for this release. + +# v1.19.1 (2023-06-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.0 (2023-05-08) + +* **Feature**: Documentation updates for AWS Security Token Service. + +# v1.18.11 (2023-05-04) + +* No change notes available for this release. + +# v1.18.10 (2023-04-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.9 (2023-04-10) + +* No change notes available for this release. + +# v1.18.8 (2023-04-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.7 (2023-03-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.6 (2023-03-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.5 (2023-02-22) + +* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes. + +# v1.18.4 (2023-02-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.3 (2023-02-03) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade smithy to 1.27.2 and correct empty query list serialization. + +# v1.18.2 (2023-01-25) + +* **Documentation**: Doc only change to update wording in a key topic + +# v1.18.1 (2023-01-23) + +* No change notes available for this release. + +# v1.18.0 (2023-01-05) + +* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401). + +# v1.17.7 (2022-12-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.6 (2022-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.5 (2022-11-22) + +* No change notes available for this release. + +# v1.17.4 (2022-11-17) + +* **Documentation**: Documentation updates for AWS Security Token Service. + +# v1.17.3 (2022-11-16) + +* No change notes available for this release. + +# v1.17.2 (2022-11-10) + +* No change notes available for this release. + +# v1.17.1 (2022-10-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.0 (2022-10-21) + +* **Feature**: Add presign functionality for sts:AssumeRole operation +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.19 (2022-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.18 (2022-09-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.17 (2022-09-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.16 (2022-08-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.15 (2022-08-30) + +* No change notes available for this release. + +# v1.16.14 (2022-08-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.13 (2022-08-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.12 (2022-08-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.11 (2022-08-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.10 (2022-08-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.9 (2022-07-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.8 (2022-06-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.7 (2022-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.6 (2022-05-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.5 (2022-05-16) + +* **Documentation**: Documentation updates for AWS Security Token Service. + +# v1.16.4 (2022-04-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.3 (2022-03-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.2 (2022-03-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.1 (2022-03-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.0 (2022-03-08) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Documentation**: Updated service client model to latest release. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.0 (2022-02-24) + +* **Feature**: API client updated +* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.0 (2022-01-14) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.0 (2022-01-07) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.0 (2021-12-21) + +* **Feature**: Updated to latest service endpoints + +# v1.11.1 (2021-12-02) + +* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514)) +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.0 (2021-11-30) + +* **Feature**: API client updated + +# v1.10.1 (2021-11-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.0 (2021-11-12) + +* **Feature**: Service clients now support custom endpoints that have an initial URI path defined. + +# v1.9.0 (2021-11-06) + +* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.0 (2021-10-21) + +* **Feature**: API client updated +* **Feature**: Updated to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.7.2 (2021-10-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.7.1 (2021-09-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.7.0 (2021-08-27) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.2 (2021-08-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.1 (2021-08-04) + +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.0 (2021-07-15) + +* **Feature**: The ErrorCode method on generated service error types has been corrected to match the API model. +* **Documentation**: Updated service model to latest revision. +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.0 (2021-06-25) + +* **Feature**: API client updated +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.1 (2021-05-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.0 (2021-05-14) + +* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. +* **Dependency Update**: Updated to the latest SDK module versions + diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go index 0d67082f..369de83b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go @@ -4,17 +4,25 @@ package sts import ( "context" + "fmt" "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/protocol/query" "github.com/aws/aws-sdk-go-v2/aws/retry" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + acceptencodingcust "github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding" presignedurlcust "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url" smithy "github.com/aws/smithy-go" + smithydocument "github.com/aws/smithy-go/document" "github.com/aws/smithy-go/logging" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" + "net" "net/http" "time" ) @@ -36,96 +44,59 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveDefaultLogger(&options) + setResolvedDefaultsMode(&options) + resolveRetryer(&options) resolveHTTPClient(&options) resolveHTTPSignerV4(&options) - resolveDefaultEndpointConfiguration(&options) + resolveEndpointResolverV2(&options) + + resolveAuthSchemeResolver(&options) for _, fn := range optFns { fn(&options) } - client := &Client{ - options: options, - } - - return client -} - -type Options struct { - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - APIOptions []func(*middleware.Stack) error - - // Configures the events that will be sent to the configured logger. - ClientLogMode aws.ClientLogMode + finalizeRetryMaxAttempts(&options) - // The credentials object to use when signing requests. - Credentials aws.CredentialsProvider + ignoreAnonymousAuth(&options) - // The endpoint options to be used when attempting to resolve an endpoint. - EndpointOptions EndpointResolverOptions + wrapWithAnonymousAuth(&options) - // The service endpoint resolver. - EndpointResolver EndpointResolver + resolveAuthSchemes(&options) - // Signature Version 4 (SigV4) Signer - HTTPSignerV4 HTTPSignerV4 - - // The logger writer interface to write logging messages to. - Logger logging.Logger - - // The region to send requests to. (Required) - Region string - - // Retryer guides how HTTP requests should be retried in case of recoverable - // failures. When nil the API client will use a default retryer. - Retryer aws.Retryer - - // The HTTP client to invoke API calls with. Defaults to client's default HTTP - // implementation if nil. - HTTPClient HTTPClient -} - -// WithAPIOptions returns a functional option for setting the Client's APIOptions -// option. -func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { - return func(o *Options) { - o.APIOptions = append(o.APIOptions, optFns...) + client := &Client{ + options: options, } -} -// WithEndpointResolver returns a functional option for setting the Client's -// EndpointResolver option. -func WithEndpointResolver(v EndpointResolver) func(*Options) { - return func(o *Options) { - o.EndpointResolver = v - } + return client } -type HTTPClient interface { - Do(*http.Request) (*http.Response, error) +// Options returns a copy of the client configuration. +// +// Callers SHOULD NOT perform mutations on any inner structures within client +// config. Config overrides should instead be made on a per-operation basis through +// functional options. +func (c *Client) Options() Options { + return c.options.Copy() } -// Copy creates a clone where the APIOptions list is deep copied. -func (o Options) Copy() Options { - to := o - to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) - copy(to.APIOptions, o.APIOptions) - return to -} func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { ctx = middleware.ClearStackValues(ctx) stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) options := c.options.Copy() + for _, fn := range optFns { fn(&options) } + finalizeOperationRetryMaxAttempts(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + for _, fn := range stackFns { if err := fn(stack, options); err != nil { return nil, metadata, err @@ -150,6 +121,89 @@ func (c *Client) invokeOperation(ctx context.Context, opID string, params interf return result, metadata, err } +type operationInputKey struct{} + +func setOperationInput(ctx context.Context, input interface{}) context.Context { + return middleware.WithStackValue(ctx, operationInputKey{}, input) +} + +func getOperationInput(ctx context.Context) interface{} { + return middleware.GetStackValue(ctx, operationInputKey{}) +} + +type setOperationInputMiddleware struct { +} + +func (*setOperationInputMiddleware) ID() string { + return "setOperationInput" +} + +func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + ctx = setOperationInput(ctx, in.Parameters) + return next.HandleSerialize(ctx, in) +} + +func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %w", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %v", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %v", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{}, "ResolveEndpointV2", middleware.After); err != nil { + return fmt.Errorf("add Signing: %w", err) + } + return nil +} +func resolveAuthSchemeResolver(options *Options) { + if options.AuthSchemeResolver == nil { + options.AuthSchemeResolver = &defaultAuthSchemeResolver{} + } +} + +func resolveAuthSchemes(options *Options) { + if options.AuthSchemes == nil { + options.AuthSchemes = []smithyhttp.AuthScheme{ + internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ + Signer: options.HTTPSignerV4, + Logger: options.Logger, + LogSigning: options.ClientLogMode.IsSigning(), + }), + } + } +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +type legacyEndpointContextSetter struct { + LegacyResolver EndpointResolver +} + +func (*legacyEndpointContextSetter) ID() string { + return "legacyEndpointContextSetter" +} + +func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.LegacyResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) + } + + return next.HandleInitialize(ctx, in) + +} +func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { + return stack.Initialize.Add(&legacyEndpointContextSetter{ + LegacyResolver: o.EndpointResolver, + }, middleware.Before) +} + func resolveDefaultLogger(o *Options) { if o.Logger != nil { return @@ -161,33 +215,110 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { return middleware.AddSetLoggerMiddleware(stack, o.Logger) } +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + // NewFromConfig returns a new client from the provided config. func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ - Region: cfg.Region, - HTTPClient: cfg.HTTPClient, - Credentials: cfg.Credentials, - APIOptions: cfg.APIOptions, - Logger: cfg.Logger, - ClientLogMode: cfg.ClientLogMode, + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + AppID: cfg.AppID, } resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) return New(opts, optFns...) } func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + if o.HTTPClient != nil { - return + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) } - o.HTTPClient = awshttp.NewBuildableClient() + + o.HTTPClient = buildable } func resolveRetryer(o *Options) { if o.Retryer != nil { return } - o.Retryer = retry.NewStandard() + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } } func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { @@ -197,24 +328,52 @@ func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { o.Retryer = cfg.Retryer() } -func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { - if cfg.EndpointResolver == nil { +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttempts(o *Options) { + if o.RetryMaxAttempts == 0 { return } - o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, NewDefaultEndpointResolver()) + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) } -func addClientUserAgent(stack *middleware.Stack) error { - return awsmiddleware.AddRequestUserAgentMiddleware(stack) +func finalizeOperationRetryMaxAttempts(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) } -func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { - mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ - CredentialsProvider: o.Credentials, - Signer: o.HTTPSignerV4, - LogSigning: o.ClientLogMode.IsSigning(), - }) - return stack.Finalize.Add(mw, middleware.After) +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) +} + +func addClientUserAgent(stack *middleware.Stack, options Options) error { + if err := awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "sts", goModuleVersion)(stack); err != nil { + return err + } + + if len(options.AppID) > 0 { + return awsmiddleware.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID)(stack) + } + + return nil } type HTTPSignerV4 interface { @@ -243,6 +402,36 @@ func addRetryMiddlewares(stack *middleware.Stack, o Options) error { return retry.AddRetryMiddlewares(stack, mo) } +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) } @@ -321,19 +510,70 @@ func withNopHTTPClientAPIOption(o *Options) { o.HTTPClient = smithyhttp.NopClient{} } +type presignContextPolyfillMiddleware struct { +} + +func (*presignContextPolyfillMiddleware) ID() string { + return "presignContextPolyfill" +} + +func (m *presignContextPolyfillMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + schemeID := rscheme.Scheme.SchemeID() + + if schemeID == "aws.auth#sigv4" || schemeID == "com.amazonaws.s3#sigv4express" { + if sn, ok := smithyhttp.GetSigV4SigningName(&rscheme.SignerProperties); ok { + ctx = awsmiddleware.SetSigningName(ctx, sn) + } + if sr, ok := smithyhttp.GetSigV4SigningRegion(&rscheme.SignerProperties); ok { + ctx = awsmiddleware.SetSigningRegion(ctx, sr) + } + } else if schemeID == "aws.auth#sigv4a" { + if sn, ok := smithyhttp.GetSigV4ASigningName(&rscheme.SignerProperties); ok { + ctx = awsmiddleware.SetSigningName(ctx, sn) + } + if sr, ok := smithyhttp.GetSigV4ASigningRegions(&rscheme.SignerProperties); ok { + ctx = awsmiddleware.SetSigningRegion(ctx, sr[0]) + } + } + + return next.HandleFinalize(ctx, in) +} + type presignConverter PresignOptions func (c presignConverter) convertToPresignMiddleware(stack *middleware.Stack, options Options) (err error) { - stack.Finalize.Clear() + if _, ok := stack.Finalize.Get((*acceptencodingcust.DisableGzip)(nil).ID()); ok { + stack.Finalize.Remove((*acceptencodingcust.DisableGzip)(nil).ID()) + } + if _, ok := stack.Finalize.Get((*retry.Attempt)(nil).ID()); ok { + stack.Finalize.Remove((*retry.Attempt)(nil).ID()) + } + if _, ok := stack.Finalize.Get((*retry.MetricsHeader)(nil).ID()); ok { + stack.Finalize.Remove((*retry.MetricsHeader)(nil).ID()) + } stack.Deserialize.Clear() stack.Build.Remove((*awsmiddleware.ClientRequestID)(nil).ID()) + stack.Build.Remove("UserAgent") + if err := stack.Finalize.Insert(&presignContextPolyfillMiddleware{}, "Signing", middleware.Before); err != nil { + return err + } + pmw := v4.NewPresignHTTPRequestMiddleware(v4.PresignHTTPRequestMiddlewareOptions{ CredentialsProvider: options.Credentials, Presigner: c.Presigner, LogSigning: options.ClientLogMode.IsSigning(), }) - err = stack.Finalize.Add(pmw, middleware.After) - if err != nil { + if _, err := stack.Finalize.Swap("Signing", pmw); err != nil { + return err + } + if err = smithyhttp.AddNoPayloadDefaultContentTypeRemover(stack); err != nil { return err } // convert request to a GET request @@ -356,3 +596,32 @@ func addRequestResponseLogging(stack *middleware.Stack, o Options) error { LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), }, middleware.After) } + +type disableHTTPSMiddleware struct { + DisableHTTPS bool +} + +func (*disableHTTPSMiddleware) ID() string { + return "disableHTTPS" +} + +func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { + req.URL.Scheme = "http" + } + + return next.HandleFinalize(ctx, in) +} + +func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { + return stack.Finalize.Insert(&disableHTTPSMiddleware{ + DisableHTTPS: o.EndpointOptions.DisableHTTPS, + }, "ResolveEndpointV2", middleware.After) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go index a37c514b..2938dac8 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go @@ -4,6 +4,7 @@ package sts import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sts/types" @@ -11,110 +12,79 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns a set of temporary security credentials that you can use to access AWS -// resources that you might not normally have access to. These temporary -// credentials consist of an access key ID, a secret access key, and a security -// token. Typically, you use AssumeRole within your account or for cross-account -// access. For a comparison of AssumeRole with other API operations that produce -// temporary credentials, see Requesting Temporary Security Credentials -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) -// and Comparing the AWS STS API operations -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) -// in the IAM User Guide. You cannot use AWS account root user credentials to call -// AssumeRole. You must use credentials for an IAM user or an IAM role to call -// AssumeRole. For cross-account access, imagine that you own multiple accounts and -// need to access resources in each account. You could create long-term credentials -// in each account to access those resources. However, managing all those -// credentials and remembering which one can access which account can be time -// consuming. Instead, you can create one set of long-term credentials in one -// account. Then use temporary security credentials to access all the other -// accounts by assuming roles in those accounts. For more information about roles, -// see IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) -// in the IAM User Guide. Session Duration By default, the temporary security -// credentials created by AssumeRole last for one hour. However, you can use the -// optional DurationSeconds parameter to specify the duration of your session. You -// can provide a value from 900 seconds (15 minutes) up to the maximum session -// duration setting for the role. This setting can have a value from 1 hour to 12 -// hours. To learn how to view the maximum value for your role, see View the -// Maximum Session Duration Setting for a Role -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) -// in the IAM User Guide. The maximum session duration limit applies when you use -// the AssumeRole* API operations or the assume-role* CLI commands. However the -// limit does not apply when you use those operations to create a console URL. For -// more information, see Using IAM Roles -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) in the IAM -// User Guide. Permissions The temporary security credentials created by AssumeRole -// can be used to make API calls to any AWS service with the following exception: -// You cannot call the AWS STS GetFederationToken or GetSessionToken API -// operations. (Optional) You can pass inline or managed session policies -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) +// Returns a set of temporary security credentials that you can use to access +// Amazon Web Services resources. These temporary credentials consist of an access +// key ID, a secret access key, and a security token. Typically, you use AssumeRole +// within your account or for cross-account access. For a comparison of AssumeRole +// with other API operations that produce temporary credentials, see Requesting +// Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) +// and Comparing the Amazon Web Services STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) +// in the IAM User Guide. Permissions The temporary security credentials created by +// AssumeRole can be used to make API calls to any Amazon Web Services service +// with the following exception: You cannot call the Amazon Web Services STS +// GetFederationToken or GetSessionToken API operations. (Optional) You can pass +// inline or managed session policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // to this operation. You can pass a single JSON policy document to use as an -// inline session policy. You can also specify up to 10 managed policies to use as -// managed session policies. The plain text that you use for both inline and -// managed session policies can't exceed 2,048 characters. Passing policies to this -// operation returns new temporary credentials. The resulting session's permissions -// are the intersection of the role's identity-based policy and the session -// policies. You can use the role's temporary credentials in subsequent AWS API -// calls to access resources in the account that owns the role. You cannot use -// session policies to grant more permissions than those allowed by the -// identity-based policy of the role that is being assumed. For more information, -// see Session Policies -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) -// in the IAM User Guide. To assume a role from a different account, your AWS -// account must be trusted by the role. The trust relationship is defined in the -// role's trust policy when the role is created. That trust policy states which -// accounts are allowed to delegate that access to users in the account. A user who -// wants to access a role in a different account must also have permissions that -// are delegated from the user account administrator. The administrator must attach -// a policy that allows the user to call AssumeRole for the ARN of the role in the -// other account. If the user is in the same account as the role, then you can do -// either of the following: +// inline session policy. You can also specify up to 10 managed policy Amazon +// Resource Names (ARNs) to use as managed session policies. The plaintext that you +// use for both inline and managed session policies can't exceed 2,048 characters. +// Passing policies to this operation returns new temporary credentials. The +// resulting session's permissions are the intersection of the role's +// identity-based policy and the session policies. You can use the role's temporary +// credentials in subsequent Amazon Web Services API calls to access resources in +// the account that owns the role. You cannot use session policies to grant more +// permissions than those allowed by the identity-based policy of the role that is +// being assumed. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) +// in the IAM User Guide. When you create a role, you create two policies: a role +// trust policy that specifies who can assume the role, and a permissions policy +// that specifies what can be done with the role. You specify the trusted principal +// that is allowed to assume the role in the role trust policy. To assume a role +// from a different account, your Amazon Web Services account must be trusted by +// the role. The trust relationship is defined in the role's trust policy when the +// role is created. That trust policy states which accounts are allowed to delegate +// that access to users in the account. A user who wants to access a role in a +// different account must also have permissions that are delegated from the account +// administrator. The administrator must attach a policy that allows the user to +// call AssumeRole for the ARN of the role in the other account. To allow a user +// to assume a role in the same account, you can do either of the following: +// - Attach a policy to the user that allows the user to call AssumeRole (as long +// as the role's trust policy trusts the account). +// - Add the user as a principal directly in the role's trust policy. // -// * Attach a policy to the user (identical to the -// previous user in a different account). -// -// * Add the user as a principal directly -// in the role's trust policy. -// -// In this case, the trust policy acts as an IAM -// resource-based policy. Users in the same account as the role do not need -// explicit permission to assume the role. For more information about trust -// policies and resource-based policies, see IAM Policies -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html) in the -// IAM User Guide. Tags (Optional) You can pass tag key-value pairs to your +// You can do either because the role’s trust policy acts as an IAM resource-based +// policy. When a resource-based policy grants access to a principal in the same +// account, no additional identity-based policy is required. For more information +// about trust policies and resource-based policies, see IAM Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html) +// in the IAM User Guide. Tags (Optional) You can pass tag key-value pairs to your // session. These tags are called session tags. For more information about session -// tags, see Passing Session Tags in STS -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) in the -// IAM User Guide. An administrator must grant you the permissions necessary to -// pass session tags. The administrator can also create granular permissions to +// tags, see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. An administrator must grant you the permissions necessary +// to pass session tags. The administrator can also create granular permissions to // allow you to pass only specific session tags. For more information, see -// Tutorial: Using Tags for Attribute-Based Access Control -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) +// Tutorial: Using Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) // in the IAM User Guide. You can set the session tags as transitive. Transitive -// tags persist during role chaining. For more information, see Chaining Roles with -// Session Tags -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) +// tags persist during role chaining. For more information, see Chaining Roles +// with Session Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) // in the IAM User Guide. Using MFA with AssumeRole (Optional) You can include -// multi-factor authentication (MFA) information when you call AssumeRole. This is +// multi-factor authentication (MFA) information when you call AssumeRole . This is // useful for cross-account scenarios to ensure that the user that assumes the role -// has been authenticated with an AWS MFA device. In that scenario, the trust -// policy of the role being assumed includes a condition that tests for MFA -// authentication. If the caller does not include valid MFA information, the +// has been authenticated with an Amazon Web Services MFA device. In that scenario, +// the trust policy of the role being assumed includes a condition that tests for +// MFA authentication. If the caller does not include valid MFA information, the // request to assume the role is denied. The condition in a trust policy that tests // for MFA authentication might look like the following example. "Condition": // {"Bool": {"aws:MultiFactorAuthPresent": true}} For more information, see -// Configuring MFA-Protected API Access -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/MFAProtectedAPI.html) in the -// IAM User Guide guide. To use MFA with AssumeRole, you pass values for the -// SerialNumber and TokenCode parameters. The SerialNumber value identifies the -// user's hardware or virtual MFA device. The TokenCode is the time-based one-time -// password (TOTP) that the MFA device produces. +// Configuring MFA-Protected API Access (https://docs.aws.amazon.com/IAM/latest/UserGuide/MFAProtectedAPI.html) +// in the IAM User Guide guide. To use MFA with AssumeRole , you pass values for +// the SerialNumber and TokenCode parameters. The SerialNumber value identifies +// the user's hardware or virtual MFA device. The TokenCode is the time-based +// one-time password (TOTP) that the MFA device produces. func (c *Client) AssumeRole(ctx context.Context, params *AssumeRoleInput, optFns ...func(*Options)) (*AssumeRoleOutput, error) { if params == nil { params = &AssumeRoleInput{} } - result, metadata, err := c.invokeOperation(ctx, "AssumeRole", params, optFns, addOperationAssumeRoleMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "AssumeRole", params, optFns, c.addOperationAssumeRoleMiddlewares) if err != nil { return nil, err } @@ -138,30 +108,36 @@ type AssumeRoleInput struct { // The role session name is also used in the ARN of the assumed role principal. // This means that subsequent cross-account API requests that use the temporary // security credentials will expose the role session name to the external account - // in their AWS CloudTrail logs. The regex used to validate this parameter is a - // string of characters consisting of upper- and lower-case alphanumeric characters - // with no spaces. You can also include underscores or any of the following - // characters: =,.@- + // in their CloudTrail logs. The regex used to validate this parameter is a string + // of characters consisting of upper- and lower-case alphanumeric characters with + // no spaces. You can also include underscores or any of the following characters: + // =,.@- // // This member is required. RoleSessionName *string - // The duration, in seconds, of the role session. The value can range from 900 - // seconds (15 minutes) up to the maximum session duration setting for the role. - // This setting can have a value from 1 hour to 12 hours. If you specify a value - // higher than this setting, the operation fails. For example, if you specify a + // The duration, in seconds, of the role session. The value specified can range + // from 900 seconds (15 minutes) up to the maximum session duration set for the + // role. The maximum session duration setting can have a value from 1 hour to 12 + // hours. If you specify a value higher than this setting or the administrator + // setting (whichever is lower), the operation fails. For example, if you specify a // session duration of 12 hours, but your administrator set the maximum session - // duration to 6 hours, your operation fails. To learn how to view the maximum - // value for your role, see View the Maximum Session Duration Setting for a Role - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) + // duration to 6 hours, your operation fails. Role chaining limits your Amazon Web + // Services CLI or Amazon Web Services API role session to a maximum of one hour. + // When you use the AssumeRole API operation to assume a role, you can specify the + // duration of your role session with the DurationSeconds parameter. You can + // specify a parameter value of up to 43200 seconds (12 hours), depending on the + // maximum session duration setting for your role. However, if you assume a role + // using role chaining and provide a DurationSeconds parameter value greater than + // one hour, the operation fails. To learn how to view the maximum value for your + // role, see View the Maximum Session Duration Setting for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) // in the IAM User Guide. By default, the value is set to 3600 seconds. The // DurationSeconds parameter is separate from the duration of a console session // that you might request using the returned credentials. The request to the // federation endpoint for a console sign-in token takes a SessionDuration // parameter that specifies the maximum length of the console session. For more - // information, see Creating a URL that Enables Federated Users to Access the AWS - // Management Console - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html) + // information, see Creating a URL that Enables Federated Users to Access the + // Amazon Web Services Management Console (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html) // in the IAM User Guide. DurationSeconds *int32 @@ -173,9 +149,8 @@ type AssumeRoleInput struct { // the administrator of the trusting account might send an external ID to the // administrator of the trusted account. That way, only someone with the ID can // assume the role, rather than everyone in the account. For more information about - // the external ID, see How to Use an External ID When Granting Access to Your AWS - // Resources to a Third Party - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html) + // the external ID, see How to Use an External ID When Granting Access to Your + // Amazon Web Services Resources to a Third Party (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html) // in the IAM User Guide. The regex used to validate this parameter is a string of // characters consisting of upper- and lower-case alphanumeric characters with no // spaces. You can also include underscores or any of the following characters: @@ -186,116 +161,138 @@ type AssumeRoleInput struct { // This parameter is optional. Passing policies to this operation returns new // temporary credentials. The resulting session's permissions are the intersection // of the role's identity-based policy and the session policies. You can use the - // role's temporary credentials in subsequent AWS API calls to access resources in - // the account that owns the role. You cannot use session policies to grant more - // permissions than those allowed by the identity-based policy of the role that is - // being assumed. For more information, see Session Policies - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) - // in the IAM User Guide. The plain text that you use for both inline and managed + // role's temporary credentials in subsequent Amazon Web Services API calls to + // access resources in the account that owns the role. You cannot use session + // policies to grant more permissions than those allowed by the identity-based + // policy of the role that is being assumed. For more information, see Session + // Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + // in the IAM User Guide. The plaintext that you use for both inline and managed // session policies can't exceed 2,048 characters. The JSON policy characters can // be any ASCII character from the space character to the end of the valid // character list (\u0020 through \u00FF). It can also include the tab (\u0009), - // linefeed (\u000A), and carriage return (\u000D) characters. An AWS conversion - // compresses the passed session policies and session tags into a packed binary - // format that has a separate limit. Your request can fail for this limit even if - // your plain text meets the other requirements. The PackedPolicySize response - // element indicates by percentage how close the policies and tags for your request - // are to the upper size limit. + // linefeed (\u000A), and carriage return (\u000D) characters. An Amazon Web + // Services conversion compresses the passed inline session policy, managed policy + // ARNs, and session tags into a packed binary format that has a separate limit. + // Your request can fail for this limit even if your plaintext meets the other + // requirements. The PackedPolicySize response element indicates by percentage how + // close the policies and tags for your request are to the upper size limit. Policy *string // The Amazon Resource Names (ARNs) of the IAM managed policies that you want to // use as managed session policies. The policies must exist in the same account as // the role. This parameter is optional. You can provide up to 10 managed policy - // ARNs. However, the plain text that you use for both inline and managed session + // ARNs. However, the plaintext that you use for both inline and managed session // policies can't exceed 2,048 characters. For more information about ARNs, see - // Amazon Resource Names (ARNs) and AWS Service Namespaces - // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. An AWS conversion compresses the passed session - // policies and session tags into a packed binary format that has a separate limit. - // Your request can fail for this limit even if your plain text meets the other - // requirements. The PackedPolicySize response element indicates by percentage how - // close the policies and tags for your request are to the upper size limit. - // Passing policies to this operation returns new temporary credentials. The - // resulting session's permissions are the intersection of the role's - // identity-based policy and the session policies. You can use the role's temporary - // credentials in subsequent AWS API calls to access resources in the account that - // owns the role. You cannot use session policies to grant more permissions than - // those allowed by the identity-based policy of the role that is being assumed. - // For more information, see Session Policies - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + // Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the Amazon Web Services General Reference. An Amazon Web Services conversion + // compresses the passed inline session policy, managed policy ARNs, and session + // tags into a packed binary format that has a separate limit. Your request can + // fail for this limit even if your plaintext meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. Passing policies to this + // operation returns new temporary credentials. The resulting session's permissions + // are the intersection of the role's identity-based policy and the session + // policies. You can use the role's temporary credentials in subsequent Amazon Web + // Services API calls to access resources in the account that owns the role. You + // cannot use session policies to grant more permissions than those allowed by the + // identity-based policy of the role that is being assumed. For more information, + // see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // in the IAM User Guide. PolicyArns []types.PolicyDescriptorType - // The identification number of the MFA device that is associated with the user who - // is making the AssumeRole call. Specify this value if the trust policy of the - // role being assumed includes a condition that requires MFA authentication. The - // value is either the serial number for a hardware device (such as GAHT12345678) - // or an Amazon Resource Name (ARN) for a virtual device (such as - // arn:aws:iam::123456789012:mfa/user). The regex used to validate this parameter + // A list of previously acquired trusted context assertions in the format of a + // JSON array. The trusted context assertion is signed and encrypted by Amazon Web + // Services STS. The following is an example of a ProvidedContext value that + // includes a single trusted context assertion and the ARN of the context provider + // from which the trusted context assertion was generated. + // [{"ProviderArn":"arn:aws:iam::aws:contextProvider/IdentityCenter","ContextAssertion":"trusted-context-assertion"}] + ProvidedContexts []types.ProvidedContext + + // The identification number of the MFA device that is associated with the user + // who is making the AssumeRole call. Specify this value if the trust policy of + // the role being assumed includes a condition that requires MFA authentication. + // The value is either the serial number for a hardware device (such as + // GAHT12345678 ) or an Amazon Resource Name (ARN) for a virtual device (such as + // arn:aws:iam::123456789012:mfa/user ). The regex used to validate this parameter // is a string of characters consisting of upper- and lower-case alphanumeric // characters with no spaces. You can also include underscores or any of the // following characters: =,.@- SerialNumber *string - // A list of session tags that you want to pass. Each session tag consists of a key - // name and an associated value. For more information about session tags, see - // Tagging AWS STS Sessions - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) in the - // IAM User Guide. This parameter is optional. You can pass up to 50 session tags. - // The plain text session tag keys can’t exceed 128 characters, and the values + // The source identity specified by the principal that is calling the AssumeRole + // operation. You can require users to specify a source identity when they assume a + // role. You do this by using the sts:SourceIdentity condition key in a role trust + // policy. You can use source identity information in CloudTrail logs to determine + // who took actions with a role. You can use the aws:SourceIdentity condition key + // to further control access to Amazon Web Services resources based on the value of + // source identity. For more information about using source identity, see Monitor + // and control actions taken with assumed roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html) + // in the IAM User Guide. The regex used to validate this parameter is a string of + // characters consisting of upper- and lower-case alphanumeric characters with no + // spaces. You can also include underscores or any of the following characters: + // =,.@-. You cannot use a value that begins with the text aws: . This prefix is + // reserved for Amazon Web Services internal use. + SourceIdentity *string + + // A list of session tags that you want to pass. Each session tag consists of a + // key name and an associated value. For more information about session tags, see + // Tagging Amazon Web Services STS Sessions (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) + // in the IAM User Guide. This parameter is optional. You can pass up to 50 session + // tags. The plaintext session tag keys can’t exceed 128 characters, and the values // can’t exceed 256 characters. For these and additional limits, see IAM and STS - // Character Limits - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) - // in the IAM User Guide. An AWS conversion compresses the passed session policies - // and session tags into a packed binary format that has a separate limit. Your - // request can fail for this limit even if your plain text meets the other - // requirements. The PackedPolicySize response element indicates by percentage how - // close the policies and tags for your request are to the upper size limit. You - // can pass a session tag with the same key as a tag that is already attached to - // the role. When you do, session tags override a role tag with the same key. Tag - // key–value pairs are not case sensitive, but case is preserved. This means that - // you cannot have separate Department and department tag keys. Assume that the - // role has the Department=Marketing tag and you pass the department=engineering - // session tag. Department and department are not saved as separate tags, and the - // session tag passed in the request takes precedence over the role tag. - // Additionally, if you used temporary credentials to perform this operation, the - // new session inherits any transitive session tags from the calling session. If - // you pass a session tag with the same key as an inherited tag, the operation - // fails. To view the inherited tags for a session, see the AWS CloudTrail logs. - // For more information, see Viewing Session Tags in CloudTrail - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/session-tags.html#id_session-tags_ctlogs) + // Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) + // in the IAM User Guide. An Amazon Web Services conversion compresses the passed + // inline session policy, managed policy ARNs, and session tags into a packed + // binary format that has a separate limit. Your request can fail for this limit + // even if your plaintext meets the other requirements. The PackedPolicySize + // response element indicates by percentage how close the policies and tags for + // your request are to the upper size limit. You can pass a session tag with the + // same key as a tag that is already attached to the role. When you do, session + // tags override a role tag with the same key. Tag key–value pairs are not case + // sensitive, but case is preserved. This means that you cannot have separate + // Department and department tag keys. Assume that the role has the Department = + // Marketing tag and you pass the department = engineering session tag. Department + // and department are not saved as separate tags, and the session tag passed in + // the request takes precedence over the role tag. Additionally, if you used + // temporary credentials to perform this operation, the new session inherits any + // transitive session tags from the calling session. If you pass a session tag with + // the same key as an inherited tag, the operation fails. To view the inherited + // tags for a session, see the CloudTrail logs. For more information, see Viewing + // Session Tags in CloudTrail (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_ctlogs) // in the IAM User Guide. Tags []types.Tag // The value provided by the MFA device, if the trust policy of the role being - // assumed requires MFA (that is, if the policy includes a condition that tests for - // MFA). If the role being assumed requires MFA and if the TokenCode value is - // missing or expired, the AssumeRole call returns an "access denied" error. The - // format for this parameter, as described by its regex pattern, is a sequence of - // six numeric digits. + // assumed requires MFA. (In other words, if the policy includes a condition that + // tests for MFA). If the role being assumed requires MFA and if the TokenCode + // value is missing or expired, the AssumeRole call returns an "access denied" + // error. The format for this parameter, as described by its regex pattern, is a + // sequence of six numeric digits. TokenCode *string - // A list of keys for session tags that you want to set as transitive. If you set a - // tag key as transitive, the corresponding key and value passes to subsequent + // A list of keys for session tags that you want to set as transitive. If you set + // a tag key as transitive, the corresponding key and value passes to subsequent // sessions in a role chain. For more information, see Chaining Roles with Session - // Tags - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) + // Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) // in the IAM User Guide. This parameter is optional. When you set session tags as // transitive, the session policy and session tags packed binary limit is not // affected. If you choose not to specify a transitive tag key, then no tags are // passed from this session to any subsequent sessions. TransitiveTagKeys []string + + noSmithyDocumentSerde } // Contains the response to a successful AssumeRole request, including temporary -// AWS credentials that can be used to make AWS requests. +// Amazon Web Services credentials that can be used to make Amazon Web Services +// requests. type AssumeRoleOutput struct { // The Amazon Resource Name (ARN) and the assumed role ID, which are identifiers // that you can use to refer to the resulting temporary security credentials. For // example, you can reference these credentials as a principal in a resource-based // policy by using the ARN or assumed role ID. The ARN and ID include the - // RoleSessionName that you specified when you called AssumeRole. + // RoleSessionName that you specified when you called AssumeRole . AssumedRoleUser *types.AssumedRoleUser // The temporary security credentials, which include an access key ID, a secret @@ -310,11 +307,30 @@ type AssumeRoleOutput struct { // allowed space. PackedPolicySize *int32 + // The source identity specified by the principal that is calling the AssumeRole + // operation. You can require users to specify a source identity when they assume a + // role. You do this by using the sts:SourceIdentity condition key in a role trust + // policy. You can use source identity information in CloudTrail logs to determine + // who took actions with a role. You can use the aws:SourceIdentity condition key + // to further control access to Amazon Web Services resources based on the value of + // source identity. For more information about using source identity, see Monitor + // and control actions taken with assumed roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html) + // in the IAM User Guide. The regex used to validate this parameter is a string of + // characters consisting of upper- and lower-case alphanumeric characters with no + // spaces. You can also include underscores or any of the following characters: + // =,.@- + SourceIdentity *string + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationAssumeRoleMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationAssumeRoleMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsquery_serializeOpAssumeRole{}, middleware.After) if err != nil { return err @@ -323,6 +339,13 @@ func addOperationAssumeRoleMiddlewares(stack *middleware.Stack, options Options) if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "AssumeRole"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -341,16 +364,13 @@ func addOperationAssumeRoleMiddlewares(stack *middleware.Stack, options Options) if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -359,12 +379,18 @@ func addOperationAssumeRoleMiddlewares(stack *middleware.Stack, options Options) if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpAssumeRoleValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssumeRole(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -374,6 +400,9 @@ func addOperationAssumeRoleMiddlewares(stack *middleware.Stack, options Options) if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -381,7 +410,30 @@ func newServiceMetadataMiddleware_opAssumeRole(region string) *awsmiddleware.Reg return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "sts", OperationName: "AssumeRole", } } + +// PresignAssumeRole is used to generate a presigned HTTP Request which contains +// presigned URL, signed headers and HTTP method used. +func (c *PresignClient) PresignAssumeRole(ctx context.Context, params *AssumeRoleInput, optFns ...func(*PresignOptions)) (*v4.PresignedHTTPRequest, error) { + if params == nil { + params = &AssumeRoleInput{} + } + options := c.options.copy() + for _, fn := range optFns { + fn(&options) + } + clientOptFns := append(options.ClientOptions, withNopHTTPClientAPIOption) + + result, _, err := c.client.invokeOperation(ctx, "AssumeRole", params, clientOptFns, + c.client.addOperationAssumeRoleMiddlewares, + presignConverter(options).convertToPresignMiddleware, + ) + if err != nil { + return nil, err + } + + out := result.(*v4.PresignedHTTPRequest) + return out, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go index 8e7690be..ef576b64 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go @@ -4,6 +4,7 @@ package sts import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/service/sts/types" "github.com/aws/smithy-go/middleware" @@ -12,112 +13,101 @@ import ( // Returns a set of temporary security credentials for users who have been // authenticated via a SAML authentication response. This operation provides a -// mechanism for tying an enterprise identity store or directory to role-based AWS -// access without user-specific credentials or configuration. For a comparison of -// AssumeRoleWithSAML with the other API operations that produce temporary -// credentials, see Requesting Temporary Security Credentials -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) -// and Comparing the AWS STS API operations -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) +// mechanism for tying an enterprise identity store or directory to role-based +// Amazon Web Services access without user-specific credentials or configuration. +// For a comparison of AssumeRoleWithSAML with the other API operations that +// produce temporary credentials, see Requesting Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) +// and Comparing the Amazon Web Services STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) // in the IAM User Guide. The temporary security credentials returned by this // operation consist of an access key ID, a secret access key, and a security // token. Applications can use these temporary security credentials to sign calls -// to AWS services. Session Duration By default, the temporary security credentials -// created by AssumeRoleWithSAML last for one hour. However, you can use the -// optional DurationSeconds parameter to specify the duration of your session. Your -// role session lasts for the duration that you specify, or until the time -// specified in the SAML authentication response's SessionNotOnOrAfter value, -// whichever is shorter. You can provide a DurationSeconds value from 900 seconds -// (15 minutes) up to the maximum session duration setting for the role. This -// setting can have a value from 1 hour to 12 hours. To learn how to view the -// maximum value for your role, see View the Maximum Session Duration Setting for a -// Role -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) +// to Amazon Web Services services. Session Duration By default, the temporary +// security credentials created by AssumeRoleWithSAML last for one hour. However, +// you can use the optional DurationSeconds parameter to specify the duration of +// your session. Your role session lasts for the duration that you specify, or +// until the time specified in the SAML authentication response's +// SessionNotOnOrAfter value, whichever is shorter. You can provide a +// DurationSeconds value from 900 seconds (15 minutes) up to the maximum session +// duration setting for the role. This setting can have a value from 1 hour to 12 +// hours. To learn how to view the maximum value for your role, see View the +// Maximum Session Duration Setting for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) // in the IAM User Guide. The maximum session duration limit applies when you use // the AssumeRole* API operations or the assume-role* CLI commands. However the // limit does not apply when you use those operations to create a console URL. For -// more information, see Using IAM Roles -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) in the IAM -// User Guide. Permissions The temporary security credentials created by -// AssumeRoleWithSAML can be used to make API calls to any AWS service with the -// following exception: you cannot call the STS GetFederationToken or -// GetSessionToken API operations. (Optional) You can pass inline or managed -// session policies -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) +// more information, see Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) +// in the IAM User Guide. Role chaining (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#iam-term-role-chaining) +// limits your CLI or Amazon Web Services API role session to a maximum of one +// hour. When you use the AssumeRole API operation to assume a role, you can +// specify the duration of your role session with the DurationSeconds parameter. +// You can specify a parameter value of up to 43200 seconds (12 hours), depending +// on the maximum session duration setting for your role. However, if you assume a +// role using role chaining and provide a DurationSeconds parameter value greater +// than one hour, the operation fails. Permissions The temporary security +// credentials created by AssumeRoleWithSAML can be used to make API calls to any +// Amazon Web Services service with the following exception: you cannot call the +// STS GetFederationToken or GetSessionToken API operations. (Optional) You can +// pass inline or managed session policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // to this operation. You can pass a single JSON policy document to use as an -// inline session policy. You can also specify up to 10 managed policies to use as -// managed session policies. The plain text that you use for both inline and -// managed session policies can't exceed 2,048 characters. Passing policies to this -// operation returns new temporary credentials. The resulting session's permissions -// are the intersection of the role's identity-based policy and the session -// policies. You can use the role's temporary credentials in subsequent AWS API -// calls to access resources in the account that owns the role. You cannot use -// session policies to grant more permissions than those allowed by the -// identity-based policy of the role that is being assumed. For more information, -// see Session Policies -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) +// inline session policy. You can also specify up to 10 managed policy Amazon +// Resource Names (ARNs) to use as managed session policies. The plaintext that you +// use for both inline and managed session policies can't exceed 2,048 characters. +// Passing policies to this operation returns new temporary credentials. The +// resulting session's permissions are the intersection of the role's +// identity-based policy and the session policies. You can use the role's temporary +// credentials in subsequent Amazon Web Services API calls to access resources in +// the account that owns the role. You cannot use session policies to grant more +// permissions than those allowed by the identity-based policy of the role that is +// being assumed. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // in the IAM User Guide. Calling AssumeRoleWithSAML does not require the use of -// AWS security credentials. The identity of the caller is validated by using keys -// in the metadata document that is uploaded for the SAML provider entity for your -// identity provider. Calling AssumeRoleWithSAML can result in an entry in your AWS -// CloudTrail logs. The entry includes the value in the NameID element of the SAML -// assertion. We recommend that you use a NameIDType that is not associated with -// any personally identifiable information (PII). For example, you could instead -// use the persistent identifier -// (urn:oasis:names:tc:SAML:2.0:nameid-format:persistent). Tags (Optional) You can +// Amazon Web Services security credentials. The identity of the caller is +// validated by using keys in the metadata document that is uploaded for the SAML +// provider entity for your identity provider. Calling AssumeRoleWithSAML can +// result in an entry in your CloudTrail logs. The entry includes the value in the +// NameID element of the SAML assertion. We recommend that you use a NameIDType +// that is not associated with any personally identifiable information (PII). For +// example, you could instead use the persistent identifier ( +// urn:oasis:names:tc:SAML:2.0:nameid-format:persistent ). Tags (Optional) You can // configure your IdP to pass attributes into your SAML assertion as session tags. // Each session tag consists of a key name and an associated value. For more -// information about session tags, see Passing Session Tags in STS -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) in the -// IAM User Guide. You can pass up to 50 session tags. The plain text session tag -// keys can’t exceed 128 characters and the values can’t exceed 256 characters. For -// these and additional limits, see IAM and STS Character Limits -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) -// in the IAM User Guide. An AWS conversion compresses the passed session policies -// and session tags into a packed binary format that has a separate limit. Your -// request can fail for this limit even if your plain text meets the other -// requirements. The PackedPolicySize response element indicates by percentage how -// close the policies and tags for your request are to the upper size limit. You -// can pass a session tag with the same key as a tag that is attached to the role. -// When you do, session tags override the role's tags with the same key. An -// administrator must grant you the permissions necessary to pass session tags. The -// administrator can also create granular permissions to allow you to pass only -// specific session tags. For more information, see Tutorial: Using Tags for -// Attribute-Based Access Control -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) +// information about session tags, see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. You can pass up to 50 session tags. The plaintext session +// tag keys can’t exceed 128 characters and the values can’t exceed 256 characters. +// For these and additional limits, see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) +// in the IAM User Guide. An Amazon Web Services conversion compresses the passed +// inline session policy, managed policy ARNs, and session tags into a packed +// binary format that has a separate limit. Your request can fail for this limit +// even if your plaintext meets the other requirements. The PackedPolicySize +// response element indicates by percentage how close the policies and tags for +// your request are to the upper size limit. You can pass a session tag with the +// same key as a tag that is attached to the role. When you do, session tags +// override the role's tags with the same key. An administrator must grant you the +// permissions necessary to pass session tags. The administrator can also create +// granular permissions to allow you to pass only specific session tags. For more +// information, see Tutorial: Using Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) // in the IAM User Guide. You can set the session tags as transitive. Transitive -// tags persist during role chaining. For more information, see Chaining Roles with -// Session Tags -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) +// tags persist during role chaining. For more information, see Chaining Roles +// with Session Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) // in the IAM User Guide. SAML Configuration Before your application can call -// AssumeRoleWithSAML, you must configure your SAML identity provider (IdP) to -// issue the claims required by AWS. Additionally, you must use AWS Identity and -// Access Management (IAM) to create a SAML provider entity in your AWS account -// that represents your identity provider. You must also create an IAM role that -// specifies this SAML provider in its trust policy. For more information, see the -// following resources: -// -// * About SAML 2.0-based Federation -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html) -// in the IAM User Guide. -// -// * Creating SAML Identity Providers -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml.html) -// in the IAM User Guide. -// -// * Configuring a Relying Party and Claims -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml_relying-party.html) -// in the IAM User Guide. -// -// * Creating a Role for SAML 2.0 Federation -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_saml.html) -// in the IAM User Guide. +// AssumeRoleWithSAML , you must configure your SAML identity provider (IdP) to +// issue the claims required by Amazon Web Services. Additionally, you must use +// Identity and Access Management (IAM) to create a SAML provider entity in your +// Amazon Web Services account that represents your identity provider. You must +// also create an IAM role that specifies this SAML provider in its trust policy. +// For more information, see the following resources: +// - About SAML 2.0-based Federation (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html) +// in the IAM User Guide. +// - Creating SAML Identity Providers (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml.html) +// in the IAM User Guide. +// - Configuring a Relying Party and Claims (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml_relying-party.html) +// in the IAM User Guide. +// - Creating a Role for SAML 2.0 Federation (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_saml.html) +// in the IAM User Guide. func (c *Client) AssumeRoleWithSAML(ctx context.Context, params *AssumeRoleWithSAMLInput, optFns ...func(*Options)) (*AssumeRoleWithSAMLOutput, error) { if params == nil { params = &AssumeRoleWithSAMLInput{} } - result, metadata, err := c.invokeOperation(ctx, "AssumeRoleWithSAML", params, optFns, addOperationAssumeRoleWithSAMLMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "AssumeRoleWithSAML", params, optFns, c.addOperationAssumeRoleWithSAMLMiddlewares) if err != nil { return nil, err } @@ -140,9 +130,8 @@ type AssumeRoleWithSAMLInput struct { // This member is required. RoleArn *string - // The base-64 encoded SAML authentication response provided by the IdP. For more - // information, see Configuring a Relying Party and Adding Claims - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/create-role-saml-IdP-tasks.html) + // The base64 encoded SAML authentication response provided by the IdP. For more + // information, see Configuring a Relying Party and Adding Claims (https://docs.aws.amazon.com/IAM/latest/UserGuide/create-role-saml-IdP-tasks.html) // in the IAM User Guide. // // This member is required. @@ -157,16 +146,14 @@ type AssumeRoleWithSAMLInput struct { // than this setting, the operation fails. For example, if you specify a session // duration of 12 hours, but your administrator set the maximum session duration to // 6 hours, your operation fails. To learn how to view the maximum value for your - // role, see View the Maximum Session Duration Setting for a Role - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) + // role, see View the Maximum Session Duration Setting for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) // in the IAM User Guide. By default, the value is set to 3600 seconds. The // DurationSeconds parameter is separate from the duration of a console session // that you might request using the returned credentials. The request to the // federation endpoint for a console sign-in token takes a SessionDuration // parameter that specifies the maximum length of the console session. For more - // information, see Creating a URL that Enables Federated Users to Access the AWS - // Management Console - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html) + // information, see Creating a URL that Enables Federated Users to Access the + // Amazon Web Services Management Console (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html) // in the IAM User Guide. DurationSeconds *int32 @@ -174,49 +161,51 @@ type AssumeRoleWithSAMLInput struct { // This parameter is optional. Passing policies to this operation returns new // temporary credentials. The resulting session's permissions are the intersection // of the role's identity-based policy and the session policies. You can use the - // role's temporary credentials in subsequent AWS API calls to access resources in - // the account that owns the role. You cannot use session policies to grant more - // permissions than those allowed by the identity-based policy of the role that is - // being assumed. For more information, see Session Policies - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) - // in the IAM User Guide. The plain text that you use for both inline and managed + // role's temporary credentials in subsequent Amazon Web Services API calls to + // access resources in the account that owns the role. You cannot use session + // policies to grant more permissions than those allowed by the identity-based + // policy of the role that is being assumed. For more information, see Session + // Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + // in the IAM User Guide. The plaintext that you use for both inline and managed // session policies can't exceed 2,048 characters. The JSON policy characters can // be any ASCII character from the space character to the end of the valid // character list (\u0020 through \u00FF). It can also include the tab (\u0009), - // linefeed (\u000A), and carriage return (\u000D) characters. An AWS conversion - // compresses the passed session policies and session tags into a packed binary - // format that has a separate limit. Your request can fail for this limit even if - // your plain text meets the other requirements. The PackedPolicySize response - // element indicates by percentage how close the policies and tags for your request - // are to the upper size limit. + // linefeed (\u000A), and carriage return (\u000D) characters. An Amazon Web + // Services conversion compresses the passed inline session policy, managed policy + // ARNs, and session tags into a packed binary format that has a separate limit. + // Your request can fail for this limit even if your plaintext meets the other + // requirements. The PackedPolicySize response element indicates by percentage how + // close the policies and tags for your request are to the upper size limit. Policy *string // The Amazon Resource Names (ARNs) of the IAM managed policies that you want to // use as managed session policies. The policies must exist in the same account as // the role. This parameter is optional. You can provide up to 10 managed policy - // ARNs. However, the plain text that you use for both inline and managed session + // ARNs. However, the plaintext that you use for both inline and managed session // policies can't exceed 2,048 characters. For more information about ARNs, see - // Amazon Resource Names (ARNs) and AWS Service Namespaces - // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. An AWS conversion compresses the passed session - // policies and session tags into a packed binary format that has a separate limit. - // Your request can fail for this limit even if your plain text meets the other - // requirements. The PackedPolicySize response element indicates by percentage how - // close the policies and tags for your request are to the upper size limit. - // Passing policies to this operation returns new temporary credentials. The - // resulting session's permissions are the intersection of the role's - // identity-based policy and the session policies. You can use the role's temporary - // credentials in subsequent AWS API calls to access resources in the account that - // owns the role. You cannot use session policies to grant more permissions than - // those allowed by the identity-based policy of the role that is being assumed. - // For more information, see Session Policies - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + // Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the Amazon Web Services General Reference. An Amazon Web Services conversion + // compresses the passed inline session policy, managed policy ARNs, and session + // tags into a packed binary format that has a separate limit. Your request can + // fail for this limit even if your plaintext meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. Passing policies to this + // operation returns new temporary credentials. The resulting session's permissions + // are the intersection of the role's identity-based policy and the session + // policies. You can use the role's temporary credentials in subsequent Amazon Web + // Services API calls to access resources in the account that owns the role. You + // cannot use session policies to grant more permissions than those allowed by the + // identity-based policy of the role that is being assumed. For more information, + // see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // in the IAM User Guide. PolicyArns []types.PolicyDescriptorType + + noSmithyDocumentSerde } // Contains the response to a successful AssumeRoleWithSAML request, including -// temporary AWS credentials that can be used to make AWS requests. +// temporary Amazon Web Services credentials that can be used to make Amazon Web +// Services requests. type AssumeRoleWithSAMLOutput struct { // The identifiers for the temporary security credentials that the operation @@ -236,12 +225,13 @@ type AssumeRoleWithSAMLOutput struct { // The value of the Issuer element of the SAML assertion. Issuer *string - // A hash value based on the concatenation of the Issuer response value, the AWS - // account ID, and the friendly name (the last part of the ARN) of the SAML - // provider in IAM. The combination of NameQualifier and Subject can be used to - // uniquely identify a federated user. The following pseudocode shows how the hash - // value is calculated: BASE64 ( SHA1 ( "https://example.com/saml" + "123456789012" - // + "/MySAMLIdP" ) ) + // A hash value based on the concatenation of the following: + // - The Issuer response value. + // - The Amazon Web Services account ID. + // - The friendly name (the last part of the ARN) of the SAML provider in IAM. + // The combination of NameQualifier and Subject can be used to uniquely identify a + // user. The following pseudocode shows how the hash value is calculated: BASE64 ( + // SHA1 ( "https://example.com/saml" + "123456789012" + "/MySAMLIdP" ) ) NameQualifier *string // A percentage value that indicates the packed size of the session policies and @@ -250,23 +240,46 @@ type AssumeRoleWithSAMLOutput struct { // allowed space. PackedPolicySize *int32 + // The value in the SourceIdentity attribute in the SAML assertion. You can + // require users to set a source identity value when they assume a role. You do + // this by using the sts:SourceIdentity condition key in a role trust policy. That + // way, actions that are taken with the role are associated with that user. After + // the source identity is set, the value cannot be changed. It is present in the + // request for all actions that are taken by the role and persists across chained + // role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts#iam-term-role-chaining) + // sessions. You can configure your SAML identity provider to use an attribute + // associated with your users, like user name or email, as the source identity when + // calling AssumeRoleWithSAML . You do this by adding an attribute to the SAML + // assertion. For more information about using source identity, see Monitor and + // control actions taken with assumed roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html) + // in the IAM User Guide. The regex used to validate this parameter is a string of + // characters consisting of upper- and lower-case alphanumeric characters with no + // spaces. You can also include underscores or any of the following characters: + // =,.@- + SourceIdentity *string + // The value of the NameID element in the Subject element of the SAML assertion. Subject *string // The format of the name ID, as defined by the Format attribute in the NameID // element of the SAML assertion. Typical examples of the format are transient or - // persistent. If the format includes the prefix - // urn:oasis:names:tc:SAML:2.0:nameid-format, that prefix is removed. For example, - // urn:oasis:names:tc:SAML:2.0:nameid-format:transient is returned as transient. If - // the format includes any other prefix, the format is returned with no + // persistent . If the format includes the prefix + // urn:oasis:names:tc:SAML:2.0:nameid-format , that prefix is removed. For example, + // urn:oasis:names:tc:SAML:2.0:nameid-format:transient is returned as transient . + // If the format includes any other prefix, the format is returned with no // modifications. SubjectType *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationAssumeRoleWithSAMLMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationAssumeRoleWithSAMLMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsquery_serializeOpAssumeRoleWithSAML{}, middleware.After) if err != nil { return err @@ -275,6 +288,13 @@ func addOperationAssumeRoleWithSAMLMiddlewares(stack *middleware.Stack, options if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "AssumeRoleWithSAML"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -296,7 +316,7 @@ func addOperationAssumeRoleWithSAMLMiddlewares(stack *middleware.Stack, options if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -305,12 +325,18 @@ func addOperationAssumeRoleWithSAMLMiddlewares(stack *middleware.Stack, options if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpAssumeRoleWithSAMLValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssumeRoleWithSAML(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -320,6 +346,9 @@ func addOperationAssumeRoleWithSAMLMiddlewares(stack *middleware.Stack, options if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -327,7 +356,6 @@ func newServiceMetadataMiddleware_opAssumeRoleWithSAML(region string) *awsmiddle return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "sts", OperationName: "AssumeRoleWithSAML", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go index aaaa8a04..b2f126b1 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go @@ -4,6 +4,7 @@ package sts import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/service/sts/types" "github.com/aws/smithy-go/middleware" @@ -12,133 +13,112 @@ import ( // Returns a set of temporary security credentials for users who have been // authenticated in a mobile or web application with a web identity provider. -// Example providers include Amazon Cognito, Login with Amazon, Facebook, Google, -// or any OpenID Connect-compatible identity provider. For mobile applications, we -// recommend that you use Amazon Cognito. You can use Amazon Cognito with the AWS -// SDK for iOS Developer Guide (http://aws.amazon.com/sdkforios/) and the AWS SDK -// for Android Developer Guide (http://aws.amazon.com/sdkforandroid/) to uniquely -// identify a user. You can also supply the user with a consistent identity -// throughout the lifetime of an application. To learn more about Amazon Cognito, -// see Amazon Cognito Overview -// (https://docs.aws.amazon.com/mobile/sdkforandroid/developerguide/cognito-auth.html#d0e840) -// in AWS SDK for Android Developer Guide and Amazon Cognito Overview -// (https://docs.aws.amazon.com/mobile/sdkforios/developerguide/cognito-auth.html#d0e664) -// in the AWS SDK for iOS Developer Guide. Calling AssumeRoleWithWebIdentity does -// not require the use of AWS security credentials. Therefore, you can distribute -// an application (for example, on mobile devices) that requests temporary security -// credentials without including long-term AWS credentials in the application. You -// also don't need to deploy server-based proxy services that use long-term AWS -// credentials. Instead, the identity of the caller is validated by using a token -// from the web identity provider. For a comparison of AssumeRoleWithWebIdentity -// with the other API operations that produce temporary credentials, see Requesting -// Temporary Security Credentials -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) -// and Comparing the AWS STS API operations -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) +// Example providers include the OAuth 2.0 providers Login with Amazon and +// Facebook, or any OpenID Connect-compatible identity provider such as Google or +// Amazon Cognito federated identities (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html) +// . For mobile applications, we recommend that you use Amazon Cognito. You can use +// Amazon Cognito with the Amazon Web Services SDK for iOS Developer Guide (http://aws.amazon.com/sdkforios/) +// and the Amazon Web Services SDK for Android Developer Guide (http://aws.amazon.com/sdkforandroid/) +// to uniquely identify a user. You can also supply the user with a consistent +// identity throughout the lifetime of an application. To learn more about Amazon +// Cognito, see Amazon Cognito identity pools (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html) +// in Amazon Cognito Developer Guide. Calling AssumeRoleWithWebIdentity does not +// require the use of Amazon Web Services security credentials. Therefore, you can +// distribute an application (for example, on mobile devices) that requests +// temporary security credentials without including long-term Amazon Web Services +// credentials in the application. You also don't need to deploy server-based proxy +// services that use long-term Amazon Web Services credentials. Instead, the +// identity of the caller is validated by using a token from the web identity +// provider. For a comparison of AssumeRoleWithWebIdentity with the other API +// operations that produce temporary credentials, see Requesting Temporary +// Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) +// and Comparing the Amazon Web Services STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) // in the IAM User Guide. The temporary security credentials returned by this API // consist of an access key ID, a secret access key, and a security token. -// Applications can use these temporary security credentials to sign calls to AWS -// service API operations. Session Duration By default, the temporary security -// credentials created by AssumeRoleWithWebIdentity last for one hour. However, you -// can use the optional DurationSeconds parameter to specify the duration of your -// session. You can provide a value from 900 seconds (15 minutes) up to the maximum -// session duration setting for the role. This setting can have a value from 1 hour -// to 12 hours. To learn how to view the maximum value for your role, see View the -// Maximum Session Duration Setting for a Role -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) +// Applications can use these temporary security credentials to sign calls to +// Amazon Web Services service API operations. Session Duration By default, the +// temporary security credentials created by AssumeRoleWithWebIdentity last for +// one hour. However, you can use the optional DurationSeconds parameter to +// specify the duration of your session. You can provide a value from 900 seconds +// (15 minutes) up to the maximum session duration setting for the role. This +// setting can have a value from 1 hour to 12 hours. To learn how to view the +// maximum value for your role, see View the Maximum Session Duration Setting for +// a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) // in the IAM User Guide. The maximum session duration limit applies when you use // the AssumeRole* API operations or the assume-role* CLI commands. However the // limit does not apply when you use those operations to create a console URL. For -// more information, see Using IAM Roles -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) in the IAM -// User Guide. Permissions The temporary security credentials created by -// AssumeRoleWithWebIdentity can be used to make API calls to any AWS service with -// the following exception: you cannot call the STS GetFederationToken or -// GetSessionToken API operations. (Optional) You can pass inline or managed -// session policies -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) +// more information, see Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) +// in the IAM User Guide. Permissions The temporary security credentials created by +// AssumeRoleWithWebIdentity can be used to make API calls to any Amazon Web +// Services service with the following exception: you cannot call the STS +// GetFederationToken or GetSessionToken API operations. (Optional) You can pass +// inline or managed session policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // to this operation. You can pass a single JSON policy document to use as an -// inline session policy. You can also specify up to 10 managed policies to use as -// managed session policies. The plain text that you use for both inline and -// managed session policies can't exceed 2,048 characters. Passing policies to this -// operation returns new temporary credentials. The resulting session's permissions -// are the intersection of the role's identity-based policy and the session -// policies. You can use the role's temporary credentials in subsequent AWS API -// calls to access resources in the account that owns the role. You cannot use -// session policies to grant more permissions than those allowed by the -// identity-based policy of the role that is being assumed. For more information, -// see Session Policies -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) +// inline session policy. You can also specify up to 10 managed policy Amazon +// Resource Names (ARNs) to use as managed session policies. The plaintext that you +// use for both inline and managed session policies can't exceed 2,048 characters. +// Passing policies to this operation returns new temporary credentials. The +// resulting session's permissions are the intersection of the role's +// identity-based policy and the session policies. You can use the role's temporary +// credentials in subsequent Amazon Web Services API calls to access resources in +// the account that owns the role. You cannot use session policies to grant more +// permissions than those allowed by the identity-based policy of the role that is +// being assumed. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // in the IAM User Guide. Tags (Optional) You can configure your IdP to pass // attributes into your web identity token as session tags. Each session tag // consists of a key name and an associated value. For more information about -// session tags, see Passing Session Tags in STS -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) in the -// IAM User Guide. You can pass up to 50 session tags. The plain text session tag -// keys can’t exceed 128 characters and the values can’t exceed 256 characters. For -// these and additional limits, see IAM and STS Character Limits -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) -// in the IAM User Guide. An AWS conversion compresses the passed session policies -// and session tags into a packed binary format that has a separate limit. Your -// request can fail for this limit even if your plain text meets the other -// requirements. The PackedPolicySize response element indicates by percentage how -// close the policies and tags for your request are to the upper size limit. You -// can pass a session tag with the same key as a tag that is attached to the role. -// When you do, the session tag overrides the role tag with the same key. An -// administrator must grant you the permissions necessary to pass session tags. The -// administrator can also create granular permissions to allow you to pass only -// specific session tags. For more information, see Tutorial: Using Tags for -// Attribute-Based Access Control -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) +// session tags, see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. You can pass up to 50 session tags. The plaintext session +// tag keys can’t exceed 128 characters and the values can’t exceed 256 characters. +// For these and additional limits, see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) +// in the IAM User Guide. An Amazon Web Services conversion compresses the passed +// inline session policy, managed policy ARNs, and session tags into a packed +// binary format that has a separate limit. Your request can fail for this limit +// even if your plaintext meets the other requirements. The PackedPolicySize +// response element indicates by percentage how close the policies and tags for +// your request are to the upper size limit. You can pass a session tag with the +// same key as a tag that is attached to the role. When you do, the session tag +// overrides the role tag with the same key. An administrator must grant you the +// permissions necessary to pass session tags. The administrator can also create +// granular permissions to allow you to pass only specific session tags. For more +// information, see Tutorial: Using Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) // in the IAM User Guide. You can set the session tags as transitive. Transitive -// tags persist during role chaining. For more information, see Chaining Roles with -// Session Tags -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) +// tags persist during role chaining. For more information, see Chaining Roles +// with Session Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) // in the IAM User Guide. Identities Before your application can call -// AssumeRoleWithWebIdentity, you must have an identity token from a supported +// AssumeRoleWithWebIdentity , you must have an identity token from a supported // identity provider and create a role that the application can assume. The role // that your application assumes must trust the identity provider that is // associated with the identity token. In other words, the identity provider must // be specified in the role's trust policy. Calling AssumeRoleWithWebIdentity can -// result in an entry in your AWS CloudTrail logs. The entry includes the Subject -// (http://openid.net/specs/openid-connect-core-1_0.html#Claims) of the provided -// Web Identity Token. We recommend that you avoid using any personally -// identifiable information (PII) in this field. For example, you could instead use -// a GUID or a pairwise identifier, as suggested in the OIDC specification -// (http://openid.net/specs/openid-connect-core-1_0.html#SubjectIDTypes). For more -// information about how to use web identity federation and the +// result in an entry in your CloudTrail logs. The entry includes the Subject (http://openid.net/specs/openid-connect-core-1_0.html#Claims) +// of the provided web identity token. We recommend that you avoid using any +// personally identifiable information (PII) in this field. For example, you could +// instead use a GUID or a pairwise identifier, as suggested in the OIDC +// specification (http://openid.net/specs/openid-connect-core-1_0.html#SubjectIDTypes) +// . For more information about how to use web identity federation and the // AssumeRoleWithWebIdentity API, see the following resources: -// -// * Using Web -// Identity Federation API Operations for Mobile Apps -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc_manual.html) -// and Federation Through a Web-based Identity Provider -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity). -// -// * -// Web Identity Federation Playground -// (https://aws.amazon.com/blogs/aws/the-aws-web-identity-federation-playground/). -// Walk through the process of authenticating through Login with Amazon, Facebook, -// or Google, getting temporary security credentials, and then using those -// credentials to make a request to AWS. -// -// * AWS SDK for iOS Developer Guide -// (http://aws.amazon.com/sdkforios/) and AWS SDK for Android Developer Guide -// (http://aws.amazon.com/sdkforandroid/). These toolkits contain sample apps that -// show how to invoke the identity providers. The toolkits then show how to use the -// information from these providers to get and use temporary security -// credentials. -// -// * Web Identity Federation with Mobile Applications -// (http://aws.amazon.com/articles/web-identity-federation-with-mobile-applications). -// This article discusses web identity federation and shows an example of how to -// use web identity federation to get access to content in Amazon S3. +// - Using Web Identity Federation API Operations for Mobile Apps (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc_manual.html) +// and Federation Through a Web-based Identity Provider (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity) +// . +// - Web Identity Federation Playground (https://aws.amazon.com/blogs/aws/the-aws-web-identity-federation-playground/) +// . Walk through the process of authenticating through Login with Amazon, +// Facebook, or Google, getting temporary security credentials, and then using +// those credentials to make a request to Amazon Web Services. +// - Amazon Web Services SDK for iOS Developer Guide (http://aws.amazon.com/sdkforios/) +// and Amazon Web Services SDK for Android Developer Guide (http://aws.amazon.com/sdkforandroid/) +// . These toolkits contain sample apps that show how to invoke the identity +// providers. The toolkits then show how to use the information from these +// providers to get and use temporary security credentials. +// - Web Identity Federation with Mobile Applications (http://aws.amazon.com/articles/web-identity-federation-with-mobile-applications) +// . This article discusses web identity federation and shows an example of how to +// use web identity federation to get access to content in Amazon S3. func (c *Client) AssumeRoleWithWebIdentity(ctx context.Context, params *AssumeRoleWithWebIdentityInput, optFns ...func(*Options)) (*AssumeRoleWithWebIdentityOutput, error) { if params == nil { params = &AssumeRoleWithWebIdentityInput{} } - result, metadata, err := c.invokeOperation(ctx, "AssumeRoleWithWebIdentity", params, optFns, addOperationAssumeRoleWithWebIdentityMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "AssumeRoleWithWebIdentity", params, optFns, c.addOperationAssumeRoleWithWebIdentityMiddlewares) if err != nil { return nil, err } @@ -170,7 +150,8 @@ type AssumeRoleWithWebIdentityInput struct { // The OAuth 2.0 access token or OpenID Connect ID token that is provided by the // identity provider. Your application must get this token by authenticating the // user who is using your application with a web identity provider before the - // application makes an AssumeRoleWithWebIdentity call. + // application makes an AssumeRoleWithWebIdentity call. Only tokens with RSA + // algorithms (RS256) are supported. // // This member is required. WebIdentityToken *string @@ -181,16 +162,14 @@ type AssumeRoleWithWebIdentityInput struct { // higher than this setting, the operation fails. For example, if you specify a // session duration of 12 hours, but your administrator set the maximum session // duration to 6 hours, your operation fails. To learn how to view the maximum - // value for your role, see View the Maximum Session Duration Setting for a Role - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) + // value for your role, see View the Maximum Session Duration Setting for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) // in the IAM User Guide. By default, the value is set to 3600 seconds. The // DurationSeconds parameter is separate from the duration of a console session // that you might request using the returned credentials. The request to the // federation endpoint for a console sign-in token takes a SessionDuration // parameter that specifies the maximum length of the console session. For more - // information, see Creating a URL that Enables Federated Users to Access the AWS - // Management Console - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html) + // information, see Creating a URL that Enables Federated Users to Access the + // Amazon Web Services Management Console (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html) // in the IAM User Guide. DurationSeconds *int32 @@ -198,63 +177,65 @@ type AssumeRoleWithWebIdentityInput struct { // This parameter is optional. Passing policies to this operation returns new // temporary credentials. The resulting session's permissions are the intersection // of the role's identity-based policy and the session policies. You can use the - // role's temporary credentials in subsequent AWS API calls to access resources in - // the account that owns the role. You cannot use session policies to grant more - // permissions than those allowed by the identity-based policy of the role that is - // being assumed. For more information, see Session Policies - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) - // in the IAM User Guide. The plain text that you use for both inline and managed + // role's temporary credentials in subsequent Amazon Web Services API calls to + // access resources in the account that owns the role. You cannot use session + // policies to grant more permissions than those allowed by the identity-based + // policy of the role that is being assumed. For more information, see Session + // Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + // in the IAM User Guide. The plaintext that you use for both inline and managed // session policies can't exceed 2,048 characters. The JSON policy characters can // be any ASCII character from the space character to the end of the valid // character list (\u0020 through \u00FF). It can also include the tab (\u0009), - // linefeed (\u000A), and carriage return (\u000D) characters. An AWS conversion - // compresses the passed session policies and session tags into a packed binary - // format that has a separate limit. Your request can fail for this limit even if - // your plain text meets the other requirements. The PackedPolicySize response - // element indicates by percentage how close the policies and tags for your request - // are to the upper size limit. + // linefeed (\u000A), and carriage return (\u000D) characters. An Amazon Web + // Services conversion compresses the passed inline session policy, managed policy + // ARNs, and session tags into a packed binary format that has a separate limit. + // Your request can fail for this limit even if your plaintext meets the other + // requirements. The PackedPolicySize response element indicates by percentage how + // close the policies and tags for your request are to the upper size limit. Policy *string // The Amazon Resource Names (ARNs) of the IAM managed policies that you want to // use as managed session policies. The policies must exist in the same account as // the role. This parameter is optional. You can provide up to 10 managed policy - // ARNs. However, the plain text that you use for both inline and managed session + // ARNs. However, the plaintext that you use for both inline and managed session // policies can't exceed 2,048 characters. For more information about ARNs, see - // Amazon Resource Names (ARNs) and AWS Service Namespaces - // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. An AWS conversion compresses the passed session - // policies and session tags into a packed binary format that has a separate limit. - // Your request can fail for this limit even if your plain text meets the other - // requirements. The PackedPolicySize response element indicates by percentage how - // close the policies and tags for your request are to the upper size limit. - // Passing policies to this operation returns new temporary credentials. The - // resulting session's permissions are the intersection of the role's - // identity-based policy and the session policies. You can use the role's temporary - // credentials in subsequent AWS API calls to access resources in the account that - // owns the role. You cannot use session policies to grant more permissions than - // those allowed by the identity-based policy of the role that is being assumed. - // For more information, see Session Policies - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + // Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the Amazon Web Services General Reference. An Amazon Web Services conversion + // compresses the passed inline session policy, managed policy ARNs, and session + // tags into a packed binary format that has a separate limit. Your request can + // fail for this limit even if your plaintext meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. Passing policies to this + // operation returns new temporary credentials. The resulting session's permissions + // are the intersection of the role's identity-based policy and the session + // policies. You can use the role's temporary credentials in subsequent Amazon Web + // Services API calls to access resources in the account that owns the role. You + // cannot use session policies to grant more permissions than those allowed by the + // identity-based policy of the role that is being assumed. For more information, + // see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // in the IAM User Guide. PolicyArns []types.PolicyDescriptorType - // The fully qualified host component of the domain name of the identity provider. - // Specify this value only for OAuth 2.0 access tokens. Currently www.amazon.com - // and graph.facebook.com are the only supported identity providers for OAuth 2.0 - // access tokens. Do not include URL schemes and port numbers. Do not specify this - // value for OpenID Connect ID tokens. + // The fully qualified host component of the domain name of the OAuth 2.0 identity + // provider. Do not specify this value for an OpenID Connect identity provider. + // Currently www.amazon.com and graph.facebook.com are the only supported identity + // providers for OAuth 2.0 access tokens. Do not include URL schemes and port + // numbers. Do not specify this value for OpenID Connect ID tokens. ProviderId *string + + noSmithyDocumentSerde } // Contains the response to a successful AssumeRoleWithWebIdentity request, -// including temporary AWS credentials that can be used to make AWS requests. +// including temporary Amazon Web Services credentials that can be used to make +// Amazon Web Services requests. type AssumeRoleWithWebIdentityOutput struct { // The Amazon Resource Name (ARN) and the assumed role ID, which are identifiers // that you can use to refer to the resulting temporary security credentials. For // example, you can reference these credentials as a principal in a resource-based // policy by using the ARN or assumed role ID. The ARN and ID include the - // RoleSessionName that you specified when you called AssumeRole. + // RoleSessionName that you specified when you called AssumeRole . AssumedRoleUser *types.AssumedRoleUser // The intended audience (also known as client ID) of the web identity token. This @@ -274,12 +255,32 @@ type AssumeRoleWithWebIdentityOutput struct { // allowed space. PackedPolicySize *int32 - // The issuing authority of the web identity token presented. For OpenID Connect ID - // tokens, this contains the value of the iss field. For OAuth 2.0 access tokens, - // this contains the value of the ProviderId parameter that was passed in the - // AssumeRoleWithWebIdentity request. + // The issuing authority of the web identity token presented. For OpenID Connect + // ID tokens, this contains the value of the iss field. For OAuth 2.0 access + // tokens, this contains the value of the ProviderId parameter that was passed in + // the AssumeRoleWithWebIdentity request. Provider *string + // The value of the source identity that is returned in the JSON web token (JWT) + // from the identity provider. You can require users to set a source identity value + // when they assume a role. You do this by using the sts:SourceIdentity condition + // key in a role trust policy. That way, actions that are taken with the role are + // associated with that user. After the source identity is set, the value cannot be + // changed. It is present in the request for all actions that are taken by the role + // and persists across chained role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts#iam-term-role-chaining) + // sessions. You can configure your identity provider to use an attribute + // associated with your users, like user name or email, as the source identity when + // calling AssumeRoleWithWebIdentity . You do this by adding a claim to the JSON + // web token. To learn more about OIDC tokens and claims, see Using Tokens with + // User Pools (https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-with-identity-providers.html) + // in the Amazon Cognito Developer Guide. For more information about using source + // identity, see Monitor and control actions taken with assumed roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html) + // in the IAM User Guide. The regex used to validate this parameter is a string of + // characters consisting of upper- and lower-case alphanumeric characters with no + // spaces. You can also include underscores or any of the following characters: + // =,.@- + SourceIdentity *string + // The unique user identifier that is returned by the identity provider. This // identifier is associated with the WebIdentityToken that was submitted with the // AssumeRoleWithWebIdentity call. The identifier is typically unique to the user @@ -290,9 +291,14 @@ type AssumeRoleWithWebIdentityOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationAssumeRoleWithWebIdentityMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationAssumeRoleWithWebIdentityMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsquery_serializeOpAssumeRoleWithWebIdentity{}, middleware.After) if err != nil { return err @@ -301,6 +307,13 @@ func addOperationAssumeRoleWithWebIdentityMiddlewares(stack *middleware.Stack, o if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "AssumeRoleWithWebIdentity"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -322,7 +335,7 @@ func addOperationAssumeRoleWithWebIdentityMiddlewares(stack *middleware.Stack, o if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -331,12 +344,18 @@ func addOperationAssumeRoleWithWebIdentityMiddlewares(stack *middleware.Stack, o if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpAssumeRoleWithWebIdentityValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssumeRoleWithWebIdentity(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -346,6 +365,9 @@ func addOperationAssumeRoleWithWebIdentityMiddlewares(stack *middleware.Stack, o if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -353,7 +375,6 @@ func newServiceMetadataMiddleware_opAssumeRoleWithWebIdentity(region string) *aw return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "sts", OperationName: "AssumeRoleWithWebIdentity", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_DecodeAuthorizationMessage.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_DecodeAuthorizationMessage.go index a6069be3..97a00b97 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_DecodeAuthorizationMessage.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_DecodeAuthorizationMessage.go @@ -4,6 +4,7 @@ package sts import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" @@ -11,41 +12,34 @@ import ( ) // Decodes additional information about the authorization status of a request from -// an encoded message returned in response to an AWS request. For example, if a -// user is not authorized to perform an operation that he or she has requested, the -// request returns a Client.UnauthorizedOperation response (an HTTP 403 response). -// Some AWS operations additionally return an encoded message that can provide -// details about this authorization failure. Only certain AWS operations return an -// encoded authorization message. The documentation for an individual operation -// indicates whether that operation returns an encoded message in addition to -// returning an HTTP code. The message is encoded because the details of the -// authorization status can constitute privileged information that the user who -// requested the operation should not see. To decode an authorization status -// message, a user must be granted permissions via an IAM policy to request the -// DecodeAuthorizationMessage (sts:DecodeAuthorizationMessage) action. The decoded -// message includes the following type of information: -// -// * Whether the request was -// denied due to an explicit deny or due to the absence of an explicit allow. For -// more information, see Determining Whether a Request is Allowed or Denied -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-denyallow) -// in the IAM User Guide. -// -// * The principal who made the request. -// -// * The requested -// action. -// -// * The requested resource. -// -// * The values of condition keys in the -// context of the user's request. +// an encoded message returned in response to an Amazon Web Services request. For +// example, if a user is not authorized to perform an operation that he or she has +// requested, the request returns a Client.UnauthorizedOperation response (an HTTP +// 403 response). Some Amazon Web Services operations additionally return an +// encoded message that can provide details about this authorization failure. Only +// certain Amazon Web Services operations return an encoded authorization message. +// The documentation for an individual operation indicates whether that operation +// returns an encoded message in addition to returning an HTTP code. The message is +// encoded because the details of the authorization status can contain privileged +// information that the user who requested the operation should not see. To decode +// an authorization status message, a user must be granted permissions through an +// IAM policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html) +// to request the DecodeAuthorizationMessage ( sts:DecodeAuthorizationMessage ) +// action. The decoded message includes the following type of information: +// - Whether the request was denied due to an explicit deny or due to the +// absence of an explicit allow. For more information, see Determining Whether a +// Request is Allowed or Denied (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-denyallow) +// in the IAM User Guide. +// - The principal who made the request. +// - The requested action. +// - The requested resource. +// - The values of condition keys in the context of the user's request. func (c *Client) DecodeAuthorizationMessage(ctx context.Context, params *DecodeAuthorizationMessageInput, optFns ...func(*Options)) (*DecodeAuthorizationMessageOutput, error) { if params == nil { params = &DecodeAuthorizationMessageInput{} } - result, metadata, err := c.invokeOperation(ctx, "DecodeAuthorizationMessage", params, optFns, addOperationDecodeAuthorizationMessageMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "DecodeAuthorizationMessage", params, optFns, c.addOperationDecodeAuthorizationMessageMiddlewares) if err != nil { return nil, err } @@ -61,21 +55,28 @@ type DecodeAuthorizationMessageInput struct { // // This member is required. EncodedMessage *string + + noSmithyDocumentSerde } // A document that contains additional information about the authorization status -// of a request from an encoded message that is returned in response to an AWS -// request. +// of a request from an encoded message that is returned in response to an Amazon +// Web Services request. type DecodeAuthorizationMessageOutput struct { - // An XML document that contains the decoded message. + // The API returns a response with the decoded message. DecodedMessage *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationDecodeAuthorizationMessageMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationDecodeAuthorizationMessageMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsquery_serializeOpDecodeAuthorizationMessage{}, middleware.After) if err != nil { return err @@ -84,6 +85,13 @@ func addOperationDecodeAuthorizationMessageMiddlewares(stack *middleware.Stack, if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DecodeAuthorizationMessage"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -102,16 +110,13 @@ func addOperationDecodeAuthorizationMessageMiddlewares(stack *middleware.Stack, if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -120,12 +125,18 @@ func addOperationDecodeAuthorizationMessageMiddlewares(stack *middleware.Stack, if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpDecodeAuthorizationMessageValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDecodeAuthorizationMessage(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -135,6 +146,9 @@ func addOperationDecodeAuthorizationMessageMiddlewares(stack *middleware.Stack, if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -142,7 +156,6 @@ func newServiceMetadataMiddleware_opDecodeAuthorizationMessage(region string) *a return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "sts", OperationName: "DecodeAuthorizationMessage", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetAccessKeyInfo.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetAccessKeyInfo.go index 0a537cf1..e01fcebf 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetAccessKeyInfo.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetAccessKeyInfo.go @@ -4,6 +4,7 @@ package sts import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" @@ -11,21 +12,18 @@ import ( ) // Returns the account identifier for the specified access key ID. Access keys -// consist of two parts: an access key ID (for example, AKIAIOSFODNN7EXAMPLE) and a -// secret access key (for example, wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY). For -// more information about access keys, see Managing Access Keys for IAM Users -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html) +// consist of two parts: an access key ID (for example, AKIAIOSFODNN7EXAMPLE ) and +// a secret access key (for example, wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY ). +// For more information about access keys, see Managing Access Keys for IAM Users (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html) // in the IAM User Guide. When you pass an access key ID to this operation, it -// returns the ID of the AWS account to which the keys belong. Access key IDs -// beginning with AKIA are long-term credentials for an IAM user or the AWS account -// root user. Access key IDs beginning with ASIA are temporary credentials that are -// created using STS operations. If the account in the response belongs to you, you -// can sign in as the root user and review your root user access keys. Then, you -// can pull a credentials report -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html) +// returns the ID of the Amazon Web Services account to which the keys belong. +// Access key IDs beginning with AKIA are long-term credentials for an IAM user or +// the Amazon Web Services account root user. Access key IDs beginning with ASIA +// are temporary credentials that are created using STS operations. If the account +// in the response belongs to you, you can sign in as the root user and review your +// root user access keys. Then, you can pull a credentials report (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html) // to learn which IAM user owns the keys. To learn who requested the temporary -// credentials for an ASIA access key, view the STS events in your CloudTrail logs -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html) +// credentials for an ASIA access key, view the STS events in your CloudTrail logs (https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html) // in the IAM User Guide. This operation does not indicate the state of the access // key. The key might be active, inactive, or deleted. Active keys might not have // permissions to perform an operation. Providing a deleted access key might return @@ -35,7 +33,7 @@ func (c *Client) GetAccessKeyInfo(ctx context.Context, params *GetAccessKeyInfoI params = &GetAccessKeyInfoInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetAccessKeyInfo", params, optFns, addOperationGetAccessKeyInfoMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetAccessKeyInfo", params, optFns, c.addOperationGetAccessKeyInfoMiddlewares) if err != nil { return nil, err } @@ -53,18 +51,25 @@ type GetAccessKeyInfoInput struct { // // This member is required. AccessKeyId *string + + noSmithyDocumentSerde } type GetAccessKeyInfoOutput struct { - // The number used to identify the AWS account. + // The number used to identify the Amazon Web Services account. Account *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetAccessKeyInfoMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetAccessKeyInfoMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsquery_serializeOpGetAccessKeyInfo{}, middleware.After) if err != nil { return err @@ -73,6 +78,13 @@ func addOperationGetAccessKeyInfoMiddlewares(stack *middleware.Stack, options Op if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetAccessKeyInfo"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -91,16 +103,13 @@ func addOperationGetAccessKeyInfoMiddlewares(stack *middleware.Stack, options Op if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -109,12 +118,18 @@ func addOperationGetAccessKeyInfoMiddlewares(stack *middleware.Stack, options Op if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpGetAccessKeyInfoValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAccessKeyInfo(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -124,6 +139,9 @@ func addOperationGetAccessKeyInfoMiddlewares(stack *middleware.Stack, options Op if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -131,7 +149,6 @@ func newServiceMetadataMiddleware_opGetAccessKeyInfo(region string) *awsmiddlewa return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "sts", OperationName: "GetAccessKeyInfo", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetCallerIdentity.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetCallerIdentity.go index 6f4a73e7..80296940 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetCallerIdentity.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetCallerIdentity.go @@ -4,6 +4,7 @@ package sts import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" @@ -12,19 +13,18 @@ import ( // Returns details about the IAM user or role whose credentials are used to call // the operation. No permissions are required to perform this operation. If an -// administrator adds a policy to your IAM user or role that explicitly denies -// access to the sts:GetCallerIdentity action, you can still perform this -// operation. Permissions are not required because the same information is returned -// when an IAM user or role is denied access. To view an example response, see I Am -// Not Authorized to Perform: iam:DeleteVirtualMFADevice -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_access-denied-delete-mfa) +// administrator attaches a policy to your identity that explicitly denies access +// to the sts:GetCallerIdentity action, you can still perform this operation. +// Permissions are not required because the same information is returned when +// access is denied. To view an example response, see I Am Not Authorized to +// Perform: iam:DeleteVirtualMFADevice (https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_access-denied-delete-mfa) // in the IAM User Guide. func (c *Client) GetCallerIdentity(ctx context.Context, params *GetCallerIdentityInput, optFns ...func(*Options)) (*GetCallerIdentityOutput, error) { if params == nil { params = &GetCallerIdentityInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetCallerIdentity", params, optFns, addOperationGetCallerIdentityMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetCallerIdentity", params, optFns, c.addOperationGetCallerIdentityMiddlewares) if err != nil { return nil, err } @@ -35,31 +35,36 @@ func (c *Client) GetCallerIdentity(ctx context.Context, params *GetCallerIdentit } type GetCallerIdentityInput struct { + noSmithyDocumentSerde } // Contains the response to a successful GetCallerIdentity request, including // information about the entity making the request. type GetCallerIdentityOutput struct { - // The AWS account ID number of the account that owns or contains the calling - // entity. + // The Amazon Web Services account ID number of the account that owns or contains + // the calling entity. Account *string - // The AWS ARN associated with the calling entity. + // The Amazon Web Services ARN associated with the calling entity. Arn *string - // The unique identifier of the calling entity. The exact value depends on the type - // of entity that is making the call. The values returned are those listed in the - // aws:userid column in the Principal table - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable) + // The unique identifier of the calling entity. The exact value depends on the + // type of entity that is making the call. The values returned are those listed in + // the aws:userid column in the Principal table (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable) // found on the Policy Variables reference page in the IAM User Guide. UserId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetCallerIdentityMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetCallerIdentityMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsquery_serializeOpGetCallerIdentity{}, middleware.After) if err != nil { return err @@ -68,6 +73,13 @@ func addOperationGetCallerIdentityMiddlewares(stack *middleware.Stack, options O if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetCallerIdentity"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -86,16 +98,13 @@ func addOperationGetCallerIdentityMiddlewares(stack *middleware.Stack, options O if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -104,9 +113,15 @@ func addOperationGetCallerIdentityMiddlewares(stack *middleware.Stack, options O if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCallerIdentity(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -116,6 +131,9 @@ func addOperationGetCallerIdentityMiddlewares(stack *middleware.Stack, options O if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -123,7 +141,6 @@ func newServiceMetadataMiddleware_opGetCallerIdentity(region string) *awsmiddlew return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "sts", OperationName: "GetCallerIdentity", } } @@ -141,7 +158,7 @@ func (c *PresignClient) PresignGetCallerIdentity(ctx context.Context, params *Ge clientOptFns := append(options.ClientOptions, withNopHTTPClientAPIOption) result, _, err := c.client.invokeOperation(ctx, "GetCallerIdentity", params, clientOptFns, - addOperationGetCallerIdentityMiddlewares, + c.client.addOperationGetCallerIdentityMiddlewares, presignConverter(options).convertToPresignMiddleware, ) if err != nil { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go index 41535257..efaba119 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go @@ -4,6 +4,7 @@ package sts import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sts/types" @@ -11,89 +12,83 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns a set of temporary security credentials (consisting of an access key ID, -// a secret access key, and a security token) for a federated user. A typical use -// is in a proxy application that gets temporary security credentials on behalf of +// Returns a set of temporary security credentials (consisting of an access key +// ID, a secret access key, and a security token) for a user. A typical use is in a +// proxy application that gets temporary security credentials on behalf of // distributed applications inside a corporate network. You must call the // GetFederationToken operation using the long-term security credentials of an IAM // user. As a result, this call is appropriate in contexts where those credentials -// can be safely stored, usually in a server-based application. For a comparison of +// can be safeguarded, usually in a server-based application. For a comparison of // GetFederationToken with the other API operations that produce temporary -// credentials, see Requesting Temporary Security Credentials -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) -// and Comparing the AWS STS API operations -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) +// credentials, see Requesting Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) +// and Comparing the Amazon Web Services STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) +// in the IAM User Guide. Although it is possible to call GetFederationToken using +// the security credentials of an Amazon Web Services account root user rather than +// an IAM user that you create for the purpose of a proxy application, we do not +// recommend it. For more information, see Safeguard your root user credentials +// and don't use them for everyday tasks (https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#lock-away-credentials) // in the IAM User Guide. You can create a mobile-based or browser-based app that // can authenticate users using a web identity provider like Login with Amazon, // Facebook, Google, or an OpenID Connect-compatible identity provider. In this // case, we recommend that you use Amazon Cognito (http://aws.amazon.com/cognito/) -// or AssumeRoleWithWebIdentity. For more information, see Federation Through a -// Web-based Identity Provider -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity) -// in the IAM User Guide. You can also call GetFederationToken using the security -// credentials of an AWS account root user, but we do not recommend it. Instead, we -// recommend that you create an IAM user for the purpose of the proxy application. -// Then attach a policy to the IAM user that limits federated users to only the -// actions and resources that they need to access. For more information, see IAM -// Best Practices -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html) in the -// IAM User Guide. Session duration The temporary credentials are valid for the -// specified duration, from 900 seconds (15 minutes) up to a maximum of 129,600 +// or AssumeRoleWithWebIdentity . For more information, see Federation Through a +// Web-based Identity Provider (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity) +// in the IAM User Guide. Session duration The temporary credentials are valid for +// the specified duration, from 900 seconds (15 minutes) up to a maximum of 129,600 // seconds (36 hours). The default session duration is 43,200 seconds (12 hours). -// Temporary credentials that are obtained by using AWS account root user -// credentials have a maximum duration of 3,600 seconds (1 hour). Permissions You -// can use the temporary credentials created by GetFederationToken in any AWS -// service except the following: +// Temporary credentials obtained by using the root user credentials have a maximum +// duration of 3,600 seconds (1 hour). Permissions You can use the temporary +// credentials created by GetFederationToken in any Amazon Web Services service +// with the following exceptions: +// - You cannot call any IAM operations using the CLI or the Amazon Web Services +// API. This limitation does not apply to console sessions. +// - You cannot call any STS operations except GetCallerIdentity . // -// * You cannot call any IAM operations using the -// AWS CLI or the AWS API. -// -// * You cannot call any STS operations except -// GetCallerIdentity. -// -// You must pass an inline or managed session policy -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) +// You can use temporary credentials for single sign-on (SSO) to the console. You +// must pass an inline or managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // to this operation. You can pass a single JSON policy document to use as an -// inline session policy. You can also specify up to 10 managed policies to use as -// managed session policies. The plain text that you use for both inline and -// managed session policies can't exceed 2,048 characters. Though the session -// policy parameters are optional, if you do not pass a policy, then the resulting -// federated user session has no permissions. When you pass session policies, the -// session permissions are the intersection of the IAM user policies and the -// session policies that you pass. This gives you a way to further restrict the -// permissions for a federated user. You cannot use session policies to grant more -// permissions than those that are defined in the permissions policy of the IAM -// user. For more information, see Session Policies -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) +// inline session policy. You can also specify up to 10 managed policy Amazon +// Resource Names (ARNs) to use as managed session policies. The plaintext that you +// use for both inline and managed session policies can't exceed 2,048 characters. +// Though the session policy parameters are optional, if you do not pass a policy, +// then the resulting federated user session has no permissions. When you pass +// session policies, the session permissions are the intersection of the IAM user +// policies and the session policies that you pass. This gives you a way to further +// restrict the permissions for a federated user. You cannot use session policies +// to grant more permissions than those that are defined in the permissions policy +// of the IAM user. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // in the IAM User Guide. For information about using GetFederationToken to create // temporary security credentials, see GetFederationToken—Federation Through a -// Custom Identity Broker -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getfederationtoken). -// You can use the credentials to access a resource that has a resource-based +// Custom Identity Broker (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getfederationtoken) +// . You can use the credentials to access a resource that has a resource-based // policy. If that policy specifically references the federated user session in the // Principal element of the policy, the session has the permissions allowed by the // policy. These permissions are granted in addition to the permissions granted by // the session policies. Tags (Optional) You can pass tag key-value pairs to your // session. These are called session tags. For more information about session tags, -// see Passing Session Tags in STS -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) in the -// IAM User Guide. An administrator must grant you the permissions necessary to -// pass session tags. The administrator can also create granular permissions to +// see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. You can create a mobile-based or browser-based app that +// can authenticate users using a web identity provider like Login with Amazon, +// Facebook, Google, or an OpenID Connect-compatible identity provider. In this +// case, we recommend that you use Amazon Cognito (http://aws.amazon.com/cognito/) +// or AssumeRoleWithWebIdentity . For more information, see Federation Through a +// Web-based Identity Provider (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity) +// in the IAM User Guide. An administrator must grant you the permissions necessary +// to pass session tags. The administrator can also create granular permissions to // allow you to pass only specific session tags. For more information, see -// Tutorial: Using Tags for Attribute-Based Access Control -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) +// Tutorial: Using Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) // in the IAM User Guide. Tag key–value pairs are not case sensitive, but case is // preserved. This means that you cannot have separate Department and department -// tag keys. Assume that the user that you are federating has the -// Department=Marketing tag and you pass the department=engineering session tag. -// Department and department are not saved as separate tags, and the session tag -// passed in the request takes precedence over the user tag. +// tag keys. Assume that the user that you are federating has the Department = +// Marketing tag and you pass the department = engineering session tag. Department +// and department are not saved as separate tags, and the session tag passed in +// the request takes precedence over the user tag. func (c *Client) GetFederationToken(ctx context.Context, params *GetFederationTokenInput, optFns ...func(*Options)) (*GetFederationTokenOutput, error) { if params == nil { params = &GetFederationTokenInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetFederationToken", params, optFns, addOperationGetFederationTokenMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetFederationToken", params, optFns, c.addOperationGetFederationTokenMiddlewares) if err != nil { return nil, err } @@ -106,113 +101,112 @@ func (c *Client) GetFederationToken(ctx context.Context, params *GetFederationTo type GetFederationTokenInput struct { // The name of the federated user. The name is used as an identifier for the - // temporary security credentials (such as Bob). For example, you can reference the - // federated user name in a resource-based policy, such as in an Amazon S3 bucket - // policy. The regex used to validate this parameter is a string of characters - // consisting of upper- and lower-case alphanumeric characters with no spaces. You - // can also include underscores or any of the following characters: =,.@- + // temporary security credentials (such as Bob ). For example, you can reference + // the federated user name in a resource-based policy, such as in an Amazon S3 + // bucket policy. The regex used to validate this parameter is a string of + // characters consisting of upper- and lower-case alphanumeric characters with no + // spaces. You can also include underscores or any of the following characters: + // =,.@- // // This member is required. Name *string - // The duration, in seconds, that the session should last. Acceptable durations for - // federation sessions range from 900 seconds (15 minutes) to 129,600 seconds (36 - // hours), with 43,200 seconds (12 hours) as the default. Sessions obtained using - // AWS account root user credentials are restricted to a maximum of 3,600 seconds - // (one hour). If the specified duration is longer than one hour, the session - // obtained by using root user credentials defaults to one hour. + // The duration, in seconds, that the session should last. Acceptable durations + // for federation sessions range from 900 seconds (15 minutes) to 129,600 seconds + // (36 hours), with 43,200 seconds (12 hours) as the default. Sessions obtained + // using root user credentials are restricted to a maximum of 3,600 seconds (one + // hour). If the specified duration is longer than one hour, the session obtained + // by using root user credentials defaults to one hour. DurationSeconds *int32 // An IAM policy in JSON format that you want to use as an inline session policy. - // You must pass an inline or managed session policy - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + // You must pass an inline or managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // to this operation. You can pass a single JSON policy document to use as an - // inline session policy. You can also specify up to 10 managed policies to use as - // managed session policies. This parameter is optional. However, if you do not - // pass any session policies, then the resulting federated user session has no - // permissions. When you pass session policies, the session permissions are the - // intersection of the IAM user policies and the session policies that you pass. - // This gives you a way to further restrict the permissions for a federated user. - // You cannot use session policies to grant more permissions than those that are - // defined in the permissions policy of the IAM user. For more information, see - // Session Policies - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + // inline session policy. You can also specify up to 10 managed policy Amazon + // Resource Names (ARNs) to use as managed session policies. This parameter is + // optional. However, if you do not pass any session policies, then the resulting + // federated user session has no permissions. When you pass session policies, the + // session permissions are the intersection of the IAM user policies and the + // session policies that you pass. This gives you a way to further restrict the + // permissions for a federated user. You cannot use session policies to grant more + // permissions than those that are defined in the permissions policy of the IAM + // user. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // in the IAM User Guide. The resulting credentials can be used to access a // resource that has a resource-based policy. If that policy specifically // references the federated user session in the Principal element of the policy, // the session has the permissions allowed by the policy. These permissions are // granted in addition to the permissions that are granted by the session policies. - // The plain text that you use for both inline and managed session policies can't + // The plaintext that you use for both inline and managed session policies can't // exceed 2,048 characters. The JSON policy characters can be any ASCII character // from the space character to the end of the valid character list (\u0020 through // \u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage - // return (\u000D) characters. An AWS conversion compresses the passed session - // policies and session tags into a packed binary format that has a separate limit. - // Your request can fail for this limit even if your plain text meets the other - // requirements. The PackedPolicySize response element indicates by percentage how - // close the policies and tags for your request are to the upper size limit. + // return (\u000D) characters. An Amazon Web Services conversion compresses the + // passed inline session policy, managed policy ARNs, and session tags into a + // packed binary format that has a separate limit. Your request can fail for this + // limit even if your plaintext meets the other requirements. The PackedPolicySize + // response element indicates by percentage how close the policies and tags for + // your request are to the upper size limit. Policy *string // The Amazon Resource Names (ARNs) of the IAM managed policies that you want to // use as a managed session policy. The policies must exist in the same account as // the IAM user that is requesting federated access. You must pass an inline or - // managed session policy - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + // managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // to this operation. You can pass a single JSON policy document to use as an - // inline session policy. You can also specify up to 10 managed policies to use as - // managed session policies. The plain text that you use for both inline and - // managed session policies can't exceed 2,048 characters. You can provide up to 10 - // managed policy ARNs. For more information about ARNs, see Amazon Resource Names - // (ARNs) and AWS Service Namespaces - // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. This parameter is optional. However, if you do not - // pass any session policies, then the resulting federated user session has no - // permissions. When you pass session policies, the session permissions are the - // intersection of the IAM user policies and the session policies that you pass. - // This gives you a way to further restrict the permissions for a federated user. - // You cannot use session policies to grant more permissions than those that are - // defined in the permissions policy of the IAM user. For more information, see - // Session Policies - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + // inline session policy. You can also specify up to 10 managed policy Amazon + // Resource Names (ARNs) to use as managed session policies. The plaintext that you + // use for both inline and managed session policies can't exceed 2,048 characters. + // You can provide up to 10 managed policy ARNs. For more information about ARNs, + // see Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the Amazon Web Services General Reference. This parameter is optional. + // However, if you do not pass any session policies, then the resulting federated + // user session has no permissions. When you pass session policies, the session + // permissions are the intersection of the IAM user policies and the session + // policies that you pass. This gives you a way to further restrict the permissions + // for a federated user. You cannot use session policies to grant more permissions + // than those that are defined in the permissions policy of the IAM user. For more + // information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // in the IAM User Guide. The resulting credentials can be used to access a // resource that has a resource-based policy. If that policy specifically // references the federated user session in the Principal element of the policy, // the session has the permissions allowed by the policy. These permissions are // granted in addition to the permissions that are granted by the session policies. - // An AWS conversion compresses the passed session policies and session tags into a - // packed binary format that has a separate limit. Your request can fail for this - // limit even if your plain text meets the other requirements. The PackedPolicySize - // response element indicates by percentage how close the policies and tags for - // your request are to the upper size limit. + // An Amazon Web Services conversion compresses the passed inline session policy, + // managed policy ARNs, and session tags into a packed binary format that has a + // separate limit. Your request can fail for this limit even if your plaintext + // meets the other requirements. The PackedPolicySize response element indicates + // by percentage how close the policies and tags for your request are to the upper + // size limit. PolicyArns []types.PolicyDescriptorType // A list of session tags. Each session tag consists of a key name and an // associated value. For more information about session tags, see Passing Session - // Tags in STS - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) in the - // IAM User Guide. This parameter is optional. You can pass up to 50 session tags. - // The plain text session tag keys can’t exceed 128 characters and the values can’t - // exceed 256 characters. For these and additional limits, see IAM and STS - // Character Limits - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) - // in the IAM User Guide. An AWS conversion compresses the passed session policies - // and session tags into a packed binary format that has a separate limit. Your - // request can fail for this limit even if your plain text meets the other - // requirements. The PackedPolicySize response element indicates by percentage how - // close the policies and tags for your request are to the upper size limit. You - // can pass a session tag with the same key as a tag that is already attached to - // the user you are federating. When you do, session tags override a user tag with - // the same key. Tag key–value pairs are not case sensitive, but case is preserved. - // This means that you cannot have separate Department and department tag keys. - // Assume that the role has the Department=Marketing tag and you pass the - // department=engineering session tag. Department and department are not saved as - // separate tags, and the session tag passed in the request takes precedence over - // the role tag. + // Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) + // in the IAM User Guide. This parameter is optional. You can pass up to 50 session + // tags. The plaintext session tag keys can’t exceed 128 characters and the values + // can’t exceed 256 characters. For these and additional limits, see IAM and STS + // Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) + // in the IAM User Guide. An Amazon Web Services conversion compresses the passed + // inline session policy, managed policy ARNs, and session tags into a packed + // binary format that has a separate limit. Your request can fail for this limit + // even if your plaintext meets the other requirements. The PackedPolicySize + // response element indicates by percentage how close the policies and tags for + // your request are to the upper size limit. You can pass a session tag with the + // same key as a tag that is already attached to the user you are federating. When + // you do, session tags override a user tag with the same key. Tag key–value pairs + // are not case sensitive, but case is preserved. This means that you cannot have + // separate Department and department tag keys. Assume that the role has the + // Department = Marketing tag and you pass the department = engineering session + // tag. Department and department are not saved as separate tags, and the session + // tag passed in the request takes precedence over the role tag. Tags []types.Tag + + noSmithyDocumentSerde } // Contains the response to a successful GetFederationToken request, including -// temporary AWS credentials that can be used to make AWS requests. +// temporary Amazon Web Services credentials that can be used to make Amazon Web +// Services requests. type GetFederationTokenOutput struct { // The temporary security credentials, which include an access key ID, a secret @@ -222,7 +216,7 @@ type GetFederationTokenOutput struct { Credentials *types.Credentials // Identifiers for the federated user associated with the credentials (such as - // arn:aws:sts::123456789012:federated-user/Bob or 123456789012:Bob). You can use + // arn:aws:sts::123456789012:federated-user/Bob or 123456789012:Bob ). You can use // the federated user's ARN in your resource-based policies, such as an Amazon S3 // bucket policy. FederatedUser *types.FederatedUser @@ -235,9 +229,14 @@ type GetFederationTokenOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetFederationTokenMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetFederationTokenMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsquery_serializeOpGetFederationToken{}, middleware.After) if err != nil { return err @@ -246,6 +245,13 @@ func addOperationGetFederationTokenMiddlewares(stack *middleware.Stack, options if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetFederationToken"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -264,16 +270,13 @@ func addOperationGetFederationTokenMiddlewares(stack *middleware.Stack, options if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -282,12 +285,18 @@ func addOperationGetFederationTokenMiddlewares(stack *middleware.Stack, options if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = addOpGetFederationTokenValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetFederationToken(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -297,6 +306,9 @@ func addOperationGetFederationTokenMiddlewares(stack *middleware.Stack, options if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -304,7 +316,6 @@ func newServiceMetadataMiddleware_opGetFederationToken(region string) *awsmiddle return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "sts", OperationName: "GetFederationToken", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go index 45dd1970..7b07435f 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go @@ -4,6 +4,7 @@ package sts import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/sts/types" @@ -11,57 +12,53 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns a set of temporary credentials for an AWS account or IAM user. The -// credentials consist of an access key ID, a secret access key, and a security -// token. Typically, you use GetSessionToken if you want to use MFA to protect -// programmatic calls to specific AWS API operations like Amazon EC2 StopInstances. -// MFA-enabled IAM users would need to call GetSessionToken and submit an MFA code -// that is associated with their MFA device. Using the temporary security -// credentials that are returned from the call, IAM users can then make -// programmatic calls to API operations that require MFA authentication. If you do -// not supply a correct MFA code, then the API returns an access denied error. For -// a comparison of GetSessionToken with the other API operations that produce -// temporary credentials, see Requesting Temporary Security Credentials -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) -// and Comparing the AWS STS API operations -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) +// Returns a set of temporary credentials for an Amazon Web Services account or +// IAM user. The credentials consist of an access key ID, a secret access key, and +// a security token. Typically, you use GetSessionToken if you want to use MFA to +// protect programmatic calls to specific Amazon Web Services API operations like +// Amazon EC2 StopInstances . MFA-enabled IAM users must call GetSessionToken and +// submit an MFA code that is associated with their MFA device. Using the temporary +// security credentials that the call returns, IAM users can then make programmatic +// calls to API operations that require MFA authentication. An incorrect MFA code +// causes the API to return an access denied error. For a comparison of +// GetSessionToken with the other API operations that produce temporary +// credentials, see Requesting Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) +// and Comparing the Amazon Web Services STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) +// in the IAM User Guide. No permissions are required for users to perform this +// operation. The purpose of the sts:GetSessionToken operation is to authenticate +// the user using MFA. You cannot use policies to control authentication +// operations. For more information, see Permissions for GetSessionToken (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getsessiontoken.html) // in the IAM User Guide. Session Duration The GetSessionToken operation must be -// called by using the long-term AWS security credentials of the AWS account root -// user or an IAM user. Credentials that are created by IAM users are valid for the -// duration that you specify. This duration can range from 900 seconds (15 minutes) -// up to a maximum of 129,600 seconds (36 hours), with a default of 43,200 seconds -// (12 hours). Credentials based on account credentials can range from 900 seconds -// (15 minutes) up to 3,600 seconds (1 hour), with a default of 1 hour. Permissions -// The temporary security credentials created by GetSessionToken can be used to -// make API calls to any AWS service with the following exceptions: +// called by using the long-term Amazon Web Services security credentials of an IAM +// user. Credentials that are created by IAM users are valid for the duration that +// you specify. This duration can range from 900 seconds (15 minutes) up to a +// maximum of 129,600 seconds (36 hours), with a default of 43,200 seconds (12 +// hours). Credentials based on account credentials can range from 900 seconds (15 +// minutes) up to 3,600 seconds (1 hour), with a default of 1 hour. Permissions The +// temporary security credentials created by GetSessionToken can be used to make +// API calls to any Amazon Web Services service with the following exceptions: +// - You cannot call any IAM API operations unless MFA authentication +// information is included in the request. +// - You cannot call any STS API except AssumeRole or GetCallerIdentity . // -// * You cannot -// call any IAM API operations unless MFA authentication information is included in -// the request. -// -// * You cannot call any STS API except AssumeRole or -// GetCallerIdentity. -// -// We recommend that you do not call GetSessionToken with AWS -// account root user credentials. Instead, follow our best practices -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#create-iam-users) -// by creating one or more IAM users, giving them the necessary permissions, and -// using IAM users for everyday interaction with AWS. The credentials that are -// returned by GetSessionToken are based on permissions associated with the user -// whose credentials were used to call the operation. If GetSessionToken is called -// using AWS account root user credentials, the temporary credentials have root -// user permissions. Similarly, if GetSessionToken is called using the credentials -// of an IAM user, the temporary credentials have the same permissions as the IAM -// user. For more information about using GetSessionToken to create temporary -// credentials, go to Temporary Credentials for Users in Untrusted Environments -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getsessiontoken) +// The credentials that GetSessionToken returns are based on permissions +// associated with the IAM user whose credentials were used to call the operation. +// The temporary credentials have the same permissions as the IAM user. Although it +// is possible to call GetSessionToken using the security credentials of an Amazon +// Web Services account root user rather than an IAM user, we do not recommend it. +// If GetSessionToken is called using root user credentials, the temporary +// credentials have root user permissions. For more information, see Safeguard +// your root user credentials and don't use them for everyday tasks (https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#lock-away-credentials) +// in the IAM User Guide For more information about using GetSessionToken to +// create temporary credentials, see Temporary Credentials for Users in Untrusted +// Environments (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getsessiontoken) // in the IAM User Guide. func (c *Client) GetSessionToken(ctx context.Context, params *GetSessionTokenInput, optFns ...func(*Options)) (*GetSessionTokenOutput, error) { if params == nil { params = &GetSessionTokenInput{} } - result, metadata, err := c.invokeOperation(ctx, "GetSessionToken", params, optFns, addOperationGetSessionTokenMiddlewares) + result, metadata, err := c.invokeOperation(ctx, "GetSessionToken", params, optFns, c.addOperationGetSessionTokenMiddlewares) if err != nil { return nil, err } @@ -76,35 +73,38 @@ type GetSessionTokenInput struct { // The duration, in seconds, that the credentials should remain valid. Acceptable // durations for IAM user sessions range from 900 seconds (15 minutes) to 129,600 // seconds (36 hours), with 43,200 seconds (12 hours) as the default. Sessions for - // AWS account owners are restricted to a maximum of 3,600 seconds (one hour). If - // the duration is longer than one hour, the session for AWS account owners - // defaults to one hour. + // Amazon Web Services account owners are restricted to a maximum of 3,600 seconds + // (one hour). If the duration is longer than one hour, the session for Amazon Web + // Services account owners defaults to one hour. DurationSeconds *int32 - // The identification number of the MFA device that is associated with the IAM user - // who is making the GetSessionToken call. Specify this value if the IAM user has a - // policy that requires MFA authentication. The value is either the serial number - // for a hardware device (such as GAHT12345678) or an Amazon Resource Name (ARN) - // for a virtual device (such as arn:aws:iam::123456789012:mfa/user). You can find - // the device for an IAM user by going to the AWS Management Console and viewing - // the user's security credentials. The regex used to validate this parameter is a - // string of characters consisting of upper- and lower-case alphanumeric characters - // with no spaces. You can also include underscores or any of the following - // characters: =,.@:/- + // The identification number of the MFA device that is associated with the IAM + // user who is making the GetSessionToken call. Specify this value if the IAM user + // has a policy that requires MFA authentication. The value is either the serial + // number for a hardware device (such as GAHT12345678 ) or an Amazon Resource Name + // (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user ). You + // can find the device for an IAM user by going to the Amazon Web Services + // Management Console and viewing the user's security credentials. The regex used + // to validate this parameter is a string of characters consisting of upper- and + // lower-case alphanumeric characters with no spaces. You can also include + // underscores or any of the following characters: =,.@:/- SerialNumber *string - // The value provided by the MFA device, if MFA is required. If any policy requires - // the IAM user to submit an MFA code, specify this value. If MFA authentication is - // required, the user must provide a code when requesting a set of temporary - // security credentials. A user who fails to provide the code receives an "access - // denied" response when requesting resources that require MFA authentication. The - // format for this parameter, as described by its regex pattern, is a sequence of - // six numeric digits. + // The value provided by the MFA device, if MFA is required. If any policy + // requires the IAM user to submit an MFA code, specify this value. If MFA + // authentication is required, the user must provide a code when requesting a set + // of temporary security credentials. A user who fails to provide the code receives + // an "access denied" response when requesting resources that require MFA + // authentication. The format for this parameter, as described by its regex + // pattern, is a sequence of six numeric digits. TokenCode *string + + noSmithyDocumentSerde } // Contains the response to a successful GetSessionToken request, including -// temporary AWS credentials that can be used to make AWS requests. +// temporary Amazon Web Services credentials that can be used to make Amazon Web +// Services requests. type GetSessionTokenOutput struct { // The temporary security credentials, which include an access key ID, a secret @@ -115,9 +115,14 @@ type GetSessionTokenOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata + + noSmithyDocumentSerde } -func addOperationGetSessionTokenMiddlewares(stack *middleware.Stack, options Options) (err error) { +func (c *Client) addOperationGetSessionTokenMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsAwsquery_serializeOpGetSessionToken{}, middleware.After) if err != nil { return err @@ -126,6 +131,13 @@ func addOperationGetSessionTokenMiddlewares(stack *middleware.Stack, options Opt if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetSessionToken"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } @@ -144,16 +156,13 @@ func addOperationGetSessionTokenMiddlewares(stack *middleware.Stack, options Opt if err = addRetryMiddlewares(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { - return err - } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } - if err = addClientUserAgent(stack); err != nil { + if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { @@ -162,9 +171,15 @@ func addOperationGetSessionTokenMiddlewares(stack *middleware.Stack, options Opt if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSessionToken(options.Region), middleware.Before); err != nil { return err } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } @@ -174,6 +189,9 @@ func addOperationGetSessionTokenMiddlewares(stack *middleware.Stack, options Opt if err = addRequestResponseLogging(stack, options); err != nil { return err } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } return nil } @@ -181,7 +199,6 @@ func newServiceMetadataMiddleware_opGetSessionToken(region string) *awsmiddlewar return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "sts", OperationName: "GetSessionToken", } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/auth.go new file mode 100644 index 00000000..9db5bfd4 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/auth.go @@ -0,0 +1,296 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sts + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func bindAuthParamsRegion(params *AuthResolverParameters, _ interface{}, options Options) { + params.Region = options.Region +} + +type setLegacyContextSigningOptionsMiddleware struct { +} + +func (*setLegacyContextSigningOptionsMiddleware) ID() string { + return "setLegacyContextSigningOptions" +} + +func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + schemeID := rscheme.Scheme.SchemeID() + + if sn := awsmiddleware.GetSigningName(ctx); sn != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) + } + } + + if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) + } + } + + return next.HandleFinalize(ctx, in) +} + +func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) +} + +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + +// AuthResolverParameters contains the set of inputs necessary for auth scheme +// resolution. +type AuthResolverParameters struct { + // The name of the operation being invoked. + Operation string + + // The region in which the operation is being invoked. + Region string +} + +func bindAuthResolverParams(operation string, input interface{}, options Options) *AuthResolverParameters { + params := &AuthResolverParameters{ + Operation: operation, + } + + bindAuthParamsRegion(params, input, options) + + return params +} + +// AuthSchemeResolver returns a set of possible authentication options for an +// operation. +type AuthSchemeResolver interface { + ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) +} + +type defaultAuthSchemeResolver struct{} + +var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) + +func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + if overrides, ok := operationAuthOptions[params.Operation]; ok { + return overrides(params), nil + } + return serviceAuthOptions(params), nil +} + +var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{ + "AssumeRoleWithSAML": func(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + {SchemeID: smithyauth.SchemeIDAnonymous}, + } + }, + + "AssumeRoleWithWebIdentity": func(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + {SchemeID: smithyauth.SchemeIDAnonymous}, + } + }, +} + +func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + { + SchemeID: smithyauth.SchemeIDSigV4, + SignerProperties: func() smithy.Properties { + var props smithy.Properties + smithyhttp.SetSigV4SigningName(&props, "sts") + smithyhttp.SetSigV4SigningRegion(&props, params.Region) + return props + }(), + }, + } +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + params := bindAuthResolverParams(m.operation, getOperationInput(ctx), m.options) + options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) + } + + scheme, ok := m.selectScheme(options) + if !ok { + return out, metadata, fmt.Errorf("could not select an auth scheme") + } + + ctx = setResolvedAuthScheme(ctx, scheme) + return next.HandleFinalize(ctx, in) +} + +func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { + for _, option := range options { + if option.SchemeID == smithyauth.SchemeIDAnonymous { + return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true + } + + for _, scheme := range m.options.AuthSchemes { + if scheme.SchemeID() != option.SchemeID { + continue + } + + if scheme.IdentityResolver(m.options) != nil { + return newResolvedAuthScheme(scheme, option), true + } + } + } + + return nil, false +} + +type resolvedAuthSchemeKey struct{} + +type resolvedAuthScheme struct { + Scheme smithyhttp.AuthScheme + IdentityProperties smithy.Properties + SignerProperties smithy.Properties +} + +func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { + return &resolvedAuthScheme{ + Scheme: scheme, + IdentityProperties: option.IdentityProperties, + SignerProperties: option.SignerProperties, + } +} + +func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { + return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) +} + +func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { + v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) + return v +} + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + resolver := rscheme.Scheme.IdentityResolver(m.options) + if resolver == nil { + return out, metadata, fmt.Errorf("no identity resolver") + } + + identity, err := resolver.GetIdentity(ctx, rscheme.IdentityProperties) + if err != nil { + return out, metadata, fmt.Errorf("get identity: %w", err) + } + + ctx = setIdentity(ctx, identity) + return next.HandleFinalize(ctx, in) +} + +type identityKey struct{} + +func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { + return middleware.WithStackValue(ctx, identityKey{}, identity) +} + +func getIdentity(ctx context.Context) smithyauth.Identity { + v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) + return v +} + +type signRequestMiddleware struct { +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + signer := rscheme.Scheme.Signer() + if signer == nil { + return out, metadata, fmt.Errorf("no signer") + } + + if err := signer.SignRequest(ctx, req, identity, rscheme.SignerProperties); err != nil { + return out, metadata, fmt.Errorf("sign request: %w", err) + } + + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go index cfa3c38c..5d634ce3 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go @@ -120,10 +120,10 @@ func awsAwsquery_deserializeOpErrorAssumeRole(response *smithyhttp.Response, met case strings.EqualFold("ExpiredTokenException", errorCode): return awsAwsquery_deserializeErrorExpiredTokenException(response, errorBody) - case strings.EqualFold("MalformedPolicyDocumentException", errorCode): + case strings.EqualFold("MalformedPolicyDocument", errorCode): return awsAwsquery_deserializeErrorMalformedPolicyDocumentException(response, errorBody) - case strings.EqualFold("PackedPolicyTooLargeException", errorCode): + case strings.EqualFold("PackedPolicyTooLarge", errorCode): return awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response, errorBody) case strings.EqualFold("RegionDisabledException", errorCode): @@ -237,16 +237,16 @@ func awsAwsquery_deserializeOpErrorAssumeRoleWithSAML(response *smithyhttp.Respo case strings.EqualFold("ExpiredTokenException", errorCode): return awsAwsquery_deserializeErrorExpiredTokenException(response, errorBody) - case strings.EqualFold("IDPRejectedClaimException", errorCode): + case strings.EqualFold("IDPRejectedClaim", errorCode): return awsAwsquery_deserializeErrorIDPRejectedClaimException(response, errorBody) - case strings.EqualFold("InvalidIdentityTokenException", errorCode): + case strings.EqualFold("InvalidIdentityToken", errorCode): return awsAwsquery_deserializeErrorInvalidIdentityTokenException(response, errorBody) - case strings.EqualFold("MalformedPolicyDocumentException", errorCode): + case strings.EqualFold("MalformedPolicyDocument", errorCode): return awsAwsquery_deserializeErrorMalformedPolicyDocumentException(response, errorBody) - case strings.EqualFold("PackedPolicyTooLargeException", errorCode): + case strings.EqualFold("PackedPolicyTooLarge", errorCode): return awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response, errorBody) case strings.EqualFold("RegionDisabledException", errorCode): @@ -360,19 +360,19 @@ func awsAwsquery_deserializeOpErrorAssumeRoleWithWebIdentity(response *smithyhtt case strings.EqualFold("ExpiredTokenException", errorCode): return awsAwsquery_deserializeErrorExpiredTokenException(response, errorBody) - case strings.EqualFold("IDPCommunicationErrorException", errorCode): + case strings.EqualFold("IDPCommunicationError", errorCode): return awsAwsquery_deserializeErrorIDPCommunicationErrorException(response, errorBody) - case strings.EqualFold("IDPRejectedClaimException", errorCode): + case strings.EqualFold("IDPRejectedClaim", errorCode): return awsAwsquery_deserializeErrorIDPRejectedClaimException(response, errorBody) - case strings.EqualFold("InvalidIdentityTokenException", errorCode): + case strings.EqualFold("InvalidIdentityToken", errorCode): return awsAwsquery_deserializeErrorInvalidIdentityTokenException(response, errorBody) - case strings.EqualFold("MalformedPolicyDocumentException", errorCode): + case strings.EqualFold("MalformedPolicyDocument", errorCode): return awsAwsquery_deserializeErrorMalformedPolicyDocumentException(response, errorBody) - case strings.EqualFold("PackedPolicyTooLargeException", errorCode): + case strings.EqualFold("PackedPolicyTooLarge", errorCode): return awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response, errorBody) case strings.EqualFold("RegionDisabledException", errorCode): @@ -801,10 +801,10 @@ func awsAwsquery_deserializeOpErrorGetFederationToken(response *smithyhttp.Respo } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("MalformedPolicyDocumentException", errorCode): + case strings.EqualFold("MalformedPolicyDocument", errorCode): return awsAwsquery_deserializeErrorMalformedPolicyDocumentException(response, errorBody) - case strings.EqualFold("PackedPolicyTooLargeException", errorCode): + case strings.EqualFold("PackedPolicyTooLarge", errorCode): return awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response, errorBody) case strings.EqualFold("RegionDisabledException", errorCode): @@ -1939,6 +1939,19 @@ func awsAwsquery_deserializeOpDocumentAssumeRoleOutput(v **AssumeRoleOutput, dec sv.PackedPolicySize = ptr.Int32(int32(i64)) } + case strings.EqualFold("SourceIdentity", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceIdentity = ptr.String(xtv) + } + default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() @@ -2043,6 +2056,19 @@ func awsAwsquery_deserializeOpDocumentAssumeRoleWithSAMLOutput(v **AssumeRoleWit sv.PackedPolicySize = ptr.Int32(int32(i64)) } + case strings.EqualFold("SourceIdentity", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceIdentity = ptr.String(xtv) + } + case strings.EqualFold("Subject", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -2160,6 +2186,19 @@ func awsAwsquery_deserializeOpDocumentAssumeRoleWithWebIdentityOutput(v **Assume sv.Provider = ptr.String(xtv) } + case strings.EqualFold("SourceIdentity", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceIdentity = ptr.String(xtv) + } + case strings.EqualFold("SubjectFromWebIdentityToken", t.Name.Local): val, err := decoder.Value() if err != nil { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.go index b5a0a715..d963fd8d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.go @@ -3,10 +3,9 @@ // Package sts provides the API client, operations, and parameter types for AWS // Security Token Service. // -// AWS Security Token Service AWS Security Token Service (STS) enables you to -// request temporary, limited-privilege credentials for AWS Identity and Access -// Management (IAM) users or for users that you authenticate (federated users). -// This guide provides descriptions of the STS API. For more information about -// using this service, see Temporary Security Credentials -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html). +// Security Token Service Security Token Service (STS) enables you to request +// temporary, limited-privilege credentials for users. This guide provides +// descriptions of the STS API. For more information about using this service, see +// Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html) +// . package sts diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go index 5b6aa7b1..9f7932f9 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go @@ -8,10 +8,20 @@ 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" + "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" internalendpoints "github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" "net/url" + "os" + "strings" ) // EndpointResolverOptions is the service endpoint resolver options @@ -38,13 +48,6 @@ func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointRe return fn(region, options) } -func resolveDefaultEndpointConfiguration(o *Options) { - if o.EndpointResolver != nil { - return - } - o.EndpointResolver = NewDefaultEndpointResolver() -} - // EndpointResolverFromURL returns an EndpointResolver configured using the // provided endpoint url. By default, the resolved endpoint resolver uses the // client region as signing region, and the endpoint source is set to @@ -78,6 +81,10 @@ func (*ResolveEndpoint) ID() string { func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) @@ -87,9 +94,17 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") } + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + var endpoint aws.Endpoint - endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), m.Options) + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) if err != nil { + nf := (&aws.EndpointNotFoundError{}) + if errors.As(err, &nf) { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) + return next.HandleSerialize(ctx, in) + } return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) } @@ -124,37 +139,970 @@ func removeResolveEndpointMiddleware(stack *middleware.Stack) error { } type wrappedEndpointResolver struct { - awsResolver aws.EndpointResolver - resolver EndpointResolver + awsResolver aws.EndpointResolverWithOptions } func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { - if w.awsResolver == nil { - goto fallback + return w.awsResolver.ResolveEndpoint(ServiceID, region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, +// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked +// via its middleware. +// +// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) } - endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region) - if err == nil { - return endpoint, nil + + return &wrappedEndpointResolver{ + awsResolver: resolver, } +} - if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { - return endpoint, err +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } } -fallback: - if w.resolver == nil { - return endpoint, fmt.Errorf("default endpoint resolver provided was nil") +} + +func resolveEndpointResolverV2(options *Options) { + if options.EndpointResolverV2 == nil { + options.EndpointResolverV2 = NewDefaultEndpointResolverV2() } - return w.resolver.ResolveEndpoint(region, options) } -// withEndpointResolver returns an EndpointResolver that first delegates endpoint -// resolution to the awsResolver. If awsResolver returns aws.EndpointNotFoundError -// error, the resolver will use the the provided fallbackResolver for resolution. -// awsResolver and fallbackResolver must not be nil -func withEndpointResolver(awsResolver aws.EndpointResolver, fallbackResolver EndpointResolver) EndpointResolver { - return &wrappedEndpointResolver{ - awsResolver: awsResolver, - resolver: fallbackResolver, +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 + } +} + +// EndpointParameters provides the parameters that influence how endpoints are +// resolved. +type EndpointParameters struct { + // The AWS region used to dispatch the request. + // + // Parameter is + // required. + // + // AWS::Region + Region *string + + // When true, use the dual-stack endpoint. If the configured endpoint does not + // support dual-stack, dispatching the request MAY return an error. + // + // Defaults to + // false if no value is provided. + // + // AWS::UseDualStack + UseDualStack *bool + + // When true, send this request to the FIPS-compliant regional endpoint. If the + // configured endpoint does not have a FIPS compliant endpoint, dispatching the + // request will return an error. + // + // Defaults to false if no value is + // provided. + // + // AWS::UseFIPS + UseFIPS *bool + + // Override the endpoint used to send this request + // + // Parameter is + // required. + // + // SDK::Endpoint + Endpoint *string + + // Whether the global endpoint should be used, rather then the regional endpoint + // for us-east-1. + // + // Defaults to false if no value is + // provided. + // + // AWS::STS::UseGlobalEndpoint + UseGlobalEndpoint *bool +} + +// ValidateRequired validates required parameters are set. +func (p EndpointParameters) ValidateRequired() error { + if p.UseDualStack == nil { + return fmt.Errorf("parameter UseDualStack is required") + } + + if p.UseFIPS == nil { + return fmt.Errorf("parameter UseFIPS is required") + } + + if p.UseGlobalEndpoint == nil { + return fmt.Errorf("parameter UseGlobalEndpoint is required") + } + + return nil +} + +// WithDefaults returns a shallow copy of EndpointParameterswith default values +// applied to members where applicable. +func (p EndpointParameters) WithDefaults() EndpointParameters { + if p.UseDualStack == nil { + p.UseDualStack = ptr.Bool(false) + } + + if p.UseFIPS == nil { + p.UseFIPS = ptr.Bool(false) + } + + if p.UseGlobalEndpoint == nil { + p.UseGlobalEndpoint = ptr.Bool(false) + } + return p +} + +// EndpointResolverV2 provides the interface for resolving service endpoints. +type EndpointResolverV2 interface { + // ResolveEndpoint attempts to resolve the endpoint with the provided options, + // returning the endpoint if found. Otherwise an error is returned. + ResolveEndpoint(ctx context.Context, params EndpointParameters) ( + smithyendpoints.Endpoint, error, + ) +} + +// resolver provides the implementation for resolving endpoints. +type resolver struct{} + +func NewDefaultEndpointResolverV2() EndpointResolverV2 { + return &resolver{} +} + +// ResolveEndpoint attempts to resolve the endpoint with the provided options, +// returning the endpoint if found. Otherwise an error is returned. +func (r *resolver) ResolveEndpoint( + ctx context.Context, params EndpointParameters, +) ( + endpoint smithyendpoints.Endpoint, err error, +) { + params = params.WithDefaults() + if err = params.ValidateRequired(); err != nil { + return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) + } + _UseDualStack := *params.UseDualStack + _UseFIPS := *params.UseFIPS + _UseGlobalEndpoint := *params.UseGlobalEndpoint + + if _UseGlobalEndpoint == true { + if !(params.Endpoint != nil) { + if exprVal := params.Region; exprVal != nil { + _Region := *exprVal + _ = _Region + if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { + _PartitionResult := *exprVal + _ = _PartitionResult + if _UseFIPS == false { + if _UseDualStack == false { + if _Region == "ap-northeast-1" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "ap-south-1" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "ap-southeast-1" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "ap-southeast-2" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "aws-global" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "ca-central-1" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "eu-central-1" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "eu-north-1" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "eu-west-1" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "eu-west-2" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "eu-west-3" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "sa-east-1" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "us-east-1" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "us-east-2" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "us-west-1" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "us-west-2" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://sts.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + } + } + } + } } + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if _UseFIPS == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") + } + if _UseDualStack == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") + } + uriString := _Endpoint + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if exprVal := params.Region; exprVal != nil { + _Region := *exprVal + _ = _Region + if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { + _PartitionResult := *exprVal + _ = _PartitionResult + if _UseFIPS == true { + if _UseDualStack == true { + if true == _PartitionResult.SupportsFIPS { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://sts-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") + } + } + if _UseFIPS == true { + if _PartitionResult.SupportsFIPS == true { + if _PartitionResult.Name == "aws-us-gov" { + uriString := func() string { + var out strings.Builder + out.WriteString("https://sts.") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://sts-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") + } + if _UseDualStack == true { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://sts.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") + } + if _Region == "aws-global" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://sts.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") +} + +type endpointParamsBinder interface { + bindEndpointParams(*EndpointParameters) +} + +func bindEndpointParams(input interface{}, options Options) *EndpointParameters { + params := &EndpointParameters{} + + params.Region = aws.String(endpoints.MapFIPSRegion(options.Region)) + params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) + params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) + params.Endpoint = options.BaseEndpoint + + if b, ok := input.(endpointParamsBinder); ok { + b.bindEndpointParams(params) + } + + return params +} + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.options.EndpointResolverV2 == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := bindEndpointParams(getOperationInput(ctx), m.options) + endpt, err := m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + if endpt.URI.RawPath == "" && req.URL.RawPath != "" { + endpt.URI.RawPath = endpt.URI.Path + } + req.URL.Scheme = endpt.URI.Scheme + req.URL.Host = endpt.URI.Host + req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) + req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) + for k := range endpt.Headers { + req.Header.Set(k, endpt.Headers.Get(k)) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) + for _, o := range opts { + rscheme.SignerProperties.SetAll(&o.SignerProperties) + } + + return next.HandleFinalize(ctx, in) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json new file mode 100644 index 00000000..d90b8bce --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json @@ -0,0 +1,41 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding": "v1.0.5", + "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url": "v1.0.7", + "github.com/aws/smithy-go": "v1.4.0", + "github.com/google/go-cmp": "v0.5.4" + }, + "files": [ + "api_client.go", + "api_client_test.go", + "api_op_AssumeRole.go", + "api_op_AssumeRoleWithSAML.go", + "api_op_AssumeRoleWithWebIdentity.go", + "api_op_DecodeAuthorizationMessage.go", + "api_op_GetAccessKeyInfo.go", + "api_op_GetCallerIdentity.go", + "api_op_GetFederationToken.go", + "api_op_GetSessionToken.go", + "auth.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "endpoints_config_test.go", + "endpoints_test.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "options.go", + "protocol_test.go", + "serializers.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/sts", + "unstable": false +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go new file mode 100644 index 00000000..962c336c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package sts + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "1.26.7" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints/endpoints.go index 262f289b..3dbd993b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints/endpoints.go @@ -4,13 +4,62 @@ package endpoints import ( "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/internal/endpoints" + endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" + "github.com/aws/smithy-go/logging" "regexp" ) // Options is the endpoint resolver configuration options type Options struct { + // Logger is a logging implementation that log events should be sent to. + Logger logging.Logger + + // LogDeprecated indicates that deprecated endpoints should be logged to the + // provided logger. + LogDeprecated bool + + // ResolvedRegion is used to override the region to be resolved, rather then the + // using the value passed to the ResolveEndpoint method. This value is used by the + // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative + // name. You must not set this value directly in your application. + ResolvedRegion string + + // DisableHTTPS informs the resolver to return an endpoint that does not use the + // HTTPS scheme. DisableHTTPS bool + + // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. + UseDualStackEndpoint aws.DualStackEndpointState + + // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. + UseFIPSEndpoint aws.FIPSEndpointState +} + +func (o Options) GetResolvedRegion() string { + return o.ResolvedRegion +} + +func (o Options) GetDisableHTTPS() bool { + return o.DisableHTTPS +} + +func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { + return o.UseDualStackEndpoint +} + +func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { + return o.UseFIPSEndpoint +} + +func transformToSharedOptions(options Options) endpoints.Options { + return endpoints.Options{ + Logger: options.Logger, + LogDeprecated: options.LogDeprecated, + ResolvedRegion: options.ResolvedRegion, + DisableHTTPS: options.DisableHTTPS, + UseDualStackEndpoint: options.UseDualStackEndpoint, + UseFIPSEndpoint: options.UseFIPSEndpoint, + } } // Resolver STS endpoint resolver @@ -24,9 +73,7 @@ func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws return endpoint, &aws.MissingRegionError{} } - opt := endpoints.Options{ - DisableHTTPS: options.DisableHTTPS, - } + opt := transformToSharedOptions(options) return r.partitions.ResolveEndpoint(region, opt) } @@ -37,132 +84,428 @@ func New() *Resolver { } } +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsIsoE *regexp.Regexp + AwsIsoF *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), + AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + var defaultPartitions = endpoints.Partitions{ { ID: "aws", - Defaults: endpoints.Endpoint{ - Hostname: "sts.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "sts.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "sts-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "sts-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "sts.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, }, - RegionRegex: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), + RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ - "af-south-1": endpoints.Endpoint{}, - "ap-east-1": endpoints.Endpoint{}, - "ap-northeast-1": endpoints.Endpoint{}, - "ap-northeast-2": endpoints.Endpoint{}, - "ap-south-1": endpoints.Endpoint{}, - "ap-southeast-1": endpoints.Endpoint{}, - "ap-southeast-2": endpoints.Endpoint{}, - "aws-global": endpoints.Endpoint{ + endpoints.EndpointKey{ + Region: "af-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-4", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "aws-global", + }: endpoints.Endpoint{ Hostname: "sts.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-east-1", }, }, - "ca-central-1": endpoints.Endpoint{}, - "eu-central-1": endpoints.Endpoint{}, - "eu-north-1": endpoints.Endpoint{}, - "eu-south-1": endpoints.Endpoint{}, - "eu-west-1": endpoints.Endpoint{}, - "eu-west-2": endpoints.Endpoint{}, - "eu-west-3": endpoints.Endpoint{}, - "me-south-1": endpoints.Endpoint{}, - "sa-east-1": endpoints.Endpoint{}, - "us-east-1": endpoints.Endpoint{}, - "us-east-1-fips": endpoints.Endpoint{ + endpoints.EndpointKey{ + Region: "ca-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-north-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "il-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "sa-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "sts-fips.us-east-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-east-1-fips", + }: endpoints.Endpoint{ Hostname: "sts-fips.us-east-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-east-1", }, + Deprecated: aws.TrueTernary, }, - "us-east-2": endpoints.Endpoint{}, - "us-east-2-fips": endpoints.Endpoint{ + endpoints.EndpointKey{ + Region: "us-east-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "sts-fips.us-east-2.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-east-2-fips", + }: endpoints.Endpoint{ Hostname: "sts-fips.us-east-2.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-east-2", }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "sts-fips.us-west-1.amazonaws.com", }, - "us-west-1": endpoints.Endpoint{}, - "us-west-1-fips": endpoints.Endpoint{ + endpoints.EndpointKey{ + Region: "us-west-1-fips", + }: endpoints.Endpoint{ Hostname: "sts-fips.us-west-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-west-1", }, + Deprecated: aws.TrueTernary, }, - "us-west-2": endpoints.Endpoint{}, - "us-west-2-fips": endpoints.Endpoint{ + endpoints.EndpointKey{ + Region: "us-west-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "sts-fips.us-west-2.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-west-2-fips", + }: endpoints.Endpoint{ Hostname: "sts-fips.us-west-2.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-west-2", }, + Deprecated: aws.TrueTernary, }, }, }, { ID: "aws-cn", - Defaults: endpoints.Endpoint{ - Hostname: "sts.{region}.amazonaws.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "sts.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "sts-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "sts-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "sts.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, }, - RegionRegex: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + RegionRegex: partitionRegexp.AwsCn, IsRegionalized: true, Endpoints: endpoints.Endpoints{ - "cn-north-1": endpoints.Endpoint{}, - "cn-northwest-1": endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "cn-north-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "cn-northwest-1", + }: endpoints.Endpoint{}, }, }, { ID: "aws-iso", - Defaults: endpoints.Endpoint{ - Hostname: "sts.{region}.c2s.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "sts-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "sts.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, }, - RegionRegex: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + RegionRegex: partitionRegexp.AwsIso, IsRegionalized: true, Endpoints: endpoints.Endpoints{ - "us-iso-east-1": endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-iso-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-iso-west-1", + }: endpoints.Endpoint{}, }, }, { ID: "aws-iso-b", - Defaults: endpoints.Endpoint{ - Hostname: "sts.{region}.sc2s.sgov.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "sts-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "sts.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, }, - RegionRegex: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + RegionRegex: partitionRegexp.AwsIsoB, IsRegionalized: true, Endpoints: endpoints.Endpoints{ - "us-isob-east-1": endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-isob-east-1", + }: endpoints.Endpoint{}, + }, + }, + { + ID: "aws-iso-e", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "sts-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "sts.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, }, + RegionRegex: partitionRegexp.AwsIsoE, + IsRegionalized: true, + }, + { + ID: "aws-iso-f", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "sts-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "sts.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoF, + IsRegionalized: true, }, { ID: "aws-us-gov", - Defaults: endpoints.Endpoint{ - Hostname: "sts.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "sts.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "sts.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "sts-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "sts.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, }, - RegionRegex: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), + RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, Endpoints: endpoints.Endpoints{ - "us-gov-east-1": endpoints.Endpoint{}, - "us-gov-east-1-fips": endpoints.Endpoint{ + endpoints.EndpointKey{ + Region: "us-gov-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "sts.us-gov-east-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-gov-east-1-fips", + }: endpoints.Endpoint{ Hostname: "sts.us-gov-east-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-east-1", }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "sts.us-gov-west-1.amazonaws.com", }, - "us-gov-west-1": endpoints.Endpoint{}, - "us-gov-west-1-fips": endpoints.Endpoint{ + endpoints.EndpointKey{ + Region: "us-gov-west-1-fips", + }: endpoints.Endpoint{ Hostname: "sts.us-gov-west-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-west-1", }, + Deprecated: aws.TrueTernary, }, }, }, diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/options.go new file mode 100644 index 00000000..5c1be79f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/options.go @@ -0,0 +1,217 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sts + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" +) + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // The optional application specific identifier appended to the User-Agent header. + AppID string + + // This endpoint will be given as input to an EndpointResolverV2. It is used for + // providing a custom base endpoint that is subject to modifications by the + // processing EndpointResolverV2. + BaseEndpoint *string + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + // + // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a + // value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. To migrate an EndpointResolver implementation that uses a custom + // endpoint, set the client option BaseEndpoint instead. + EndpointResolver EndpointResolver + + // Resolves the endpoint used for a particular service operation. This should be + // used over the deprecated EndpointResolver. + EndpointResolverV2 EndpointResolverV2 + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. If specified in an operation call's + // functional options with a value that is different than the constructed client's + // Options, the Client's Retryer will be wrapped to use the operation's specific + // RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. Currently does not support per operation call + // overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. Currently does not support per operation call + // overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient + + // The auth scheme resolver which determines how to authenticate for each + // operation. + AuthSchemeResolver AuthSchemeResolver + + // The list of auth schemes supported by the client. + AuthSchemes []smithyhttp.AuthScheme +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} + +func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { + if schemeID == "aws.auth#sigv4" { + return getSigV4IdentityResolver(o) + } + if schemeID == "smithy.api#noAuth" { + return &smithyauth.AnonymousIdentityResolver{} + } + return nil +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for +// this field will likely prevent you from using any endpoint-related service +// features released after the introduction of EndpointResolverV2 and BaseEndpoint. +// To migrate an EndpointResolver implementation that uses a custom endpoint, set +// the client option BaseEndpoint instead. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +// WithEndpointResolverV2 returns a functional option for setting the Client's +// EndpointResolverV2 option. +func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { + return func(o *Options) { + o.EndpointResolverV2 = v + } +} + +func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { + if o.Credentials != nil { + return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} + } + return nil +} + +// WithSigV4SigningName applies an override to the authentication workflow to +// use the given signing name for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing name from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningName(name string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), + middleware.Before, + ) + }) + } +} + +// WithSigV4SigningRegion applies an override to the authentication workflow to +// use the given signing region for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing region from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningRegion(region string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), + middleware.Before, + ) + }) + } +} + +func ignoreAnonymousAuth(options *Options) { + if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { + options.Credentials = nil + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/serializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/serializers.go index b224780f..4c08061c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/serializers.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/serializers.go @@ -12,6 +12,7 @@ import ( "github.com/aws/smithy-go/encoding/httpbinding" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" + "path" ) type awsAwsquery_serializeOpAssumeRole struct { @@ -35,7 +36,15 @@ func (m *awsAwsquery_serializeOpAssumeRole) HandleSerialize(ctx context.Context, return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -91,7 +100,15 @@ func (m *awsAwsquery_serializeOpAssumeRoleWithSAML) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -147,7 +164,15 @@ func (m *awsAwsquery_serializeOpAssumeRoleWithWebIdentity) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -203,7 +228,15 @@ func (m *awsAwsquery_serializeOpDecodeAuthorizationMessage) HandleSerialize(ctx return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -259,7 +292,15 @@ func (m *awsAwsquery_serializeOpGetAccessKeyInfo) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -315,7 +356,15 @@ func (m *awsAwsquery_serializeOpGetCallerIdentity) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -367,7 +416,15 @@ func (m *awsAwsquery_serializeOpGetFederationToken) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -423,7 +480,15 @@ func (m *awsAwsquery_serializeOpGetSessionToken) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - request.Request.URL.Path = "/" + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { @@ -458,9 +523,6 @@ func (m *awsAwsquery_serializeOpGetSessionToken) HandleSerialize(ctx context.Con return next.HandleSerialize(ctx, in) } func awsAwsquery_serializeDocumentPolicyDescriptorListType(v []types.PolicyDescriptorType, value query.Value) error { - if len(v) == 0 { - return nil - } array := value.Array("member") for i := range v { @@ -484,6 +546,35 @@ func awsAwsquery_serializeDocumentPolicyDescriptorType(v *types.PolicyDescriptor return nil } +func awsAwsquery_serializeDocumentProvidedContext(v *types.ProvidedContext, value query.Value) error { + object := value.Object() + _ = object + + if v.ContextAssertion != nil { + objectKey := object.Key("ContextAssertion") + objectKey.String(*v.ContextAssertion) + } + + if v.ProviderArn != nil { + objectKey := object.Key("ProviderArn") + objectKey.String(*v.ProviderArn) + } + + return nil +} + +func awsAwsquery_serializeDocumentProvidedContextsListType(v []types.ProvidedContext, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + if err := awsAwsquery_serializeDocumentProvidedContext(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsquery_serializeDocumentTag(v *types.Tag, value query.Value) error { object := value.Object() _ = object @@ -502,9 +593,6 @@ func awsAwsquery_serializeDocumentTag(v *types.Tag, value query.Value) error { } func awsAwsquery_serializeDocumentTagKeyListType(v []string, value query.Value) error { - if len(v) == 0 { - return nil - } array := value.Array("member") for i := range v { @@ -515,9 +603,6 @@ func awsAwsquery_serializeDocumentTagKeyListType(v []string, value query.Value) } func awsAwsquery_serializeDocumentTagListType(v []types.Tag, value query.Value) error { - if len(v) == 0 { - return nil - } array := value.Array("member") for i := range v { @@ -555,6 +640,13 @@ func awsAwsquery_serializeOpDocumentAssumeRoleInput(v *AssumeRoleInput, value qu } } + if v.ProvidedContexts != nil { + objectKey := object.Key("ProvidedContexts") + if err := awsAwsquery_serializeDocumentProvidedContextsListType(v.ProvidedContexts, objectKey); err != nil { + return err + } + } + if v.RoleArn != nil { objectKey := object.Key("RoleArn") objectKey.String(*v.RoleArn) @@ -570,6 +662,11 @@ func awsAwsquery_serializeOpDocumentAssumeRoleInput(v *AssumeRoleInput, value qu objectKey.String(*v.SerialNumber) } + if v.SourceIdentity != nil { + objectKey := object.Key("SourceIdentity") + objectKey.String(*v.SourceIdentity) + } + if v.Tags != nil { objectKey := object.Key("Tags") if err := awsAwsquery_serializeDocumentTagListType(v.Tags, objectKey); err != nil { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/errors.go index 3734fa4a..097875b2 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/errors.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/errors.go @@ -11,6 +11,10 @@ import ( // identity token from the identity provider and then retry the request. type ExpiredTokenException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *ExpiredTokenException) Error() string { @@ -22,7 +26,12 @@ func (e *ExpiredTokenException) ErrorMessage() string { } return *e.Message } -func (e *ExpiredTokenException) ErrorCode() string { return "ExpiredTokenException" } +func (e *ExpiredTokenException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ExpiredTokenException" + } + return *e.ErrorCodeOverride +} func (e *ExpiredTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request could not be fulfilled because the identity provider (IDP) that was @@ -32,6 +41,10 @@ func (e *ExpiredTokenException) ErrorFault() smithy.ErrorFault { return smithy.F // persists, the identity provider might be down or not responding. type IDPCommunicationErrorException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *IDPCommunicationErrorException) Error() string { @@ -43,7 +56,12 @@ func (e *IDPCommunicationErrorException) ErrorMessage() string { } return *e.Message } -func (e *IDPCommunicationErrorException) ErrorCode() string { return "IDPCommunicationErrorException" } +func (e *IDPCommunicationErrorException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "IDPCommunicationError" + } + return *e.ErrorCodeOverride +} func (e *IDPCommunicationErrorException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The identity provider (IdP) reported that authentication failed. This might be @@ -52,6 +70,10 @@ func (e *IDPCommunicationErrorException) ErrorFault() smithy.ErrorFault { return // or has been explicitly revoked. type IDPRejectedClaimException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *IDPRejectedClaimException) Error() string { @@ -63,7 +85,12 @@ func (e *IDPRejectedClaimException) ErrorMessage() string { } return *e.Message } -func (e *IDPRejectedClaimException) ErrorCode() string { return "IDPRejectedClaimException" } +func (e *IDPRejectedClaimException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "IDPRejectedClaim" + } + return *e.ErrorCodeOverride +} func (e *IDPRejectedClaimException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The error returned if the message passed to DecodeAuthorizationMessage was @@ -71,6 +98,10 @@ func (e *IDPRejectedClaimException) ErrorFault() smithy.ErrorFault { return smit // linebreaks. type InvalidAuthorizationMessageException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidAuthorizationMessageException) Error() string { @@ -83,16 +114,24 @@ func (e *InvalidAuthorizationMessageException) ErrorMessage() string { return *e.Message } func (e *InvalidAuthorizationMessageException) ErrorCode() string { - return "InvalidAuthorizationMessageException" + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidAuthorizationMessageException" + } + return *e.ErrorCodeOverride } func (e *InvalidAuthorizationMessageException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The web identity token that was passed could not be validated by AWS. Get a new -// identity token from the identity provider and then retry the request. +// The web identity token that was passed could not be validated by Amazon Web +// Services. Get a new identity token from the identity provider and then retry the +// request. type InvalidIdentityTokenException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *InvalidIdentityTokenException) Error() string { @@ -104,13 +143,22 @@ func (e *InvalidIdentityTokenException) ErrorMessage() string { } return *e.Message } -func (e *InvalidIdentityTokenException) ErrorCode() string { return "InvalidIdentityTokenException" } +func (e *InvalidIdentityTokenException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidIdentityToken" + } + return *e.ErrorCodeOverride +} func (e *InvalidIdentityTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request was rejected because the policy document was malformed. The error // message describes the specific error. type MalformedPolicyDocumentException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *MalformedPolicyDocumentException) Error() string { @@ -123,24 +171,29 @@ func (e *MalformedPolicyDocumentException) ErrorMessage() string { return *e.Message } func (e *MalformedPolicyDocumentException) ErrorCode() string { - return "MalformedPolicyDocumentException" + if e == nil || e.ErrorCodeOverride == nil { + return "MalformedPolicyDocument" + } + return *e.ErrorCodeOverride } func (e *MalformedPolicyDocumentException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request was rejected because the total packed size of the session policies -// and session tags combined was too large. An AWS conversion compresses the -// session policy document, session policy ARNs, and session tags into a packed -// binary format that has a separate limit. The error message indicates by -// percentage how close the policies and tags are to the upper size limit. For more -// information, see Passing Session Tags in STS -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) in the -// IAM User Guide. You could receive this error even though you meet other defined -// session policy and session tag limits. For more information, see IAM and STS -// Entity Character Limits -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) +// and session tags combined was too large. An Amazon Web Services conversion +// compresses the session policy document, session policy ARNs, and session tags +// into a packed binary format that has a separate limit. The error message +// indicates by percentage how close the policies and tags are to the upper size +// limit. For more information, see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. You could receive this error even though you meet other +// defined session policy and session tag limits. For more information, see IAM +// and STS Entity Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-limits-entity-length) // in the IAM User Guide. type PackedPolicyTooLargeException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *PackedPolicyTooLargeException) Error() string { @@ -152,17 +205,25 @@ func (e *PackedPolicyTooLargeException) ErrorMessage() string { } return *e.Message } -func (e *PackedPolicyTooLargeException) ErrorCode() string { return "PackedPolicyTooLargeException" } +func (e *PackedPolicyTooLargeException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "PackedPolicyTooLarge" + } + return *e.ErrorCodeOverride +} func (e *PackedPolicyTooLargeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// STS is not activated in the requested region for the account that is being asked -// to generate credentials. The account administrator must use the IAM console to -// activate STS in that region. For more information, see Activating and -// Deactivating AWS STS in an AWS Region -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) +// STS is not activated in the requested region for the account that is being +// asked to generate credentials. The account administrator must use the IAM +// console to activate STS in that region. For more information, see Activating +// and Deactivating Amazon Web Services STS in an Amazon Web Services Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) // in the IAM User Guide. type RegionDisabledException struct { Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde } func (e *RegionDisabledException) Error() string { @@ -174,5 +235,10 @@ func (e *RegionDisabledException) ErrorMessage() string { } return *e.Message } -func (e *RegionDisabledException) ErrorCode() string { return "RegionDisabledException" } +func (e *RegionDisabledException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "RegionDisabledException" + } + return *e.ErrorCodeOverride +} func (e *RegionDisabledException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/types.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/types.go index b4dc167f..e3701d11 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/types.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/types.go @@ -3,6 +3,7 @@ package types import ( + smithydocument "github.com/aws/smithy-go/document" "time" ) @@ -12,22 +13,23 @@ type AssumedRoleUser struct { // The ARN of the temporary security credentials that are returned from the // AssumeRole action. For more information about ARNs and how to use them in - // policies, see IAM Identifiers - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) in - // the IAM User Guide. + // policies, see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) + // in the IAM User Guide. // // This member is required. Arn *string // A unique identifier that contains the role ID and the role session name of the - // role that is being assumed. The role ID is generated by AWS when the role is - // created. + // role that is being assumed. The role ID is generated by Amazon Web Services when + // the role is created. // // This member is required. AssumedRoleId *string + + noSmithyDocumentSerde } -// AWS credentials for API authentication. +// Amazon Web Services credentials for API authentication. type Credentials struct { // The access key ID that identifies the temporary security credentials. @@ -50,6 +52,8 @@ type Credentials struct { // // This member is required. SessionToken *string + + noSmithyDocumentSerde } // Identifiers for the federated user that is associated with the credentials. @@ -57,9 +61,8 @@ type FederatedUser struct { // The ARN that specifies the federated user that is associated with the // credentials. For more information about ARNs and how to use them in policies, - // see IAM Identifiers - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) in - // the IAM User Guide. + // see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) + // in the IAM User Guide. // // This member is required. Arn *string @@ -69,6 +72,8 @@ type FederatedUser struct { // // This member is required. FederatedUserId *string + + noSmithyDocumentSerde } // A reference to the IAM managed policy that is passed as a session policy for a @@ -77,23 +82,39 @@ type PolicyDescriptorType struct { // The Amazon Resource Name (ARN) of the IAM managed policy to use as a session // policy for the role. For more information about ARNs, see Amazon Resource Names - // (ARNs) and AWS Service Namespaces - // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in - // the AWS General Reference. + // (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the Amazon Web Services General Reference. Arn *string + + noSmithyDocumentSerde } -// You can pass custom key-value pair attributes when you assume a role or federate -// a user. These are called session tags. You can then use the session tags to -// control access to resources. For more information, see Tagging AWS STS Sessions -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) in the -// IAM User Guide. +// Contains information about the provided context. This includes the signed and +// encrypted trusted context assertion and the context provider ARN from which the +// trusted context assertion was generated. +type ProvidedContext struct { + + // The signed and encrypted trusted context assertion generated by the context + // provider. The trusted context assertion is signed and encrypted by Amazon Web + // Services STS. + ContextAssertion *string + + // The context provider ARN from which the trusted context assertion was generated. + ProviderArn *string + + noSmithyDocumentSerde +} + +// You can pass custom key-value pair attributes when you assume a role or +// federate a user. These are called session tags. You can then use the session +// tags to control access to resources. For more information, see Tagging Amazon +// Web Services STS Sessions (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. type Tag struct { // The key for a session tag. You can pass up to 50 session tags. The plain text // session tag keys can’t exceed 128 characters. For these and additional limits, - // see IAM and STS Character Limits - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) + // see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) // in the IAM User Guide. // // This member is required. @@ -101,10 +122,13 @@ type Tag struct { // The value for a session tag. You can pass up to 50 session tags. The plain text // session tag values can’t exceed 256 characters. For these and additional limits, - // see IAM and STS Character Limits - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) + // see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) // in the IAM User Guide. // // This member is required. Value *string + + noSmithyDocumentSerde } + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/vendor/github.com/aws/smithy-go/.gitignore b/vendor/github.com/aws/smithy-go/.gitignore index c01141aa..c92d6105 100644 --- a/vendor/github.com/aws/smithy-go/.gitignore +++ b/vendor/github.com/aws/smithy-go/.gitignore @@ -20,3 +20,7 @@ target/ build/ */out/ */*/out/ + +# VS Code +bin/ +.vscode/ diff --git a/vendor/github.com/aws/smithy-go/.travis.yml b/vendor/github.com/aws/smithy-go/.travis.yml index 6e75f301..f8d1035c 100644 --- a/vendor/github.com/aws/smithy-go/.travis.yml +++ b/vendor/github.com/aws/smithy-go/.travis.yml @@ -1,33 +1,28 @@ -language: java +language: go sudo: true dist: bionic -install: - - eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | GIMME_GO_VERSION=1.15.x bash)" - - echo `go env` - - echo `which go` +branches: + only: + - main -script: cd codegen && ./gradlew clean build -Plog-tests +os: + - linux + - osx + # Travis doesn't work with windows and Go tip + #- windows -matrix: - include: - - language: java - go: 1.15.x - jdk: openjdk8 +go: + - tip - - language: java - go: 1.15.x - jdk: openjdk11 +matrix: + allow_failures: + - go: tip - - language: go - go: 1.15.x - script: go test -v ./... +before_install: + - if [ "$TRAVIS_OS_NAME" = "windows" ]; then choco install make; fi + - (cd /tmp/; go get golang.org/x/lint/golint) - allow_failures: - - language: go - go: tip - script: go test -v ./... +script: + - make go test -v ./...; -branches: - only: - - main diff --git a/vendor/github.com/aws/smithy-go/CHANGELOG.md b/vendor/github.com/aws/smithy-go/CHANGELOG.md new file mode 100644 index 00000000..46b11508 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/CHANGELOG.md @@ -0,0 +1,216 @@ +# Release (2023-12-07) + +## Module Highlights +* `github.com/aws/smithy-go`: v1.19.0 + * **Feature**: Support modeled request compression. + +# Release (2023-11-30) + +* No change notes available for this release. + +# Release (2023-11-29) + +## Module Highlights +* `github.com/aws/smithy-go`: v1.18.0 + * **Feature**: Expose Options() method on generated service clients. + +# Release (2023-11-15) + +## Module Highlights +* `github.com/aws/smithy-go`: v1.17.0 + * **Feature**: Support identity/auth components of client reference architecture. + +# Release (2023-10-31) + +## Module Highlights +* `github.com/aws/smithy-go`: v1.16.0 + * **Feature**: **LANG**: Bump minimum go version to 1.19. + +# Release (2023-10-06) + +## Module Highlights +* `github.com/aws/smithy-go`: v1.15.0 + * **Feature**: Add `http.WithHeaderComment` middleware. + +# Release (2023-08-18) + +* No change notes available for this release. + +# Release (2023-08-07) + +## Module Highlights +* `github.com/aws/smithy-go`: v1.14.1 + * **Bug Fix**: Prevent duplicated error returns in EndpointResolverV2 default implementation. + +# Release (2023-07-31) + +## General Highlights +* **Feature**: Adds support for smithy-modeled endpoint resolution. + +# Release (2022-12-02) + +* No change notes available for this release. + +# Release (2022-10-24) + +## Module Highlights +* `github.com/aws/smithy-go`: v1.13.4 + * **Bug Fix**: fixed document type checking for encoding nested types + +# Release (2022-09-14) + +* No change notes available for this release. + +# Release (v1.13.2) + +* No change notes available for this release. + +# Release (v1.13.1) + +* No change notes available for this release. + +# Release (v1.13.0) + +## Module Highlights +* `github.com/aws/smithy-go`: v1.13.0 + * **Feature**: Adds support for the Smithy httpBearerAuth authentication trait to smithy-go. This allows the SDK to support the bearer authentication flow for API operations decorated with httpBearerAuth. An API client will need to be provided with its own bearer.TokenProvider implementation or use the bearer.StaticTokenProvider implementation. + +# Release (v1.12.1) + +## Module Highlights +* `github.com/aws/smithy-go`: v1.12.1 + * **Bug Fix**: Fixes a bug where JSON object keys were not escaped. + +# Release (v1.12.0) + +## Module Highlights +* `github.com/aws/smithy-go`: v1.12.0 + * **Feature**: `transport/http`: Add utility for setting context metadata when operation serializer automatically assigns content-type default value. + +# Release (v1.11.3) + +## Module Highlights +* `github.com/aws/smithy-go`: v1.11.3 + * **Dependency Update**: Updates smithy-go unit test dependency go-cmp to 0.5.8. + +# Release (v1.11.2) + +* No change notes available for this release. + +# Release (v1.11.1) + +## Module Highlights +* `github.com/aws/smithy-go`: v1.11.1 + * **Bug Fix**: Updates the smithy-go HTTP Request to correctly handle building the request to an http.Request. Related to [aws/aws-sdk-go-v2#1583](https://github.com/aws/aws-sdk-go-v2/issues/1583) + +# Release (v1.11.0) + +## Module Highlights +* `github.com/aws/smithy-go`: v1.11.0 + * **Feature**: Updates deserialization of header list to supported quoted strings + +# Release (v1.10.0) + +## Module Highlights +* `github.com/aws/smithy-go`: v1.10.0 + * **Feature**: Add `ptr.Duration`, `ptr.ToDuration`, `ptr.DurationSlice`, `ptr.ToDurationSlice`, `ptr.DurationMap`, and `ptr.ToDurationMap` functions for the `time.Duration` type. + +# Release (v1.9.1) + +## Module Highlights +* `github.com/aws/smithy-go`: v1.9.1 + * **Documentation**: Fixes various typos in Go package documentation. + +# Release (v1.9.0) + +## Module Highlights +* `github.com/aws/smithy-go`: v1.9.0 + * **Feature**: sync: OnceErr, can be used to concurrently record a signal when an error has occurred. + * **Bug Fix**: `transport/http`: CloseResponseBody and ErrorCloseResponseBody middleware have been updated to ensure that the body is fully drained before closing. + +# Release v1.8.1 + +### Smithy Go Module +* **Bug Fix**: Fixed an issue that would cause the HTTP Content-Length to be set to 0 if the stream body was not set. + * Fixes [aws/aws-sdk-go-v2#1418](https://github.com/aws/aws-sdk-go-v2/issues/1418) + +# Release v1.8.0 + +### Smithy Go Module + +* `time`: Add support for parsing additional DateTime timestamp format ([#324](https://github.com/aws/smithy-go/pull/324)) + * Adds support for parsing DateTime timestamp formatted time similar to RFC 3339, but without the `Z` character, nor UTC offset. + * Fixes [#1387](https://github.com/aws/aws-sdk-go-v2/issues/1387) + +# Release v1.7.0 + +### Smithy Go Module +* `ptr`: Handle error for deferred file close call ([#314](https://github.com/aws/smithy-go/pull/314)) + * Handle error for defer close call +* `middleware`: Add Clone to Metadata ([#318](https://github.com/aws/smithy-go/pull/318)) + * Adds a new Clone method to the middleware Metadata type. This provides a shallow clone of the entries in the Metadata. +* `document`: Add new package for document shape serialization support ([#310](https://github.com/aws/smithy-go/pull/310)) + +### Codegen +* Add Smithy Document Shape Support ([#310](https://github.com/aws/smithy-go/pull/310)) + * Adds support for Smithy Document shapes and supporting types for protocols to implement support + +# Release v1.6.0 (2021-07-15) + +### Smithy Go Module +* `encoding/httpbinding`: Support has been added for encoding `float32` and `float64` values that are `NaN`, `Infinity`, or `-Infinity`. ([#316](https://github.com/aws/smithy-go/pull/316)) + +### Codegen +* Adds support for handling `float32` and `float64` `NaN` values in HTTP Protocol Unit Tests. ([#316](https://github.com/aws/smithy-go/pull/316)) +* Adds support protocol generator implementations to override the error code string returned by `ErrorCode` methods on generated error types. ([#315](https://github.com/aws/smithy-go/pull/315)) + +# Release v1.5.0 (2021-06-25) + +### Smithy Go module +* `time`: Update time parsing to not be as strict for HTTPDate and DateTime ([#307](https://github.com/aws/smithy-go/pull/307)) + * Fixes [#302](https://github.com/aws/smithy-go/issues/302) by changing time to UTC before formatting so no local offset time is lost. + +### Codegen +* Adds support for integrating client members via plugins ([#301](https://github.com/aws/smithy-go/pull/301)) +* Fix serialization of enum types marked with payload trait ([#296](https://github.com/aws/smithy-go/pull/296)) +* Update generation of API client modules to include a manifest of files generated ([#283](https://github.com/aws/smithy-go/pull/283)) +* Update Group Java group ID for smithy-go generator ([#298](https://github.com/aws/smithy-go/pull/298)) +* Support the delegation of determining the errors that can occur for an operation ([#304](https://github.com/aws/smithy-go/pull/304)) +* Support for marking and documenting deprecated client config fields. ([#303](https://github.com/aws/smithy-go/pull/303)) + +# Release v1.4.0 (2021-05-06) + +### Smithy Go module +* `encoding/xml`: Fix escaping of Next Line and Line Start in XML Encoder ([#267](https://github.com/aws/smithy-go/pull/267)) + +### Codegen +* Add support for Smithy 1.7 ([#289](https://github.com/aws/smithy-go/pull/289)) +* Add support for httpQueryParams location +* Add support for model renaming conflict resolution with service closure + +# Release v1.3.1 (2021-04-08) + +### Smithy Go module +* `transport/http`: Loosen endpoint hostname validation to allow specifying port numbers. ([#279](https://github.com/aws/smithy-go/pull/279)) +* `io`: Fix RingBuffer panics due to out of bounds index. ([#282](https://github.com/aws/smithy-go/pull/282)) + +# Release v1.3.0 (2021-04-01) + +### Smithy Go module +* `transport/http`: Add utility to safely join string to url path, and url raw query. + +### Codegen +* Update HttpBindingProtocolGenerator to use http/transport JoinPath and JoinQuery utility. + +# Release v1.2.0 (2021-03-12) + +### Smithy Go module +* Fix support for parsing shortened year format in HTTP Date header. +* Fix GitHub APIDiff action workflow to get gorelease tool correctly. +* Fix codegen artifact unit test for Go 1.16 + +### Codegen +* Fix generating paginator nil parameter handling before usage. +* Fix Serialize unboxed members decorated as required. +* Add ability to define resolvers at both client construction and operation invocation. +* Support for extending paginators with custom runtime trait diff --git a/vendor/github.com/aws/smithy-go/Makefile b/vendor/github.com/aws/smithy-go/Makefile index 89dd6fbb..4b3c2093 100644 --- a/vendor/github.com/aws/smithy-go/Makefile +++ b/vendor/github.com/aws/smithy-go/Makefile @@ -1,3 +1,25 @@ +PRE_RELEASE_VERSION ?= + +RELEASE_MANIFEST_FILE ?= +RELEASE_CHGLOG_DESC_FILE ?= + +REPOTOOLS_VERSION ?= latest +REPOTOOLS_MODULE = github.com/awslabs/aws-go-multi-module-repository-tools +REPOTOOLS_CMD_CALCULATE_RELEASE = ${REPOTOOLS_MODULE}/cmd/calculaterelease@${REPOTOOLS_VERSION} +REPOTOOLS_CMD_CALCULATE_RELEASE_ADDITIONAL_ARGS ?= +REPOTOOLS_CMD_UPDATE_REQUIRES = ${REPOTOOLS_MODULE}/cmd/updaterequires@${REPOTOOLS_VERSION} +REPOTOOLS_CMD_UPDATE_MODULE_METADATA = ${REPOTOOLS_MODULE}/cmd/updatemodulemeta@${REPOTOOLS_VERSION} +REPOTOOLS_CMD_GENERATE_CHANGELOG = ${REPOTOOLS_MODULE}/cmd/generatechangelog@${REPOTOOLS_VERSION} +REPOTOOLS_CMD_CHANGELOG = ${REPOTOOLS_MODULE}/cmd/changelog@${REPOTOOLS_VERSION} +REPOTOOLS_CMD_TAG_RELEASE = ${REPOTOOLS_MODULE}/cmd/tagrelease@${REPOTOOLS_VERSION} +REPOTOOLS_CMD_MODULE_VERSION = ${REPOTOOLS_MODULE}/cmd/moduleversion@${REPOTOOLS_VERSION} + +UNIT_TEST_TAGS= +BUILD_TAGS= + +ifneq ($(PRE_RELEASE_VERSION),) + REPOTOOLS_CMD_CALCULATE_RELEASE_ADDITIONAL_ARGS += -preview=${PRE_RELEASE_VERSION} +endif smithy-publish-local: cd codegen && ./gradlew publishToMavenLocal @@ -7,3 +29,69 @@ smithy-build: smithy-clean: cd codegen && ./gradlew clean + +################## +# Linting/Verify # +################## +.PHONY: verify vet + +verify: vet + +vet: + go vet ${BUILD_TAGS} --all ./... + +################ +# Unit Testing # +################ +.PHONY: unit unit-race unit-test unit-race-test + +unit: verify + go vet ${BUILD_TAGS} --all ./... && \ + go test ${BUILD_TAGS} ${RUN_NONE} ./... && \ + go test -timeout=1m ${UNIT_TEST_TAGS} ./... + +unit-race: verify + go vet ${BUILD_TAGS} --all ./... && \ + go test ${BUILD_TAGS} ${RUN_NONE} ./... && \ + go test -timeout=1m ${UNIT_TEST_TAGS} -race -cpu=4 ./... + +unit-test: verify + go test -timeout=1m ${UNIT_TEST_TAGS} ./... + +unit-race-test: verify + go test -timeout=1m ${UNIT_TEST_TAGS} -race -cpu=4 ./... + +##################### +# Release Process # +##################### +.PHONY: preview-release pre-release-validation release + +preview-release: + go run ${REPOTOOLS_CMD_CALCULATE_RELEASE} ${REPOTOOLS_CMD_CALCULATE_RELEASE_ADDITIONAL_ARGS} + +pre-release-validation: + @if [[ -z "${RELEASE_MANIFEST_FILE}" ]]; then \ + echo "RELEASE_MANIFEST_FILE is required to specify the file to write the release manifest" && false; \ + fi + @if [[ -z "${RELEASE_CHGLOG_DESC_FILE}" ]]; then \ + echo "RELEASE_CHGLOG_DESC_FILE is required to specify the file to write the release notes" && false; \ + fi + +release: pre-release-validation + go run ${REPOTOOLS_CMD_CALCULATE_RELEASE} -o ${RELEASE_MANIFEST_FILE} ${REPOTOOLS_CMD_CALCULATE_RELEASE_ADDITIONAL_ARGS} + go run ${REPOTOOLS_CMD_UPDATE_REQUIRES} -release ${RELEASE_MANIFEST_FILE} + go run ${REPOTOOLS_CMD_UPDATE_MODULE_METADATA} -release ${RELEASE_MANIFEST_FILE} + go run ${REPOTOOLS_CMD_GENERATE_CHANGELOG} -release ${RELEASE_MANIFEST_FILE} -o ${RELEASE_CHGLOG_DESC_FILE} + go run ${REPOTOOLS_CMD_CHANGELOG} rm -all + go run ${REPOTOOLS_CMD_TAG_RELEASE} -release ${RELEASE_MANIFEST_FILE} + +module-version: + @go run ${REPOTOOLS_CMD_MODULE_VERSION} . + +############## +# Repo Tools # +############## +.PHONY: install-changelog + +install-changelog: + go install ${REPOTOOLS_MODULE}/cmd/changelog@${REPOTOOLS_VERSION} diff --git a/vendor/github.com/aws/smithy-go/README.md b/vendor/github.com/aws/smithy-go/README.md index 80c458db..c374f692 100644 --- a/vendor/github.com/aws/smithy-go/README.md +++ b/vendor/github.com/aws/smithy-go/README.md @@ -1,9 +1,26 @@ ## Smithy Go -Smithy code generators for Go. +[![Go Build Status](https://github.com/aws/smithy-go/actions/workflows/go.yml/badge.svg?branch=main)](https://github.com/aws/smithy-go/actions/workflows/go.yml)[![Codegen Build Status](https://github.com/aws/smithy-go/actions/workflows/codegen.yml/badge.svg?branch=main)](https://github.com/aws/smithy-go/actions/workflows/codegen.yml) + +[Smithy](https://smithy.io/) code generators for Go. **WARNING: All interfaces are subject to change.** +## Can I use this? + +In order to generate a usable smithy client you must provide a [protocol definition](https://github.com/aws/smithy-go/blob/main/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/integration/ProtocolGenerator.java), +such as [AWS restJson1](https://smithy.io/2.0/aws/protocols/aws-restjson1-protocol.html), +in order to generate transport mechanisms and serialization/deserialization +code ("serde") accordingly. + +The code generator does not currently support any protocols out of the box, +therefore the useability of this project on its own is currently limited. +Support for all [AWS protocols](https://smithy.io/2.0/aws/protocols/index.html) +exists in [aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2). We are +tracking the movement of those out of the SDK into smithy-go in +[#458](https://github.com/aws/smithy-go/issues/458), but there's currently no +timeline for doing so. + ## License This project is licensed under the Apache-2.0 License. diff --git a/vendor/github.com/aws/smithy-go/auth/auth.go b/vendor/github.com/aws/smithy-go/auth/auth.go new file mode 100644 index 00000000..5bdb70c9 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/auth/auth.go @@ -0,0 +1,3 @@ +// Package auth defines protocol-agnostic authentication types for smithy +// clients. +package auth diff --git a/vendor/github.com/aws/smithy-go/auth/bearer/docs.go b/vendor/github.com/aws/smithy-go/auth/bearer/docs.go new file mode 100644 index 00000000..1c9b9715 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/auth/bearer/docs.go @@ -0,0 +1,3 @@ +// Package bearer provides middleware and utilities for authenticating API +// operation calls with a Bearer Token. +package bearer diff --git a/vendor/github.com/aws/smithy-go/auth/bearer/middleware.go b/vendor/github.com/aws/smithy-go/auth/bearer/middleware.go new file mode 100644 index 00000000..8c7d7209 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/auth/bearer/middleware.go @@ -0,0 +1,104 @@ +package bearer + +import ( + "context" + "fmt" + + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Message is the middleware stack's request transport message value. +type Message interface{} + +// Signer provides an interface for implementations to decorate a request +// message with a bearer token. The signer is responsible for validating the +// message type is compatible with the signer. +type Signer interface { + SignWithBearerToken(context.Context, Token, Message) (Message, error) +} + +// AuthenticationMiddleware provides the Finalize middleware step for signing +// an request message with a bearer token. +type AuthenticationMiddleware struct { + signer Signer + tokenProvider TokenProvider +} + +// AddAuthenticationMiddleware helper adds the AuthenticationMiddleware to the +// middleware Stack in the Finalize step with the options provided. +func AddAuthenticationMiddleware(s *middleware.Stack, signer Signer, tokenProvider TokenProvider) error { + return s.Finalize.Add( + NewAuthenticationMiddleware(signer, tokenProvider), + middleware.After, + ) +} + +// NewAuthenticationMiddleware returns an initialized AuthenticationMiddleware. +func NewAuthenticationMiddleware(signer Signer, tokenProvider TokenProvider) *AuthenticationMiddleware { + return &AuthenticationMiddleware{ + signer: signer, + tokenProvider: tokenProvider, + } +} + +const authenticationMiddlewareID = "BearerTokenAuthentication" + +// ID returns the resolver identifier +func (m *AuthenticationMiddleware) ID() string { + return authenticationMiddlewareID +} + +// HandleFinalize implements the FinalizeMiddleware interface in order to +// update the request with bearer token authentication. +func (m *AuthenticationMiddleware) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, +) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + token, err := m.tokenProvider.RetrieveBearerToken(ctx) + if err != nil { + return out, metadata, fmt.Errorf("failed AuthenticationMiddleware wrap message, %w", err) + } + + signedMessage, err := m.signer.SignWithBearerToken(ctx, token, in.Request) + if err != nil { + return out, metadata, fmt.Errorf("failed AuthenticationMiddleware sign message, %w", err) + } + + in.Request = signedMessage + return next.HandleFinalize(ctx, in) +} + +// SignHTTPSMessage provides a bearer token authentication implementation that +// will sign the message with the provided bearer token. +// +// Will fail if the message is not a smithy-go HTTP request or the request is +// not HTTPS. +type SignHTTPSMessage struct{} + +// NewSignHTTPSMessage returns an initialized signer for HTTP messages. +func NewSignHTTPSMessage() *SignHTTPSMessage { + return &SignHTTPSMessage{} +} + +// SignWithBearerToken returns a copy of the HTTP request with the bearer token +// added via the "Authorization" header, per RFC 6750, https://datatracker.ietf.org/doc/html/rfc6750. +// +// Returns an error if the request's URL scheme is not HTTPS, or the request +// message is not an smithy-go HTTP Request pointer type. +func (SignHTTPSMessage) SignWithBearerToken(ctx context.Context, token Token, message Message) (Message, error) { + req, ok := message.(*smithyhttp.Request) + if !ok { + return nil, fmt.Errorf("expect smithy-go HTTP Request, got %T", message) + } + + if !req.IsHTTPS() { + return nil, fmt.Errorf("bearer token with HTTP request requires HTTPS") + } + + reqClone := req.Clone() + reqClone.Header.Set("Authorization", "Bearer "+token.Value) + + return reqClone, nil +} diff --git a/vendor/github.com/aws/smithy-go/auth/bearer/token.go b/vendor/github.com/aws/smithy-go/auth/bearer/token.go new file mode 100644 index 00000000..be260d4c --- /dev/null +++ b/vendor/github.com/aws/smithy-go/auth/bearer/token.go @@ -0,0 +1,50 @@ +package bearer + +import ( + "context" + "time" +) + +// Token provides a type wrapping a bearer token and expiration metadata. +type Token struct { + Value string + + CanExpire bool + Expires time.Time +} + +// Expired returns if the token's Expires time is before or equal to the time +// provided. If CanExpires is false, Expired will always return false. +func (t Token) Expired(now time.Time) bool { + if !t.CanExpire { + return false + } + now = now.Round(0) + return now.Equal(t.Expires) || now.After(t.Expires) +} + +// TokenProvider provides interface for retrieving bearer tokens. +type TokenProvider interface { + RetrieveBearerToken(context.Context) (Token, error) +} + +// TokenProviderFunc provides a helper utility to wrap a function as a type +// that implements the TokenProvider interface. +type TokenProviderFunc func(context.Context) (Token, error) + +// RetrieveBearerToken calls the wrapped function, returning the Token or +// error. +func (fn TokenProviderFunc) RetrieveBearerToken(ctx context.Context) (Token, error) { + return fn(ctx) +} + +// StaticTokenProvider provides a utility for wrapping a static bearer token +// value within an implementation of a token provider. +type StaticTokenProvider struct { + Token Token +} + +// RetrieveBearerToken returns the static token specified. +func (s StaticTokenProvider) RetrieveBearerToken(context.Context) (Token, error) { + return s.Token, nil +} diff --git a/vendor/github.com/aws/smithy-go/auth/bearer/token_cache.go b/vendor/github.com/aws/smithy-go/auth/bearer/token_cache.go new file mode 100644 index 00000000..223ddf52 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/auth/bearer/token_cache.go @@ -0,0 +1,208 @@ +package bearer + +import ( + "context" + "fmt" + "sync/atomic" + "time" + + smithycontext "github.com/aws/smithy-go/context" + "github.com/aws/smithy-go/internal/sync/singleflight" +) + +// package variable that can be override in unit tests. +var timeNow = time.Now + +// TokenCacheOptions provides a set of optional configuration options for the +// TokenCache TokenProvider. +type TokenCacheOptions struct { + // The duration before the token will expire when the credentials will be + // refreshed. If DisableAsyncRefresh is true, the RetrieveBearerToken calls + // will be blocking. + // + // Asynchronous refreshes are deduplicated, and only one will be in-flight + // at a time. If the token expires while an asynchronous refresh is in + // flight, the next call to RetrieveBearerToken will block on that refresh + // to return. + RefreshBeforeExpires time.Duration + + // The timeout the underlying TokenProvider's RetrieveBearerToken call must + // return within, or will be canceled. Defaults to 0, no timeout. + // + // If 0 timeout, its possible for the underlying tokenProvider's + // RetrieveBearerToken call to block forever. Preventing subsequent + // TokenCache attempts to refresh the token. + // + // If this timeout is reached all pending deduplicated calls to + // TokenCache RetrieveBearerToken will fail with an error. + RetrieveBearerTokenTimeout time.Duration + + // The minimum duration between asynchronous refresh attempts. If the next + // asynchronous recent refresh attempt was within the minimum delay + // duration, the call to retrieve will return the current cached token, if + // not expired. + // + // The asynchronous retrieve is deduplicated across multiple calls when + // RetrieveBearerToken is called. The asynchronous retrieve is not a + // periodic task. It is only performed when the token has not yet expired, + // and the current item is within the RefreshBeforeExpires window, and the + // TokenCache's RetrieveBearerToken method is called. + // + // If 0, (default) there will be no minimum delay between asynchronous + // refresh attempts. + // + // If DisableAsyncRefresh is true, this option is ignored. + AsyncRefreshMinimumDelay time.Duration + + // Sets if the TokenCache will attempt to refresh the token in the + // background asynchronously instead of blocking for credentials to be + // refreshed. If disabled token refresh will be blocking. + // + // The first call to RetrieveBearerToken will always be blocking, because + // there is no cached token. + DisableAsyncRefresh bool +} + +// TokenCache provides an utility to cache Bearer Authentication tokens from a +// wrapped TokenProvider. The TokenCache can be has options to configure the +// cache's early and asynchronous refresh of the token. +type TokenCache struct { + options TokenCacheOptions + provider TokenProvider + + cachedToken atomic.Value + lastRefreshAttemptTime atomic.Value + sfGroup singleflight.Group +} + +// NewTokenCache returns a initialized TokenCache that implements the +// TokenProvider interface. Wrapping the provider passed in. Also taking a set +// of optional functional option parameters to configure the token cache. +func NewTokenCache(provider TokenProvider, optFns ...func(*TokenCacheOptions)) *TokenCache { + var options TokenCacheOptions + for _, fn := range optFns { + fn(&options) + } + + return &TokenCache{ + options: options, + provider: provider, + } +} + +// RetrieveBearerToken returns the token if it could be obtained, or error if a +// valid token could not be retrieved. +// +// The passed in Context's cancel/deadline/timeout will impacting only this +// individual retrieve call and not any other already queued up calls. This +// means underlying provider's RetrieveBearerToken calls could block for ever, +// and not be canceled with the Context. Set RetrieveBearerTokenTimeout to +// provide a timeout, preventing the underlying TokenProvider blocking forever. +// +// By default, if the passed in Context is canceled, all of its values will be +// considered expired. The wrapped TokenProvider will not be able to lookup the +// values from the Context once it is expired. This is done to protect against +// expired values no longer being valid. To disable this behavior, use +// smithy-go's context.WithPreserveExpiredValues to add a value to the Context +// before calling RetrieveBearerToken to enable support for expired values. +// +// Without RetrieveBearerTokenTimeout there is the potential for a underlying +// Provider's RetrieveBearerToken call to sit forever. Blocking in subsequent +// attempts at refreshing the token. +func (p *TokenCache) RetrieveBearerToken(ctx context.Context) (Token, error) { + cachedToken, ok := p.getCachedToken() + if !ok || cachedToken.Expired(timeNow()) { + return p.refreshBearerToken(ctx) + } + + // Check if the token should be refreshed before it expires. + refreshToken := cachedToken.Expired(timeNow().Add(p.options.RefreshBeforeExpires)) + if !refreshToken { + return cachedToken, nil + } + + if p.options.DisableAsyncRefresh { + return p.refreshBearerToken(ctx) + } + + p.tryAsyncRefresh(ctx) + + return cachedToken, nil +} + +// tryAsyncRefresh attempts to asynchronously refresh the token returning the +// already cached token. If it AsyncRefreshMinimumDelay option is not zero, and +// the duration since the last refresh is less than that value, nothing will be +// done. +func (p *TokenCache) tryAsyncRefresh(ctx context.Context) { + if p.options.AsyncRefreshMinimumDelay != 0 { + var lastRefreshAttempt time.Time + if v := p.lastRefreshAttemptTime.Load(); v != nil { + lastRefreshAttempt = v.(time.Time) + } + + if timeNow().Before(lastRefreshAttempt.Add(p.options.AsyncRefreshMinimumDelay)) { + return + } + } + + // Ignore the returned channel so this won't be blocking, and limit the + // number of additional goroutines created. + p.sfGroup.DoChan("async-refresh", func() (interface{}, error) { + res, err := p.refreshBearerToken(ctx) + if p.options.AsyncRefreshMinimumDelay != 0 { + var refreshAttempt time.Time + if err != nil { + refreshAttempt = timeNow() + } + p.lastRefreshAttemptTime.Store(refreshAttempt) + } + + return res, err + }) +} + +func (p *TokenCache) refreshBearerToken(ctx context.Context) (Token, error) { + resCh := p.sfGroup.DoChan("refresh-token", func() (interface{}, error) { + ctx := smithycontext.WithSuppressCancel(ctx) + if v := p.options.RetrieveBearerTokenTimeout; v != 0 { + var cancel func() + ctx, cancel = context.WithTimeout(ctx, v) + defer cancel() + } + return p.singleRetrieve(ctx) + }) + + select { + case res := <-resCh: + return res.Val.(Token), res.Err + case <-ctx.Done(): + return Token{}, fmt.Errorf("retrieve bearer token canceled, %w", ctx.Err()) + } +} + +func (p *TokenCache) singleRetrieve(ctx context.Context) (interface{}, error) { + token, err := p.provider.RetrieveBearerToken(ctx) + if err != nil { + return Token{}, fmt.Errorf("failed to retrieve bearer token, %w", err) + } + + p.cachedToken.Store(&token) + return token, nil +} + +// getCachedToken returns the currently cached token and true if found. Returns +// false if no token is cached. +func (p *TokenCache) getCachedToken() (Token, bool) { + v := p.cachedToken.Load() + if v == nil { + return Token{}, false + } + + t := v.(*Token) + if t == nil || t.Value == "" { + return Token{}, false + } + + return *t, true +} diff --git a/vendor/github.com/aws/smithy-go/auth/identity.go b/vendor/github.com/aws/smithy-go/auth/identity.go new file mode 100644 index 00000000..ba8cf70d --- /dev/null +++ b/vendor/github.com/aws/smithy-go/auth/identity.go @@ -0,0 +1,47 @@ +package auth + +import ( + "context" + "time" + + "github.com/aws/smithy-go" +) + +// Identity contains information that identifies who the user making the +// request is. +type Identity interface { + Expiration() time.Time +} + +// IdentityResolver defines the interface through which an Identity is +// retrieved. +type IdentityResolver interface { + GetIdentity(context.Context, smithy.Properties) (Identity, error) +} + +// IdentityResolverOptions defines the interface through which an entity can be +// queried to retrieve an IdentityResolver for a given auth scheme. +type IdentityResolverOptions interface { + GetIdentityResolver(schemeID string) IdentityResolver +} + +// AnonymousIdentity is a sentinel to indicate no identity. +type AnonymousIdentity struct{} + +var _ Identity = (*AnonymousIdentity)(nil) + +// Expiration returns the zero value for time, as anonymous identity never +// expires. +func (*AnonymousIdentity) Expiration() time.Time { + return time.Time{} +} + +// AnonymousIdentityResolver returns AnonymousIdentity. +type AnonymousIdentityResolver struct{} + +var _ IdentityResolver = (*AnonymousIdentityResolver)(nil) + +// GetIdentity returns AnonymousIdentity. +func (*AnonymousIdentityResolver) GetIdentity(_ context.Context, _ smithy.Properties) (Identity, error) { + return &AnonymousIdentity{}, nil +} diff --git a/vendor/github.com/aws/smithy-go/auth/option.go b/vendor/github.com/aws/smithy-go/auth/option.go new file mode 100644 index 00000000..d5dabff0 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/auth/option.go @@ -0,0 +1,25 @@ +package auth + +import "github.com/aws/smithy-go" + +type ( + authOptionsKey struct{} +) + +// Option represents a possible authentication method for an operation. +type Option struct { + SchemeID string + IdentityProperties smithy.Properties + SignerProperties smithy.Properties +} + +// GetAuthOptions gets auth Options from Properties. +func GetAuthOptions(p *smithy.Properties) ([]*Option, bool) { + v, ok := p.Get(authOptionsKey{}).([]*Option) + return v, ok +} + +// SetAuthOptions sets auth Options on Properties. +func SetAuthOptions(p *smithy.Properties, options []*Option) { + p.Set(authOptionsKey{}, options) +} diff --git a/vendor/github.com/aws/smithy-go/auth/scheme_id.go b/vendor/github.com/aws/smithy-go/auth/scheme_id.go new file mode 100644 index 00000000..fb6a57c6 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/auth/scheme_id.go @@ -0,0 +1,20 @@ +package auth + +// Anonymous +const ( + SchemeIDAnonymous = "smithy.api#noAuth" +) + +// HTTP auth schemes +const ( + SchemeIDHTTPBasic = "smithy.api#httpBasicAuth" + SchemeIDHTTPDigest = "smithy.api#httpDigestAuth" + SchemeIDHTTPBearer = "smithy.api#httpBearerAuth" + SchemeIDHTTPAPIKey = "smithy.api#httpApiKeyAuth" +) + +// AWS auth schemes +const ( + SchemeIDSigV4 = "aws.auth#sigv4" + SchemeIDSigV4A = "aws.auth#sigv4a" +) diff --git a/vendor/github.com/aws/smithy-go/context/suppress_expired.go b/vendor/github.com/aws/smithy-go/context/suppress_expired.go new file mode 100644 index 00000000..a39b84a2 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/context/suppress_expired.go @@ -0,0 +1,81 @@ +package context + +import "context" + +// valueOnlyContext provides a utility to preserve only the values of a +// Context. Suppressing any cancellation or deadline on that context being +// propagated downstream of this value. +// +// If preserveExpiredValues is false (default), and the valueCtx is canceled, +// calls to lookup values with the Values method, will always return nil. Setting +// preserveExpiredValues to true, will allow the valueOnlyContext to lookup +// values in valueCtx even if valueCtx is canceled. +// +// Based on the Go standard libraries net/lookup.go onlyValuesCtx utility. +// https://github.com/golang/go/blob/da2773fe3e2f6106634673a38dc3a6eb875fe7d8/src/net/lookup.go +type valueOnlyContext struct { + context.Context + + preserveExpiredValues bool + valuesCtx context.Context +} + +var _ context.Context = (*valueOnlyContext)(nil) + +// Value looks up the key, returning its value. If configured to not preserve +// values of expired context, and the wrapping context is canceled, nil will be +// returned. +func (v *valueOnlyContext) Value(key interface{}) interface{} { + if !v.preserveExpiredValues { + select { + case <-v.valuesCtx.Done(): + return nil + default: + } + } + + return v.valuesCtx.Value(key) +} + +// WithSuppressCancel wraps the Context value, suppressing its deadline and +// cancellation events being propagated downstream to consumer of the returned +// context. +// +// By default the wrapped Context's Values are available downstream until the +// wrapped Context is canceled. Once the wrapped Context is canceled, Values +// method called on the context return will no longer lookup any key. As they +// are now considered expired. +// +// To override this behavior, use WithPreserveExpiredValues on the Context +// before it is wrapped by WithSuppressCancel. This will make the Context +// returned by WithSuppressCancel allow lookup of expired values. +func WithSuppressCancel(ctx context.Context) context.Context { + return &valueOnlyContext{ + Context: context.Background(), + valuesCtx: ctx, + + preserveExpiredValues: GetPreserveExpiredValues(ctx), + } +} + +type preserveExpiredValuesKey struct{} + +// WithPreserveExpiredValues adds a Value to the Context if expired values +// should be preserved, and looked up by a Context wrapped by +// WithSuppressCancel. +// +// WithPreserveExpiredValues must be added as a value to a Context, before that +// Context is wrapped by WithSuppressCancel +func WithPreserveExpiredValues(ctx context.Context, enable bool) context.Context { + return context.WithValue(ctx, preserveExpiredValuesKey{}, enable) +} + +// GetPreserveExpiredValues looks up, and returns the PreserveExpressValues +// value in the context. Returning true if enabled, false otherwise. +func GetPreserveExpiredValues(ctx context.Context) bool { + v := ctx.Value(preserveExpiredValuesKey{}) + if v != nil { + return v.(bool) + } + return false +} diff --git a/vendor/github.com/aws/smithy-go/document.go b/vendor/github.com/aws/smithy-go/document.go index bd931880..dec498c5 100644 --- a/vendor/github.com/aws/smithy-go/document.go +++ b/vendor/github.com/aws/smithy-go/document.go @@ -2,6 +2,8 @@ package smithy // Document provides access to loosely structured data in a document-like // format. +// +// Deprecated: See the github.com/aws/smithy-go/document package. type Document interface { UnmarshalDocument(interface{}) error GetValue() (interface{}, error) diff --git a/vendor/github.com/aws/smithy-go/document/doc.go b/vendor/github.com/aws/smithy-go/document/doc.go new file mode 100644 index 00000000..03055b7a --- /dev/null +++ b/vendor/github.com/aws/smithy-go/document/doc.go @@ -0,0 +1,12 @@ +// Package document provides interface definitions and error types for document types. +// +// A document is a protocol-agnostic type which supports a JSON-like data-model. You can use this type to send +// UTF-8 strings, arbitrary precision numbers, booleans, nulls, a list of these values, and a map of UTF-8 +// strings to these values. +// +// API Clients expose document constructors in their respective client document packages which must be used to +// Marshal and Unmarshal Go types to and from their respective protocol representations. +// +// See the Marshaler and Unmarshaler type documentation for more details on how to Go types can be converted to and from +// document types. +package document diff --git a/vendor/github.com/aws/smithy-go/document/document.go b/vendor/github.com/aws/smithy-go/document/document.go new file mode 100644 index 00000000..8f852d95 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/document/document.go @@ -0,0 +1,153 @@ +package document + +import ( + "fmt" + "math/big" + "strconv" +) + +// Marshaler is an interface for a type that marshals a document to its protocol-specific byte representation and +// returns the resulting bytes. A non-nil error will be returned if an error is encountered during marshaling. +// +// Marshal supports basic scalars (int,uint,float,bool,string), big.Int, and big.Float, maps, slices, and structs. +// Anonymous nested types are flattened based on Go anonymous type visibility. +// +// When defining struct types. the `document` struct tag can be used to control how the value will be +// marshaled into the resulting protocol document. +// +// // Field is ignored +// Field int `document:"-"` +// +// // Field object of key "myName" +// Field int `document:"myName"` +// +// // Field object key of key "myName", and +// // Field is omitted if the field is a zero value for the type. +// Field int `document:"myName,omitempty"` +// +// // Field object key of "Field", and +// // Field is omitted if the field is a zero value for the type. +// Field int `document:",omitempty"` +// +// All struct fields, including anonymous fields, are marshaled unless the +// any of the following conditions are meet. +// +// - the field is not exported +// - document field tag is "-" +// - document field tag specifies "omitempty", and is a zero value. +// +// Pointer and interface values are encoded as the value pointed to or +// contained in the interface. A nil value encodes as a null +// value unless `omitempty` struct tag is provided. +// +// Channel, complex, and function values are not encoded and will be skipped +// when walking the value to be marshaled. +// +// time.Time is not supported and will cause the Marshaler to return an error. These values should be represented +// by your application as a string or numerical representation. +// +// Errors that occur when marshaling will stop the marshaler, and return the error. +// +// Marshal cannot represent cyclic data structures and will not handle them. +// Passing cyclic structures to Marshal will result in an infinite recursion. +type Marshaler interface { + MarshalSmithyDocument() ([]byte, error) +} + +// Unmarshaler is an interface for a type that unmarshals a document from its protocol-specific representation, and +// stores the result into the value pointed by v. If v is nil or not a pointer then InvalidUnmarshalError will be +// returned. +// +// Unmarshaler supports the same encodings produced by a document Marshaler. This includes support for the `document` +// struct field tag for controlling how struct fields are unmarshaled. +// +// Both generic interface{} and concrete types are valid unmarshal destination types. When unmarshaling a document +// into an empty interface the Unmarshaler will store one of these values: +// bool, for boolean values +// document.Number, for arbitrary-precision numbers (int64, float64, big.Int, big.Float) +// string, for string values +// []interface{}, for array values +// map[string]interface{}, for objects +// nil, for null values +// +// When unmarshaling, any error that occurs will halt the unmarshal and return the error. +type Unmarshaler interface { + UnmarshalSmithyDocument(v interface{}) error +} + +type noSerde interface { + noSmithyDocumentSerde() +} + +// NoSerde is a sentinel value to indicate that a given type should not be marshaled or unmarshaled +// into a protocol document. +type NoSerde struct{} + +func (n NoSerde) noSmithyDocumentSerde() {} + +var _ noSerde = (*NoSerde)(nil) + +// IsNoSerde returns whether the given type implements the no smithy document serde interface. +func IsNoSerde(x interface{}) bool { + _, ok := x.(noSerde) + return ok +} + +// Number is an arbitrary precision numerical value +type Number string + +// Int64 returns the number as a string. +func (n Number) String() string { + return string(n) +} + +// Int64 returns the number as an int64. +func (n Number) Int64() (int64, error) { + return n.intOfBitSize(64) +} + +func (n Number) intOfBitSize(bitSize int) (int64, error) { + return strconv.ParseInt(string(n), 10, bitSize) +} + +// Uint64 returns the number as a uint64. +func (n Number) Uint64() (uint64, error) { + return n.uintOfBitSize(64) +} + +func (n Number) uintOfBitSize(bitSize int) (uint64, error) { + return strconv.ParseUint(string(n), 10, bitSize) +} + +// Float32 returns the number parsed as a 32-bit float, returns a float64. +func (n Number) Float32() (float64, error) { + return n.floatOfBitSize(32) +} + +// Float64 returns the number as a float64. +func (n Number) Float64() (float64, error) { + return n.floatOfBitSize(64) +} + +// Float64 returns the number as a float64. +func (n Number) floatOfBitSize(bitSize int) (float64, error) { + return strconv.ParseFloat(string(n), bitSize) +} + +// BigFloat attempts to convert the number to a big.Float, returns an error if the operation fails. +func (n Number) BigFloat() (*big.Float, error) { + f, ok := (&big.Float{}).SetString(string(n)) + if !ok { + return nil, fmt.Errorf("failed to convert to big.Float") + } + return f, nil +} + +// BigInt attempts to convert the number to a big.Int, returns an error if the operation fails. +func (n Number) BigInt() (*big.Int, error) { + f, ok := (&big.Int{}).SetString(string(n), 10) + if !ok { + return nil, fmt.Errorf("failed to convert to big.Float") + } + return f, nil +} diff --git a/vendor/github.com/aws/smithy-go/document/errors.go b/vendor/github.com/aws/smithy-go/document/errors.go new file mode 100644 index 00000000..046a7a76 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/document/errors.go @@ -0,0 +1,75 @@ +package document + +import ( + "fmt" + "reflect" +) + +// UnmarshalTypeError is an error type representing an error +// unmarshaling a Smithy document to a Go value type. This is different +// from UnmarshalError in that it does not wrap an underlying error type. +type UnmarshalTypeError struct { + Value string + Type reflect.Type +} + +// Error returns the string representation of the error. +// Satisfying the error interface. +func (e *UnmarshalTypeError) Error() string { + return fmt.Sprintf("unmarshal failed, cannot unmarshal %s into Go value type %s", + e.Value, e.Type.String()) +} + +// An InvalidUnmarshalError is an error type representing an invalid type +// encountered while unmarshaling a Smithy document to a Go value type. +type InvalidUnmarshalError struct { + Type reflect.Type +} + +// Error returns the string representation of the error. +// Satisfying the error interface. +func (e *InvalidUnmarshalError) Error() string { + var msg string + if e.Type == nil { + msg = "cannot unmarshal to nil value" + } else if e.Type.Kind() != reflect.Ptr { + msg = fmt.Sprintf("cannot unmarshal to non-pointer value, got %s", e.Type.String()) + } else { + msg = fmt.Sprintf("cannot unmarshal to nil value, %s", e.Type.String()) + } + + return fmt.Sprintf("unmarshal failed, %s", msg) +} + +// An UnmarshalError wraps an error that occurred while unmarshaling a +// Smithy document into a Go type. This is different from +// UnmarshalTypeError in that it wraps the underlying error that occurred. +type UnmarshalError struct { + Err error + Value string + Type reflect.Type +} + +// Unwrap returns the underlying unmarshaling error +func (e *UnmarshalError) Unwrap() error { + return e.Err +} + +// Error returns the string representation of the error. +// Satisfying the error interface. +func (e *UnmarshalError) Error() string { + return fmt.Sprintf("unmarshal failed, cannot unmarshal %q into %s, %v", + e.Value, e.Type.String(), e.Err) +} + +// An InvalidMarshalError is an error type representing an error +// occurring when marshaling a Go value type. +type InvalidMarshalError struct { + Message string +} + +// Error returns the string representation of the error. +// Satisfying the error interface. +func (e *InvalidMarshalError) Error() string { + return fmt.Sprintf("marshal failed, %s", e.Message) +} diff --git a/vendor/github.com/aws/smithy-go/encoding/httpbinding/encode.go b/vendor/github.com/aws/smithy-go/encoding/httpbinding/encode.go index 70dc2e89..543e7cf0 100644 --- a/vendor/github.com/aws/smithy-go/encoding/httpbinding/encode.go +++ b/vendor/github.com/aws/smithy-go/encoding/httpbinding/encode.go @@ -8,7 +8,12 @@ import ( "strings" ) -const contentLengthHeader = "Content-Length" +const ( + contentLengthHeader = "Content-Length" + floatNaN = "NaN" + floatInfinity = "Infinity" + floatNegInfinity = "-Infinity" +) // An Encoder provides encoding of REST URI path, query, and header components // of an HTTP request. Can also encode a stream as the payload. @@ -21,10 +26,17 @@ type Encoder struct { header http.Header } -// NewEncoder creates a new encoder from the passed in request. All query and +// NewEncoder creates a new encoder from the passed in request. It assumes that +// raw path contains no valuable information at this point, so it passes in path +// as path and raw path for subsequent trans +func NewEncoder(path, query string, headers http.Header) (*Encoder, error) { + return NewEncoderWithRawPath(path, path, query, headers) +} + +// NewHTTPBindingEncoder creates a new encoder from the passed in request. All query and // header values will be added on top of the request's existing values. Overwriting // duplicate values. -func NewEncoder(path, query string, headers http.Header) (*Encoder, error) { +func NewEncoderWithRawPath(path, rawPath, query string, headers http.Header) (*Encoder, error) { parseQuery, err := url.ParseQuery(query) if err != nil { return nil, fmt.Errorf("failed to parse query string: %w", err) @@ -32,7 +44,7 @@ func NewEncoder(path, query string, headers http.Header) (*Encoder, error) { e := &Encoder{ path: []byte(path), - rawPath: []byte(path), + rawPath: []byte(rawPath), query: parseQuery, header: headers.Clone(), } @@ -45,7 +57,7 @@ func NewEncoder(path, query string, headers http.Header) (*Encoder, error) { // Due net/http requiring `Content-Length` to be specified on the http.Request#ContentLength directly. Encode // will look for whether the header is present, and if so will remove it and set the respective value on http.Request. // -// Returns any error if one occurred during encoding. +// Returns any error occurring during encoding. func (e *Encoder) Encode(req *http.Request) (*http.Request, error) { req.URL.Path, req.URL.RawPath = string(e.path), string(e.rawPath) req.URL.RawQuery = e.query.Encode() @@ -75,7 +87,7 @@ func (e *Encoder) SetHeader(key string) HeaderValue { return newHeaderValue(e.header, key, false) } -// Headers returns a Header used encoding headers with the given prefix +// Headers returns a Header used for encoding headers with the given prefix func (e *Encoder) Headers(prefix string) Headers { return Headers{ header: e.header, @@ -83,7 +95,7 @@ func (e *Encoder) Headers(prefix string) Headers { } } -// HasHeader returns if a header with the key specified exists with one more +// HasHeader returns if a header with the key specified exists with one or // more value. func (e Encoder) HasHeader(key string) bool { return len(e.header[key]) != 0 @@ -103,3 +115,9 @@ func (e *Encoder) SetQuery(key string) QueryValue { func (e *Encoder) AddQuery(key string) QueryValue { return NewQueryValue(e.query, key, true) } + +// HasQuery returns if a query with the key specified exists with one or +// more values. +func (e *Encoder) HasQuery(key string) bool { + return len(e.query.Get(key)) != 0 +} diff --git a/vendor/github.com/aws/smithy-go/encoding/httpbinding/header.go b/vendor/github.com/aws/smithy-go/encoding/httpbinding/header.go index 618ef658..f9256e17 100644 --- a/vendor/github.com/aws/smithy-go/encoding/httpbinding/header.go +++ b/vendor/github.com/aws/smithy-go/encoding/httpbinding/header.go @@ -2,6 +2,7 @@ package httpbinding import ( "encoding/base64" + "math" "math/big" "net/http" "strconv" @@ -88,7 +89,16 @@ func (h HeaderValue) Double(v float64) { } func (h HeaderValue) float(v float64, bitSize int) { - h.modifyHeader(strconv.FormatFloat(v, 'f', -1, bitSize)) + switch { + case math.IsNaN(v): + h.String(floatNaN) + case math.IsInf(v, 1): + h.String(floatInfinity) + case math.IsInf(v, -1): + h.String(floatNegInfinity) + default: + h.modifyHeader(strconv.FormatFloat(v, 'f', -1, bitSize)) + } } // BigInteger encodes the value v as a query string value diff --git a/vendor/github.com/aws/smithy-go/encoding/httpbinding/query.go b/vendor/github.com/aws/smithy-go/encoding/httpbinding/query.go index ee7791f5..c2e7d0a2 100644 --- a/vendor/github.com/aws/smithy-go/encoding/httpbinding/query.go +++ b/vendor/github.com/aws/smithy-go/encoding/httpbinding/query.go @@ -2,6 +2,7 @@ package httpbinding import ( "encoding/base64" + "math" "math/big" "net/url" "strconv" @@ -79,7 +80,16 @@ func (qv QueryValue) Double(v float64) { } func (qv QueryValue) float(v float64, bitSize int) { - qv.updateKey(strconv.FormatFloat(v, 'f', -1, bitSize)) + switch { + case math.IsNaN(v): + qv.String(floatNaN) + case math.IsInf(v, 1): + qv.String(floatInfinity) + case math.IsInf(v, -1): + qv.String(floatNegInfinity) + default: + qv.updateKey(strconv.FormatFloat(v, 'f', -1, bitSize)) + } } // BigInteger encodes v as a query string value diff --git a/vendor/github.com/aws/smithy-go/encoding/httpbinding/uri.go b/vendor/github.com/aws/smithy-go/encoding/httpbinding/uri.go index 89cfae6d..f04e1198 100644 --- a/vendor/github.com/aws/smithy-go/encoding/httpbinding/uri.go +++ b/vendor/github.com/aws/smithy-go/encoding/httpbinding/uri.go @@ -1,6 +1,7 @@ package httpbinding import ( + "math" "math/big" "strconv" "strings" @@ -19,6 +20,9 @@ func newURIValue(path *[]byte, rawPath *[]byte, buffer *[]byte, key string) URIV func (u URIValue) modifyURI(value string) (err error) { *u.path, *u.buffer, err = replacePathElement(*u.path, *u.buffer, u.key, value, false) + if err != nil { + return err + } *u.rawPath, *u.buffer, err = replacePathElement(*u.rawPath, *u.buffer, u.key, value, true) return err } @@ -64,7 +68,16 @@ func (u URIValue) Double(v float64) error { } func (u URIValue) float(v float64, bitSize int) error { - return u.modifyURI(strconv.FormatFloat(v, 'f', -1, bitSize)) + switch { + case math.IsNaN(v): + return u.String(floatNaN) + case math.IsInf(v, 1): + return u.String(floatInfinity) + case math.IsInf(v, -1): + return u.String(floatNegInfinity) + default: + return u.modifyURI(strconv.FormatFloat(v, 'f', -1, bitSize)) + } } // BigInteger encodes v as a query string value diff --git a/vendor/github.com/aws/smithy-go/encoding/json/array.go b/vendor/github.com/aws/smithy-go/encoding/json/array.go index f740ca7e..7a232f66 100644 --- a/vendor/github.com/aws/smithy-go/encoding/json/array.go +++ b/vendor/github.com/aws/smithy-go/encoding/json/array.go @@ -4,7 +4,7 @@ import ( "bytes" ) -// Array represent the encoding of a JSON Array +// Array represents the encoding of a JSON Array type Array struct { w *bytes.Buffer writeComma bool diff --git a/vendor/github.com/aws/smithy-go/encoding/json/decoder_util.go b/vendor/github.com/aws/smithy-go/encoding/json/decoder_util.go index 5dce43e7..7050c85b 100644 --- a/vendor/github.com/aws/smithy-go/encoding/json/decoder_util.go +++ b/vendor/github.com/aws/smithy-go/encoding/json/decoder_util.go @@ -7,8 +7,8 @@ import ( "io" ) -// DiscardUnknownField discards unknown fields from decoder body. -// This function is useful while deserializing json body with additional +// DiscardUnknownField discards unknown fields from a decoder body. +// This function is useful while deserializing a JSON body with additional // unknown information that should be discarded. func DiscardUnknownField(decoder *json.Decoder) error { // This deliberately does not share logic with CollectUnknownField, even diff --git a/vendor/github.com/aws/smithy-go/encoding/json/object.go b/vendor/github.com/aws/smithy-go/encoding/json/object.go index 15fb6478..722346d0 100644 --- a/vendor/github.com/aws/smithy-go/encoding/json/object.go +++ b/vendor/github.com/aws/smithy-go/encoding/json/object.go @@ -17,9 +17,7 @@ func newObject(w *bytes.Buffer, scratch *[]byte) *Object { } func (o *Object) writeKey(key string) { - o.w.WriteRune(quote) - o.w.Write([]byte(key)) - o.w.WriteRune(quote) + escapeStringBytes(o.w, []byte(key)) o.w.WriteRune(colon) } diff --git a/vendor/github.com/aws/smithy-go/encoding/json/value.go b/vendor/github.com/aws/smithy-go/encoding/json/value.go index 966bb496..b41ff1e1 100644 --- a/vendor/github.com/aws/smithy-go/encoding/json/value.go +++ b/vendor/github.com/aws/smithy-go/encoding/json/value.go @@ -47,6 +47,12 @@ func (jv Value) Long(v int64) { jv.w.Write(*jv.scratch) } +// ULong encodes v as a JSON number +func (jv Value) ULong(v uint64) { + *jv.scratch = strconv.AppendUint((*jv.scratch)[:0], v, 10) + jv.w.Write(*jv.scratch) +} + // Float encodes v as a JSON number func (jv Value) Float(v float32) { jv.float(float64(v), 32) diff --git a/vendor/github.com/aws/smithy-go/encoding/xml/doc.go b/vendor/github.com/aws/smithy-go/encoding/xml/doc.go index d6e1e41e..f9200093 100644 --- a/vendor/github.com/aws/smithy-go/encoding/xml/doc.go +++ b/vendor/github.com/aws/smithy-go/encoding/xml/doc.go @@ -2,7 +2,7 @@ Package xml holds the XMl encoder utility. This utility is written in accordance to our design to delegate to shape serializer function in which a xml.Value will be passed around. -Resources followed: https://awslabs.github.io/smithy/1.0/spec/core/xml-traits.html# +Resources followed: https://smithy.io/2.0/spec/protocol-traits.html#xml-bindings Member Element diff --git a/vendor/github.com/aws/smithy-go/encoding/xml/escape.go b/vendor/github.com/aws/smithy-go/encoding/xml/escape.go index be223e09..1c5479af 100644 --- a/vendor/github.com/aws/smithy-go/encoding/xml/escape.go +++ b/vendor/github.com/aws/smithy-go/encoding/xml/escape.go @@ -21,6 +21,10 @@ var ( escNL = []byte(" ") escCR = []byte(" ") escFFFD = []byte("\uFFFD") // Unicode replacement character + + // Additional Escapes + escNextLine = []byte("…") + escLS = []byte("
") ) // Decide whether the given rune is in the XML Character Range, per @@ -61,6 +65,12 @@ func escapeString(e writer, s string) { esc = escNL case '\r': esc = escCR + case '\u0085': + // Not escaped by stdlib + esc = escNextLine + case '\u2028': + // Not escaped by stdlib + esc = escLS default: if !isInCharacterRange(r) || (r == 0xFFFD && width == 1) { esc = escFFFD @@ -101,11 +111,17 @@ func escapeText(e writer, s []byte) { case '\t': esc = escTab case '\n': - // TODO: This always escapes newline, which is different than stdlib's optional - // escape of new line + // This always escapes newline, which is different than stdlib's optional + // escape of new line. esc = escNL case '\r': esc = escCR + case '\u0085': + // Not escaped by stdlib + esc = escNextLine + case '\u2028': + // Not escaped by stdlib + esc = escLS default: if !isInCharacterRange(r) || (r == 0xFFFD && width == 1) { esc = escFFFD diff --git a/vendor/github.com/aws/smithy-go/endpoints/endpoint.go b/vendor/github.com/aws/smithy-go/endpoints/endpoint.go new file mode 100644 index 00000000..a9352839 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/endpoints/endpoint.go @@ -0,0 +1,23 @@ +package transport + +import ( + "net/http" + "net/url" + + "github.com/aws/smithy-go" +) + +// Endpoint is the endpoint object returned by Endpoint resolution V2 +type Endpoint struct { + // The complete URL minimally specfiying the scheme and host. + // May optionally specify the port and base path component. + URI url.URL + + // An optional set of headers to be sent using transport layer headers. + Headers http.Header + + // A grab-bag property map of endpoint attributes. The + // values present here are subject to change, or being add/removed at any + // time. + Properties smithy.Properties +} diff --git a/vendor/github.com/aws/smithy-go/errors.go b/vendor/github.com/aws/smithy-go/errors.go index a397cf6f..d6948d02 100644 --- a/vendor/github.com/aws/smithy-go/errors.go +++ b/vendor/github.com/aws/smithy-go/errors.go @@ -60,7 +60,7 @@ func (e *OperationError) Error() string { return fmt.Sprintf("operation error %s: %s, %v", e.ServiceID, e.OperationName, e.Err) } -// DeserializationError provides a wrapper for and error that occurs during +// DeserializationError provides a wrapper for an error that occurs during // deserialization. type DeserializationError struct { Err error // original error diff --git a/vendor/github.com/aws/smithy-go/go_module_metadata.go b/vendor/github.com/aws/smithy-go/go_module_metadata.go new file mode 100644 index 00000000..cd6f7fa4 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package smithy + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "1.19.0" diff --git a/vendor/github.com/aws/smithy-go/internal/sync/singleflight/LICENSE b/vendor/github.com/aws/smithy-go/internal/sync/singleflight/LICENSE new file mode 100644 index 00000000..fe6a6200 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/internal/sync/singleflight/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/vendor/github.com/aws/smithy-go/internal/sync/singleflight/docs.go b/vendor/github.com/aws/smithy-go/internal/sync/singleflight/docs.go new file mode 100644 index 00000000..9c9d02b9 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/internal/sync/singleflight/docs.go @@ -0,0 +1,8 @@ +// Package singleflight provides a duplicate function call suppression +// mechanism. This package is a fork of the Go golang.org/x/sync/singleflight +// package. The package is forked, because the package a part of the unstable +// and unversioned golang.org/x/sync module. +// +// https://github.com/golang/sync/tree/67f06af15bc961c363a7260195bcd53487529a21/singleflight + +package singleflight diff --git a/vendor/github.com/aws/smithy-go/internal/sync/singleflight/singleflight.go b/vendor/github.com/aws/smithy-go/internal/sync/singleflight/singleflight.go new file mode 100644 index 00000000..e8a1b17d --- /dev/null +++ b/vendor/github.com/aws/smithy-go/internal/sync/singleflight/singleflight.go @@ -0,0 +1,210 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package singleflight + +import ( + "bytes" + "errors" + "fmt" + "runtime" + "runtime/debug" + "sync" +) + +// errGoexit indicates the runtime.Goexit was called in +// the user given function. +var errGoexit = errors.New("runtime.Goexit was called") + +// A panicError is an arbitrary value recovered from a panic +// with the stack trace during the execution of given function. +type panicError struct { + value interface{} + stack []byte +} + +// Error implements error interface. +func (p *panicError) Error() string { + return fmt.Sprintf("%v\n\n%s", p.value, p.stack) +} + +func newPanicError(v interface{}) error { + stack := debug.Stack() + + // The first line of the stack trace is of the form "goroutine N [status]:" + // but by the time the panic reaches Do the goroutine may no longer exist + // and its status will have changed. Trim out the misleading line. + if line := bytes.IndexByte(stack[:], '\n'); line >= 0 { + stack = stack[line+1:] + } + return &panicError{value: v, stack: stack} +} + +// call is an in-flight or completed singleflight.Do call +type call struct { + wg sync.WaitGroup + + // These fields are written once before the WaitGroup is done + // and are only read after the WaitGroup is done. + val interface{} + err error + + // forgotten indicates whether Forget was called with this call's key + // while the call was still in flight. + forgotten bool + + // These fields are read and written with the singleflight + // mutex held before the WaitGroup is done, and are read but + // not written after the WaitGroup is done. + dups int + chans []chan<- Result +} + +// Group represents a class of work and forms a namespace in +// which units of work can be executed with duplicate suppression. +type Group struct { + mu sync.Mutex // protects m + m map[string]*call // lazily initialized +} + +// Result holds the results of Do, so they can be passed +// on a channel. +type Result struct { + Val interface{} + Err error + Shared bool +} + +// Do executes and returns the results of the given function, making +// sure that only one execution is in-flight for a given key at a +// time. If a duplicate comes in, the duplicate caller waits for the +// original to complete and receives the same results. +// The return value shared indicates whether v was given to multiple callers. +func (g *Group) Do(key string, fn func() (interface{}, error)) (v interface{}, err error, shared bool) { + g.mu.Lock() + if g.m == nil { + g.m = make(map[string]*call) + } + if c, ok := g.m[key]; ok { + c.dups++ + g.mu.Unlock() + c.wg.Wait() + + if e, ok := c.err.(*panicError); ok { + panic(e) + } else if c.err == errGoexit { + runtime.Goexit() + } + return c.val, c.err, true + } + c := new(call) + c.wg.Add(1) + g.m[key] = c + g.mu.Unlock() + + g.doCall(c, key, fn) + return c.val, c.err, c.dups > 0 +} + +// DoChan is like Do but returns a channel that will receive the +// results when they are ready. +// +// The returned channel will not be closed. +func (g *Group) DoChan(key string, fn func() (interface{}, error)) <-chan Result { + ch := make(chan Result, 1) + g.mu.Lock() + if g.m == nil { + g.m = make(map[string]*call) + } + if c, ok := g.m[key]; ok { + c.dups++ + c.chans = append(c.chans, ch) + g.mu.Unlock() + return ch + } + c := &call{chans: []chan<- Result{ch}} + c.wg.Add(1) + g.m[key] = c + g.mu.Unlock() + + go g.doCall(c, key, fn) + + return ch +} + +// doCall handles the single call for a key. +func (g *Group) doCall(c *call, key string, fn func() (interface{}, error)) { + normalReturn := false + recovered := false + + // use double-defer to distinguish panic from runtime.Goexit, + // more details see https://golang.org/cl/134395 + defer func() { + // the given function invoked runtime.Goexit + if !normalReturn && !recovered { + c.err = errGoexit + } + + c.wg.Done() + g.mu.Lock() + defer g.mu.Unlock() + if !c.forgotten { + delete(g.m, key) + } + + if e, ok := c.err.(*panicError); ok { + // In order to prevent the waiting channels from being blocked forever, + // needs to ensure that this panic cannot be recovered. + if len(c.chans) > 0 { + go panic(e) + select {} // Keep this goroutine around so that it will appear in the crash dump. + } else { + panic(e) + } + } else if c.err == errGoexit { + // Already in the process of goexit, no need to call again + } else { + // Normal return + for _, ch := range c.chans { + ch <- Result{c.val, c.err, c.dups > 0} + } + } + }() + + func() { + defer func() { + if !normalReturn { + // Ideally, we would wait to take a stack trace until we've determined + // whether this is a panic or a runtime.Goexit. + // + // Unfortunately, the only way we can distinguish the two is to see + // whether the recover stopped the goroutine from terminating, and by + // the time we know that, the part of the stack trace relevant to the + // panic has been discarded. + if r := recover(); r != nil { + c.err = newPanicError(r) + } + } + }() + + c.val, c.err = fn() + normalReturn = true + }() + + if !normalReturn { + recovered = true + } +} + +// Forget tells the singleflight to forget about a key. Future calls +// to Do for this key will call the function rather than waiting for +// an earlier call to complete. +func (g *Group) Forget(key string) { + g.mu.Lock() + if c, ok := g.m[key]; ok { + c.forgotten = true + } + delete(g.m, key) + g.mu.Unlock() +} diff --git a/vendor/github.com/aws/smithy-go/io/ringbuffer.go b/vendor/github.com/aws/smithy-go/io/ringbuffer.go index 7537eb24..06b476ad 100644 --- a/vendor/github.com/aws/smithy-go/io/ringbuffer.go +++ b/vendor/github.com/aws/smithy-go/io/ringbuffer.go @@ -24,7 +24,7 @@ func NewRingBuffer(slice []byte) *RingBuffer { return &ringBuf } -// Write method inserts the elements in a byte slice, and returns the number of bytes written along with an error. +// Write method inserts the elements in a byte slice, and returns the number of bytes written along with any error. func (r *RingBuffer) Write(p []byte) (int, error) { for _, b := range p { // check if end points to invalid index, we need to circle back @@ -45,11 +45,11 @@ func (r *RingBuffer) Write(p []byte) (int, error) { r.end++ r.size++ } - return r.size, nil + return len(p), nil } // Read copies the data on the ring buffer into the byte slice provided to the method. -// Returns the read count along with Error encountered while reading +// Returns the read count along with any error encountered while reading. func (r *RingBuffer) Read(p []byte) (int, error) { // readCount keeps track of the number of bytes read var readCount int @@ -60,20 +60,25 @@ func (r *RingBuffer) Read(p []byte) (int, error) { return readCount, io.EOF } + if r.start == len(r.slice) { + r.start = 0 + } + p[j] = r.slice[r.start] readCount++ // increment the start pointer for ring buffer r.start++ // decrement the size of ring buffer r.size-- - - if r.start == len(r.slice) { - r.start = 0 - } } return readCount, nil } +// Len returns the number of unread bytes in the buffer. +func (r *RingBuffer) Len() int { + return r.size +} + // Bytes returns a copy of the RingBuffer's bytes. func (r RingBuffer) Bytes() []byte { var b bytes.Buffer diff --git a/vendor/github.com/aws/smithy-go/local-mod-replace.sh b/vendor/github.com/aws/smithy-go/local-mod-replace.sh new file mode 100644 index 00000000..800bf376 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/local-mod-replace.sh @@ -0,0 +1,39 @@ +#1/usr/bin/env bash + +PROJECT_DIR="" +SMITHY_SOURCE_DIR=$(cd `dirname $0` && pwd) + +usage() { + echo "Usage: $0 [-s SMITHY_SOURCE_DIR] [-d PROJECT_DIR]" 1>&2 + exit 1 +} + +while getopts "hs:d:" options; do + case "${options}" in + s) + SMITHY_SOURCE_DIR=${OPTARG} + if [ "$SMITHY_SOURCE_DIR" == "" ]; then + echo "path to smithy-go source directory is required" || exit + usage + fi + ;; + d) + PROJECT_DIR=${OPTARG} + ;; + h) + usage + ;; + *) + usage + ;; + esac +done + +if [ "$PROJECT_DIR" != "" ]; then + cd $PROJECT_DIR || exit +fi + +go mod graph | awk '{print $1}' | cut -d '@' -f 1 | sort | uniq | grep "github.com/aws/smithy-go" | while read x; do + repPath=${x/github.com\/aws\/smithy-go/${SMITHY_SOURCE_DIR}} + echo -replace $x=$repPath +done | xargs go mod edit diff --git a/vendor/github.com/aws/smithy-go/logging/logger.go b/vendor/github.com/aws/smithy-go/logging/logger.go index 70b38762..2071924b 100644 --- a/vendor/github.com/aws/smithy-go/logging/logger.go +++ b/vendor/github.com/aws/smithy-go/logging/logger.go @@ -6,7 +6,7 @@ import ( "log" ) -// Classification the log entry's classification name +// Classification is the type of the log entry's classification name. type Classification string // Set of standard classifications that can be used by clients and middleware diff --git a/vendor/github.com/aws/smithy-go/middleware/doc.go b/vendor/github.com/aws/smithy-go/middleware/doc.go index c4bc958c..9858928a 100644 --- a/vendor/github.com/aws/smithy-go/middleware/doc.go +++ b/vendor/github.com/aws/smithy-go/middleware/doc.go @@ -1,4 +1,4 @@ -// Package middleware provide transport agnostic middleware for decorating SDK +// Package middleware provides transport agnostic middleware for decorating SDK // handlers. // // The Smithy middleware stack provides ordered behavior to be invoked on an @@ -24,7 +24,7 @@ // order by the Stack. These steps represent fixed points in the middleware stack // for organizing specific behavior, such as serialize and build. A Stack Step is // composed of zero or more middleware that are specific to that step. A step may -// define its on set of input/output parameters the generic input/output +// define its own set of input/output parameters the generic input/output // parameters are cast from. A step calls its middleware recursively, before // calling the next step in the stack returning the result or error of the step // middleware decorating the underlying handler. @@ -39,7 +39,7 @@ // HTTP's Content-Length header, or body checksum). Decorations and // modifications to the message should be copied to all message attempts. // -// * Finalize: Preforms final preparations needed before sending the message. The +// * Finalize: Performs final preparations needed before sending the message. The // message should already be complete by this stage, and is only alternated to // meet the expectations of the recipient, (e.g. Retry and AWS SigV4 request // signing). @@ -51,8 +51,8 @@ // Adding Middleware to a Stack Step // // Middleware can be added to a step front or back, or relative, by name, to an -// existing middleware in that stack. If a middleware does not have a name a -// unique name will be generated at the middleware is added to the step. +// existing middleware in that stack. If a middleware does not have a name, a +// unique name will be generated at the middleware and be added to the step. // // // Create middleware stack // stack := middleware.NewStack() diff --git a/vendor/github.com/aws/smithy-go/middleware/metadata.go b/vendor/github.com/aws/smithy-go/middleware/metadata.go index c41ebf5a..7bb7dbcf 100644 --- a/vendor/github.com/aws/smithy-go/middleware/metadata.go +++ b/vendor/github.com/aws/smithy-go/middleware/metadata.go @@ -25,11 +25,24 @@ func (m Metadata) Get(key interface{}) interface{} { return m.values[key] } +// Clone creates a shallow copy of Metadata entries, returning a new Metadata +// value with the original entries copied into it. +func (m Metadata) Clone() Metadata { + vs := make(map[interface{}]interface{}, len(m.values)) + for k, v := range m.values { + vs[k] = v + } + + return Metadata{ + values: vs, + } +} + // Set stores the value pointed to by the key. If a value already exists at // that key it will be replaced with the new value. // // Set method must be called as an addressable value, or pointer. If Set is not -// called as a addressable value or pointer, the key value pair being set may +// called as an addressable value or pointer, the key value pair being set may // be lost. // // Panics if the key type is not comparable. @@ -40,7 +53,7 @@ func (m *Metadata) Set(key, value interface{}) { m.values[key] = value } -// Has returns if the key exists in the metadata. +// Has returns whether the key exists in the metadata. // // Panics if the key type is not comparable. func (m Metadata) Has(key interface{}) bool { diff --git a/vendor/github.com/aws/smithy-go/middleware/ordered_group.go b/vendor/github.com/aws/smithy-go/middleware/ordered_group.go index 144a7fa9..4b195308 100644 --- a/vendor/github.com/aws/smithy-go/middleware/ordered_group.go +++ b/vendor/github.com/aws/smithy-go/middleware/ordered_group.go @@ -48,7 +48,7 @@ func (g *orderedIDs) Add(m ider, pos RelativePosition) error { return nil } -// Insert injects the item relative to an existing item id. Return error if +// Insert injects the item relative to an existing item id. Returns an error if // the original item does not exist, or the item being added already exists. func (g *orderedIDs) Insert(m ider, relativeTo string, pos RelativePosition) error { if len(m.ID()) == 0 { @@ -66,13 +66,13 @@ func (g *orderedIDs) Insert(m ider, relativeTo string, pos RelativePosition) err return nil } -// Get returns the ider identified by id. If ider is not present, returns false +// Get returns the ider identified by id. If ider is not present, returns false. func (g *orderedIDs) Get(id string) (ider, bool) { v, ok := g.items[id] return v, ok } -// Swap removes the item by id, replacing it with the new item. Returns error +// Swap removes the item by id, replacing it with the new item. Returns an error // if the original item doesn't exist. func (g *orderedIDs) Swap(id string, m ider) (ider, error) { if len(id) == 0 { @@ -96,7 +96,7 @@ func (g *orderedIDs) Swap(id string, m ider) (ider, error) { return removed, nil } -// Remove removes the item by id. Returns error if the item +// Remove removes the item by id. Returns an error if the item // doesn't exist. func (g *orderedIDs) Remove(id string) (ider, error) { if len(id) == 0 { @@ -147,7 +147,7 @@ func newRelativeOrder() *relativeOrder { } } -// Add inserts a item into the order relative to the position provided. +// Add inserts an item into the order relative to the position provided. func (s *relativeOrder) Add(pos RelativePosition, ids ...string) error { if len(ids) == 0 { return nil @@ -173,7 +173,7 @@ func (s *relativeOrder) Add(pos RelativePosition, ids ...string) error { return nil } -// Insert injects a item before or after the relative item. Returns +// Insert injects an item before or after the relative item. Returns // an error if the relative item does not exist. func (s *relativeOrder) Insert(relativeTo string, pos RelativePosition, ids ...string) error { if len(ids) == 0 { @@ -195,7 +195,7 @@ func (s *relativeOrder) Insert(relativeTo string, pos RelativePosition, ids ...s } // Swap will replace the item id with the to item. Returns an -// error if the original item id does not exist. Allows swapping out a +// error if the original item id does not exist. Allows swapping out an // item for another item with the same id. func (s *relativeOrder) Swap(id, to string) error { i, ok := s.has(id) diff --git a/vendor/github.com/aws/smithy-go/middleware/stack.go b/vendor/github.com/aws/smithy-go/middleware/stack.go index ae3d82e6..45ccb5b9 100644 --- a/vendor/github.com/aws/smithy-go/middleware/stack.go +++ b/vendor/github.com/aws/smithy-go/middleware/stack.go @@ -7,7 +7,7 @@ import ( ) // Stack provides protocol and transport agnostic set of middleware split into -// distinct steps. Steps have specific transitions between them, that is +// distinct steps. Steps have specific transitions between them, that are // managed by the individual step. // // Steps are composed as middleware around the underlying handler in the @@ -15,7 +15,7 @@ import ( // // Initialize -> Serialize -> Build -> Finalize -> Deserialize -> Handler // -// Any middleware within the chain may chose to stop and return an error or +// Any middleware within the chain may choose to stop and return an error or // response. Since the middleware decorate the handler like a call stack, each // middleware will receive the result of the next middleware in the chain. // Middleware that does not need to react to an input, or result must forward @@ -23,7 +23,7 @@ import ( // // Initialize <- Serialize -> Build -> Finalize <- Deserialize <- Handler type Stack struct { - // Initialize Prepares the input, and sets any default parameters as + // Initialize prepares the input, and sets any default parameters as // needed, (e.g. idempotency token, and presigned URLs). // // Takes Input Parameters, and returns result or error. @@ -31,7 +31,7 @@ type Stack struct { // Receives result or error from Serialize step. Initialize *InitializeStep - // Serializes the prepared input into a data structure that can be consumed + // Serialize serializes the prepared input into a data structure that can be consumed // by the target transport's message, (e.g. REST-JSON serialization) // // Converts Input Parameters into a Request, and returns the result or error. @@ -39,7 +39,7 @@ type Stack struct { // Receives result or error from Build step. Serialize *SerializeStep - // Adds additional metadata to the serialized transport message, + // Build adds additional metadata to the serialized transport message // (e.g. HTTP's Content-Length header, or body checksum). Decorations and // modifications to the message should be copied to all message attempts. // @@ -48,9 +48,9 @@ type Stack struct { // Receives result or error from Finalize step. Build *BuildStep - // Preforms final preparations needed before sending the message. The + // Finalize performs final preparations needed before sending the message. The // message should already be complete by this stage, and is only alternated - // to meet the expectations of the recipient, (e.g. Retry and AWS SigV4 + // to meet the expectations of the recipient (e.g. Retry and AWS SigV4 // request signing) // // Takes Request, and returns result or error. @@ -58,7 +58,7 @@ type Stack struct { // Receives result or error from Deserialize step. Finalize *FinalizeStep - // Reacts to the handler's response returned by the recipient of the request + // Deserialize reacts to the handler's response returned by the recipient of the request // message. Deserializes the response into a structured type or error above // stacks can react to. // diff --git a/vendor/github.com/aws/smithy-go/middleware/stack_values.go b/vendor/github.com/aws/smithy-go/middleware/stack_values.go index 21b736a9..ef96009b 100644 --- a/vendor/github.com/aws/smithy-go/middleware/stack_values.go +++ b/vendor/github.com/aws/smithy-go/middleware/stack_values.go @@ -6,7 +6,7 @@ import ( "strings" ) -// WithStackValue adds a key value pair to the context that are intended to be +// WithStackValue adds a key value pair to the context that is intended to be // scoped to a stack. Use ClearStackValues to get a new context with all stack // values cleared. func WithStackValue(ctx context.Context, key, value interface{}) context.Context { diff --git a/vendor/github.com/aws/smithy-go/middleware/step_build.go b/vendor/github.com/aws/smithy-go/middleware/step_build.go index b91e0959..7e1d94ca 100644 --- a/vendor/github.com/aws/smithy-go/middleware/step_build.go +++ b/vendor/github.com/aws/smithy-go/middleware/step_build.go @@ -70,12 +70,12 @@ func (s buildMiddlewareFunc) HandleBuild(ctx context.Context, in BuildInput, nex var _ BuildMiddleware = (buildMiddlewareFunc{}) // BuildStep provides the ordered grouping of BuildMiddleware to be invoked on -// an handler. +// a handler. type BuildStep struct { ids *orderedIDs } -// NewBuildStep returns an BuildStep ready to have middleware for +// NewBuildStep returns a BuildStep ready to have middleware for // initialization added to it. func NewBuildStep() *BuildStep { return &BuildStep{ @@ -131,14 +131,14 @@ func (s *BuildStep) Add(m BuildMiddleware, pos RelativePosition) error { } // Insert injects the middleware relative to an existing middleware id. -// Return error if the original middleware does not exist, or the middleware +// Returns an error if the original middleware does not exist, or the middleware // being added already exists. func (s *BuildStep) Insert(m BuildMiddleware, relativeTo string, pos RelativePosition) error { return s.ids.Insert(m, relativeTo, pos) } // Swap removes the middleware by id, replacing it with the new middleware. -// Returns the middleware removed, or error if the middleware to be removed +// Returns the middleware removed, or an error if the middleware to be removed // doesn't exist. func (s *BuildStep) Swap(id string, m BuildMiddleware) (BuildMiddleware, error) { removed, err := s.ids.Swap(id, m) diff --git a/vendor/github.com/aws/smithy-go/middleware/step_deserialize.go b/vendor/github.com/aws/smithy-go/middleware/step_deserialize.go index 0d46e6b1..44860721 100644 --- a/vendor/github.com/aws/smithy-go/middleware/step_deserialize.go +++ b/vendor/github.com/aws/smithy-go/middleware/step_deserialize.go @@ -12,7 +12,7 @@ type DeserializeInput struct { } // DeserializeOutput provides the result returned by the next -// DeserializeHandler. The DeserializeMiddleware should deserailize the +// DeserializeHandler. The DeserializeMiddleware should deserialize the // RawResponse into a Result that can be consumed by middleware higher up in // the stack. type DeserializeOutput struct { @@ -32,11 +32,11 @@ type DeserializeHandler interface { // serialize step. Delegates to the next DeserializeHandler for further // processing. type DeserializeMiddleware interface { - // Unique ID for the middleware in the DeserializeStep. The step does not + // ID returns a unique ID for the middleware in the DeserializeStep. The step does not // allow duplicate IDs. ID() string - // Invokes the middleware behavior which must delegate to the next handler + // HandleDeserialize invokes the middleware behavior which must delegate to the next handler // for the middleware chain to continue. The method must return a result or // error to its caller. HandleDeserialize(ctx context.Context, in DeserializeInput, next DeserializeHandler) ( @@ -76,12 +76,12 @@ func (s deserializeMiddlewareFunc) HandleDeserialize(ctx context.Context, in Des var _ DeserializeMiddleware = (deserializeMiddlewareFunc{}) // DeserializeStep provides the ordered grouping of DeserializeMiddleware to be -// invoked on an handler. +// invoked on a handler. type DeserializeStep struct { ids *orderedIDs } -// NewDeserializeStep returns an DeserializeStep ready to have middleware for +// NewDeserializeStep returns a DeserializeStep ready to have middleware for // initialization added to it. func NewDeserializeStep() *DeserializeStep { return &DeserializeStep{ @@ -91,7 +91,7 @@ func NewDeserializeStep() *DeserializeStep { var _ Middleware = (*DeserializeStep)(nil) -// ID returns the unique id of the step as a middleware. +// ID returns the unique ID of the step as a middleware. func (s *DeserializeStep) ID() string { return "Deserialize stack step" } @@ -136,8 +136,8 @@ func (s *DeserializeStep) Add(m DeserializeMiddleware, pos RelativePosition) err return s.ids.Add(m, pos) } -// Insert injects the middleware relative to an existing middleware id. -// Return error if the original middleware does not exist, or the middleware +// Insert injects the middleware relative to an existing middleware ID. +// Returns error if the original middleware does not exist, or the middleware // being added already exists. func (s *DeserializeStep) Insert(m DeserializeMiddleware, relativeTo string, pos RelativePosition) error { return s.ids.Insert(m, relativeTo, pos) @@ -182,7 +182,7 @@ type deserializeWrapHandler struct { var _ DeserializeHandler = (*deserializeWrapHandler)(nil) -// Implements DeserializeHandler, converts types and delegates to underlying +// HandleDeserialize implements DeserializeHandler, converts types and delegates to underlying // generic handler. func (w deserializeWrapHandler) HandleDeserialize(ctx context.Context, in DeserializeInput) ( out DeserializeOutput, metadata Metadata, err error, diff --git a/vendor/github.com/aws/smithy-go/middleware/step_finalize.go b/vendor/github.com/aws/smithy-go/middleware/step_finalize.go index 88e79ded..065e3885 100644 --- a/vendor/github.com/aws/smithy-go/middleware/step_finalize.go +++ b/vendor/github.com/aws/smithy-go/middleware/step_finalize.go @@ -26,11 +26,11 @@ type FinalizeHandler interface { // serialize step. Delegates to the next FinalizeHandler for further // processing. type FinalizeMiddleware interface { - // Unique ID for the middleware in the FinalizeStep. The step does not + // ID returns a unique ID for the middleware in the FinalizeStep. The step does not // allow duplicate IDs. ID() string - // Invokes the middleware behavior which must delegate to the next handler + // HandleFinalize invokes the middleware behavior which must delegate to the next handler // for the middleware chain to continue. The method must return a result or // error to its caller. HandleFinalize(ctx context.Context, in FinalizeInput, next FinalizeHandler) ( @@ -70,12 +70,12 @@ func (s finalizeMiddlewareFunc) HandleFinalize(ctx context.Context, in FinalizeI var _ FinalizeMiddleware = (finalizeMiddlewareFunc{}) // FinalizeStep provides the ordered grouping of FinalizeMiddleware to be -// invoked on an handler. +// invoked on a handler. type FinalizeStep struct { ids *orderedIDs } -// NewFinalizeStep returns an FinalizeStep ready to have middleware for +// NewFinalizeStep returns a FinalizeStep ready to have middleware for // initialization added to it. func NewFinalizeStep() *FinalizeStep { return &FinalizeStep{ @@ -130,8 +130,8 @@ func (s *FinalizeStep) Add(m FinalizeMiddleware, pos RelativePosition) error { return s.ids.Add(m, pos) } -// Insert injects the middleware relative to an existing middleware id. -// Return error if the original middleware does not exist, or the middleware +// Insert injects the middleware relative to an existing middleware ID. +// Returns error if the original middleware does not exist, or the middleware // being added already exists. func (s *FinalizeStep) Insert(m FinalizeMiddleware, relativeTo string, pos RelativePosition) error { return s.ids.Insert(m, relativeTo, pos) @@ -176,7 +176,7 @@ type finalizeWrapHandler struct { var _ FinalizeHandler = (*finalizeWrapHandler)(nil) -// Implements FinalizeHandler, converts types and delegates to underlying +// HandleFinalize implements FinalizeHandler, converts types and delegates to underlying // generic handler. func (w finalizeWrapHandler) HandleFinalize(ctx context.Context, in FinalizeInput) ( out FinalizeOutput, metadata Metadata, err error, diff --git a/vendor/github.com/aws/smithy-go/middleware/step_initialize.go b/vendor/github.com/aws/smithy-go/middleware/step_initialize.go index 3980bce6..fe359144 100644 --- a/vendor/github.com/aws/smithy-go/middleware/step_initialize.go +++ b/vendor/github.com/aws/smithy-go/middleware/step_initialize.go @@ -26,11 +26,11 @@ type InitializeHandler interface { // initialize step. Delegates to the next InitializeHandler for further // processing. type InitializeMiddleware interface { - // Unique ID for the middleware in the InitializeStep. The step does not + // ID returns a unique ID for the middleware in the InitializeStep. The step does not // allow duplicate IDs. ID() string - // Invokes the middleware behavior which must delegate to the next handler + // HandleInitialize invokes the middleware behavior which must delegate to the next handler // for the middleware chain to continue. The method must return a result or // error to its caller. HandleInitialize(ctx context.Context, in InitializeInput, next InitializeHandler) ( @@ -70,7 +70,7 @@ func (s initializeMiddlewareFunc) HandleInitialize(ctx context.Context, in Initi var _ InitializeMiddleware = (initializeMiddlewareFunc{}) // InitializeStep provides the ordered grouping of InitializeMiddleware to be -// invoked on an handler. +// invoked on a handler. type InitializeStep struct { ids *orderedIDs } @@ -85,7 +85,7 @@ func NewInitializeStep() *InitializeStep { var _ Middleware = (*InitializeStep)(nil) -// ID returns the unique id of the step as a middleware. +// ID returns the unique ID of the step as a middleware. func (s *InitializeStep) ID() string { return "Initialize stack step" } @@ -130,8 +130,8 @@ func (s *InitializeStep) Add(m InitializeMiddleware, pos RelativePosition) error return s.ids.Add(m, pos) } -// Insert injects the middleware relative to an existing middleware id. -// Return error if the original middleware does not exist, or the middleware +// Insert injects the middleware relative to an existing middleware ID. +// Returns error if the original middleware does not exist, or the middleware // being added already exists. func (s *InitializeStep) Insert(m InitializeMiddleware, relativeTo string, pos RelativePosition) error { return s.ids.Insert(m, relativeTo, pos) @@ -176,7 +176,7 @@ type initializeWrapHandler struct { var _ InitializeHandler = (*initializeWrapHandler)(nil) -// Implements InitializeHandler, converts types and delegates to underlying +// HandleInitialize implements InitializeHandler, converts types and delegates to underlying // generic handler. func (w initializeWrapHandler) HandleInitialize(ctx context.Context, in InitializeInput) ( out InitializeOutput, metadata Metadata, err error, diff --git a/vendor/github.com/aws/smithy-go/middleware/step_serialize.go b/vendor/github.com/aws/smithy-go/middleware/step_serialize.go index 1e25bbca..114bafce 100644 --- a/vendor/github.com/aws/smithy-go/middleware/step_serialize.go +++ b/vendor/github.com/aws/smithy-go/middleware/step_serialize.go @@ -29,11 +29,11 @@ type SerializeHandler interface { // serialize step. Delegates to the next SerializeHandler for further // processing. type SerializeMiddleware interface { - // Unique ID for the middleware in the SerializeStep. The step does not + // ID returns a unique ID for the middleware in the SerializeStep. The step does not // allow duplicate IDs. ID() string - // Invokes the middleware behavior which must delegate to the next handler + // HandleSerialize invokes the middleware behavior which must delegate to the next handler // for the middleware chain to continue. The method must return a result or // error to its caller. HandleSerialize(ctx context.Context, in SerializeInput, next SerializeHandler) ( @@ -73,13 +73,13 @@ func (s serializeMiddlewareFunc) HandleSerialize(ctx context.Context, in Seriali var _ SerializeMiddleware = (serializeMiddlewareFunc{}) // SerializeStep provides the ordered grouping of SerializeMiddleware to be -// invoked on an handler. +// invoked on a handler. type SerializeStep struct { newRequest func() interface{} ids *orderedIDs } -// NewSerializeStep returns an SerializeStep ready to have middleware for +// NewSerializeStep returns a SerializeStep ready to have middleware for // initialization added to it. The newRequest func parameter is used to // initialize the transport specific request for the stack SerializeStep to // serialize the input parameters into. @@ -92,7 +92,7 @@ func NewSerializeStep(newRequest func() interface{}) *SerializeStep { var _ Middleware = (*SerializeStep)(nil) -// ID returns the unique id of the step as a middleware. +// ID returns the unique ID of the step as a middleware. func (s *SerializeStep) ID() string { return "Serialize stack step" } @@ -138,8 +138,8 @@ func (s *SerializeStep) Add(m SerializeMiddleware, pos RelativePosition) error { return s.ids.Add(m, pos) } -// Insert injects the middleware relative to an existing middleware id. -// Return error if the original middleware does not exist, or the middleware +// Insert injects the middleware relative to an existing middleware ID. +// Returns error if the original middleware does not exist, or the middleware // being added already exists. func (s *SerializeStep) Insert(m SerializeMiddleware, relativeTo string, pos RelativePosition) error { return s.ids.Insert(m, relativeTo, pos) diff --git a/vendor/github.com/aws/smithy-go/modman.toml b/vendor/github.com/aws/smithy-go/modman.toml new file mode 100644 index 00000000..20295cdd --- /dev/null +++ b/vendor/github.com/aws/smithy-go/modman.toml @@ -0,0 +1,11 @@ +[dependencies] + "github.com/google/go-cmp" = "v0.5.8" + "github.com/jmespath/go-jmespath" = "v0.4.0" + +[modules] + + [modules.codegen] + no_tag = true + + [modules."codegen/smithy-go-codegen/build/test-generated/go/internal/testmodule"] + no_tag = true diff --git a/vendor/github.com/aws/smithy-go/private/requestcompression/gzip.go b/vendor/github.com/aws/smithy-go/private/requestcompression/gzip.go new file mode 100644 index 00000000..004d78f2 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/private/requestcompression/gzip.go @@ -0,0 +1,30 @@ +package requestcompression + +import ( + "bytes" + "compress/gzip" + "fmt" + "io" +) + +func gzipCompress(input io.Reader) ([]byte, error) { + var b bytes.Buffer + w, err := gzip.NewWriterLevel(&b, gzip.DefaultCompression) + if err != nil { + return nil, fmt.Errorf("failed to create gzip writer, %v", err) + } + + inBytes, err := io.ReadAll(input) + if err != nil { + return nil, fmt.Errorf("failed read payload to compress, %v", err) + } + + if _, err = w.Write(inBytes); err != nil { + return nil, fmt.Errorf("failed to write payload to be compressed, %v", err) + } + if err = w.Close(); err != nil { + return nil, fmt.Errorf("failed to flush payload being compressed, %v", err) + } + + return b.Bytes(), nil +} diff --git a/vendor/github.com/aws/smithy-go/private/requestcompression/middleware_capture_request_compression.go b/vendor/github.com/aws/smithy-go/private/requestcompression/middleware_capture_request_compression.go new file mode 100644 index 00000000..06c16afc --- /dev/null +++ b/vendor/github.com/aws/smithy-go/private/requestcompression/middleware_capture_request_compression.go @@ -0,0 +1,52 @@ +package requestcompression + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "net/http" +) + +const captureUncompressedRequestID = "CaptureUncompressedRequest" + +// AddCaptureUncompressedRequestMiddleware captures http request before compress encoding for check +func AddCaptureUncompressedRequestMiddleware(stack *middleware.Stack, buf *bytes.Buffer) error { + return stack.Serialize.Insert(&captureUncompressedRequestMiddleware{ + buf: buf, + }, "RequestCompression", middleware.Before) +} + +type captureUncompressedRequestMiddleware struct { + req *http.Request + buf *bytes.Buffer + bytes []byte +} + +// ID returns id of the captureUncompressedRequestMiddleware +func (*captureUncompressedRequestMiddleware) ID() string { + return captureUncompressedRequestID +} + +// HandleSerialize captures request payload before it is compressed by request compression middleware +func (m *captureUncompressedRequestMiddleware) HandleSerialize(ctx context.Context, input middleware.SerializeInput, next middleware.SerializeHandler, +) ( + output middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := input.Request.(*smithyhttp.Request) + if !ok { + return output, metadata, fmt.Errorf("error when retrieving http request") + } + + _, err = io.Copy(m.buf, request.GetStream()) + if err != nil { + return output, metadata, fmt.Errorf("error when copying http request stream: %q", err) + } + if err = request.RewindStream(); err != nil { + return output, metadata, fmt.Errorf("error when rewinding request stream: %q", err) + } + + return next.HandleSerialize(ctx, input) +} diff --git a/vendor/github.com/aws/smithy-go/private/requestcompression/request_compression.go b/vendor/github.com/aws/smithy-go/private/requestcompression/request_compression.go new file mode 100644 index 00000000..7c414760 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/private/requestcompression/request_compression.go @@ -0,0 +1,103 @@ +// Package requestcompression implements runtime support for smithy-modeled +// request compression. +// +// This package is designated as private and is intended for use only by the +// smithy client runtime. The exported API therein is not considered stable and +// is subject to breaking changes without notice. +package requestcompression + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/transport/http" + "io" +) + +const MaxRequestMinCompressSizeBytes = 10485760 + +// Enumeration values for supported compress Algorithms. +const ( + GZIP = "gzip" +) + +type compressFunc func(io.Reader) ([]byte, error) + +var allowedAlgorithms = map[string]compressFunc{ + GZIP: gzipCompress, +} + +// AddRequestCompression add requestCompression middleware to op stack +func AddRequestCompression(stack *middleware.Stack, disabled bool, minBytes int64, algorithms []string) error { + return stack.Serialize.Add(&requestCompression{ + disableRequestCompression: disabled, + requestMinCompressSizeBytes: minBytes, + compressAlgorithms: algorithms, + }, middleware.After) +} + +type requestCompression struct { + disableRequestCompression bool + requestMinCompressSizeBytes int64 + compressAlgorithms []string +} + +// ID returns the ID of the middleware +func (m requestCompression) ID() string { + return "RequestCompression" +} + +// HandleSerialize gzip compress the request's stream/body if enabled by config fields +func (m requestCompression) HandleSerialize( + ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, +) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if m.disableRequestCompression { + return next.HandleSerialize(ctx, in) + } + // still need to check requestMinCompressSizeBytes in case it is out of range after service client config + if m.requestMinCompressSizeBytes < 0 || m.requestMinCompressSizeBytes > MaxRequestMinCompressSizeBytes { + return out, metadata, fmt.Errorf("invalid range for min request compression size bytes %d, must be within 0 and 10485760 inclusively", m.requestMinCompressSizeBytes) + } + + req, ok := in.Request.(*http.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown request type %T", req) + } + + for _, algorithm := range m.compressAlgorithms { + compressFunc := allowedAlgorithms[algorithm] + if compressFunc != nil { + if stream := req.GetStream(); stream != nil { + size, found, err := req.StreamLength() + if err != nil { + return out, metadata, fmt.Errorf("error while finding request stream length, %v", err) + } else if !found || size < m.requestMinCompressSizeBytes { + return next.HandleSerialize(ctx, in) + } + + compressedBytes, err := compressFunc(stream) + if err != nil { + return out, metadata, fmt.Errorf("failed to compress request stream, %v", err) + } + + var newReq *http.Request + if newReq, err = req.SetStream(bytes.NewReader(compressedBytes)); err != nil { + return out, metadata, fmt.Errorf("failed to set request stream, %v", err) + } + *req = *newReq + + if val := req.Header.Get("Content-Encoding"); val != "" { + req.Header.Set("Content-Encoding", fmt.Sprintf("%s, %s", val, algorithm)) + } else { + req.Header.Set("Content-Encoding", algorithm) + } + } + break + } + } + + return next.HandleSerialize(ctx, in) +} diff --git a/vendor/github.com/aws/smithy-go/properties.go b/vendor/github.com/aws/smithy-go/properties.go new file mode 100644 index 00000000..c9af66c0 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/properties.go @@ -0,0 +1,62 @@ +package smithy + +// PropertiesReader provides an interface for reading metadata from the +// underlying metadata container. +type PropertiesReader interface { + Get(key interface{}) interface{} +} + +// Properties provides storing and reading metadata values. Keys may be any +// comparable value type. Get and Set will panic if a key is not comparable. +// +// The zero value for a Properties instance is ready for reads/writes without +// any additional initialization. +type Properties struct { + values map[interface{}]interface{} +} + +// Get attempts to retrieve the value the key points to. Returns nil if the +// key was not found. +// +// Panics if key type is not comparable. +func (m *Properties) Get(key interface{}) interface{} { + m.lazyInit() + return m.values[key] +} + +// Set stores the value pointed to by the key. If a value already exists at +// that key it will be replaced with the new value. +// +// Panics if the key type is not comparable. +func (m *Properties) Set(key, value interface{}) { + m.lazyInit() + m.values[key] = value +} + +// Has returns whether the key exists in the metadata. +// +// Panics if the key type is not comparable. +func (m *Properties) Has(key interface{}) bool { + m.lazyInit() + _, ok := m.values[key] + return ok +} + +// SetAll accepts all of the given Properties into the receiver, overwriting +// any existing keys in the case of conflicts. +func (m *Properties) SetAll(other *Properties) { + if other.values == nil { + return + } + + m.lazyInit() + for k, v := range other.values { + m.values[k] = v + } +} + +func (m *Properties) lazyInit() { + if m.values == nil { + m.values = map[interface{}]interface{}{} + } +} diff --git a/vendor/github.com/aws/smithy-go/ptr/from_ptr.go b/vendor/github.com/aws/smithy-go/ptr/from_ptr.go index 5d5a9b3b..a2845bb2 100644 --- a/vendor/github.com/aws/smithy-go/ptr/from_ptr.go +++ b/vendor/github.com/aws/smithy-go/ptr/from_ptr.go @@ -564,3 +564,38 @@ func ToTimeMap(vs map[string]*time.Time) map[string]time.Time { return ps } + +// ToDuration returns time.Duration value dereferenced if the passed +// in pointer was not nil. Returns a time.Duration zero value if the +// pointer was nil. +func ToDuration(p *time.Duration) (v time.Duration) { + if p == nil { + return v + } + + return *p +} + +// ToDurationSlice returns a slice of time.Duration values, that are +// dereferenced if the passed in pointer was not nil. Returns a time.Duration +// zero value if the pointer was nil. +func ToDurationSlice(vs []*time.Duration) []time.Duration { + ps := make([]time.Duration, len(vs)) + for i, v := range vs { + ps[i] = ToDuration(v) + } + + return ps +} + +// ToDurationMap returns a map of time.Duration values, that are +// dereferenced if the passed in pointer was not nil. The time.Duration +// zero value is used if the pointer was nil. +func ToDurationMap(vs map[string]*time.Duration) map[string]time.Duration { + ps := make(map[string]time.Duration, len(vs)) + for k, v := range vs { + ps[k] = ToDuration(v) + } + + return ps +} diff --git a/vendor/github.com/aws/smithy-go/ptr/gen_scalars.go b/vendor/github.com/aws/smithy-go/ptr/gen_scalars.go index 56c85fb3..97f01011 100644 --- a/vendor/github.com/aws/smithy-go/ptr/gen_scalars.go +++ b/vendor/github.com/aws/smithy-go/ptr/gen_scalars.go @@ -1,3 +1,4 @@ +//go:build codegen // +build codegen package ptr @@ -22,6 +23,7 @@ func GetScalars() Scalars { {Type: "float32"}, {Type: "float64"}, {Type: "Time", Import: &Import{Path: "time"}}, + {Type: "Duration", Import: &Import{Path: "time"}}, } } diff --git a/vendor/github.com/aws/smithy-go/ptr/to_ptr.go b/vendor/github.com/aws/smithy-go/ptr/to_ptr.go index a57d1301..0bfbbecb 100644 --- a/vendor/github.com/aws/smithy-go/ptr/to_ptr.go +++ b/vendor/github.com/aws/smithy-go/ptr/to_ptr.go @@ -468,3 +468,32 @@ func TimeMap(vs map[string]time.Time) map[string]*time.Time { return ps } + +// Duration returns a pointer value for the time.Duration value passed in. +func Duration(v time.Duration) *time.Duration { + return &v +} + +// DurationSlice returns a slice of time.Duration pointers from the values +// passed in. +func DurationSlice(vs []time.Duration) []*time.Duration { + ps := make([]*time.Duration, len(vs)) + for i, v := range vs { + vv := v + ps[i] = &vv + } + + return ps +} + +// DurationMap returns a map of time.Duration pointers from the values +// passed in. +func DurationMap(vs map[string]time.Duration) map[string]*time.Duration { + ps := make(map[string]*time.Duration, len(vs)) + for k, v := range vs { + vv := v + ps[k] = &vv + } + + return ps +} diff --git a/vendor/github.com/aws/smithy-go/rand/rand.go b/vendor/github.com/aws/smithy-go/rand/rand.go index 4dc176d7..9c479f62 100644 --- a/vendor/github.com/aws/smithy-go/rand/rand.go +++ b/vendor/github.com/aws/smithy-go/rand/rand.go @@ -25,7 +25,7 @@ func Int63n(reader io.Reader, max int64) (int64, error) { } // CryptoRandInt63n returns a random int64 between zero and value of max -//obtained from the crypto rand source. +// obtained from the crypto rand source. func CryptoRandInt63n(max int64) (int64, error) { return Int63n(Reader, max) } diff --git a/vendor/github.com/aws/smithy-go/rand/uuid.go b/vendor/github.com/aws/smithy-go/rand/uuid.go index 962b9466..dc81cbc6 100644 --- a/vendor/github.com/aws/smithy-go/rand/uuid.go +++ b/vendor/github.com/aws/smithy-go/rand/uuid.go @@ -31,30 +31,45 @@ type UUID struct { } // NewUUID returns an initialized UUID value that can be used to retrieve -// random UUID values. +// random UUID version 4 values. func NewUUID(r io.Reader) *UUID { return &UUID{randSrc: r} } -// GetUUID returns a UUID random string sourced from the random reader the +// GetUUID returns a random UUID version 4 string representation sourced from the random reader the // UUID was created with. Returns an error if unable to compute the UUID. func (r *UUID) GetUUID() (string, error) { var b [16]byte if _, err := io.ReadFull(r.randSrc, b[:]); err != nil { return "", err } - - return uuidVersion4(b), nil + r.makeUUIDv4(b[:]) + return format(b), nil } -// uuidVersion4 returns a random UUID version 4 from the byte slice provided. -func uuidVersion4(u [16]byte) string { - // https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_.28random.29 +// GetBytes returns a byte slice containing a random UUID version 4 sourced from the random reader the +// UUID was created with. Returns an error if unable to compute the UUID. +func (r *UUID) GetBytes() (u []byte, err error) { + u = make([]byte, 16) + if _, err = io.ReadFull(r.randSrc, u); err != nil { + return u, err + } + r.makeUUIDv4(u) + return u, nil +} +func (r *UUID) makeUUIDv4(u []byte) { // 13th character is "4" u[6] = (u[6] & 0x0f) | 0x40 // Version 4 // 17th character is "8", "9", "a", or "b" - u[8] = (u[8] & 0x3f) | 0x80 // Variant is 10 + u[8] = (u[8] & 0x3f) | 0x80 // Variant most significant bits are 10x where x can be either 1 or 0 +} + +// Format returns the canonical text representation of a UUID. +// This implementation is optimized to not use fmt. +// Example: 82e42f16-b6cc-4d5b-95f5-d403c4befd3d +func format(u [16]byte) string { + // https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_.28random.29 var scratch [36]byte diff --git a/vendor/github.com/aws/smithy-go/time/time.go b/vendor/github.com/aws/smithy-go/time/time.go index 54f9f0fe..b552a09f 100644 --- a/vendor/github.com/aws/smithy-go/time/time.go +++ b/vendor/github.com/aws/smithy-go/time/time.go @@ -2,46 +2,65 @@ package time import ( "context" + "fmt" "math/big" + "strings" "time" ) const ( - // dateTimeFormat is a IMF-fixdate formatted time https://tools.ietf.org/html/rfc7231.html#section-7.1.1.1 - dateTimeFormat = "2006-01-02T15:04:05.99Z" + // dateTimeFormat is a IMF-fixdate formatted RFC3339 section 5.6 + dateTimeFormatInput = "2006-01-02T15:04:05.999999999Z" + dateTimeFormatInputNoZ = "2006-01-02T15:04:05.999999999" + dateTimeFormatOutput = "2006-01-02T15:04:05.999Z" - // httpDateFormat is a date time defined by RFC3339 section 5.6 with no UTC offset. + // httpDateFormat is a date time defined by RFC 7231#section-7.1.1.1 + // IMF-fixdate with no UTC offset. httpDateFormat = "Mon, 02 Jan 2006 15:04:05 GMT" + // Additional formats needed for compatibility. + httpDateFormatSingleDigitDay = "Mon, _2 Jan 2006 15:04:05 GMT" + httpDateFormatSingleDigitDayTwoDigitYear = "Mon, _2 Jan 06 15:04:05 GMT" ) var millisecondFloat = big.NewFloat(1e3) -// FormatDateTime format value as a date-time (RFC3339 section 5.6) +// FormatDateTime formats value as a date-time, (RFC3339 section 5.6) // // Example: 1985-04-12T23:20:50.52Z func FormatDateTime(value time.Time) string { - return value.Format(dateTimeFormat) + return value.UTC().Format(dateTimeFormatOutput) } -// ParseDateTime parse a string as a date-time +// ParseDateTime parses a string as a date-time, (RFC3339 section 5.6) // // Example: 1985-04-12T23:20:50.52Z func ParseDateTime(value string) (time.Time, error) { - return time.Parse(dateTimeFormat, value) + return tryParse(value, + dateTimeFormatInput, + dateTimeFormatInputNoZ, + time.RFC3339Nano, + time.RFC3339, + ) } -// FormatHTTPDate format value as a http-date (RFC 7231#section-7.1.1.1 IMF-fixdate) +// FormatHTTPDate formats value as a http-date, (RFC 7231#section-7.1.1.1 IMF-fixdate) // // Example: Tue, 29 Apr 2014 18:30:38 GMT func FormatHTTPDate(value time.Time) string { - return value.Format(httpDateFormat) + return value.UTC().Format(httpDateFormat) } -// ParseHTTPDate parse a string as a http-date +// ParseHTTPDate parses a string as a http-date, (RFC 7231#section-7.1.1.1 IMF-fixdate) // // Example: Tue, 29 Apr 2014 18:30:38 GMT func ParseHTTPDate(value string) (time.Time, error) { - return time.Parse(httpDateFormat, value) + return tryParse(value, + httpDateFormat, + httpDateFormatSingleDigitDay, + httpDateFormatSingleDigitDayTwoDigitYear, + time.RFC850, + time.ANSIC, + ) } // FormatEpochSeconds returns value as a Unix time in seconds with with decimal precision @@ -59,11 +78,46 @@ func ParseEpochSeconds(value float64) time.Time { f := big.NewFloat(value) f = f.Mul(f, millisecondFloat) i, _ := f.Int64() + // Offset to `UTC` because time.Unix returns the time value based on system + // local setting. return time.Unix(0, i*1e6).UTC() } -// SleepWithContext will wait for the timer duration to expire, or the context -// is canceled. Which ever happens first. If the context is canceled the +func tryParse(v string, formats ...string) (time.Time, error) { + var errs parseErrors + for _, f := range formats { + t, err := time.Parse(f, v) + if err != nil { + errs = append(errs, parseError{ + Format: f, + Err: err, + }) + continue + } + return t, nil + } + + return time.Time{}, fmt.Errorf("unable to parse time string, %w", errs) +} + +type parseErrors []parseError + +func (es parseErrors) Error() string { + var s strings.Builder + for _, e := range es { + fmt.Fprintf(&s, "\n * %q: %v", e.Format, e.Err) + } + + return "parse errors:" + s.String() +} + +type parseError struct { + Format string + Err error +} + +// SleepWithContext will wait for the timer duration to expire, or until the context +// is canceled. Whichever happens first. If the context is canceled the // Context's error will be returned. func SleepWithContext(ctx context.Context, dur time.Duration) error { t := time.NewTimer(dur) diff --git a/vendor/github.com/aws/smithy-go/transport/http/auth.go b/vendor/github.com/aws/smithy-go/transport/http/auth.go new file mode 100644 index 00000000..58e1ab5e --- /dev/null +++ b/vendor/github.com/aws/smithy-go/transport/http/auth.go @@ -0,0 +1,21 @@ +package http + +import ( + "context" + + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/auth" +) + +// AuthScheme defines an HTTP authentication scheme. +type AuthScheme interface { + SchemeID() string + IdentityResolver(auth.IdentityResolverOptions) auth.IdentityResolver + Signer() Signer +} + +// Signer defines the interface through which HTTP requests are supplemented +// with an Identity. +type Signer interface { + SignRequest(context.Context, *Request, auth.Identity, smithy.Properties) error +} diff --git a/vendor/github.com/aws/smithy-go/transport/http/auth_schemes.go b/vendor/github.com/aws/smithy-go/transport/http/auth_schemes.go new file mode 100644 index 00000000..d60cf2a6 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/transport/http/auth_schemes.go @@ -0,0 +1,45 @@ +package http + +import ( + "context" + + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/auth" +) + +// NewAnonymousScheme returns the anonymous HTTP auth scheme. +func NewAnonymousScheme() AuthScheme { + return &authScheme{ + schemeID: auth.SchemeIDAnonymous, + signer: &nopSigner{}, + } +} + +// authScheme is parameterized to generically implement the exported AuthScheme +// interface +type authScheme struct { + schemeID string + signer Signer +} + +var _ AuthScheme = (*authScheme)(nil) + +func (s *authScheme) SchemeID() string { + return s.schemeID +} + +func (s *authScheme) IdentityResolver(o auth.IdentityResolverOptions) auth.IdentityResolver { + return o.GetIdentityResolver(s.schemeID) +} + +func (s *authScheme) Signer() Signer { + return s.signer +} + +type nopSigner struct{} + +var _ Signer = (*nopSigner)(nil) + +func (*nopSigner) SignRequest(context.Context, *Request, auth.Identity, smithy.Properties) error { + return nil +} diff --git a/vendor/github.com/aws/smithy-go/transport/http/checksum_middleware.go b/vendor/github.com/aws/smithy-go/transport/http/checksum_middleware.go index 7b1cd567..bc4ad6e7 100644 --- a/vendor/github.com/aws/smithy-go/transport/http/checksum_middleware.go +++ b/vendor/github.com/aws/smithy-go/transport/http/checksum_middleware.go @@ -21,7 +21,7 @@ func AddContentChecksumMiddleware(stack *middleware.Stack) error { return stack.Build.Add(&contentMD5Checksum{}, middleware.Before) } -// ID the identifier for the checksum middleware +// ID returns the identifier for the checksum middleware func (m *contentMD5Checksum) ID() string { return "ContentChecksum" } // HandleBuild adds behavior to compute md5 checksum and add content-md5 header @@ -45,6 +45,11 @@ func (m *contentMD5Checksum) HandleBuild( stream := req.GetStream() // compute checksum if payload is explicit if stream != nil { + if !req.IsStreamSeekable() { + return out, metadata, fmt.Errorf( + "unseekable stream is not supported for computing md5 checksum") + } + v, err := computeMD5Checksum(stream) if err != nil { return out, metadata, fmt.Errorf("error computing md5 checksum, %w", err) diff --git a/vendor/github.com/aws/smithy-go/transport/http/client.go b/vendor/github.com/aws/smithy-go/transport/http/client.go index 55b5a95b..e691c69b 100644 --- a/vendor/github.com/aws/smithy-go/transport/http/client.go +++ b/vendor/github.com/aws/smithy-go/transport/http/client.go @@ -14,7 +14,7 @@ type ClientDo interface { Do(*http.Request) (*http.Response, error) } -// ClientDoFunc provides a helper to wrap an function as an HTTP client for +// ClientDoFunc provides a helper to wrap a function as an HTTP client for // round tripping requests. type ClientDoFunc func(*http.Request) (*http.Response, error) @@ -37,7 +37,7 @@ func NewClientHandler(client ClientDo) ClientHandler { } // Handle implements the middleware Handler interface, that will invoke the -// underlying HTTP client. Requires the input to be an Smithy *Request. Returns +// underlying HTTP client. Requires the input to be a Smithy *Request. Returns // a smithy *Response, or error if the request failed. func (c ClientHandler) Handle(ctx context.Context, input interface{}) ( out interface{}, metadata middleware.Metadata, err error, @@ -91,7 +91,7 @@ type RequestSendError struct { Err error } -// ConnectionError return that the error is related to not being able to send +// ConnectionError returns that the error is related to not being able to send // the request, or receive a response from the service. func (e *RequestSendError) ConnectionError() bool { return true @@ -106,7 +106,7 @@ func (e *RequestSendError) Error() string { return fmt.Sprintf("request send failed, %v", e.Err) } -// NopClient provides a client that ignores the request, and returns a empty +// NopClient provides a client that ignores the request, and returns an empty // successful HTTP response value. type NopClient struct{} diff --git a/vendor/github.com/aws/smithy-go/transport/http/headerlist.go b/vendor/github.com/aws/smithy-go/transport/http/headerlist.go index e232211b..cbc9deb4 100644 --- a/vendor/github.com/aws/smithy-go/transport/http/headerlist.go +++ b/vendor/github.com/aws/smithy-go/transport/http/headerlist.go @@ -2,53 +2,125 @@ package http import ( "fmt" + "strconv" "strings" + "unicode" ) func splitHeaderListValues(vs []string, splitFn func(string) ([]string, error)) ([]string, error) { - for i := 0; i < len(vs); i++ { - if len(vs[i]) == 0 { - continue - } + values := make([]string, 0, len(vs)) + for i := 0; i < len(vs); i++ { parts, err := splitFn(vs[i]) if err != nil { return nil, err } - if len(parts) < 2 { - continue - } - - tmp := make([]string, len(vs)+len(parts)-1) - copy(tmp, vs[:i]) - - for j, p := range parts { - tmp[i+j] = strings.TrimSpace(p) - } - - copy(tmp[i+len(parts):], vs[i+1:]) - - vs = tmp - i += len(parts) - 1 + values = append(values, parts...) } - return vs, nil + return values, nil } // SplitHeaderListValues attempts to split the elements of the slice by commas, // and return a list of all values separated. Returns error if unable to // separate the values. func SplitHeaderListValues(vs []string) ([]string, error) { - return splitHeaderListValues(vs, commaSplit) + return splitHeaderListValues(vs, quotedCommaSplit) } -func commaSplit(v string) ([]string, error) { - return strings.Split(v, ","), nil +func quotedCommaSplit(v string) (parts []string, err error) { + v = strings.TrimSpace(v) + + expectMore := true + for i := 0; i < len(v); i++ { + if unicode.IsSpace(rune(v[i])) { + continue + } + expectMore = false + + // leading space in part is ignored. + // Start of value must be non-space, or quote. + // + // - If quote, enter quoted mode, find next non-escaped quote to + // terminate the value. + // - Otherwise, find next comma to terminate value. + + remaining := v[i:] + + var value string + var valueLen int + if remaining[0] == '"' { + //------------------------------ + // Quoted value + //------------------------------ + var j int + var skipQuote bool + for j += 1; j < len(remaining); j++ { + if remaining[j] == '\\' || (remaining[j] != '\\' && skipQuote) { + skipQuote = !skipQuote + continue + } + if remaining[j] == '"' { + break + } + } + if j == len(remaining) || j == 1 { + return nil, fmt.Errorf("value %v missing closing double quote", + remaining) + } + valueLen = j + 1 + + tail := remaining[valueLen:] + var k int + for ; k < len(tail); k++ { + if !unicode.IsSpace(rune(tail[k])) && tail[k] != ',' { + return nil, fmt.Errorf("value %v has non-space trailing characters", + remaining) + } + if tail[k] == ',' { + expectMore = true + break + } + } + value = remaining[:valueLen] + value, err = strconv.Unquote(value) + if err != nil { + return nil, fmt.Errorf("failed to unquote value %v, %w", value, err) + } + + // Pad valueLen to include trailing space(s) so `i` is updated correctly. + valueLen += k + + } else { + //------------------------------ + // Unquoted value + //------------------------------ + + // Index of the next comma is the length of the value, or end of string. + valueLen = strings.Index(remaining, ",") + if valueLen != -1 { + expectMore = true + } else { + valueLen = len(remaining) + } + value = strings.TrimSpace(remaining[:valueLen]) + } + + i += valueLen + parts = append(parts, value) + + } + + if expectMore { + parts = append(parts, "") + } + + return parts, nil } // SplitHTTPDateTimestampHeaderListValues attempts to split the HTTP-Date // timestamp values in the slice by commas, and return a list of all values -// separated. The split is aware of HTTP-Date timestamp format, and will skip +// separated. The split is aware of the HTTP-Date timestamp format, and will skip // comma within the timestamp value. Returns an error if unable to split the // timestamp values. func SplitHTTPDateTimestampHeaderListValues(vs []string) ([]string, error) { @@ -56,10 +128,10 @@ func SplitHTTPDateTimestampHeaderListValues(vs []string) ([]string, error) { } func splitHTTPDateHeaderValue(v string) ([]string, error) { - if n := strings.Count(v, ","); n == 1 { - // Skip values with only a single HTTPDate value - return nil, nil - } else if n == 0 || n%2 == 0 { + if n := strings.Count(v, ","); n <= 1 { + // Nothing to do if only contains a no, or single HTTPDate value + return []string{v}, nil + } else if n%2 == 0 { return nil, fmt.Errorf("invalid timestamp HTTPDate header comma separations, %q", v) } @@ -71,7 +143,7 @@ func splitHTTPDateHeaderValue(v string) ([]string, error) { if v[i] == ',' { if doSplit { doSplit = false - parts = append(parts, v[j:i]) + parts = append(parts, strings.TrimSpace(v[j:i])) j = i + 1 } else { // Skip the first comma in the timestamp value since that @@ -82,8 +154,9 @@ func splitHTTPDateHeaderValue(v string) ([]string, error) { } } } + // Add final part if j < len(v) { - parts = append(parts, v[j:]) + parts = append(parts, strings.TrimSpace(v[j:])) } return parts, nil diff --git a/vendor/github.com/aws/smithy-go/transport/http/host.go b/vendor/github.com/aws/smithy-go/transport/http/host.go index b8c95d53..6b290fec 100644 --- a/vendor/github.com/aws/smithy-go/transport/http/host.go +++ b/vendor/github.com/aws/smithy-go/transport/http/host.go @@ -2,6 +2,8 @@ package http import ( "fmt" + "net" + "strconv" "strings" ) @@ -9,8 +11,25 @@ import ( // 3986 host. Returns error if the host is not valid. func ValidateEndpointHost(host string) error { var errors strings.Builder - labels := strings.Split(host, ".") + var hostname string + var port string + var err error + if strings.Contains(host, ":") { + hostname, port, err = net.SplitHostPort(host) + if err != nil { + errors.WriteString(fmt.Sprintf("\n endpoint %v, failed to parse, got ", host)) + errors.WriteString(err.Error()) + } + + if !ValidPortNumber(port) { + errors.WriteString(fmt.Sprintf("port number should be in range [0-65535], got %v", port)) + } + } else { + hostname = host + } + + labels := strings.Split(hostname, ".") for i, label := range labels { if i == len(labels)-1 && len(label) == 0 { // Allow trailing dot for FQDN hosts. @@ -23,8 +42,12 @@ func ValidateEndpointHost(host string) error { } } - if len(host) > 255 { - errors.WriteString(fmt.Sprintf("\nendpoint host must be less than 255 characters, but was %d", len(host))) + if len(hostname) == 0 && len(port) != 0 { + errors.WriteString("\nendpoint host with port must not be empty") + } + + if len(hostname) > 255 { + errors.WriteString(fmt.Sprintf("\nendpoint host must be less than 255 characters, but was %d", len(hostname))) } if len(errors.String()) > 0 { @@ -33,7 +56,20 @@ func ValidateEndpointHost(host string) error { return nil } -// ValidHostLabel returns if the label is a valid RFC 3986 host label. +// ValidPortNumber returns whether the port is valid RFC 3986 port. +func ValidPortNumber(port string) bool { + i, err := strconv.Atoi(port) + if err != nil { + return false + } + + if i < 0 || i > 65535 { + return false + } + return true +} + +// ValidHostLabel returns whether the label is a valid RFC 3986 host abel. func ValidHostLabel(label string) bool { if l := len(label); l == 0 || l > 63 { return false diff --git a/vendor/github.com/aws/smithy-go/transport/http/md5_checksum.go b/vendor/github.com/aws/smithy-go/transport/http/md5_checksum.go index 8e4acb89..5d6a4b23 100644 --- a/vendor/github.com/aws/smithy-go/transport/http/md5_checksum.go +++ b/vendor/github.com/aws/smithy-go/transport/http/md5_checksum.go @@ -7,7 +7,7 @@ import ( "io" ) -// computeMD5Checksum computes base64 md5 checksum of an io.Reader contents. +// computeMD5Checksum computes base64 md5 checksum of an io.Reader's contents. // Returns the byte slice of md5 checksum and an error. func computeMD5Checksum(r io.Reader) ([]byte, error) { h := md5.New() diff --git a/vendor/github.com/aws/smithy-go/transport/http/middleware_close_response_body.go b/vendor/github.com/aws/smithy-go/transport/http/middleware_close_response_body.go index 86608857..1d3b218a 100644 --- a/vendor/github.com/aws/smithy-go/transport/http/middleware_close_response_body.go +++ b/vendor/github.com/aws/smithy-go/transport/http/middleware_close_response_body.go @@ -2,9 +2,10 @@ package http import ( "context" - "fmt" - + "github.com/aws/smithy-go/logging" "github.com/aws/smithy-go/middleware" + "io" + "io/ioutil" ) // AddErrorCloseResponseBodyMiddleware adds the middleware to automatically @@ -28,6 +29,8 @@ func (m *errorCloseResponseBodyMiddleware) HandleDeserialize( out, metadata, err := next.HandleDeserialize(ctx, input) if err != nil { if resp, ok := out.RawResponse.(*Response); ok && resp != nil && resp.Body != nil { + // Consume the full body to prevent TCP connection resets on some platforms + _, _ = io.Copy(ioutil.Discard, resp.Body) // Do not validate that the response closes successfully. resp.Body.Close() } @@ -60,8 +63,15 @@ func (m *closeResponseBody) HandleDeserialize( } if resp, ok := out.RawResponse.(*Response); ok { - if err = resp.Body.Close(); err != nil { - return out, metadata, fmt.Errorf("close response body failed, %w", err) + // Consume the full body to prevent TCP connection resets on some platforms + _, copyErr := io.Copy(ioutil.Discard, resp.Body) + if copyErr != nil { + middleware.GetLogger(ctx).Logf(logging.Warn, "failed to discard remaining HTTP response body, this may affect connection reuse") + } + + closeErr := resp.Body.Close() + if closeErr != nil { + middleware.GetLogger(ctx).Logf(logging.Warn, "failed to close HTTP response body, this may affect connection reuse") } } diff --git a/vendor/github.com/aws/smithy-go/transport/http/middleware_content_length.go b/vendor/github.com/aws/smithy-go/transport/http/middleware_content_length.go index a5668762..9969389b 100644 --- a/vendor/github.com/aws/smithy-go/transport/http/middleware_content_length.go +++ b/vendor/github.com/aws/smithy-go/transport/http/middleware_content_length.go @@ -18,7 +18,7 @@ func AddComputeContentLengthMiddleware(stack *middleware.Stack) error { return stack.Build.Add(&ComputeContentLength{}, middleware.After) } -// ID the identifier for the ComputeContentLength +// ID returns the identifier for the ComputeContentLength. func (m *ComputeContentLength) ID() string { return "ComputeContentLength" } // HandleBuild adds the length of the serialized request to the HTTP header @@ -44,12 +44,6 @@ func (m *ComputeContentLength) HandleBuild( "failed getting length of request stream, %w", err) } else if ok { req.ContentLength = n - if n == 0 { - // If the content length could be determined, and the body is empty - // the stream must be cleared to prevent unexpected chunk encoding. - req, _ = req.SetStream(nil) - in.Request = req - } } return next.HandleBuild(ctx, in) @@ -65,7 +59,7 @@ func ValidateContentLengthHeader(stack *middleware.Stack) error { return stack.Build.Add(&validateContentLength{}, middleware.After) } -// ID the identifier for the ComputeContentLength +// ID returns the identifier for the ComputeContentLength. func (m *validateContentLength) ID() string { return "ValidateContentLength" } // HandleBuild adds the length of the serialized request to the HTTP header diff --git a/vendor/github.com/aws/smithy-go/transport/http/middleware_header_comment.go b/vendor/github.com/aws/smithy-go/transport/http/middleware_header_comment.go new file mode 100644 index 00000000..855c2272 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/transport/http/middleware_header_comment.go @@ -0,0 +1,81 @@ +package http + +import ( + "context" + "fmt" + "net/http" + + "github.com/aws/smithy-go/middleware" +) + +// WithHeaderComment instruments a middleware stack to append an HTTP field +// comment to the given header as specified in RFC 9110 +// (https://www.rfc-editor.org/rfc/rfc9110#name-comments). +// +// The header is case-insensitive. If the provided header exists when the +// middleware runs, the content will be inserted as-is enclosed in parentheses. +// +// Note that per the HTTP specification, comments are only allowed in fields +// containing "comment" as part of their field value definition, but this API +// will NOT verify whether the provided header is one of them. +// +// WithHeaderComment MAY be applied more than once to a middleware stack and/or +// more than once per header. +func WithHeaderComment(header, content string) func(*middleware.Stack) error { + return func(s *middleware.Stack) error { + m, err := getOrAddHeaderComment(s) + if err != nil { + return fmt.Errorf("get or add header comment: %v", err) + } + + m.values.Add(header, content) + return nil + } +} + +type headerCommentMiddleware struct { + values http.Header // hijack case-insensitive access APIs +} + +func (*headerCommentMiddleware) ID() string { + return "headerComment" +} + +func (m *headerCommentMiddleware) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) ( + out middleware.BuildOutput, metadata middleware.Metadata, err error, +) { + r, ok := in.Request.(*Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + for h, contents := range m.values { + for _, c := range contents { + if existing := r.Header.Get(h); existing != "" { + r.Header.Set(h, fmt.Sprintf("%s (%s)", existing, c)) + } + } + } + + return next.HandleBuild(ctx, in) +} + +func getOrAddHeaderComment(s *middleware.Stack) (*headerCommentMiddleware, error) { + id := (*headerCommentMiddleware)(nil).ID() + m, ok := s.Build.Get(id) + if !ok { + m := &headerCommentMiddleware{values: http.Header{}} + if err := s.Build.Add(m, middleware.After); err != nil { + return nil, fmt.Errorf("add build: %v", err) + } + + return m, nil + } + + hc, ok := m.(*headerCommentMiddleware) + if !ok { + return nil, fmt.Errorf("existing middleware w/ id %s is not *headerCommentMiddleware", id) + } + + return hc, nil +} diff --git a/vendor/github.com/aws/smithy-go/transport/http/middleware_headers.go b/vendor/github.com/aws/smithy-go/transport/http/middleware_headers.go index 49884e6a..eac32b4b 100644 --- a/vendor/github.com/aws/smithy-go/transport/http/middleware_headers.go +++ b/vendor/github.com/aws/smithy-go/transport/http/middleware_headers.go @@ -7,6 +7,85 @@ import ( "github.com/aws/smithy-go/middleware" ) +type isContentTypeAutoSet struct{} + +// SetIsContentTypeDefaultValue returns a Context specifying if the request's +// content-type header was set to a default value. +func SetIsContentTypeDefaultValue(ctx context.Context, isDefault bool) context.Context { + return context.WithValue(ctx, isContentTypeAutoSet{}, isDefault) +} + +// GetIsContentTypeDefaultValue returns if the content-type HTTP header on the +// request is a default value that was auto assigned by an operation +// serializer. Allows middleware post serialization to know if the content-type +// was auto set to a default value or not. +// +// Also returns false if the Context value was never updated to include if +// content-type was set to a default value. +func GetIsContentTypeDefaultValue(ctx context.Context) bool { + v, _ := ctx.Value(isContentTypeAutoSet{}).(bool) + return v +} + +// AddNoPayloadDefaultContentTypeRemover Adds the DefaultContentTypeRemover +// middleware to the stack after the operation serializer. This middleware will +// remove the content-type header from the request if it was set as a default +// value, and no request payload is present. +// +// Returns error if unable to add the middleware. +func AddNoPayloadDefaultContentTypeRemover(stack *middleware.Stack) (err error) { + err = stack.Serialize.Insert(removeDefaultContentType{}, + "OperationSerializer", middleware.After) + if err != nil { + return fmt.Errorf("failed to add %s serialize middleware, %w", + removeDefaultContentType{}.ID(), err) + } + + return nil +} + +// RemoveNoPayloadDefaultContentTypeRemover removes the +// DefaultContentTypeRemover middleware from the stack. Returns an error if +// unable to remove the middleware. +func RemoveNoPayloadDefaultContentTypeRemover(stack *middleware.Stack) (err error) { + _, err = stack.Serialize.Remove(removeDefaultContentType{}.ID()) + if err != nil { + return fmt.Errorf("failed to remove %s serialize middleware, %w", + removeDefaultContentType{}.ID(), err) + + } + return nil +} + +// removeDefaultContentType provides after serialization middleware that will +// remove the content-type header from an HTTP request if the header was set as +// a default value by the operation serializer, and there is no request payload. +type removeDefaultContentType struct{} + +// ID returns the middleware ID +func (removeDefaultContentType) ID() string { return "RemoveDefaultContentType" } + +// HandleSerialize implements the serialization middleware. +func (removeDefaultContentType) HandleSerialize( + ctx context.Context, input middleware.SerializeInput, next middleware.SerializeHandler, +) ( + out middleware.SerializeOutput, meta middleware.Metadata, err error, +) { + req, ok := input.Request.(*Request) + if !ok { + return out, meta, fmt.Errorf( + "unexpected request type %T for removeDefaultContentType middleware", + input.Request) + } + + if GetIsContentTypeDefaultValue(ctx) && req.GetStream() == nil { + req.Header.Del("Content-Type") + input.Request = req + } + + return next.HandleSerialize(ctx, input) +} + type headerValue struct { header string value string diff --git a/vendor/github.com/aws/smithy-go/transport/http/middleware_http_logging.go b/vendor/github.com/aws/smithy-go/transport/http/middleware_http_logging.go index 71f0dcce..d5909b0a 100644 --- a/vendor/github.com/aws/smithy-go/transport/http/middleware_http_logging.go +++ b/vendor/github.com/aws/smithy-go/transport/http/middleware_http_logging.go @@ -46,11 +46,13 @@ func (r *RequestResponseLogger) HandleDeserialize( logger.Logf(logging.Debug, "Request\n%v", string(reqBytes)) - smithyRequest, err = smithyRequest.SetStream(rc.Body) - if err != nil { - return out, metadata, err + if r.LogRequestWithBody { + smithyRequest, err = smithyRequest.SetStream(rc.Body) + if err != nil { + return out, metadata, err + } + in.Request = smithyRequest } - in.Request = smithyRequest } out, metadata, err = next.HandleDeserialize(ctx, in) diff --git a/vendor/github.com/aws/smithy-go/transport/http/middleware_metadata.go b/vendor/github.com/aws/smithy-go/transport/http/middleware_metadata.go index 443ececb..d6079b25 100644 --- a/vendor/github.com/aws/smithy-go/transport/http/middleware_metadata.go +++ b/vendor/github.com/aws/smithy-go/transport/http/middleware_metadata.go @@ -11,7 +11,7 @@ type ( hostPrefixDisableKey struct{} ) -// GetHostnameImmutable retrieves if the endpoint hostname should be considered +// GetHostnameImmutable retrieves whether the endpoint hostname should be considered // immutable or not. // // Scoped to stack values. Use middleware#ClearStackValues to clear all stack @@ -21,7 +21,7 @@ func GetHostnameImmutable(ctx context.Context) (v bool) { return v } -// SetHostnameImmutable sets or modifies if the request's endpoint hostname +// SetHostnameImmutable sets or modifies whether the request's endpoint hostname // should be considered immutable or not. // // Scoped to stack values. Use middleware#ClearStackValues to clear all stack @@ -30,7 +30,7 @@ func SetHostnameImmutable(ctx context.Context, value bool) context.Context { return middleware.WithStackValue(ctx, hostnameImmutableKey{}, value) } -// IsEndpointHostPrefixDisabled retrieves if the hostname prefixing is +// IsEndpointHostPrefixDisabled retrieves whether the hostname prefixing is // disabled. // // Scoped to stack values. Use middleware#ClearStackValues to clear all stack @@ -40,8 +40,8 @@ func IsEndpointHostPrefixDisabled(ctx context.Context) (v bool) { return v } -// DisableEndpointHostPrefix sets or modifies if the request's endpoint host -// prefixing to be disabled. If value is set to true, endpoint host prefixing +// DisableEndpointHostPrefix sets or modifies whether the request's endpoint host +// prefixing should be disabled. If value is true, endpoint host prefixing // will be disabled. // // Scoped to stack values. Use middleware#ClearStackValues to clear all stack diff --git a/vendor/github.com/aws/smithy-go/transport/http/middleware_min_proto.go b/vendor/github.com/aws/smithy-go/transport/http/middleware_min_proto.go new file mode 100644 index 00000000..326cb8a6 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/transport/http/middleware_min_proto.go @@ -0,0 +1,79 @@ +package http + +import ( + "context" + "fmt" + "github.com/aws/smithy-go/middleware" + "strings" +) + +// MinimumProtocolError is an error type indicating that the established connection did not meet the expected minimum +// HTTP protocol version. +type MinimumProtocolError struct { + proto string + expectedProtoMajor int + expectedProtoMinor int +} + +// Error returns the error message. +func (m *MinimumProtocolError) Error() string { + return fmt.Sprintf("operation requires minimum HTTP protocol of HTTP/%d.%d, but was %s", + m.expectedProtoMajor, m.expectedProtoMinor, m.proto) +} + +// RequireMinimumProtocol is a deserialization middleware that asserts that the established HTTP connection +// meets the minimum major ad minor version. +type RequireMinimumProtocol struct { + ProtoMajor int + ProtoMinor int +} + +// AddRequireMinimumProtocol adds the RequireMinimumProtocol middleware to the stack using the provided minimum +// protocol major and minor version. +func AddRequireMinimumProtocol(stack *middleware.Stack, major, minor int) error { + return stack.Deserialize.Insert(&RequireMinimumProtocol{ + ProtoMajor: major, + ProtoMinor: minor, + }, "OperationDeserializer", middleware.Before) +} + +// ID returns the middleware identifier string. +func (r *RequireMinimumProtocol) ID() string { + return "RequireMinimumProtocol" +} + +// HandleDeserialize asserts that the established connection is a HTTP connection with the minimum major and minor +// protocol version. +func (r *RequireMinimumProtocol) HandleDeserialize( + ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler, +) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*Response) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type: %T", out.RawResponse) + } + + if !strings.HasPrefix(response.Proto, "HTTP") { + return out, metadata, &MinimumProtocolError{ + proto: response.Proto, + expectedProtoMajor: r.ProtoMajor, + expectedProtoMinor: r.ProtoMinor, + } + } + + if response.ProtoMajor < r.ProtoMajor || response.ProtoMinor < r.ProtoMinor { + return out, metadata, &MinimumProtocolError{ + proto: response.Proto, + expectedProtoMajor: r.ProtoMajor, + expectedProtoMinor: r.ProtoMinor, + } + } + + return out, metadata, err +} diff --git a/vendor/github.com/aws/smithy-go/transport/http/properties.go b/vendor/github.com/aws/smithy-go/transport/http/properties.go new file mode 100644 index 00000000..c65aa393 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/transport/http/properties.go @@ -0,0 +1,80 @@ +package http + +import smithy "github.com/aws/smithy-go" + +type ( + sigV4SigningNameKey struct{} + sigV4SigningRegionKey struct{} + + sigV4ASigningNameKey struct{} + sigV4ASigningRegionsKey struct{} + + isUnsignedPayloadKey struct{} + disableDoubleEncodingKey struct{} +) + +// GetSigV4SigningName gets the signing name from Properties. +func GetSigV4SigningName(p *smithy.Properties) (string, bool) { + v, ok := p.Get(sigV4SigningNameKey{}).(string) + return v, ok +} + +// SetSigV4SigningName sets the signing name on Properties. +func SetSigV4SigningName(p *smithy.Properties, name string) { + p.Set(sigV4SigningNameKey{}, name) +} + +// GetSigV4SigningRegion gets the signing region from Properties. +func GetSigV4SigningRegion(p *smithy.Properties) (string, bool) { + v, ok := p.Get(sigV4SigningRegionKey{}).(string) + return v, ok +} + +// SetSigV4SigningRegion sets the signing region on Properties. +func SetSigV4SigningRegion(p *smithy.Properties, region string) { + p.Set(sigV4SigningRegionKey{}, region) +} + +// GetSigV4ASigningName gets the v4a signing name from Properties. +func GetSigV4ASigningName(p *smithy.Properties) (string, bool) { + v, ok := p.Get(sigV4ASigningNameKey{}).(string) + return v, ok +} + +// SetSigV4ASigningName sets the signing name on Properties. +func SetSigV4ASigningName(p *smithy.Properties, name string) { + p.Set(sigV4ASigningNameKey{}, name) +} + +// GetSigV4ASigningRegion gets the v4a signing region set from Properties. +func GetSigV4ASigningRegions(p *smithy.Properties) ([]string, bool) { + v, ok := p.Get(sigV4ASigningRegionsKey{}).([]string) + return v, ok +} + +// SetSigV4ASigningRegions sets the v4a signing region set on Properties. +func SetSigV4ASigningRegions(p *smithy.Properties, regions []string) { + p.Set(sigV4ASigningRegionsKey{}, regions) +} + +// GetIsUnsignedPayload gets whether the payload is unsigned from Properties. +func GetIsUnsignedPayload(p *smithy.Properties) (bool, bool) { + v, ok := p.Get(isUnsignedPayloadKey{}).(bool) + return v, ok +} + +// SetIsUnsignedPayload sets whether the payload is unsigned on Properties. +func SetIsUnsignedPayload(p *smithy.Properties, isUnsignedPayload bool) { + p.Set(isUnsignedPayloadKey{}, isUnsignedPayload) +} + +// GetDisableDoubleEncoding gets whether the payload is unsigned from Properties. +func GetDisableDoubleEncoding(p *smithy.Properties) (bool, bool) { + v, ok := p.Get(disableDoubleEncodingKey{}).(bool) + return v, ok +} + +// SetDisableDoubleEncoding sets whether the payload is unsigned on Properties. +func SetDisableDoubleEncoding(p *smithy.Properties, disableDoubleEncoding bool) { + p.Set(disableDoubleEncodingKey{}, disableDoubleEncoding) +} diff --git a/vendor/github.com/aws/smithy-go/transport/http/request.go b/vendor/github.com/aws/smithy-go/transport/http/request.go index caa73bec..7177d6f9 100644 --- a/vendor/github.com/aws/smithy-go/transport/http/request.go +++ b/vendor/github.com/aws/smithy-go/transport/http/request.go @@ -7,6 +7,7 @@ import ( "io/ioutil" "net/http" "net/url" + "strings" iointernal "github.com/aws/smithy-go/transport/http/internal/io" ) @@ -20,7 +21,7 @@ type Request struct { streamStartPos int64 } -// NewStackRequest returns an initialized request ready to populated with the +// NewStackRequest returns an initialized request ready to be populated with the // HTTP request details. Returns empty interface so the function can be used as // a parameter to the Smithy middleware Stack constructor. func NewStackRequest() interface{} { @@ -33,6 +34,14 @@ func NewStackRequest() interface{} { } } +// IsHTTPS returns if the request is HTTPS. Returns false if no endpoint URL is set. +func (r *Request) IsHTTPS() bool { + if r.URL == nil { + return false + } + return strings.EqualFold(r.URL.Scheme, "https") +} + // Clone returns a deep copy of the Request for the new context. A reference to // the Stream is copied, but the underlying stream is not copied. func (r *Request) Clone() *Request { @@ -45,19 +54,23 @@ func (r *Request) Clone() *Request { // to the request and ok set. If the length cannot be determined, an error will // be returned. func (r *Request) StreamLength() (size int64, ok bool, err error) { - if r.stream == nil { + return streamLength(r.stream, r.isStreamSeekable, r.streamStartPos) +} + +func streamLength(stream io.Reader, seekable bool, startPos int64) (size int64, ok bool, err error) { + if stream == nil { return 0, true, nil } - if l, ok := r.stream.(interface{ Len() int }); ok { + if l, ok := stream.(interface{ Len() int }); ok { return int64(l.Len()), true, nil } - if !r.isStreamSeekable { + if !seekable { return 0, false, nil } - s := r.stream.(io.Seeker) + s := stream.(io.Seeker) endOffset, err := s.Seek(0, io.SeekEnd) if err != nil { return 0, false, err @@ -69,12 +82,12 @@ func (r *Request) StreamLength() (size int64, ok bool, err error) { // file, and wants to skip the first N bytes uploading the rest. The // application would move the file's offset N bytes, then hand it off to // the SDK to send the remaining. The SDK should respect that initial offset. - _, err = s.Seek(r.streamStartPos, io.SeekStart) + _, err = s.Seek(startPos, io.SeekStart) if err != nil { return 0, false, err } - return endOffset - r.streamStartPos, true, nil + return endOffset - startPos, true, nil } // RewindStream will rewind the io.Reader to the relative start position if it @@ -98,28 +111,46 @@ func (r *Request) GetStream() io.Reader { return r.stream } -// IsStreamSeekable returns if the stream is seekable. +// IsStreamSeekable returns whether the stream is seekable. func (r *Request) IsStreamSeekable() bool { return r.isStreamSeekable } -// SetStream returns a clone of the request with the stream set to the provided reader. -// May return an error if the provided reader is seekable but returns an error. +// SetStream returns a clone of the request with the stream set to the provided +// reader. May return an error if the provided reader is seekable but returns +// an error. func (r *Request) SetStream(reader io.Reader) (rc *Request, err error) { rc = r.Clone() + if reader == http.NoBody { + reader = nil + } + + var isStreamSeekable bool + var streamStartPos int64 switch v := reader.(type) { case io.Seeker: n, err := v.Seek(0, io.SeekCurrent) if err != nil { return r, err } - rc.isStreamSeekable = true - rc.streamStartPos = n + isStreamSeekable = true + streamStartPos = n default: - rc.isStreamSeekable = false + // If the stream length can be determined, and is determined to be empty, + // use a nil stream to prevent confusion between empty vs not-empty + // streams. + length, ok, err := streamLength(reader, false, 0) + if err != nil { + return nil, err + } else if ok && length == 0 { + reader = nil + } } + rc.stream = reader + rc.isStreamSeekable = isStreamSeekable + rc.streamStartPos = streamStartPos return rc, err } @@ -130,19 +161,29 @@ func (r *Request) SetStream(reader io.Reader) (rc *Request, err error) { func (r *Request) Build(ctx context.Context) *http.Request { req := r.Request.Clone(ctx) - if r.stream != nil { - req.Body = iointernal.NewSafeReadCloser(ioutil.NopCloser(r.stream)) - } else { - // we update the content-length to 0, - // if request stream was not set. + if r.stream == nil && req.ContentLength == -1 { req.ContentLength = 0 } + switch stream := r.stream.(type) { + case *io.PipeReader: + req.Body = ioutil.NopCloser(stream) + req.ContentLength = -1 + default: + // HTTP Client Request must only have a non-nil body if the + // ContentLength is explicitly unknown (-1) or non-zero. The HTTP + // Client will interpret a non-nil body and ContentLength 0 as + // "unknown". This is unwanted behavior. + if req.ContentLength != 0 && r.stream != nil { + req.Body = iointernal.NewSafeReadCloser(ioutil.NopCloser(stream)) + } + } + return req } // RequestCloner is a function that can take an input request type and clone the request -// for use in a subsequent retry attempt +// for use in a subsequent retry attempt. func RequestCloner(v interface{}) interface{} { return v.(*Request).Clone() } diff --git a/vendor/github.com/aws/smithy-go/transport/http/response.go b/vendor/github.com/aws/smithy-go/transport/http/response.go index 7c65fa31..0c13bfcc 100644 --- a/vendor/github.com/aws/smithy-go/transport/http/response.go +++ b/vendor/github.com/aws/smithy-go/transport/http/response.go @@ -18,7 +18,7 @@ type ResponseError struct { Err error } -// HttpStatusCode returns the HTTP response status code received from the service +// HTTPStatusCode returns the HTTP response status code received from the service. func (e *ResponseError) HTTPStatusCode() int { return e.Response.StatusCode } // HTTPResponse returns the HTTP response received from the service. diff --git a/vendor/github.com/aws/smithy-go/transport/http/time.go b/vendor/github.com/aws/smithy-go/transport/http/time.go index 734550f8..607b196a 100644 --- a/vendor/github.com/aws/smithy-go/transport/http/time.go +++ b/vendor/github.com/aws/smithy-go/transport/http/time.go @@ -1,27 +1,13 @@ package http import ( - "fmt" "time" -) -// Time parsing function sourced from stdlib with an additional time format so -// non-compliant timestamps are still parseable. -// https://github.com/golang/go/blob/8869086d8f0a31033ccdc103106c768dc17216b1/src/net/http/header.go#L110-L127 -var timeFormats = []string{ - "Mon, _2 Jan 2006 15:04:05 GMT", // Modifies http.TimeFormat with a leading underscore for day number (leading 0 optional). - time.RFC850, - time.ANSIC, -} + smithytime "github.com/aws/smithy-go/time" +) -// ParseTime parses a time header like the HTTP Date header. -// This uses a more relaxed rule set for date parsing compared to the standard library. +// ParseTime parses a time string like the HTTP Date header. This uses a more +// relaxed rule set for date parsing compared to the standard library. func ParseTime(text string) (t time.Time, err error) { - for _, layout := range timeFormats { - t, err = time.Parse(layout, text) - if err == nil { - return t, nil - } - } - return time.Time{}, fmt.Errorf("unknown time format: %w", err) + return smithytime.ParseHTTPDate(text) } diff --git a/vendor/github.com/aws/smithy-go/transport/http/url.go b/vendor/github.com/aws/smithy-go/transport/http/url.go new file mode 100644 index 00000000..60a5fc10 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/transport/http/url.go @@ -0,0 +1,44 @@ +package http + +import "strings" + +// JoinPath returns an absolute URL path composed of the two paths provided. +// Enforces that the returned path begins with '/'. If added path is empty the +// returned path suffix will match the first parameter suffix. +func JoinPath(a, b string) string { + if len(a) == 0 { + a = "/" + } else if a[0] != '/' { + a = "/" + a + } + + if len(b) != 0 && b[0] == '/' { + b = b[1:] + } + + if len(b) != 0 && len(a) > 1 && a[len(a)-1] != '/' { + a = a + "/" + } + + return a + b +} + +// JoinRawQuery returns an absolute raw query expression. Any duplicate '&' +// will be collapsed to single separator between values. +func JoinRawQuery(a, b string) string { + a = strings.TrimFunc(a, isAmpersand) + b = strings.TrimFunc(b, isAmpersand) + + if len(a) == 0 { + return b + } + if len(b) == 0 { + return a + } + + return a + "&" + b +} + +func isAmpersand(v rune) bool { + return v == '&' +} diff --git a/vendor/github.com/aws/smithy-go/waiter/logger.go b/vendor/github.com/aws/smithy-go/waiter/logger.go index 064ecafa..8d70a03f 100644 --- a/vendor/github.com/aws/smithy-go/waiter/logger.go +++ b/vendor/github.com/aws/smithy-go/waiter/logger.go @@ -30,7 +30,7 @@ func (m *Logger) HandleInitialize(ctx context.Context, in middleware.InitializeI return next.HandleInitialize(ctx, in) } -// AddLogger is helper util to add waiter logger after `SetLogger` middleware in +// AddLogger is a helper util to add waiter logger after `SetLogger` middleware in func (m Logger) AddLogger(stack *middleware.Stack) error { return stack.Initialize.Insert(&m, "SetLogger", middleware.After) } diff --git a/vendor/modules.txt b/vendor/modules.txt index 2bfe53c8..e3a268a8 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -145,10 +145,12 @@ github.com/armon/go-metrics # github.com/atotto/clipboard v0.1.4 ## explicit github.com/atotto/clipboard -# github.com/aws/aws-sdk-go-v2 v1.2.0 -## explicit; go 1.15 +# github.com/aws/aws-sdk-go-v2 v1.24.1 +## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/aws +github.com/aws/aws-sdk-go-v2/aws/defaults github.com/aws/aws-sdk-go-v2/aws/middleware +github.com/aws/aws-sdk-go-v2/aws/middleware/private/metrics github.com/aws/aws-sdk-go-v2/aws/protocol/query github.com/aws/aws-sdk-go-v2/aws/protocol/restjson github.com/aws/aws-sdk-go-v2/aws/protocol/xml @@ -157,19 +159,22 @@ github.com/aws/aws-sdk-go-v2/aws/retry github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4 github.com/aws/aws-sdk-go-v2/aws/signer/v4 github.com/aws/aws-sdk-go-v2/aws/transport/http +github.com/aws/aws-sdk-go-v2/internal/auth +github.com/aws/aws-sdk-go-v2/internal/auth/smithy github.com/aws/aws-sdk-go-v2/internal/endpoints -github.com/aws/aws-sdk-go-v2/internal/ini +github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn github.com/aws/aws-sdk-go-v2/internal/rand github.com/aws/aws-sdk-go-v2/internal/sdk github.com/aws/aws-sdk-go-v2/internal/sdkio +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.1.1 -## explicit; go 1.15 +# github.com/aws/aws-sdk-go-v2/config v1.26.5 +## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/config -# github.com/aws/aws-sdk-go-v2/credentials v1.1.1 -## explicit; go 1.15 +# github.com/aws/aws-sdk-go-v2/credentials v1.16.16 +## 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 @@ -177,42 +182,67 @@ 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.0.2 -## explicit; go 1.15 +# github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11 +## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/feature/ec2/imds -# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2 -## explicit; go 1.15 +github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config +# github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.10 +## explicit; go 1.19 +github.com/aws/aws-sdk-go-v2/internal/configsources +# github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.10 +## explicit; go 1.19 +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 +# github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2 +## explicit; go 1.19 +github.com/aws/aws-sdk-go-v2/internal/ini +# github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 +## explicit; go 1.19 +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding +# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10 +## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/service/internal/presigned-url -# github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.1.1 -## explicit; go 1.15 +# github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.26.2 +## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/service/secretsmanager github.com/aws/aws-sdk-go-v2/service/secretsmanager/internal/endpoints github.com/aws/aws-sdk-go-v2/service/secretsmanager/types -# github.com/aws/aws-sdk-go-v2/service/ssm v1.1.1 -## explicit; go 1.15 +# github.com/aws/aws-sdk-go-v2/service/ssm v1.44.7 +## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/service/ssm github.com/aws/aws-sdk-go-v2/service/ssm/internal/endpoints github.com/aws/aws-sdk-go-v2/service/ssm/types -# github.com/aws/aws-sdk-go-v2/service/sso v1.1.1 -## explicit; go 1.15 +# github.com/aws/aws-sdk-go-v2/service/sso v1.18.7 +## 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/sts v1.1.1 -## explicit; go 1.15 +# github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.7 +## 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.26.7 +## 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 -# github.com/aws/smithy-go v1.1.0 -## explicit; go 1.14 +# github.com/aws/smithy-go v1.19.0 +## explicit; go 1.19 github.com/aws/smithy-go +github.com/aws/smithy-go/auth +github.com/aws/smithy-go/auth/bearer +github.com/aws/smithy-go/context +github.com/aws/smithy-go/document github.com/aws/smithy-go/encoding github.com/aws/smithy-go/encoding/httpbinding github.com/aws/smithy-go/encoding/json github.com/aws/smithy-go/encoding/xml +github.com/aws/smithy-go/endpoints +github.com/aws/smithy-go/internal/sync/singleflight github.com/aws/smithy-go/io github.com/aws/smithy-go/logging github.com/aws/smithy-go/middleware +github.com/aws/smithy-go/private/requestcompression github.com/aws/smithy-go/ptr github.com/aws/smithy-go/rand github.com/aws/smithy-go/time