mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-09 20:12:10 +10:00
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:
@ -15,4 +15,13 @@ export default defineNitroPlugin(async (nitro) => {
|
||||
const store = fsCertificateStore(basePath);
|
||||
|
||||
ca = await CertificateAuthority.new(store);
|
||||
|
||||
nitro.hooks.hook("request", (h3) => {
|
||||
if (!ca)
|
||||
throw createError({
|
||||
statusCode: 500,
|
||||
statusMessage: "Certificate authority not initialised",
|
||||
});
|
||||
h3.context.ca = ca;
|
||||
});
|
||||
});
|
||||
|
||||
11
server/plugins/objects.ts
Normal file
11
server/plugins/objects.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { FsObjectBackend } from "../internal/objects/fsBackend";
|
||||
|
||||
export default defineNitroPlugin((nitro) => {
|
||||
const currentObjectHandler = new FsObjectBackend();
|
||||
|
||||
// To-do insert logic surrounding deciding what object backend to use
|
||||
|
||||
nitro.hooks.hook("request", (h3) => {
|
||||
h3.context.objects = currentObjectHandler;
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user