139ec1e6b8
Extract storage allowlist into internal/storageallowlist so KB creation uses FirstAllowed when tenant default_provider is empty or disallowed. Share pickUsableStorageProvider via editorResources for consistent UI selection, and add regression tests for OBS status and allow-list defaults.
20 lines
448 B
Go
20 lines
448 B
Go
package handler
|
|
|
|
import "github.com/Tencent/WeKnora/internal/storageallowlist"
|
|
|
|
func getSupportedStorageProviders() []string {
|
|
return storageallowlist.Supported()
|
|
}
|
|
|
|
func getAllowedStorageProviders() map[string]bool {
|
|
return storageallowlist.AllowedMap()
|
|
}
|
|
|
|
func isStorageProviderAllowed(provider string) bool {
|
|
return storageallowlist.IsAllowed(provider)
|
|
}
|
|
|
|
func firstAllowedStorageProvider() string {
|
|
return storageallowlist.FirstAllowed()
|
|
}
|