ast: Adding rego.metadata.* built-in functions (#4537)

New functions:
* rego.metadata.chain(): returns the chain of metadata, starting from the active rule, going outward
* rego.metadata.rule(): returns the metadata for the active rule

Signed-off-by: Johan Fylling <johan.dev@fylling.se>
This commit is contained in:
Johan Fylling
2022-04-13 11:46:11 +02:00
committed by GitHub
parent 05dad98d27
commit c6226621c4
15 changed files with 1714 additions and 261 deletions
+21
View File
@@ -2856,6 +2856,27 @@
"type": "function"
}
},
{
"name": "rego.metadata.chain",
"decl": {
"result": {
"dynamic": {
"type": "any"
},
"type": "array"
},
"type": "function"
}
},
{
"name": "rego.metadata.rule",
"decl": {
"result": {
"type": "any"
},
"type": "function"
}
},
{
"name": "rego.parse_module",
"decl": {