Prerequisites and overview for using Guard rules
This section demonstrates how you can complete the core Guard tasks of writing, testing, and validating rules against JSON- or YAML-formatted data. In addition, it contains detailed walkthroughs that demonstrate writing rules that respond to specific use cases.
Topics
Prerequisites
Before you can write policy rules using the Guard domain-specific language (DSL), you must install the Guard command line interface (CLI). For more information, see Setting up Guard.
Overview of using Guard rules
When using Guard, you typically perform the following steps:
-
Write JSON- or YAML-formatted data to validate.
-
Write Guard policy rules. For more information, see Writing Guard rules.
-
Verify that your rules work as intended by using the Guard
test
command. For more information about unit testing, see Testing Guard rules. -
Use the Guard
validate
command to validate your JSON- or YAML-formatted data against your rules. For more information, see Validating input data against Guard rules.