You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/macaron/slsa_analyzer/checks/README.md
+19-1Lines changed: 19 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ These are the steps for creating a Check in Macaron:
11
11
1. Create a module with the name `<name>_check.py`. Note that Macaron **only** loads check modules that have this name format.
12
12
2. Create a class that inherits `BaseCheck` and initiates the attributes of a `BaseCheck` instance.
13
13
3. Register the newly created Check class to the Registry ([registry.py](../registry.py)). This will make the Check available to Macaron. For example:
14
-
```
14
+
```python
15
15
from macaron.slsa_analyzer.registry import registry
16
16
17
17
# Check class is defined here
@@ -20,5 +20,23 @@ from macaron.slsa_analyzer.registry import registry
20
20
21
21
registry.register(ExampleCheck())
22
22
```
23
+
4. Add an ORM mapped class for the check facts so that the policy engine can reason about the properties. To provide the mapped class, all you need to do is to add a class that inherits from `CheckFacts` class and add the following attributes (rename the `MyCheckFacts` check name and `__tablename__` as appropriate).
24
+
25
+
```python
26
+
classMyCheckFacts(CheckFacts):
27
+
"""The ORM mapping for justifications in my check."""
0 commit comments