feat(backend): link cards to users; charger-qualified gun restrictions; config-driven gun labels
- Allowlist entries take "user": <username> — sessions started with that card attribute to the person, and the owner sees their card's history even without gun-wide permissions (ownership looked up live) - "guns": ["eu092025:2"] (fnmatch) replaces the charger-blind "connectors": [2] restriction — safe with multiple chargers - New "chargers" config section provides per-charger/per-gun display names; the panel no longer hardcodes the Anfu gun labels - Panel admin tab: owner dropdown + guns field on card entries - Smoke test: 42 checks, incl. retroactive history visibility after linking a card and rejection of links to unknown users
This commit is contained in:
@@ -71,3 +71,7 @@ Owner requirement: per-user permissions (gun 1 vs gun 2 of eu092025, per-relay o
|
||||
## [2026-07-11] meta | Consumption tracking (SQLite) + the PWA control panel
|
||||
|
||||
Owner requirement: button-push start when a gun is ready (and permitted) + "who charged when and how many kWh". Built store.py (sessions.db: sessions with resolved who/started/ended/Wh + per-minute samples energy/power/SoC; tx ids survive restarts; stop falls back to store after restart), /api/sessions with visibility rules (own + in-scope guns; admin all), and the phase-3 web panel in backend/static/ (vanilla JS PWA at /: login, gun cards with scope- and readiness-gated Start/Stop, relay toggles, history tab, admin tab with allowlist/users/mode). Fixed a sqlite connection leak (with-connect commits but never closes). Smoke test 28 -> 37 checks, all passing. Updated [[backend]], [[architecture-plan]] (phases 1-3 all done), [[overview]], [[index]].
|
||||
|
||||
## [2026-07-11] meta | Cards linked to users; multi-charger gaps closed
|
||||
|
||||
Owner requirements: cards must belong to a person (not float around as "RFID card A (tapped first...)"), and adding a second charger must be clean. Allowlist entries now take "user" (sessions attribute to the person; owner sees their card's history) and charger-qualified "guns": ["eu092025:2"] (fnmatch; replaces the charger-blind "connectors" field). Gun display names moved from hardcoded panel JS to a "chargers" config section served via /api/status. Adding a charger = point it at the same URL with a unique ChargerID + grant charger:<id>:<gun> scopes. Panel admin tab: owner dropdown + guns field. Smoke test 37 -> 42 checks. Updated [[authorization]], [[backend]].
|
||||
|
||||
Reference in New Issue
Block a user