fix(kb): 不再按控制台传输形态拦截 API Key

- 删除 KBBindingSnapshot 的 secret_entry_allowed 能力位与服务端 catalog/save 的 KB 传输门禁
- 非 HTTPS 控制台保留明文传输提示,但不再阻断 Key 录入
- 保留 QA AI 严格 HTTPS/回环校验、管理员认证、写意图头与 Key 不回显
- 补齐明文 HTTP 页面与服务端写入回归测试,同步运行手册和 CHANGELOG
This commit is contained in:
Zhero & Miku
2026-11-25 10:47:53 +08:00
committed by 姚章浩
parent 7926c8e8b9
commit 32c7074f41
14 changed files with 131 additions and 322 deletions
+3 -10
View File
@@ -45,7 +45,7 @@ describe('knowledgeBaseBindings', () => {
expect(parsed.test.base_url).toBe('https://test.example')
expect(parsed.production.internal_kb_name).toBe('内部资料')
expect(parsed.storage_ready).toBe(true)
expect(parsed.secret_entry_allowed).toBe(true)
expect((parsed as unknown as Record<string, unknown>).secret_entry_allowed).toBeUndefined()
const asRecord = parsed.test as unknown as Record<string, unknown>
expect(asRecord.api_key).toBeUndefined()
expect(asRecord.key_ciphertext).toBeUndefined()
@@ -55,14 +55,7 @@ describe('knowledgeBaseBindings', () => {
expect(() => parseKBBindingSnapshot({ data: { environments: [binding('test')], storage_ready: true } })).toThrow()
})
it('leaves the capability absent when an older API does not report it', () => {
const parsed = parseKBBindingSnapshot({
data: { environments: [binding('test'), binding('production')], storage_ready: true },
})
expect(parsed.secret_entry_allowed).toBeUndefined()
})
it('keeps an explicit refusal distinguishable from a missing field', () => {
it('ignores the removed legacy transport capability', () => {
const parsed = parseKBBindingSnapshot({
data: {
environments: [binding('test'), binding('production')],
@@ -70,7 +63,7 @@ describe('knowledgeBaseBindings', () => {
secret_entry_allowed: false,
},
})
expect(parsed.secret_entry_allowed).toBe(false)
expect((parsed as unknown as Record<string, unknown>).secret_entry_allowed).toBeUndefined()
})
it('shows a short id next to the name so same-name bases are distinguishable', () => {