From e505dd1e903277c085dce079922d53d3a05fb95a Mon Sep 17 00:00:00 2001 From: "EPAM\\Felipe_Hernandez" Date: Fri, 1 Mar 2024 08:04:19 -0500 Subject: [PATCH 1/2] fix: fix path issue --- api/secrets/secrets.go | 9 +++++++-- api/utils/validator.go | 5 +++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/api/secrets/secrets.go b/api/secrets/secrets.go index ff6f690..c1bebac 100644 --- a/api/secrets/secrets.go +++ b/api/secrets/secrets.go @@ -61,8 +61,13 @@ func (secretObj *SecretObj) GetSecretFlow(secretsToRetrieve []string, separator for _, secretToRetrieve := range secretsToRetrieve { secretData := strings.Split(secretToRetrieve, separator) - secretPath := secretData[0] - secretTitle := secretData[1] + secretObj.log.Info(fmt.Sprintf("secretData: %v ", secretData)) + + secretTitle := secretData[len(secretData)-1] + secretPath := strings.Join(secretData[:len(secretData)-1], separator) + + secretObj.log.Info(fmt.Sprintf("Ttile: %v ", secretTitle)) + secretObj.log.Info(fmt.Sprintf("Path: %v ", secretPath)) secret, err := secretObj.SecretGetSecretByPath(secretPath, secretTitle, separator, "secrets-safe/secrets") diff --git a/api/utils/validator.go b/api/utils/validator.go index adbdadf..4e99e0c 100644 --- a/api/utils/validator.go +++ b/api/utils/validator.go @@ -133,8 +133,9 @@ func ValidatePaths(secretPaths []string, isManagedAccount bool, separator string secretData := strings.Split(secretToRetrieve, separator) - path := secretData[0] - name := secretData[1] + name := secretData[len(secretData)-1] + path := strings.Join(secretData[:len(secretData)-1], separator) + maxPath := maxPathLength maxName := maxTitleLength invalidPathName := "path" From de51218a83261ca6ec4ef2c1b1ae951a86f04286 Mon Sep 17 00:00:00 2001 From: "EPAM\\Felipe_Hernandez" Date: Fri, 1 Mar 2024 08:13:07 -0500 Subject: [PATCH 2/2] fix: fix path issue --- api/secrets/secrets.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/api/secrets/secrets.go b/api/secrets/secrets.go index c1bebac..13faa3f 100644 --- a/api/secrets/secrets.go +++ b/api/secrets/secrets.go @@ -61,14 +61,9 @@ func (secretObj *SecretObj) GetSecretFlow(secretsToRetrieve []string, separator for _, secretToRetrieve := range secretsToRetrieve { secretData := strings.Split(secretToRetrieve, separator) - secretObj.log.Info(fmt.Sprintf("secretData: %v ", secretData)) - secretTitle := secretData[len(secretData)-1] secretPath := strings.Join(secretData[:len(secretData)-1], separator) - secretObj.log.Info(fmt.Sprintf("Ttile: %v ", secretTitle)) - secretObj.log.Info(fmt.Sprintf("Path: %v ", secretPath)) - secret, err := secretObj.SecretGetSecretByPath(secretPath, secretTitle, separator, "secrets-safe/secrets") if err != nil {