🐛 fix(proxy): 避免全局代理影响数据库连接

移除数据库和 Redis 连接对全局代理的隐式继承

保留连接自身代理与 HTTP 隧道配置并修正缓存释放链路

同步六种语言的代理作用域说明并增加回归测试

Fixes #347
This commit is contained in:
Syngnat
2026-07-18 16:43:39 +08:00
parent aeecffb517
commit 0136b87311
16 changed files with 147 additions and 75 deletions

View File

@@ -0,0 +1,41 @@
import { describe, expect, it } from 'vitest';
import { catalogs } from './catalog';
const expectedDatabaseBoundaries = {
'de-DE': {
description: 'Datenbankverbindungen verwenden nur ihre eigenen Proxy-Einstellungen',
scope: 'Datenbankverbindungen sind nicht betroffen',
},
'en-US': {
description: 'Database connections only use their own proxy settings',
scope: 'does not affect database connections',
},
'ja-JP': {
description: 'データベース接続では接続ごとのプロキシ設定のみを使用します',
scope: 'データベース接続には影響しません',
},
'ru-RU': {
description: 'Подключения к базе данных используют только собственные настройки прокси',
scope: 'не влияет на подключения к базе данных',
},
'zh-CN': {
description: '数据库连接仅使用连接自身的代理配置',
scope: '不影响数据库连接',
},
'zh-TW': {
description: '資料庫連線僅使用連線本身的代理設定',
scope: '不影響資料庫連線',
},
} as const;
describe('global proxy scope copy', () => {
it('makes the database proxy boundary explicit in every locale', () => {
for (const [language, expected] of Object.entries(expectedDatabaseBoundaries)) {
const catalog = catalogs[language as keyof typeof catalogs];
expect(catalog['app.proxy.description']).toContain(expected.description);
expect(catalog['app.proxy.scope_hint']).toContain(expected.scope);
}
});
});