chore(release): v1.4.38

Robustness sweep, perf hotspots, full localization, coach gate
cascade closure.

- /api/dashboard/summary cold-mount 4.6 s → ~500 ms via DAY-bucket
  sparkline + 60 s response cache.
- Coach API gate inventory test surfaced and closed two orphan
  routes (chat[id] GET+DELETE, chat-message feedback POST).
- Cross-tz fast-path runtime guard falls back to live for users
  more than ±3 h from UTC; proper bucket minting stays v1.5.
- es / fr / it / pl coverage 27 % → 63 % (~3 400 new strings) plus
  three medication-cluster placeholder restorations.
- IANA timezone validation closes the User.timezone self-DoS
  regression the new dashboard SQL would have surfaced.
- Unit suite 4520 → 4524.

See CHANGELOG.md for the full set.
This commit is contained in:
Marc-André Bombeck committed 2026-05-17 19:07:03 +02:00
1 parent fe64f66c7f
commit a550031a84
66 files changed
+7910 -3717

No files matched your search

+12 -1
View File
@@ -1,3 +1,4 @@
import { isIP } from "node:net";
import { NextResponse } from "next/server";
export function apiSuccess<T>(data: T, status = 200) {
@@ -86,8 +87,18 @@ export async function safeJson<T = unknown>(
*
* Returns the resolved IP or null when no trusted source is available.
*/
/**
* v1.4.38 — strict IP validation via Node's built-in `net.isIP`. The
* earlier regex `/^[0-9a-fA-F.:]+$/` matched any structurally-broken
* input the character set accepted (`:::`, `1.2`, `1.2.3`, `gg:hh::`).
* The cf-connecting-ip flow trusts the header under the env flag and
* the trusted-proxy XFF chain forwards the rightmost entry straight
* to the rate-limiter + audit log; a malformed value would land
* downstream unchanged. `isIP` returns 4 / 6 for valid v4 / v6 and 0
* for anything else — invert to a boolean for the helper's surface.
*/
function looksLikeIp(s: string): boolean {
return /^[0-9a-fA-F.:]+$/.test(s) && s.length >= 3 && s.length <= 45;
return isIP(s) !== 0;
}
/**