Hmac.Test
Path:
_archive/loom-stale-pre-sprint-snapshot/tests/hmac.test.tsRelative: loom-stale-pre-sprint-snapshot/tests/hmac.test.tsSubproject: _archiveCategory: archivedLines: 42Bytes: 2,124Imports: 2Exports: 0has tests
Content Preview
- import { describe, expect, test } from "bun:test";
- import { mintApprovalToken, verifyApprovalToken } from "../src/lib/hmac";
- const SECRET = "test-secret-at-least-32-bytes-long!!";
- const SCOPE = { goalId: "goal_a1b2c3d4e5f6", stageId: "stg_a1b2c3d4e5f6" };
- const future = Math.floor(Date.now() / 1000) + 600;
- describe("HMAC approval tokens (H1.5 mint / H3.3 verify)", () => {
- test("round-trip verifies", async () => {
- const t = await mintApprovalToken({ gid: SCOPE.goalId, sid: SCOPE.stageId,