Skip to content

Commit

Permalink
Add description of getting started activity, and some minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
samriddhi99 committed Aug 9, 2024
1 parent f6108c4 commit 5f5424b
Showing 1 changed file with 8 additions and 31 deletions.
39 changes: 8 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1113,8 +1113,9 @@ JSON Output:
``` -->
## Getting Started

create two files, one for input.json one for
policy.json.
This is a short getting started guide for Tirith. We will take a look on how we can use Tirith to guardrail a JSON input.

Create two files, one for input.json one for policy.json.

**input.json**

Expand Down Expand Up @@ -1189,17 +1190,17 @@ tirith -input-path input.json -policy-path policy.json

Explanation:

- **tirith**:
- `tirith`:
- This is the command to run the Tirith program, which is part of
the StackGuardian Policy Framework.

- **-input-path input.json**:
- The -input-path option specifies the path to the input file.
- `-input-path input.json`:
- The `-input-path` option specifies the path to the input file.
- input.json is the file that contains the input data to be
scanned by Tirith.

- **-policy-path policy.json**:
- The -policy-path option specifies the path to the policy file.
- `-policy-path policy.json`:
- The `-policy-path option` specifies the path to the policy file.
- policy.json is the file that contains the policies (rules)
defined in Tirith\'s policy as code.

Expand Down Expand Up @@ -1228,30 +1229,6 @@ Final expression used:
```


### Error tolerance

What if sometimes one or more keys inside the input file are not found?
Let's try to delete the **verb** key inside the **input.json** and see
what happens when we try to run the evaluation again using the same
command above.

It should fail the evaluation.

What if we, as a user, want the evaluator to "skips" itself (don't
include the result to the final evaluator) when a particular key is not
found?

This is when **error tolerance** can be helpful.

A provider can raise an error and the error itself has a **severity**
value. (see Appendix). In this case the JSON provider raises an error of
severity value 2 when the `get_value` operation can't find the JSON
path inside the input.

By setting the **error_tolerance** value to 2 or more inside the
**condition** key in the evaluator, it will mark the evaluator as Skipped instead of Failed.


## Want to contribute?

If you're interested, please email us at team[at]stackguardian.io or get started by reading the [contributing.md](./CONTRIBUTING.md).
Expand Down

0 comments on commit 5f5424b

Please sign in to comment.