mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 16:52:38 +00:00
Merge pull request #2206 from GLEF1X/refactor/hashicorp-vault-integration
refactor(hashicorp-integration): make hashicorp vault integration easier to use
This commit is contained in:
@@ -3,3 +3,12 @@ export const removeTrailingSlash = (str: string) => {
|
||||
|
||||
return str.endsWith("/") ? str.slice(0, -1) : str;
|
||||
};
|
||||
|
||||
export const isValidPath = (val: string): boolean => {
|
||||
if (val.length === 0) return false;
|
||||
if (val === "/") return true;
|
||||
|
||||
// Check for valid characters and no consecutive slashes
|
||||
const validPathRegex = /^[a-zA-Z0-9-_.:]+(?:\/[a-zA-Z0-9-_.:]+)*$/;
|
||||
return validPathRegex.test(val);
|
||||
}
|
||||
Reference in New Issue
Block a user