Skip to main content

Module askpass

Module askpass 

Source
Expand description

askpass mode: ssh runs $SSH_ASKPASS "<prompt>" and reads the answer on stdout. When AgentMux runs ssh for an agent it points SSH_ASKPASS here and sets AGENTMUX_ASKPASS_SECRET on that ssh only; this asks srv (POST /api/v1/askpass), which shows the prompt to the user, and prints their answer. The secret, not anything here, decides whose prompt it is (srv’s backend::remote::askpass).

Recognised before clap runs: ssh passes the prompt as the only argument, with no subcommand.

Constants§

ANSWER_TIMEOUT 🔒
Longer than srv waits for the user (two minutes), so srv’s own answer, or its “not answered”, is what arrives.
ENV_SECRET 🔒
SUBCOMMANDS 🔒
bashwrap’s own subcommands: never an askpass call, even if the variable was inherited by something run under that ssh.

Functions§

askpass_prompt
The prompt, when this run is ssh asking: the secret is set and the arguments are not a bashwrap subcommand.
run_if_asked
Run askpass mode if this is an askpass call: Some(exit code) (0 with the answer on stdout, 1 when there is none), None to carry on as bashwrap.