Fix integration tests: correct vault derivation index and debug test failures
This commit is contained in:
@@ -63,10 +63,31 @@ func (v *Vault) ListSecrets() ([]string, error) {
|
||||
}
|
||||
|
||||
// isValidSecretName validates secret names according to the format [a-z0-9\.\-\_\/]+
|
||||
// but with additional restrictions:
|
||||
// - No leading or trailing slashes
|
||||
// - No double slashes
|
||||
// - No names starting with dots
|
||||
func isValidSecretName(name string) bool {
|
||||
if name == "" {
|
||||
return false
|
||||
}
|
||||
|
||||
// Check for leading/trailing slashes
|
||||
if strings.HasPrefix(name, "/") || strings.HasSuffix(name, "/") {
|
||||
return false
|
||||
}
|
||||
|
||||
// Check for double slashes
|
||||
if strings.Contains(name, "//") {
|
||||
return false
|
||||
}
|
||||
|
||||
// Check for names starting with dot
|
||||
if strings.HasPrefix(name, ".") {
|
||||
return false
|
||||
}
|
||||
|
||||
// Check the basic pattern
|
||||
matched, _ := regexp.MatchString(`^[a-z0-9\.\-\_\/]+$`, name)
|
||||
return matched
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user