(if blocked { "Primary: receives security notices. Make another address primary to remove it." diff --git a/infra/README.md b/infra/README.md index 5592e04be..849e7ffd3 100644 --- a/infra/README.md +++ b/infra/README.md @@ -181,13 +181,15 @@ the gateway ranges in `PIQUELD_INGRESS_PROXIES` to trust ingress's overwritten Auth decides every response's `Cache-Control` itself; the edge needs no rule. Handlers mark a response cacheable with `Cached` (`apps/auth-service/src/security`), and anything else, including any error and any response that sets a cookie, is -`no-store`: +`no-store`. Every value also carries `no-transform`, so Cloudflare never rewrites +a body: its Email Address Obfuscation would replace addresses with a link to a +decoding script the pages' Content-Security-Policy blocks. | Class | `Cache-Control` | Responses | | --- | --- | --- | -| `NoStore` | `no-store` | APIs, OAuth, server-rendered pages, errors, everything not below | -| `Immutable` | `public, max-age=31536000, immutable` | the pages' content-hashed stylesheet and script, under `/assets/` | -| `Public` | `public, max-age=N` | discovery and JWKS, for an hour | +| `NoStore` | `no-store, no-transform` | APIs, OAuth, server-rendered pages, errors, everything not below | +| `Immutable` | `public, max-age=31536000, immutable, no-transform` | the pages' content-hashed stylesheet and script, under `/assets/` | +| `Public` | `public, max-age=N, no-transform` | discovery and JWKS, for an hour | Every page is server-rendered and `no-store`, so a deploy never leaves a cached page pointing at a stylesheet or script the new binary no longer serves. The Cloudflare Tunnel diff --git a/tests/browser/developers.spec.ts b/tests/browser/developers.spec.ts index 10e87f2c0..213af5a8c 100644 --- a/tests/browser/developers.spec.ts +++ b/tests/browser/developers.spec.ts @@ -53,7 +53,7 @@ test('the developer console registers an app, shows its secret once, and the app await page.getByRole('button', { name: 'Register app', exact: true }).click(); const answer = await registered; expect(answer.status()).toBe(200); - expect(answer.headers()['cache-control']).toBe('no-store'); + expect(answer.headers()['cache-control']).toBe('no-store, no-transform'); await expect(page.getByRole('heading', { name: 'Your client secret' })).toBeVisible(); const secret = (await page.locator('#client-secret').textContent()) ?? ''; expect(secret).toMatch(/^pqcs_/);