🔒 feat: Implement Granular File Storage Strategies and Access Control Middleware

This commit is contained in:
“Praneeth 2025-07-25 16:50:18 +02:00 committed by Danny Avila
parent 74e029e78f
commit ff54cbffd9
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
13 changed files with 269 additions and 210 deletions

View file

@ -62,6 +62,15 @@ export enum SettingsViews {
export const fileSourceSchema = z.nativeEnum(FileSources);
export const fileStrategiesSchema = z
.object({
default: fileSourceSchema.optional(),
avatar: fileSourceSchema.optional(),
image: fileSourceSchema.optional(),
document: fileSourceSchema.optional(),
})
.optional();
// Helper type to extract the shape of the Zod object schema
type SchemaShape<T> = T extends z.ZodObject<infer U> ? U : never;
@ -822,6 +831,7 @@ export const configSchema = z.object({
interface: interfaceSchema,
turnstile: turnstileSchema.optional(),
fileStrategy: fileSourceSchema.default(FileSources.local),
fileStrategies: fileStrategiesSchema,
actions: z
.object({
allowedDomains: z.array(z.string()).optional(),