Add small SaaS profile proof

This commit is contained in:
tegwick 2026-05-23 04:26:28 +02:00
parent 79e4d10b68
commit 6351ebc627
40 changed files with 1696 additions and 54 deletions

View file

@ -15,7 +15,9 @@ from .service import (
list_models,
list_standards,
list_views,
profile_graph,
profile_inspect,
profile_validate,
read_view,
validate_canon,
)
@ -96,6 +98,14 @@ def _route(
if path.startswith("/profiles/") and path.endswith("/inspect"):
profile = path.removeprefix("/profiles/").removesuffix("/inspect").strip("/")
return HTTPStatus.OK, profile_inspect(profile, root)
if path.startswith("/profiles/") and path.endswith("/validate"):
profile = path.removeprefix("/profiles/").removesuffix("/validate").strip("/")
payload = profile_validate(profile, root)
return (HTTPStatus.OK if payload["ok"] else HTTPStatus.BAD_REQUEST), payload
if path.startswith("/profiles/") and path.endswith("/graph"):
profile = path.removeprefix("/profiles/").removesuffix("/graph").strip("/")
graph_format = _first(query, "format") or "json"
return HTTPStatus.OK, profile_graph(profile, root, output_format=graph_format)
return HTTPStatus.NOT_FOUND, {
"ok": False,
"error": {