beads/internal
Sam 7e4da9ab20
Add credentials file support for Dolt server passwords (#2854)
* feat: add credentials file support for Dolt server passwords

Add INI-style credentials file (~/.config/beads/credentials) as a
fallback for Dolt server passwords, keyed by [host:port] section.
This lets users working with multiple servers avoid juggling env vars
per project.

Lookup order: BEADS_DOLT_PASSWORD env var > credentials file > empty.
Path overridable via BEADS_CREDENTIALS_FILE env var.
Warns on overly permissive file permissions (unix only, mirrors ssh).

* docs: document credentials file in DOLT.md

Add credentials file section to the Dolt backend docs covering file
format, default location, permission warnings, and password resolution
order. Update the config reference and env var table to reference the
new feature.

* fix: use resolved runtime port for credentials file lookup

The credential file lookup in GetDoltServerPassword() used the port
from metadata.json, but the actual connection port comes from
doltserver.DefaultConfig() which has its own priority chain (port file >
config.yaml > metadata.json). When these diverge — e.g., IAP tunnel on
3308 vs local Dolt on 3307 — the credentials file lookup used the wrong
[host:port] section.

Add GetDoltServerPasswordForPort() that accepts an explicit port, and
use it in main.go where the resolved runtime port is already known.
Existing GetDoltServerPassword() delegates to the new method for
backward compatibility.

* fix: use mysql.Config.FormatDSN for proper password escaping

Passwords with special characters (& < > / % etc.) were inserted raw
into the DSN string, breaking go-sql-driver/mysql parsing. Passwords
like "zId&z,L9P4X,%k4n4rylGV<Ibos9<)/p" would cause "Access denied"
errors even though the password was correct.

Switch from manual fmt.Sprintf DSN construction to mysql.Config's
FormatDSN(), which handles escaping correctly. This also consolidates
timeout and TLS configuration into the typed Config struct instead of
string concatenation.

* test: add DSN special character password roundtrip tests

Covers passwords with &, <, >, /, ?, %, @, :, and () — all of which
broke the old fmt.Sprintf DSN construction. Verifies that FormatDSN
produces a parseable DSN and the password survives the roundtrip.
2026-04-02 20:35:56 -07:00
..
ado fix: recognize ado:NNNNN shorthand in IsExternalRef and ExtractIdentifier (#2966) 2026-04-02 19:20:30 -07:00
audit Enforce .beads/ directory permissions at runtime 2026-03-30 09:15:49 -07:00
beads fix(beads): detect embeddeddolt/ directory in database discovery (#2909) 2026-03-30 07:12:32 -07:00
compact fix(ci): get nightly full tests passing (#2835) 2026-03-26 09:52:03 -07:00
config feat: move hook firing into storage layer via decorator (#2891) 2026-03-31 14:32:01 -07:00
configfile Add credentials file support for Dolt server passwords (#2854) 2026-04-02 20:35:56 -07:00
debug chore: unexport 14 dead symbols across 8 packages 2026-02-07 09:24:22 -08:00
doltserver fix: use strconv.ParseBool for env var parsing in IsAutoStartDisabled (#2956) 2026-04-02 19:23:04 -07:00
formula fix: include convoy-type formulas in bd formula list text output 2026-03-30 06:45:14 -07:00
git feat: add --list and --doc flags to bd help for CLI doc generation (GH#2527) 2026-03-11 18:25:40 -07:00
github fix: recognize ado:NNNNN shorthand in IsExternalRef and ExtractIdentifier (#2966) 2026-04-02 19:20:30 -07:00
gitlab fix: recognize ado:NNNNN shorthand in IsExternalRef and ExtractIdentifier (#2966) 2026-04-02 19:20:30 -07:00
hooks fix: increase TestRun_Async polling timeout to 10s (bd-ldi) 2026-02-28 23:11:46 -08:00
idgen fix(idgen): correct test vectors in hash_test.go 2025-12-19 18:13:56 -08:00
jira feat: add SlotSet/SlotGet/SlotClear to Storage interface (#2870) 2026-04-02 19:25:18 -07:00
linear fix: address PR review feedback 2026-03-30 09:15:55 -07:00
lockfile chore: remove daemon infrastructure (lockfile, activity signal) (bd-9u8zd) 2026-02-18 19:05:31 -08:00
molecules /{cmd,internal}: update global store to be interface 2026-03-17 13:26:17 -07:00
notion feat: reimplement Notion sync on REST data sources (fix-merge PR #2759) 2026-03-27 19:20:40 -07:00
query fix: allow colons in unquoted query identifier values 2026-03-14 05:02:22 +00:00
recipes Enforce .beads/ directory permissions at runtime 2026-03-30 09:15:49 -07:00
remotecache feat: add remote URL support to multi-repo hydration (PR #2827) 2026-03-26 19:31:40 -07:00
routing Fix init leaving beads.role unset in edge cases (GH#2950) (#2964) 2026-04-01 17:00:41 -07:00
storage Add credentials file support for Dolt server passwords (#2854) 2026-04-02 20:35:56 -07:00
telemetry feat: add SlotSet/SlotGet/SlotClear to Storage interface (#2870) 2026-04-02 19:25:18 -07:00
templates/agents fix(init): replace 'bd onboard' references with 'bd prime' in AGENTS.md (#2902) 2026-03-30 10:42:50 -07:00
testutil /{go,internal}: bump driver and dolt version in tests 2026-03-26 11:52:40 -07:00
timeparsing chore: unexport 14 dead symbols across 8 packages 2026-02-07 09:24:22 -08:00
tracker fix: remove dead rig routing code and unused variable after rebase 2026-03-30 09:23:01 -07:00
types feat: add spike, story, and milestone as first-class issue types (#2923) 2026-04-02 20:28:44 -07:00
ui Merge pull request #2814 from harry-miller-trimble/feat/tracker-hardening-and-core 2026-03-30 20:41:05 -07:00
utils cleanup: remove daemon infrastructure remnants (GH#2431) 2026-03-10 15:24:27 -07:00
validation refactor: remove gastown/Gas Town string references from beads code and docs (bd-1ue8) 2026-03-20 18:39:50 -07:00