fix(GRO-2299): redact googleMapsApiKey from PATCH /api/admin/settings response
The PATCH handler returned the full businessSettings row via .returning(), echoing the encrypted googleMapsApiKey ciphertext back to the caller. Wrap the return in the existing redactSettings() helper (after a !updated guard) so redaction is applied symmetrically with the GET projection (GRO-2294). - src/routes/settings.ts: guard + redactSettings(updated) on PATCH return - src/__tests__/settings.test.ts: assert PATCH omits googleMapsApiKey (existing-row and auto-create-then-update branches) - UAT_PLAYBOOK.md §13 TC-API-13.2: assert PATCH response omits the secret Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
+1
-1
@@ -333,7 +333,7 @@ This means:
|
||||
| # | Scenario | Steps | Expected |
|
||||
|---|----------|-------|----------|
|
||||
| TC-API-13.1 | Get business settings | GET /api/admin/settings | 200 OK, business settings returned. Response body **must NOT include `googleMapsApiKey`** — the encrypted secret is redacted from the projection (GRO-2294, defense-in-depth); non-secret fields (`businessName`, colors, `routeOptimizationProvider`, etc.) are still present |
|
||||
| TC-API-13.2 | Update business settings | PATCH /api/admin/settings with updated values | 200 OK, settings updated |
|
||||
| TC-API-13.2 | Update business settings | PATCH /api/admin/settings with updated values | 200 OK, settings updated. Response body **must NOT include `googleMapsApiKey`** — the encrypted secret is redacted from the PATCH response symmetrically with the GET projection (GRO-2299, defense-in-depth); non-secret updated fields are still returned |
|
||||
| TC-API-13.3 | Upload logo | POST /api/admin/settings/logo/upload with file | 200 OK, logo uploaded and stored |
|
||||
| TC-API-13.4 | View logo | GET /api/admin/settings/logo | 200 OK, logo image returned |
|
||||
| TC-API-13.5 | Delete logo | DELETE /api/admin/settings/logo | 200 OK, logo removed |
|
||||
|
||||
Reference in New Issue
Block a user