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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user