Update hivegrid-cloud reference to latest main

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
davidandClaude Fable 5 committed 2026-07-08 16:15:37 +02:00
1 parent e98d38e716
commit 7b21524c86
3781 files changed
+373484 -225607

No files matched your search

@@ -8,12 +8,11 @@ const testWebConfig = {
appBaseDomain: "localhost",
protocol: "http" as const,
},
stripe: { secretKey: "sk_test_root_data" },
crisp: { chatWebsiteId: undefined },
};
vi.doMock("@toolctrl/config", async () => {
const actual = await vi.importActual<typeof import("@toolctrl/config")>("@toolctrl/config");
vi.doMock("@hivegrid/config", async () => {
const actual = await vi.importActual<typeof import("@hivegrid/config")>("@hivegrid/config");
return {
...actual,
loadRequiredWebConfig: () => testWebConfig,
@@ -29,7 +28,7 @@ vi.mock("./db/users.db.server", () => ({
getUser: vi.fn(),
}));
vi.mock("@toolctrl/db/auth-boundary.server", () => ({
vi.mock("@hivegrid/db/auth-boundary.server", () => ({
getAuthUserWithoutPasswordById: vi.fn(),
getTenantById: vi.fn(),
}));
@@ -86,7 +85,7 @@ const {
storage,
validateImpersonationSessionState,
} = await import("./session.server");
const { getAuthUserWithoutPasswordById } = await import("@toolctrl/db/auth-boundary.server");
const { getAuthUserWithoutPasswordById } = await import("@hivegrid/db/auth-boundary.server");
const { loadRootData } = await import("./data/.server/rootData");
const now = new Date("2026-01-01T12:00:00.000Z");
@@ -156,6 +155,18 @@ describe("impersonation session TTL", () => {
).toMatchObject({ valid: false, reason: "stale_started_at" });
});
it("caps the impersonation window at 30 minutes (AK-P19 DoD #4)", () => {
expect(IMPERSONATION_SESSION_TTL_MS).toBe(30 * 60 * 1000);
// 29 minutes in: still valid; 31 minutes in: stale.
const at = (minutes: number) =>
validateImpersonationSessionState(
{ impersonatingFromUserId: "admin-1", impersonatingStartedAt: new Date(now.getTime() - minutes * 60 * 1000).toISOString() },
{ now }
);
expect(at(29)).toMatchObject({ valid: true });
expect(at(31)).toMatchObject({ valid: false, reason: "stale_started_at" });
});
it("rejects wrong actor state", () => {
expect(
validateImpersonationSessionState(
@@ -228,7 +239,7 @@ describe("impersonation session TTL", () => {
);
const cookie = response.headers.get("Set-Cookie") ?? "";
expect(cookie).toContain("RJ_session=");
expect(cookie).toContain("hivegrid_session=");
expect(cookie).not.toContain("csrf-secret-token");
expect(cookie).not.toContain("password");
expect(cookie).not.toContain("totp");