feat(admin): CRUD produits avec PIN conditionnel et audit #17

Merged
Corentin merged 1 commit from feat/p3-products-crud into dev 2026-06-15 22:35:51 +02:00
Owner

CRUD Produits (P3)

CRUD server-rendered sous /admin/products.

Securite Merise

  • RG-T16 mass-assignment allowlist dans ProductRepository
  • RG-T18 validation serveur bornee (categorie existante, nom <=120, prix > 0 et <= UINT32, TVA dans {55,100}, image <=255, display_order 0..65535)
  • RG-T13 PIN equipier exige UNIQUEMENT si price_cents ou vat_rate change a lupdate, et systematiquement a la suppression ; sinon write simple
  • RG-T14 + RG-T08 audit_log ecrit dans la MEME transaction que la mutation, acteur resolu via email + PIN (is_active = 1)
  • Suppression FK-safe : hard delete si non referencee, sinon PDOException 23000 -> 422

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 (P3) CRUD server-rendered sous `/admin/products`. ### Securite Merise - **RG-T16** mass-assignment allowlist dans ProductRepository - **RG-T18** validation serveur bornee (categorie existante, nom <=120, prix > 0 et <= UINT32, TVA dans {55,100}, image <=255, display_order 0..65535) - **RG-T13** PIN equipier exige UNIQUEMENT si price_cents ou vat_rate change a lupdate, et systematiquement a la suppression ; sinon write simple - **RG-T14 + RG-T08** audit_log ecrit dans la MEME transaction que la mutation, acteur resolu via email + PIN (is_active = 1) - Suppression FK-safe : hard delete si non referencee, sinon PDOException 23000 -> 422 ### 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.
Corentin added 1 commit 2026-06-15 22:32:19 +02:00
feat(admin): CRUD produits avec PIN conditionnel et audit
Some checks failed
CI / php-lint (push) Successful in 25s
CI / secret-scan (pull_request) Successful in 9s
CI / secret-scan (push) Successful in 13s
CI / static-tests (push) Successful in 36s
CI / php-lint (pull_request) Successful in 19s
CI / static-tests (pull_request) Successful in 41s
CI / auto-merge (push) Has been skipped
CI / auto-merge (pull_request) Failing after 5s
49ab77b3a3
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.
Corentin added the
auto-merge
label 2026-06-15 22:32:28 +02:00
Corentin merged commit 2756fb4080 into dev 2026-06-15 22:35:51 +02:00
Corentin deleted branch feat/p3-products-crud 2026-06-15 22:35:51 +02:00
Sign in to join this conversation.
No reviewers
No labels
auto-merge
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: AcadeNice/corentin_wakdo#17
No description provided.