Repository navigation
Conversation
`hsh tunnel ls` prints each connection's fixed credentials as a ready-to-paste client command, sourced from the daemon. The dashboard shares those templates and now renders them from the daemon's record too, replacing a shell-username guess that produced commands which could not connect. �� Generated with Mister Maluco Co-Authored-By: MisterMal <teskeslab@lucasteske.dev>
PR Summary by QodoDEP-142: Show tunnel credentials in connection commands
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
Code Review by Qodo
1.
|
A daemon predating the credentials field omits username/password, and TunnelClient casts the response without validating, so the fields are undefined at runtime. The templates interpolated them directly, printing "PGPASSWORD=undefined psql -U undefined". Each subtype now falls back to its credential-free form, which prompts instead. Also capitalise the product name in prose comments. Reported by Qodo on the pull request. �� Generated with Mister Maluco Co-Authored-By: MisterMal <teskeslab@lucasteske.dev>
|
Thanks Qodo — pushed c1c60ef. Finding 2 (invalid commands without credentials) was a real bug. Confirmed before fixing: a daemon predating the credentials field omits Each subtype now falls back to its credential-free form, which prompts instead of failing: Guarded with Added 10 regression tests covering both shapes per subtype: no Finding 1 (product naming) fixed — the two prose references now say Hoop; Typecheck clean, 466 pass. The one failure ( |
Thanks for the update. The fixes address both items: finding 1 is resolved with the corrected |
Description
hsh tunnel lsnow prints each connection's fixed credentials as a ready-to-paste client command, sourced from the daemon.Requires the daemon-side change in hoophq/hoop#1722, which adds
username/passwordto/v1/connectionsand — more importantly — makes those credentials actually work. Until that lands, the fields come back empty andlsrenders as it does today.Changes
src/commands/tunnel.ts—renderConnectionsprints a connect command per row, plus a one-line note that the credentials are local to the tunnel. The note is suppressed when no listed connection has credentials, so a list oftcpconnections doesn't advertise a login that doesn't exist.src/dashboard/commands.ts—renderCommandtakes the daemon's credentials instead of guessing. It previously interpolated the shell-level username (psql -U $(whoami)), which produced commands that could not connect. Now shared bytunnel lsand the dashboard's "Copy command" button.src/dashboard/server.ts—/api/commands/:subtypelooks the connection up in the daemon's snapshot and renders from that record; removed the now-deaduserNameplumbing. AddedhttpproxytoKNOWN_SUBTYPES(it was already tunnelable server-side).src/tunnel/types.ts—username/passwordonConnection;httpproxyadded toConnectionSubtype.Example output
How to test
bun run typecheck bun testtests/dashboard.test.tspins the per-client credential syntax (each tool takes them differently —PGPASSWORD=,-p<pass>glued,-P <pass>), that/api/commandsrenders from the daemon record rather than the shell user, and thattcpcarries no credentials.Full suite: 456 pass, 1 fail —
ssh-askpass integration: non-Hoop passthrough, which fails identically on a clean tree and is unrelated.Notes
Those credentials are placeholders, not secrets: the agent's protocol proxy accepts them locally and re-authenticates upstream with the connection's stored credentials. Printing them is the point — the user should never have to hunt for real ones.
Automated by MisterMal