ExportConfig returns a password-encrypted RESULTPROXY2: payload. The password is enforced server-side (>= config.MinPasswordLength). UI must prompt the user; sending an empty / short string returns config.ErrPasswordTooShort.
(password string)
| 1306 | // prompt the user; sending an empty / short string returns |
| 1307 | // config.ErrPasswordTooShort. |
| 1308 | func (a *App) ExportConfig(password string) (string, error) { |
| 1309 | if a.config == nil { |
| 1310 | return "", fmt.Errorf("config manager not initialized") |
| 1311 | } |
| 1312 | cfg := a.config.GetConfig() |
| 1313 | result, err := config.ExportConfig(cfg, password) |
| 1314 | if err != nil { |
| 1315 | // Warn-level: password validation failures are part of normal UX, |
| 1316 | // not bugs. The user-facing error message comes from the sentinel. |
| 1317 | a.log.Warning(fmt.Sprintf("Ошибка экспорта: %v", err)) |
| 1318 | return "", err |
| 1319 | } |
| 1320 | a.log.Success("Конфигурация экспортирована (зашифровано)") |
| 1321 | return result, nil |
| 1322 | } |
| 1323 | |
| 1324 | // ImportConfig accepts both RESULTPROXY2: (password required) and the legacy |
| 1325 | // RESULTPROXY: prefix (no password — surfaced with a warning). |
nothing calls this directly
no test coverage detected