radicle-heartwood-lfs/crates
Maciek "mab122" Bator ff762ef8f2 Prompt interactively for passphrase instead of requiring RAD_PASSPHRASE
Private-repo LFS operations need a signer capable of ECDH, which
ssh-agent (the normal day-to-day flow after `rad auth`) can't provide --
that's a hard protocol limitation (standard ssh-agent only implements
signing, there's no key-agreement request type), not a gap in our code,
so there's no way to make it work "through the agent" the way signing
does.

Previously the only alternative to an unencrypted keystore was setting
RAD_PASSPHRASE, which breaks the normal ssh-agent-based workflow and
means putting a password in an environment variable -- not ergonomic,
and not how any other `rad` command behaves.

`rad` already has an established fallback for exactly this situation:
`crate::terminal::io::signer` tries ssh-agent first, and if that's
unavailable/unregistered and we're connected to a TTY, prompts
interactively for the passphrase via `inquire` (reusing the existing
`PassphraseValidator`). `lfs_crypto::load_signer` was missing this last
step entirely -- it only tried "unencrypted keystore" then
"RAD_PASSPHRASE" then gave up. Added the same interactive-prompt
fallback, reusing the exact same validator/prompt helpers already used
elsewhere, before falling back to a hard failure.

This covers the common case (an interactive `git commit` triggering the
pre-commit hook, which inherits the terminal's TTY) with no environment
variable needed at all. Only genuinely non-interactive contexts (CI, a
script with no TTY) still need RAD_PASSPHRASE -- and get a fast, clear
failure rather than hanging, since `inquire` returns `Ok(None)` on
`NotTTY` rather than blocking (verified: piping /dev/null as stdin still
fails immediately, not a timeout).

Verified against a real encrypted keystore through an actual pty (via
`script`, since a plain non-interactive shell doesn't have a TTY to
prompt on): the masked "Passphrase:" prompt appears, accepts the typed
passphrase, and produces a correctly encrypted note -- with
RAD_PASSPHRASE unset the entire time.
2026-07-14 17:59:04 +02:00
..
radicle radicle/identity: Tidy up 2026-07-09 16:26:25 +02:00
radicle-cli Prompt interactively for passphrase instead of requiring RAD_PASSPHRASE 2026-07-14 17:59:04 +02:00
radicle-cli-test cli-test: Disable normalizing paths 2026-06-03 11:49:41 +02:00
radicle-cob cob/change_graph: Log Errors 2026-05-28 16:58:55 +01:00
radicle-core core: Release 0.3.0 2026-05-06 21:00:14 +01:00
radicle-crypto crypto: Handle default `SSH_AUTH_SOCK` on Windows 2026-05-26 09:18:07 +02:00
radicle-dag rust/msrv: 1.85.0 → 1.88.0 2026-05-11 11:23:18 +01:00
radicle-fetch fetch: Update gix packages 2026-05-18 14:57:33 +02:00
radicle-git-metadata rust/msrv: 1.85.0 → 1.88.0 2026-05-11 11:23:18 +01:00
radicle-git-ref-format git-ref-format: New crate 2025-10-13 13:34:15 +02:00
radicle-localtime localtime: add description in Cargo.toml 2026-02-20 13:48:14 +00:00
radicle-log log: New crate for logger implementations 2026-05-11 16:44:37 +01:00
radicle-node node/wire: Test connected node removes active fetch 2026-06-22 18:02:57 +01:00
radicle-oid oid: Release 0.2.0 2026-05-06 21:00:14 +01:00
radicle-protocol fetcher: Test removing active fetch from another node 2026-06-22 18:02:57 +01:00
radicle-remote-helper Fix: git fetch rad can never fetch refs/notes/rad-lfs 2026-07-14 17:47:15 +02:00
radicle-schemars schemars: Release 0.8.0 2026-05-06 21:15:54 +01:00
radicle-signals rust/edition/fmt: 2021 → 2024 2026-03-30 16:57:51 +02:00
radicle-systemd systemd: Release 0.13.0 2026-05-06 21:00:14 +01:00
radicle-term Fix NO_COLOR to only suppress colors, not all ANSI styles 2026-06-23 17:23:36 +01:00
radicle-windows rust/edition/fmt: 2021 → 2024 2026-03-30 16:57:51 +02:00