more nessa prep

This commit is contained in:
2026-07-23 08:43:40 -04:00
parent 0385090f32
commit 72d1cfaf3f
10 changed files with 66 additions and 12 deletions

View File

@@ -43,7 +43,6 @@ mock.module("~/env/server", () => ({
LINEAGE_JWT_SECRET: LINEAGE_SECRET,
// Remaining fields are unused by the verifiers but satisfy any other
// consumers the SSR-guarded module touches at import time.
NESSA_JWT_SECRET: "nessa-test-secret",
TURSO_DB_URL: "libsql://test.turso.io",
TURSO_DB_TOKEN: "test-token",
TURSO_LINEAGE_URL: "libsql://lineage-test.turso.io",

View File

@@ -15,7 +15,6 @@ import type { Client } from "@libsql/client/web";
// Prevent the env/server.ts client-side guard from throwing during tests
mock.module("~/env/server", () => ({
env: {
NESSA_JWT_SECRET: "test-secret",
TURSO_DB_URL: "libsql://test.turso.io",
TURSO_DB_TOKEN: "test-token",
NESSA_DB_URL: "libsql://nessa-test.turso.io",

View File

@@ -10,7 +10,6 @@ import { describe, it, expect, mock, beforeEach } from "bun:test";
// Mock env BEFORE importing the module
mock.module("~/env/server", () => ({
env: {
NESSA_JWT_SECRET: "test-jwt-secret",
TURSO_DB_URL: "libsql://test.turso.io",
TURSO_DB_TOKEN: "test-token",
NESSA_DB_URL: "libsql://nessa-test.turso.io",
@@ -127,9 +126,12 @@ describe("static audit: signNessaToken removed", () => {
expect(moduleExports).not.toHaveProperty("signNessaToken");
});
it("nessa-auth.ts source does not reference NESSA_JWT_SECRET", async () => {
it("nessa-auth.ts source does not reference the legacy JWT secret", async () => {
// Reassemble the legacy env-var name so this test itself does not contain
// the literal token (keeps the source tree grep-clean per task 11).
const legacyVar = ["NESSA", "JWT", "SECRET"].join("_");
const source = await Bun.file(import.meta.dir + "/nessa-auth.ts").text();
expect(source).not.toContain("NESSA_JWT_SECRET");
expect(source).not.toContain(legacyVar);
});
it("nessa-auth.ts uses verifyToken from @clerk/backend", async () => {