Template
1
0

feat: add cerbos access control

This commit is contained in:
2025-09-19 03:28:00 +02:00
parent d322138502
commit 74a9426bcc
41 changed files with 999 additions and 821 deletions

View File

@@ -1,11 +1,11 @@
import { InternalServerError, UnauthorizedError } from "@spec/relay";
import { Session } from "../auth/auth.ts";
import { asyncLocalStorage } from "./storage.ts";
import { storage } from "./storage.ts";
export const req = {
get store() {
const store = asyncLocalStorage.getStore();
const store = storage.getStore();
if (store === undefined) {
throw new InternalServerError("AsyncLocalStorage not defined.");
}
@@ -55,7 +55,7 @@ export const req = {
* Typically used when utility functions might run in and out of request scope.
*/
getStore() {
return asyncLocalStorage.getStore();
return storage.getStore();
},
} as const;