refactor: pass secrets as values, fetched once per scope (#713)

* refactor: pass secrets as values, fetched once per scope

A master key travelled through five layers of function values and three
sync.Once guarded reuse; holding each secret where its scope lives shows
where it comes from. Only the keychain prompt still waits for first use.

* docs(rfcs): fetch secrets per extraction, not per record
This commit is contained in:
Roger authored and GitHub committed 2026-11-22 23:52:12 +08:00
1 parent a734e777a8
commit f36790d4dd
41 files changed
+285 -388

No files matched your search

+4 -1
View File
@@ -42,10 +42,13 @@ func newDumpCommand() *cobra.Command {
}
func runDump(ctx context.Context, stderr io.Writer, flags app.DumpFlags, keychain, firefox passwordFlags) error {
options, err := app.ValidateDump(flags, keychainPasswordFunc(keychain, os.Stdin), firefoxPasswordFunc(firefox, os.Stdin))
options, err := app.ValidateDump(flags, keychainPasswordFunc(keychain, os.Stdin))
if err != nil {
return err
}
if options.FirefoxPrimaryPassword, err = readFirefoxPassword(ctx, firefox, os.Stdin); err != nil {
return err
}
discovery, summary, err := app.Dump(ctx, options)
if err != nil {
return err