The design RFCs describe the code as it is rather than contrasting it with v1.1.0, the migration roadmap is gone, and the technique RFCs use the current masterkey.Locator / RetrieveAll / internal/abe names instead of the deleted types and paths. Docs only; techniques unchanged.
9.0 KiB
RFC-010: Dependencies
Every dependency is justified or dropped. The bar: a dependency earns its place only if replacing it with stdlib would cost materially more than the dependency costs us (in audit surface, license, and Go-1.20 compatibility). The tool runs on evidence machines and goes on stage — the dependency list is part of the audit story.
Direct dependencies — keep / drop / pin
| Module | Decision | Rationale |
|---|---|---|
modernc.org/sqlite v1.31.1 |
KEEP, pinned | Pure-Go SQLite; no cgo, so cross-compilation stays trivial. v1.32+ needs Go 1.21. Wrapped by internal/sqlitex. |
github.com/spf13/cobra + pflag |
KEEP | Command tree and flags; the frozen CLI surface is defined with them. Confined to cmd/. |
github.com/inconshreveable/mousetrap |
KEEP | Detects a launch from Explorer (double-click) so cmd/ can hide the console and skip cobra's double-click guard; already required by cobra. |
github.com/tidwall/gjson v1.18.0 |
KEEP, pinned | Read-only JSON probing of browser files (Local State, Bookmarks, Secure Preferences) without full unmarshal. v1.19+ needs Go 1.23. |
github.com/syndtr/goleveldb |
KEEP | LevelDB reader for Local/Session Storage. No stdlib equivalent. |
github.com/moond4rk/binarycookies |
KEEP | First-party; Safari cookie format. MIT. |
github.com/moond4rk/plist |
KEEP | First-party fork of howett.net/plist; Safari plists. BSD-3 — keep Howett's notice. |
github.com/moond4rk/keychainbreaker |
KEEP | First-party; macOS keychain files. Apache-2.0. Behind keychain and masterkey (darwin); the Safari extractor uses only its record type. |
github.com/godbus/dbus/v5 + ppacher/go-dbus-keyring |
KEEP | Linux Secret Service access. BSD. Behind masterkey (linux). |
golang.org/x/sys v0.30.0 |
KEEP, pinned | Windows syscalls for DPAPI, locked-file copy, and the ABE bridge. Behind winapi and abe. Later releases raise the go directive above 1.20. |
golang.org/x/term v0.29.0 |
KEEP, pinned | No-echo password prompt (RFC-009). v0.30+ needs Go 1.23. |
github.com/otiai10/copy |
DROP | It links golang.org/x/sync into every binary, and its Windows build imports testing and the github.com/otiai10/mint assertion library from non-test code, so both ship in the release exe. Every call already goes through one wrapper; a ~50-line copier in internal/snapshot (files, directories, skip list) replaces it. |
github.com/stretchr/testify |
KEEP (test-only) | Assertions in tests; never linked into the binary. |
golang.org/x/text needs no action: HBD does not import it and it is not linked into the binary. It stays in go.mod as // indirect only because goleveldb's test dependencies require it (go mod why -m golang.org/x/text), so dropping it is not something HBD code can do.
Indirect dependencies
The modernc.org/* set (libc, memory, mathutil, …) comes in through modernc.org/sqlite and rides its pin. go-humanize, golang-lru/v2, uuid, go-isatty, go-strftime, bigfft, snappy, tidwall/match + pretty, go.yaml.in/yaml/v3, x/sync, x/tools, x/text are transitive. otiai10/copy and otiai10/mint are gone, and go mod tidy under the Go 1.20 toolchain leaves the go directive at 1.20.
The Go 1.20 discipline
go mod tidyandgo mod verifymust be run with the go@1.20 toolchain (per project CLAUDE.md), or a transitive dependency silently bumps thegodirective and breaks the Windows 7 build.- Any candidate dependency is checked for its own
godirective before adoption. A library requiring 1.21+ is disqualified regardless of merit. - Dependabot's ignore rules (
.github/dependabot.yml) hold every pin above; a new pin gets its rule in the same PR. - CI must not follow
go.mod: withgo-version-file: go.mod, a bump that raised thegodirective would make CI install the newer Go and pass. Every workflow pinsgo-version: '1.20.x'instead, and lint fails whengo.modsays anything butgo 1.20or gains atoolchainline (RFC-011).
License hygiene
The project is MIT; the shipped binary links only permissively licensed modules. The policy is an allowlist — MIT, BSD-2-Clause, BSD-3-Clause, Apache-2.0, ISC — applied to the modules actually linked into a release binary (go list -deps per GOOS) and kept by review; an automated release check is DEFERRED. The linked set is MIT (gjson and the tidwall helpers, binarycookies, go-humanize, go-isatty, go-strftime), BSD (modernc, goleveldb, godbus, go-dbus-keyring, plist, snappy, uuid, bigfft, pflag, the x/ modules), and Apache-2.0 (cobra, mousetrap, keychainbreaker). golang-lru/v2 (MPL-2.0) is in the module graph but not linked, and must stay unlinked.
BSD and Apache-2.0 require their notices in binary distributions, so each release archive ships a THIRD_PARTY_NOTICES file generated from the linked modules' license files.
Net effect
Drop otiai10/copy (and with it x/sync from every binary and testing + mint from the Windows exe); make every Go-1.20 pin explicit; keep everything else. The result is a dependency list short enough to read aloud and defend — which is the goal for a showcased tool.