Update .gitignore to exclude Python-related files and directories. Enhance AGENTS.md and README.md with clarifications on documentation structure and product identity. Add technical architecture references and local setup instructions. Revise privacy guardrails and product identity documents for consistency. Remove obsolete memory and context documentation. Expand reflection spaces documentation to define context boundaries and lifecycle. Ensure all changes align with the ongoing development of the Kanshō project.
This commit is contained in:
1 parent
3a367b7bcc
commit
d62673e48b
89 files changed
+13463
-241
No files matched your search
@@ -0,0 +1,29 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from fastapi import APIRouter, Depends, HTTPException
|
||||
|
||||
from auth import require_admin_dep, require_auth
|
||||
from db import get_db, row_to_dict
|
||||
from entitlements import EntitlementError, check_feature_access, subscription_for
|
||||
|
||||
router = APIRouter(prefix="/api", tags=["subscription"])
|
||||
|
||||
|
||||
@router.get("/subscription")
|
||||
def get_subscription(session: dict = Depends(require_auth)):
|
||||
return subscription_for(session["profile_id"])
|
||||
|
||||
|
||||
@router.get("/features")
|
||||
def list_features(session: dict = Depends(require_admin_dep)):
|
||||
with get_db() as conn:
|
||||
rows = conn.execute("SELECT * FROM features ORDER BY id").fetchall()
|
||||
return [row_to_dict(row) for row in rows]
|
||||
|
||||
|
||||
@router.get("/features/{feature_id}/access")
|
||||
def feature_access(feature_id: str, session: dict = Depends(require_auth)):
|
||||
try:
|
||||
return check_feature_access(session["profile_id"], feature_id)
|
||||
except EntitlementError as exc:
|
||||
raise HTTPException(status_code=exc.status_code, detail={"code": exc.code, "message": exc.message}) from exc
|
||||
Reference in new issue
Block a user