Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

418 B
Raw Blame
import { CharacterType, characterValidator } from "./validate-string";

// regex to allow only alphanumeric, dash, underscore
export const isValidFolderName = characterValidator([
  CharacterType.AlphaNumeric,
  CharacterType.Hyphen,
  CharacterType.Underscore
]);

export const isValidSecretPath = (path: string) =>
  path
    .split("/")
    .filter((el) => el.length)
    .every((name) => isValidFolderName(name));