refactor(integration): make hashicorp vault integration easier to use

* Makes `namespace` optional allowing to use self-hosted OSS hashicorp vault
This commit is contained in:
GLEF1X
2024-07-30 22:06:54 -04:00
parent 1d97921c7c
commit 96cffd6196
4 changed files with 272 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);
}