From 390a1283fe94a94b5d6fdcac839df94c7bca826b Mon Sep 17 00:00:00 2001 From: Steven Kessler Date: Sun, 21 Jan 2024 11:41:23 -0500 Subject: [PATCH] fix(typing): fixing consistent use of the special aws boolean for new versions --- main.go | 2 +- pkg/porcelain.go | 4 ++-- pkg/providers/aws_secretsmanager.go | 2 +- pkg/providers/aws_ssm.go | 5 +++-- pkg/providers/aws_ssm_test.go | 1 + pkg/providers/google_secretmanager.go | 2 +- pkg/providers/heroku.go | 2 +- pkg/providers/keypass.go | 2 +- pkg/providers/lastpass.go | 4 ++-- pkg/providers/process_env.go | 2 +- pkg/providers/vercel.go | 2 +- pkg/teller_test.go | 2 +- 12 files changed, 16 insertions(+), 14 deletions(-) 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 20a61d47..a93ae51c 100644 --- a/pkg/providers/aws_secretsmanager.go +++ b/pkg/providers/aws_secretsmanager.go @@ -38,7 +38,7 @@ var defaultDeletionRecoveryWindowInDays int64 = 7 const versionSplit = "," -// nolint +//nolint func init() { metaInfo := core.MetaInfo{ Name: "aws_secretsmanager", diff --git a/pkg/providers/aws_ssm.go b/pkg/providers/aws_ssm.go index d504b900..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 { diff --git a/pkg/providers/aws_ssm_test.go b/pkg/providers/aws_ssm_test.go index 63e414f6..5c1a0bda 100644 --- a/pkg/providers/aws_ssm_test.go +++ b/pkg/providers/aws_ssm_test.go @@ -21,6 +21,7 @@ func TestAWSSSM(t *testing.T) { client := mock_providers.NewMockAWSSSMClient(ctrl) path := "settings/prod/billing-svc" val := "shazam" + in := ssm.GetParameterInput{Name: &path, WithDecryption: aws.Bool(true)} out := ssm.GetParameterOutput{ Parameter: &types.Parameter{ 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",