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:
Maidul Islam
2024-07-30 23:05:28 -04:00
committed by GitHub
5 changed files with 273 additions and 208 deletions
+9
View File
@@ -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);
}