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
| scope | string; one of `package`, `rule`, `document`, `subpackages`| The scope for which the metadata applies. Read more in the [Metadata Scope section below](#metadata-scope). |
2606
-
|`id`| string | A unique identifier for the rule, used to track evaluated rules in decision logs. Read more in the [Metadata ID section below](#metadata-id). |
2607
-
|`title`| string | A human-readable name for the annotation target. Read more in the [Metadata Title section below](#metadata-title). |
2608
-
|`description`| string | A description of the annotation target. Read more in the [Metadata Description section below](#metadata-description). |
2609
-
|`related_resources`| list of URLs | A list of URLs pointing to related resources/documentation. Read more in the [Metadata Related Resources section below](#metadata-related_resources). |
2610
-
|`authors`| list of strings | A list of authors for the annotation target. Read more in the [Metadata Authors section below](#metadata-authors). |
2611
-
|`organizations`| list of strings | A list of organizations related to the annotation target. Read more in the [Metadata Organizations section below](#metadata-organizations). |
2612
-
|`schemas`| list of object | A list of associations between value paths and schema definitions. Read more in the [Metadata Schemas section below](#metadata-schemas). |
2613
-
|`entrypoint`| boolean | Whether or not the annotation target is to be used as a policy entrypoint. Read more in the [Metadata Entrypoint section below](#metadata-entrypoint). |
2614
-
|`custom`| mapping of arbitrary data | A custom mapping of named parameters holding arbitrary data. Read more in the [Metadata Custom section below](#metadata-custom). |
| scope | string; one of `package`, `rule`, `document`, `subpackages`| The scope for which the metadata applies. Read more in the [Metadata Scope section below](#metadata-scope). |
2606
+
|`labels`| mapping of key-value pairs| Arbitrary labels attached to a rule, recorded in decision logs when the rule is evaluated. Read more in the [Metadata Labels section below](#metadata-labels).|
2607
+
|`title`| string | A human-readable name for the annotation target. Read more in the [Metadata Title section below](#metadata-title). |
2608
+
|`description`| string | A description of the annotation target. Read more in the [Metadata Description section below](#metadata-description). |
2609
+
|`related_resources`| list of URLs | A list of URLs pointing to related resources/documentation. Read more in the [Metadata Related Resources section below](#metadata-related_resources). |
2610
+
|`authors`| list of strings | A list of authors for the annotation target. Read more in the [Metadata Authors section below](#metadata-authors). |
2611
+
|`organizations`| list of strings | A list of organizations related to the annotation target. Read more in the [Metadata Organizations section below](#metadata-organizations). |
2612
+
|`schemas`| list of object | A list of associations between value paths and schema definitions. Read more in the [Metadata Schemas section below](#metadata-schemas). |
2613
+
|`entrypoint`| boolean | Whether or not the annotation target is to be used as a policy entrypoint. Read more in the [Metadata Entrypoint section below](#metadata-entrypoint). |
2614
+
|`custom`| mapping of arbitrary data | A custom mapping of named parameters holding arbitrary data. Read more in the [Metadata Custom section below](#metadata-custom). |
2615
2615
2616
2616
### Metadata `Scope`
2617
2617
@@ -2665,19 +2665,19 @@ allow if {
2665
2665
message := "welcome!" if allow
2666
2666
```
2667
2667
2668
-
### Metadata `id`
2668
+
### Metadata `labels`
2669
2669
2670
-
The `id` annotation is a string value that uniquely identifies a rule. When
2671
-
any loaded policy contains rules with `id` annotations (or when external rule
2672
-
sources are registered), the IDs of successfully evaluated rules are
2673
-
automatically recorded in decision log events.
2674
-
2675
-
When any module contains a metadata block with an `id` field, annotation
2676
-
parsing is enabled automatically (even if `ProcessAnnotation` was not set).
2670
+
The `labels` annotation is a map of arbitrary key-value pairs attached to a
2671
+
rule (or document). When rules with `labels` are successfully evaluated, their
2672
+
label sets are automatically recorded in decision log events under the
2673
+
`rule_labels` field. Labels from document-scoped and rule-scoped annotations
0 commit comments