All checks were successful
Deploy Development / deploy (push) Successful in 38s
Test Suite / pytest-backend (push) Successful in 18s
Test Suite / lint-backend (push) Successful in 1s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 24s
Migration 005, Registry-Sync, Placeholder-Validation, capability-geschuetzte API, Tests und Abschlussbericht v0.1. Co-authored-by: Cursor <cursoragent@cursor.com>
36 lines
990 B
Python
36 lines
990 B
Python
"""Feature registry API."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from capabilities import require_capability_ctx
|
|
from db import get_connection
|
|
from fastapi import APIRouter, Depends
|
|
|
|
router = APIRouter(prefix="/api/features", tags=["features"])
|
|
|
|
|
|
@router.get("")
|
|
def list_features(_ctx=Depends(require_capability_ctx("kairo.feature.registry.read"))):
|
|
conn = get_connection()
|
|
try:
|
|
with conn.cursor() as cur:
|
|
cur.execute(
|
|
"""
|
|
SELECT feature_key, module, name, description, is_active
|
|
FROM features
|
|
ORDER BY feature_key
|
|
"""
|
|
)
|
|
return [
|
|
{
|
|
"feature_key": row[0],
|
|
"module": row[1],
|
|
"name": row[2],
|
|
"description": row[3],
|
|
"is_active": row[4],
|
|
}
|
|
for row in cur.fetchall()
|
|
]
|
|
finally:
|
|
conn.close()
|