mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: Optimize rego policy input allocations (#6135)
* chore: Optimize rego policy evaluation allocations Manually convert to ast.Value instead of using generic json.Marshal conversion. * Add a unit test that prevents regressions of rego input The optimized input is always compared to the normal json marshal parser.
This commit is contained in:
+15
-1
@@ -12,7 +12,21 @@
|
||||
},
|
||||
"subject": {
|
||||
"id": "10d03e62-7703-4df5-a358-4f76577d4e2f",
|
||||
"roles": [],
|
||||
"roles": [
|
||||
{
|
||||
"name": "owner",
|
||||
"display_name": "Owner",
|
||||
"site": [
|
||||
{
|
||||
"negate": false,
|
||||
"resource_type": "*",
|
||||
"action": "*"
|
||||
}
|
||||
],
|
||||
"org": {},
|
||||
"user": []
|
||||
}
|
||||
],
|
||||
"groups": ["b617a647-b5d0-4cbe-9e40-26f89710bf18"],
|
||||
"scope": {
|
||||
"name": "Scope_all",
|
||||
|
||||
Reference in New Issue
Block a user