refactor(backend): remove the v1 auth and permission leftovers no frontend uses

Platform-v2 step 2.99a. After 2.6 no frontend calls these any more:
- POST /api/auth/login needs `client` (manager/waiter/terminal); the no-`client`
  path with v1 rules and the `legacy_manager` single-session exception are gone.
- GET /api/setup/security-config (bootstrap's `login` replaced it in 2.6b).
- POST /api/recovery/use (a recovery code works in the normal login's
  password field).
- PUT /api/waiters/{id}/permission and /reset-permissions (the permission editor
  saves keys with PUT /{id}/permissions); staff create/update ignore perm_* fields.
- The v1 perm_* projection: core/access/legacy.py deleted, UserOut carries only
  `permissions` (no app reads the 13 booleans, waiter included).
e2e manager login sends client "manager"; smoke_routes too. Backend 281 passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-14 12:08:01 +02:00
co-authored by Claude Opus 5.5
parent eb22997f8e
commit 7cbd0325a4
17 changed files with 57 additions and 249 deletions
-19
View File
@@ -34,25 +34,6 @@ class SetupInitResponse(BaseModel):
ok: bool
class SecurityConfigResponse(BaseModel):
login_method: str
autofill_username: bool
@router.get("/security-config", response_model=SecurityConfigResponse, dependencies=[Depends(public())])
def security_config(db: Session = Depends(get_db)):
"""Public endpoint — returns only the security settings needed by the login page."""
from models.settings import PosSettings
rows = {r.key: r.value for r in db.query(PosSettings).filter(
PosSettings.key.in_(["auth.manager_login_mode", "security.autofill_username"])
).all()}
# `login_method` is what the current manager login page reads; "none" no longer exists (D-8)
return SecurityConfigResponse(
login_method=rows.get("auth.manager_login_mode", "password"),
autofill_username=rows.get("security.autofill_username", "true") == "true",
)
@router.get("/status", response_model=SetupStatusResponse, dependencies=[Depends(public())])
def setup_status(db: Session = Depends(get_db)):
has_manager = db.query(User).filter(