Files
Clintchiz 3fa3fce5df feat(authz): add database-backed PermissionStore
Adds dbPermissionStore/ensureAuthzTables/authzMigrationSql, backed by
_wrn_authz_assignment and _wrn_authz_grant tables, plus a ./db subpath
export. Passes the identical 19-test store-conformance suite the memory
adapter passes, including tenant-scope isolation.
2026-08-04 20:22:31 +05:30

12 lines
457 B
TypeScript

import { createDb } from "@wrnexus/db";
import { sqlite } from "@wrnexus/db/sqlite";
import { dbPermissionStore, ensureAuthzTables } from "../src/db.ts";
import { runStoreConformance } from "./store-conformance.ts";
// The db adapter must satisfy exactly the same contract as the memory one.
runStoreConformance("sqlite", async () => {
const db = createDb(sqlite(":memory:"));
await ensureAuthzTables(db, "sqlite");
return dbPermissionStore(db);
});