topdown/builtins: Add object support for GraphQL builtins. (#4752)

This commit adds support for AST objects to be usable in place of
strings for several of the GraphQL built-in functions, to improve
the composability of the GraphQL set of built-ins, and to dramatically
reduce the amount of redundant parsing when writing GraphQL policies.

Fixes: #4742

Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
This commit is contained in:
Philip Conrad
2022-09-26 05:47:40 -04:00
committed by GitHub
parent 79f77e422b
commit ab385e9c17
8 changed files with 372 additions and 116 deletions
+102 -6
View File
@@ -1051,10 +1051,42 @@
"decl": {
"args": [
{
"type": "string"
"of": [
{
"type": "string"
},
{
"dynamic": {
"key": {
"type": "any"
},
"value": {
"type": "any"
}
},
"type": "object"
}
],
"type": "any"
},
{
"type": "string"
"of": [
{
"type": "string"
},
{
"dynamic": {
"key": {
"type": "any"
},
"value": {
"type": "any"
}
},
"type": "object"
}
],
"type": "any"
}
],
"result": {
@@ -1068,10 +1100,42 @@
"decl": {
"args": [
{
"type": "string"
"of": [
{
"type": "string"
},
{
"dynamic": {
"key": {
"type": "any"
},
"value": {
"type": "any"
}
},
"type": "object"
}
],
"type": "any"
},
{
"type": "string"
"of": [
{
"type": "string"
},
{
"dynamic": {
"key": {
"type": "any"
},
"value": {
"type": "any"
}
},
"type": "object"
}
],
"type": "any"
}
],
"result": {
@@ -1109,10 +1173,42 @@
"decl": {
"args": [
{
"type": "string"
"of": [
{
"type": "string"
},
{
"dynamic": {
"key": {
"type": "any"
},
"value": {
"type": "any"
}
},
"type": "object"
}
],
"type": "any"
},
{
"type": "string"
"of": [
{
"type": "string"
},
{
"dynamic": {
"key": {
"type": "any"
},
"value": {
"type": "any"
}
},
"type": "object"
}
],
"type": "any"
}
],
"result": {