feat(admin): CRUD produits avec PIN conditionnel et audit #17
No reviewers
Labels
No labels
auto-merge
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: AcadeNice/corentin_wakdo#17
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/p3-products-crud"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
CRUD Produits (P3)
CRUD server-rendered sous
/admin/products.Securite Merise
Finding HIGH (revue) — mitigation
Le PIN daction sensible na pas de throttle. Mitigation shippee : chaque echec PIN ecrit un audit_log
pin.failed(detectable). Le throttle PIN degressif complet (table pin_throttle dediee, par user + IP) est un chunk dedie a venir, avant Menus/Stock.Tests
172 verts (452 assertions), PHPStan L6 clean.
CRUD produits server-rendered sous /admin/products (index/create/edit/delete). - ProductRepository sur DatabaseInterface : all/find/create/update/delete + categoryExists, allowlist mass-assignment (RG-T16). - ProductController : validation serveur bornee (RG-T18) — categorie existante, nom <=120, prix > 0 et <= UINT32, TVA dans {55,100}, image <=255, display_order 0..65535. - PIN equipier (RG-T13) exige UNIQUEMENT si price_cents ou vat_rate change a l'update, et systematiquement a la suppression ; sinon write simple sans PIN. - audit_log (RG-T14) ecrit dans la meme transaction (RG-T08) que la mutation, acteur resolu via PinVerifier::resolveActingUser (email + PIN, is_active = 1). - Suppression FK-safe : hard delete seulement si non referencee, sinon PDOException 23000 -> 422. - Mitigation brute-force PIN : chaque echec ecrit un audit_log pin.failed (detectable). Le throttle PIN degressif complet est un chunk dedie a venir. Tests : 172 verts (452 assertions), PHPStan L6 clean.