package serviceverify import ( "context" "errors" "knowledge-governance/internal/platform/weknora" ) // ListProductionKnowledgeBases enumerates the bases a release could be written // into. It asks the operator-managed production endpoint with the production // credential file, so the settings page can offer real bases instead of asking // the operator to paste an id. A missing endpoint or credential is an error the // caller reports honestly rather than a silently empty picker. func (verifier *Verifier) ListProductionKnowledgeBases(ctx context.Context, baseURL string) ([]weknora.KnowledgeBase, error) { resolved := firstNonEmpty(baseURL, verifier.config.ProductionBaseURLFallback) if resolved == "" { return nil, errors.New("production WeKnora endpoint is not configured") } apiKey := verifier.apiKey(verifier.config.ProductionAPIKeyFile) if apiKey == "" { return nil, errors.New("production WeKnora API key file is not available") } client, err := verifier.client(resolved, apiKey, verifier.config.ProductionAllowDockerHTTP) if err != nil { return nil, err } return client.ListKnowledgeBases(ctx) }