object storage + full permission system + testing

Object storage now works fully, with the permission system. It still
needs additional external endpoints for updating and deleting objects
from the API, but it is otherwise complete. Further tasks include
writing an S3 adapter.
This commit is contained in:
DecDuck
2024-10-09 14:43:06 +11:00
parent de388a937a
commit 435551c207
20 changed files with 376 additions and 63 deletions

View File

@ -1,7 +1,6 @@
import { Client, User } from "@prisma/client";
import { EventHandlerRequest, H3Event } from "h3";
import droplet from "@drop/droplet";
import { useGlobalCertificateAuthority } from "~/server/plugins/ca";
import prisma from "../db/database";
export type EventHandlerFunction<T> = (
@ -31,7 +30,7 @@ export function defineClientEventHandler<T>(handler: EventHandlerFunction<T>) {
if (!clientId || !nonce || !signature)
throw createError({ statusCode: 403 });
const ca = useGlobalCertificateAuthority();
const ca = h3.context.ca;
const certBundle = await ca.fetchClientCertificate(clientId);
if (!certBundle)
throw createError({