feat: add STORAGE_ALLOW_LIST env var

This commit is contained in:
Windfarer
2026-04-29 18:58:09 +08:00
parent 2beb64c429
commit 6601a483be
9 changed files with 198 additions and 33 deletions
+4
View File
@@ -328,6 +328,10 @@ func (h *InitializationHandler) UpdateKBConfig(c *gin.Context) {
if provider == "" {
provider = "local"
}
if !isStorageProviderAllowed(provider) {
c.Error(errors.NewBadRequestError("Storage provider is not allowed by STORAGE_ALLOW_LIST"))
return
}
oldProvider := kb.GetStorageProvider()
if oldProvider == "" {
oldProvider = "local"