feat: add cerbos access control
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { route } from "@spec/relay";
|
||||
import { ForbiddenError, NotFoundError, route, UnauthorizedError } from "@spec/relay";
|
||||
import z from "zod";
|
||||
|
||||
import { NameSchema } from "../name.ts";
|
||||
import { AccountSchema } from "./account.ts";
|
||||
import { AccountEmailClaimedError } from "./errors.ts";
|
||||
|
||||
export const create = route
|
||||
@@ -15,6 +16,15 @@ export const create = route
|
||||
.errors([AccountEmailClaimedError])
|
||||
.response(z.uuid());
|
||||
|
||||
export const getById = route
|
||||
.get("/api/v1/accounts/:id")
|
||||
.params({
|
||||
id: z.string(),
|
||||
})
|
||||
.errors([UnauthorizedError, ForbiddenError, NotFoundError])
|
||||
.response(AccountSchema);
|
||||
|
||||
export const routes = {
|
||||
create,
|
||||
getById,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user