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:
@@ -4,7 +4,7 @@ from conftest import TEST_PASSWORD
|
||||
|
||||
def test_manager_logs_in_and_reads_me(client, make_user):
|
||||
m = make_user(role="store_manager")
|
||||
r = client.post("/api/auth/login", json={"username": m.username, "password": TEST_PASSWORD})
|
||||
r = client.post("/api/auth/login", json={"client": "manager", "username": m.username, "password": TEST_PASSWORD})
|
||||
assert r.status_code == 200, r.text
|
||||
token = r.json()["access_token"]
|
||||
me = client.get("/api/auth/me", headers={"Authorization": f"Bearer {token}"})
|
||||
@@ -14,7 +14,7 @@ def test_manager_logs_in_and_reads_me(client, make_user):
|
||||
|
||||
def test_wrong_password_is_rejected(client, make_user):
|
||||
m = make_user(role="store_manager")
|
||||
r = client.post("/api/auth/login", json={"username": m.username, "password": "nope"})
|
||||
r = client.post("/api/auth/login", json={"client": "manager", "username": m.username, "password": "nope"})
|
||||
assert r.status_code == 401
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user