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
+4 -1
View File
@@ -44,7 +44,7 @@ async function devicePicksUpToken(req) {
return (await res.json()).device_token
}
const asDevice = (token, url) => fetch(`${backend.url}${url}`, { headers: { 'X-Xenia-Device': token } })
const loginApi = (username, secret) => api('POST', '/api/auth/login', { body: { username, ...secret } }).then(d => d.access_token)
const loginApi = (username, secret) => api('POST', '/api/auth/login', { body: { client: 'manager', username, ...secret } }).then(d => d.access_token)
async function uiLogin(page, password) {
await page.goto(`${APP}/login`)
@@ -409,7 +409,10 @@ try {
// a staff manager can't give what they don't have (disabled), and the backend's refusal is explained
const sm = await api('POST', '/api/waiters/', { token: boss, body: { username: 'e2e_staffmgr', full_name: 'Stella Staff', pin: '5151', role: 'staff_manager', is_active: true } })
// new staff have only a PIN: sign them in while managers use PINs, then back to passwords
await api('PUT', '/api/settings/auth.manager_login_mode', { token: boss, body: { value: 'pin' } })
const smToken = await loginApi('e2e_staffmgr', { pin: '5151' })
await api('PUT', '/api/settings/auth.manager_login_mode', { token: boss, body: { value: 'password' } })
const s2 = await (await browser.newContext({ viewport: { width: 1400, height: 900 } })).newPage()
s2.on('pageerror', e => errors.push(e.message))
await s2.goto(`${APP}/login`)