Optimize terminal startup and deployment smoke checks
This commit is contained in:
@@ -149,10 +149,16 @@ export function runTests() {
|
||||
"/api/auth/me must verify bearer tokens directly and return a degraded authenticated profile when the backend auth profile is transiently unavailable",
|
||||
);
|
||||
assert(
|
||||
authMeRouteSource.indexOf("const bearerIdentity = await getVerifiedBearerIdentity(req)") <
|
||||
authMeRouteSource.indexOf("return buildProxyExceptionResponse(error"),
|
||||
authMeRouteSource.includes("const identity = await getBearerIdentityOnce();") &&
|
||||
!authMeRouteSource.includes("return buildProxyExceptionResponse(error"),
|
||||
"/api/auth/me must try bearer identity fallback before returning a proxy exception",
|
||||
);
|
||||
assert(
|
||||
authMeRouteSource.includes("exception_snapshot") &&
|
||||
authMeRouteSource.includes("unauthenticatedAuthProfileResponse") &&
|
||||
!authMeRouteSource.includes("return buildProxyExceptionResponse(error"),
|
||||
"/api/auth/me must serve a snapshot or anonymous auth profile before surfacing proxy exceptions to long-lived clients",
|
||||
);
|
||||
for (const route of [
|
||||
"app/api/ops/analytics/funnel/route.ts",
|
||||
"app/api/ops/config/route.ts",
|
||||
|
||||
@@ -372,4 +372,11 @@ export function runTests() {
|
||||
.length >= 3,
|
||||
"manual payment mutations must require a valid Supabase bearer token instead of forwarding unauthenticated requests that surface raw backend JSON",
|
||||
);
|
||||
assert(
|
||||
paymentFlowSource.includes("verifyPaymentAuthReady") &&
|
||||
paymentFlowSource.indexOf("await verifyPaymentAuthReady()") <
|
||||
paymentFlowSource.indexOf("resolvePaymentProvider(") &&
|
||||
paymentFlowSource.includes("auth_confirmed_at"),
|
||||
"wallet checkout must confirm a fresh Supabase bearer before opening wallet prompts or creating payment intents",
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user