@tokenoftrust/storefront-runner 2.4.43 → 2.4.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -752,11 +752,6 @@ export async function runRenderChain(input: RenderChainInput): Promise<Response>
752
752
  // store below so cached copies carry them too.
753
753
  applySecurityHeaders(response.headers);
754
754
 
755
- // Preview (test) output must never be indexed.
756
- if (customization.noindex) {
757
- response.headers.set("X-Robots-Tag", "noindex, nofollow");
758
- }
759
-
760
755
  // Strict CSP — now ENFORCED in every environment (Epic S2). The report-only
761
756
  // rollout is complete: platform output is CSP-clean — inline styles are
762
757
  // externalized (`inlineStylesheets: "never"`), Astro's static inline scripts +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tokenoftrust/storefront-runner",
3
- "version": "2.4.43",
3
+ "version": "2.4.44",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "description": "World-shareable storefront runner: multi-tenant renderer on Astro/Cloudflare. No control plane.",
6
6
  "packageManager": "pnpm@11.9.0",
@@ -15,8 +15,6 @@
15
15
  * - **Tokens are tenant-bound.** A token minted for tenant A cannot preview
16
16
  * tenant B (no cross-tenant leakage).
17
17
  * - **Tokens expire.** `exp` is checked against the caller-supplied clock.
18
- * - **Test is never indexable.** The resolution carries `noindex: true` so the
19
- * middleware can set `X-Robots-Tag: noindex`.
20
18
  */
21
19
 
22
20
  /** Claims carried by a preview token. */
@@ -251,8 +249,6 @@ export interface EnvResolutionInput {
251
249
 
252
250
  export interface EnvResolution {
253
251
  env: CustomizationEnv;
254
- /** Set `X-Robots-Tag: noindex` when true (test is never indexable). */
255
- noindex: boolean;
256
252
  /** When set, the middleware should short-circuit with this status. */
257
253
  reject?: { status: number; message: string };
258
254
  }
@@ -277,12 +273,12 @@ export function isPreviewDispatcherPath(pathname: string): boolean {
277
273
 
278
274
  /**
279
275
  * Decide which customization environment to serve. A valid, unexpired,
280
- * tenant-matching `__preview`/`tot_preview` token grants `test` (noindex) on
281
- * ANY host — the token is checked before the host is, so a signed preview
282
- * link keeps working even when opened on the tenant's normal (non-`preview.*`)
283
- * host. Without such a token, production hosts always get `live`; preview
284
- * hosts are auth-gated and reject a missing/invalid/cross-tenant token. The
285
- * one exception is the token-dispenser path itself (see
276
+ * tenant-matching `__preview`/`tot_preview` token grants `test` on ANY host —
277
+ * the token is checked before the host is, so a signed preview link keeps
278
+ * working even when opened on the tenant's normal (non-`preview.*`) host.
279
+ * Without such a token, production hosts always get `live`; preview hosts
280
+ * are auth-gated and reject a missing/invalid/cross-tenant token. The one
281
+ * exception is the token-dispenser path itself (see
286
282
  * {@link isPreviewDispatcherPath}) — it renders the dispatcher's own minimal
287
283
  * page, never tenant content, so it's always `live`/no-token regardless of
288
284
  * host or token, rather than 401ing on the very request that would otherwise
@@ -292,7 +288,7 @@ export async function resolveCustomizationEnv(
292
288
  input: EnvResolutionInput,
293
289
  ): Promise<EnvResolution> {
294
290
  if (isPreviewDispatcherPath(input.pathname ?? "")) {
295
- return { env: "live", noindex: false };
291
+ return { env: "live" };
296
292
  }
297
293
 
298
294
  const tokenResult =
@@ -300,36 +296,32 @@ export async function resolveCustomizationEnv(
300
296
  ? await verifyPreviewToken(input.secret, input.token, input.nowSeconds)
301
297
  : null;
302
298
  if (tokenResult?.ok && tokenResult.claims.tenantId === input.tenantId) {
303
- return { env: "test", noindex: true };
299
+ return { env: "test" };
304
300
  }
305
301
 
306
302
  if (!input.isPreviewHost) {
307
- return { env: "live", noindex: false };
303
+ return { env: "live" };
308
304
  }
309
305
  if (!input.secret) {
310
306
  return {
311
307
  env: "live",
312
- noindex: true,
313
308
  reject: { status: 503, message: "Preview is not configured." },
314
309
  };
315
310
  }
316
311
  if (!input.token) {
317
312
  return {
318
313
  env: "live",
319
- noindex: true,
320
314
  reject: { status: 401, message: "Preview token required." },
321
315
  };
322
316
  }
323
317
  if (!tokenResult!.ok) {
324
318
  return {
325
319
  env: "live",
326
- noindex: true,
327
320
  reject: { status: 401, message: `Invalid preview token (${tokenResult!.reason}).` },
328
321
  };
329
322
  }
330
323
  return {
331
324
  env: "live",
332
- noindex: true,
333
325
  reject: { status: 403, message: "Preview token is for a different tenant." },
334
326
  };
335
327
  }