mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 15:27:27 +00:00
feat(secret-ref): updated reference corner cases of trailing slashes
This commit is contained in:
@@ -358,10 +358,9 @@ func ExpandSecrets(secrets []models.SingleEnvironmentVariable, infisicalToken st
|
|||||||
}
|
}
|
||||||
|
|
||||||
expandedVal := recursivelyExpandSecret(expandedSecs, interpolatedSecs, func(env string, secPaths []string, secKey string) string {
|
expandedVal := recursivelyExpandSecret(expandedSecs, interpolatedSecs, func(env string, secPaths []string, secKey string) string {
|
||||||
|
secPaths = append([]string{"/"}, secPaths...)
|
||||||
secPath := path.Join(secPaths...)
|
secPath := path.Join(secPaths...)
|
||||||
if secPath == "" {
|
|
||||||
secPath = "/"
|
|
||||||
}
|
|
||||||
secPathDot := strings.Join(secPaths, ".")
|
secPathDot := strings.Join(secPaths, ".")
|
||||||
uniqKey := fmt.Sprintf("%s.%s", env, secPathDot)
|
uniqKey := fmt.Sprintf("%s.%s", env, secPathDot)
|
||||||
|
|
||||||
|
|||||||
+8
-1
@@ -45,7 +45,14 @@ const schema = yup.object({
|
|||||||
.array(
|
.array(
|
||||||
yup.object({
|
yup.object({
|
||||||
environment: yup.string().max(50).required().label("Environment"),
|
environment: yup.string().max(50).required().label("Environment"),
|
||||||
secretPath: yup.string().required().default("/").label("Secret Path")
|
secretPath: yup
|
||||||
|
.string()
|
||||||
|
.required()
|
||||||
|
.default("/")
|
||||||
|
.label("Secret Path")
|
||||||
|
.transform((val) =>
|
||||||
|
typeof val === "string" && val.at(-1) === "/" && val.length > 1 ? val.slice(0, -1) : val
|
||||||
|
)
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
.min(1)
|
.min(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user