13 lines
578 B
TypeScript
13 lines
578 B
TypeScript
import { getAuthzCatalog } from "./client.ts";
|
|
import { setDefaultAuthzRoleStore } from "./defaults.ts";
|
|
import { authzMiddleware } from "./middleware.ts";
|
|
import { memoryPermissionStore } from "./store.ts";
|
|
|
|
/** Process-local authorization storage for development and stateless tests. */
|
|
const store = memoryPermissionStore();
|
|
setDefaultAuthzRoleStore(store);
|
|
export default function frameworkMemoryAuthz(ctx: Context, next: Next) {
|
|
return authzMiddleware({ catalog: getAuthzCatalog(), store, strict: true })(ctx, next);
|
|
}
|
|
import type { Context, Next } from "@wrnexus/core";
|