You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix two preview-route cache bugs and remove long-stale debug endpoints.
6
+
7
+
**Affects:** Client app developers, Operators
8
+
9
+
**Client app developers:**
10
+
11
+
- Preview-route fetch failures no longer poison the shared client-metadata cache. Previously, a failed preview fetch for a `client_id` with a valid 10-minute entry would overwrite that entry with a 60-second branding-less fallback, silently dropping `branding.css` on real OAuth flows for up to a minute. The in-memory cache is now only written by real-flow resolution.
12
+
- The auth-service HTML preview pages (`/preview/login`, `/preview/login-otp`, `/preview/choose-handle`, `/preview/choose-handle-picker`, `/preview/recovery`, `/preview/recovery-otp`, and the `/preview` index) now send `Cache-Control: no-store`. Without it, a browser refresh could serve a cached page and never ask the server for fresh `branding.css`, breaking the advertised "edit `branding.css`, refresh the preview page" workflow.
13
+
-`/preview/validate` now flags `branding.css` whose escaped size exceeds the 32 KB injection limit as an error, instead of reporting `ok` and letting the developer discover later that their CSS was silently dropped on real OAuth flows. Byte counts now match `getClientCss()`'s measurement (escaped UTF-8).
14
+
15
+
**Operators:**
16
+
17
+
- Removed `/_internal/debug-grants` and `/_internal/debug-recent-accounts`. These were added as temporary HYPER-270 debugging endpoints with a code comment marking them for removal before PR #21 shipped (v0.2.2); they survived through v0.2.2, v0.3.0, v0.4.0, and the pending v0.5.0. The matching env var `EPDS_DEBUG_GRANTS` is no longer read.
// Mirror getClientCss's size check: it measures the escaped form
340
+
// (each `</style>` → `\u003c/style>`, +5 bytes) against
341
+
// MAX_CSS_BYTES and silently returns null when it's over.
342
+
// Reporting the raw byte count here would tell devs their CSS is
343
+
// fine up to 32 KB raw when in fact it gets dropped on real flows.
344
+
constescaped=escapeCss(cssString)
345
+
constbytes=Buffer.byteLength(escaped,'utf8')
346
+
if(bytes>MAX_CSS_BYTES){
347
+
return{
348
+
id: 'branding-css',
349
+
label,
350
+
severity: 'error',
351
+
detail: `${bytes.toLocaleString()} bytes (escaped) exceeds the ${MAX_CSS_BYTES.toLocaleString()}-byte limit. getClientCss() will silently drop it on real OAuth flows.`,
352
+
labelHtml,
353
+
detailHtml: `${bytes.toLocaleString()} bytes (escaped) exceeds the ${MAX_CSS_BYTES.toLocaleString()}-byte limit. ${code('getClientCss()')} will silently drop it on real OAuth flows.`,
354
+
}
355
+
}
336
356
return{
337
357
id: 'branding-css',
338
358
label,
339
359
severity: 'ok',
340
-
detail: `${bytes.toLocaleString()} bytes. Injected into /preview/consent (pds-core) and the auth-service pages when the client is trusted.`,
360
+
detail: `${bytes.toLocaleString()} bytes (escaped). Injected into /preview/consent (pds-core) and the auth-service pages when the client is trusted.`,
341
361
labelHtml,
342
-
detailHtml: `${bytes.toLocaleString()} bytes. Injected into ${code('/preview/consent')} (pds-core) and the auth-service pages when the client is trusted.`,
362
+
detailHtml: `${bytes.toLocaleString()} bytes (escaped). Injected into ${code('/preview/consent')} (pds-core) and the auth-service pages when the client is trusted.`,
0 commit comments