From 9743a3f7e094d9b8e38c40029167fdf3f2644c9e Mon Sep 17 00:00:00 2001 From: Bill Hamilton Date: Mon, 12 Aug 2024 13:31:07 -0700 Subject: [PATCH] modified securePassword name to authSP to avoid linter/snyk issues --- auth/method_password.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/auth/method_password.go b/auth/method_password.go index 747abab0..fbe2c3cf 100644 --- a/auth/method_password.go +++ b/auth/method_password.go @@ -8,6 +8,8 @@ import ( "github.com/spf13/viper" ) +const authSP = "auth.securePassword" + func buildPasswordParams() (*requestBody, error) { data := &requestBody{ GrantType: authTypeToGrantType[Password], @@ -20,13 +22,13 @@ func buildPasswordParams() (*requestBody, error) { // If it is an empty string, look for SecurePassword, which Viper gets only from config. Get the corresponding // key file and use it to decrypt SecurePassword. if data.Password == "" { - passSetting := "auth.securePassword" + passSetting := authSP storeType := viper.GetString(cst.StoreType) if storeType == store.WinCred || storeType == store.PassLinux { passSetting = cst.Password } if pass, err := store.GetSecureSetting(passSetting); err == nil && pass != "" { - if passSetting == "auth.securePassword" { + if passSetting == authSP { keyPath := GetEncryptionKeyFilename(viper.GetString(cst.Tenant), data.Username) key, err := store.ReadFileInDefaultPath(keyPath) if err != nil || key == "" {