feat(secret-ref): updated reference corner cases of trailing slashes

This commit is contained in:
akhilmhdh
2023-07-06 22:15:10 +05:30
parent 5aba0c60b8
commit 8a237af4ac
2 changed files with 10 additions and 4 deletions

View File

@@ -358,10 +358,9 @@ func ExpandSecrets(secrets []models.SingleEnvironmentVariable, infisicalToken st
}
expandedVal := recursivelyExpandSecret(expandedSecs, interpolatedSecs, func(env string, secPaths []string, secKey string) string {
secPaths = append([]string{"/"}, secPaths...)
secPath := path.Join(secPaths...)
if secPath == "" {
secPath = "/"
}
secPathDot := strings.Join(secPaths, ".")
uniqKey := fmt.Sprintf("%s.%s", env, secPathDot)