MCPcopy Create free account
hub / github.com/AandStep/ResultV / ExportConfig

Method ExportConfig

app.go:1308–1322  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

1306// prompt the user; sending an empty / short string returns
1307// config.ErrPasswordTooShort.
1308func (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).

Callers

nothing calls this directly

Calls 4

ExportConfigFunction · 0.92
SuccessMethod · 0.80
WarningMethod · 0.65
GetConfigMethod · 0.45

Tested by

no test coverage detected