fix(security): harden secret redaction follow-ups for PR #1884

Restore PreserveIfRedacted merge on tenant KV PUT so Admin settings saves
no longer overwrite stored secrets with placeholder values. Redact cross-
tenant tenant listings, tighten Viewer MCP/model responses, and align init
config frontend types with credentials metadata.
This commit is contained in:
wizardchen
2026-07-02 14:24:40 +08:00
committed by lyingbug
parent 512d2e5c25
commit 1a264e09c1
16 changed files with 377 additions and 44 deletions
+23 -2
View File
@@ -3,26 +3,42 @@ import i18n from '@/i18n'
const t = (key: string) => i18n.global.t(key)
// GET /initialization/config/:kbId exposes credential presence, not values.
export interface ModelCredentialStatus {
apiKey?: boolean;
}
export interface COSCredentialStatus {
secretId?: boolean;
secretKey?: boolean;
}
// 初始化配置数据类型
export interface InitializationConfig {
llm: {
source: string;
modelName: string;
baseUrl?: string;
/** @deprecated Use credentials.apiKey from GET responses */
apiKey?: string;
credentials?: ModelCredentialStatus;
};
embedding: {
source: string;
modelName: string;
baseUrl?: string;
/** @deprecated Use credentials.apiKey from GET responses */
apiKey?: string;
dimension?: number; // 添加embedding维度字段
credentials?: ModelCredentialStatus;
};
rerank: {
modelName: string;
baseUrl: string;
/** @deprecated Use credentials.apiKey from GET responses */
apiKey?: string;
enabled: boolean;
credentials?: ModelCredentialStatus;
};
multimodal: {
enabled: boolean;
@@ -30,16 +46,21 @@ export interface InitializationConfig {
vlm?: {
modelName: string;
baseUrl: string;
/** @deprecated Use credentials.apiKey from GET responses */
apiKey?: string;
interfaceType?: string; // "ollama" or "openai"
credentials?: ModelCredentialStatus;
};
cos?: {
secretId: string;
secretKey: string;
region: string;
bucketName: string;
appId: string;
pathPrefix?: string;
/** @deprecated Use credentials from GET responses */
secretId?: string;
/** @deprecated Use credentials from GET responses */
secretKey?: string;
credentials?: COSCredentialStatus;
};
minio?: {
bucketName: string;