feat: add session authorization mode configuration (#446)
Add approvals.mode configuration to allow users to enable/disable session operation authorization. Mode can be 'off' (no auth) or 'manual' (require auth). Changes trigger automatic gateway restart for config to take effect. - Add ApprovalConfig type with mode: 'off' | 'manual' - Add approvals section to settings store - Add session authorization toggle in SessionSettings UI - Add approvals to PLATFORM_SECTIONS for auto-restart - Add i18n support for all 8 languages Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,7 @@ import { saveEnvValue } from '../../services/config-helpers'
|
||||
const PLATFORM_SECTIONS = new Set([
|
||||
'telegram', 'discord', 'slack', 'whatsapp', 'matrix',
|
||||
'weixin', 'wecom', 'feishu', 'dingtalk',
|
||||
'approvals',
|
||||
])
|
||||
|
||||
const configPath = () => getActiveConfigPath()
|
||||
@@ -95,7 +96,12 @@ async function readConfig(): Promise<Record<string, any>> {
|
||||
async function writeConfig(data: Record<string, any>): Promise<void> {
|
||||
const cp = configPath()
|
||||
await copyFile(cp, cp + '.bak')
|
||||
const yamlStr = YAML.dump(data, { lineWidth: -1, noRefs: true, quotingType: '"', forceQuotes: false })
|
||||
const yamlStr = YAML.dump(data, {
|
||||
lineWidth: -1,
|
||||
noRefs: true,
|
||||
quotingType: '"',
|
||||
forceQuotes: true, // Force quotes on all string values
|
||||
})
|
||||
await writeFile(cp, yamlStr, 'utf-8')
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user