feat(api): list roots with policy names

The §9.2 add flow pre-fills root and policy; without this endpoint the
SPA has no way to know either. No issue covers it separately.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Miguel Palhas
2026-08-22 21:48:27 +01:00
co-authored by Claude Fable 5
parent 5a1cf999b6
commit 6d5c90ac08
3 changed files with 134 additions and 1 deletions
@@ -0,0 +1,50 @@
{
"db_name": "SQLite",
"query": "SELECT r.id AS \"id!: i64\", r.kind AS \"kind!: String\", r.audience AS \"audience!: String\", r.path AS \"path!: String\", p.id AS \"policy_id!: i64\", p.name AS \"policy_name!: String\" FROM roots r JOIN policies p ON p.id = r.policy_id ORDER BY r.id",
"describe": {
"columns": [
{
"name": "id!: i64",
"ordinal": 0,
"type_info": "Integer"
},
{
"name": "kind!: String",
"ordinal": 1,
"type_info": "Text"
},
{
"name": "audience!: String",
"ordinal": 2,
"type_info": "Text"
},
{
"name": "path!: String",
"ordinal": 3,
"type_info": "Text"
},
{
"name": "policy_id!: i64",
"ordinal": 4,
"type_info": "Integer"
},
{
"name": "policy_name!: String",
"ordinal": 5,
"type_info": "Text"
}
],
"parameters": {
"Right": 0
},
"nullable": [
false,
false,
false,
false,
false,
false
]
},
"hash": "fa84977e249cb6f3b95d5f3486346450066ac2997437175e30c60d6364701dcf"
}