Path Schema Validator (Schematic) aims to be flexible, schema-driven tool for validating structured paths like strings against configurable, rule-based schemas.
Current design enforces naming conventions for secret management systems.
Possible other usecases might include naming conventions for access control policies, and resource organization standards in CI/CD pipelines,and other automated workflows.
- Declarative Schemas: Define path structures using a simple, human-readable schema language.
- Variable and Set Support: Reference variables and predefined sets in your schemas.
- Modifiers: Apply transformations to variables (e.g., strip prefixes) before validation.
- Wildcard Matching: Support for single and multi-segment wildcards.
- Extensible: Easily add new constraint types or modifiers.
- Enforcing naming conventions for secrets or resources in CI/CD pipelines.
- Validating access control paths in automation workflows.
- Ensuring compliance with organizational structure for resource identifiers.
- Validating configuration keys or file paths in infrastructure projects.
- Replacing regex
-
Define a Schema:
Write a schema that describes the allowed structure of your paths, using variables, sets, and modifiers. -
Configure Variables and Sets:
Provide values for variables and sets via environment variables or configuration files. -
Validate Input:
Use the tool to check if a given input string matches the schema. If it matches, validation succeeds; otherwise, it fails with error.
Schema:
$some_variable.strip_prefix("helm-")/$[technologies]/+
Context variables:
some_variable(variable):group1/helm-project1such as $CI_PROJECT_PATH in gitlab runnertechnologies(variable set):["mssql", "kafka", "postgres"]- defined in config or database
Input:
group1/project1/postgres/admin
Result:
Validation succeeds if the input matches the schema after applying variable values and modifiers.
TODO