@tokenoftrust/storefront-runner 7.11.5 → 7.11.7
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.
|
@@ -583,7 +583,7 @@ export function evaluateLoginGate(input: LoginGateInput): LoginGateDecision {
|
|
|
583
583
|
if (input.mode !== "login") return { action: "pass" };
|
|
584
584
|
if (!hostInGateList(input.host, input.gatedHosts)) return { action: "pass" };
|
|
585
585
|
if (input.tenantExempt) return { action: "pass" };
|
|
586
|
-
if (isAuthPath(input.pathname)) return { action: "pass" };
|
|
586
|
+
if (isAuthPath(input.renderPath ?? input.pathname)) return { action: "pass" };
|
|
587
587
|
if (isPublicPath(input.pathname)) return { action: "pass" };
|
|
588
588
|
if (isCapturedAssetPoolPath(input.pathname, input.method)) return { action: "pass" };
|
|
589
589
|
// Candidate-preview control-plane routes govern their OWN (stricter, honest) auth
|
|
@@ -141,7 +141,7 @@ async function serveControlPlaneInScope(input: ControlPlaneInput): Promise<Respo
|
|
|
141
141
|
// viewer iff they hold a MEMBERSHIP for the host's tenant. One session model for
|
|
142
142
|
// the console + the preview gate. Deny-closed: no session / no membership → gate.
|
|
143
143
|
let viewerRecord = null;
|
|
144
|
-
if (!isAuthPath(
|
|
144
|
+
if (!isAuthPath(renderPath)) {
|
|
145
145
|
const sessionKv = await readKv("SESSION");
|
|
146
146
|
const sid = context.cookies.get(SESSION_COOKIE)?.value ?? null;
|
|
147
147
|
if (sessionKv) {
|
|
@@ -621,7 +621,7 @@ export async function runRenderChain(input: RenderChainInput): Promise<Response>
|
|
|
621
621
|
!candidatePin &&
|
|
622
622
|
!draftCookie &&
|
|
623
623
|
!isInternalPublication &&
|
|
624
|
-
isCacheablePath(
|
|
624
|
+
isCacheablePath(renderPath);
|
|
625
625
|
let pageKey: Request | null = null;
|
|
626
626
|
if (pageCacheEligible && cache && kv) {
|
|
627
627
|
const version = await timed(timing, "page-cache", () => readCacheVersion(kv, tenant.tenant_id));
|
|
@@ -135,7 +135,7 @@ function readSnapshot(value: unknown): FinalCartWire | null {
|
|
|
135
135
|
typeof v.tenantId !== "string" || !["preview", "publication"].includes(String(v.stage)) || typeof v.currency !== "string" || !/^[A-Z]{3}$/.test(v.currency) ||
|
|
136
136
|
!Array.isArray(v.lines) || v.lines.length < 1 || v.lines.length > 50) return null;
|
|
137
137
|
if (v.lines.some(line => !line || typeof line !== "object" || skuFromToken(line.sku) === null ||
|
|
138
|
-
!Number.isSafeInteger(line.quantity) || line.quantity < 1 || line.quantity >
|
|
138
|
+
!Number.isSafeInteger(line.quantity) || line.quantity < 1 || line.quantity > 10_000 || !Number.isSafeInteger(line.unitMinor) || line.unitMinor < 0 ||
|
|
139
139
|
Object.keys(line).some(k => !["sku", "quantity", "unitMinor"].includes(k)))) return null;
|
|
140
140
|
const t = v.totals as Record<string, unknown> | undefined;
|
|
141
141
|
const totalKeys = ["subtotalMinor", "shippingMinor", "taxMinor", "totalMinor"];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenoftrust/storefront-runner",
|
|
3
|
-
"version": "7.11.
|
|
3
|
+
"version": "7.11.7",
|
|
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",
|