mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-20 02:10:15 +01:00
🔒 feat: Implement Granular File Storage Strategies and Access Control Middleware
This commit is contained in:
parent
74e029e78f
commit
ff54cbffd9
13 changed files with 269 additions and 210 deletions
|
|
@ -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(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue