Skip to main content

Module pin_ask

Module pin_ask 

Source
Expand description

Agents ask_pin_change (POST /api/v1/agent/pin-ask): an agent asks the person to move or forget one pin, and the person answers with one click on a card in that agent’s own pane (backend::pin_asks).

An agent that acts on its own can only accept a key the hosting install vouches for (pins::agent_adopt); every other change is the person’s. This is how the person’s decision reaches an agent that was given the work: nothing about the change comes from the agent’s words but its reason. srv reads the pin and what was refused for it, builds the card from them, and keeps it. The answer is pins.ask.answer, which only the AgentMux window can send; it names the ask by id and carries nothing else, so what changes is what the card showed. srv checks it all again when the person allows: the pin must still be the one that was shown, and the key or install refused for the name the one that was shown. A no, a timeout and a closed window all leave the pin as it is. forget without a card stays the window’s alone.

The pin log (logs/pin-changes.log) names the agent that asked and says the person confirmed it; the audit log has the ask under the agent and the answer under the person.

Structs§

AskRequest 🔒
Shown 🔒
The pin and what is refused for it, as srv holds them now, in the words of the card.

Constants§

AUDIT_ALLOW 🔒
AUDIT_ASK 🔒
The audit entry’s action for an ask, and for the person’s two answers.
AUDIT_DECLINE 🔒
MAX_REASON 🔒
The longest reason an agent may give, in characters.
ONLY_THE_PERSON_ANSWERS 🔒
What a caller is told when it is not the window.

Functions§

answer 🔒
The person’s answer to one ask: taken once, by its id, and applied exactly as the card showed it.
apply 🔒
What the person allowed, applied as srv holds the pin now: refused if it is not what the card showed.
ask 🔒
Where an ask for the change stands, asking the person when they have not been asked.
audit 🔒
Records an ask under the agent that made it, or an answer under the person (by is None).
clean_reason 🔒
A reason on one line, with no control characters; refused when empty or long.
describe 🔒
What the person would be shown for this request, from srv’s own record; refused when the pin or the refused key is not what the agent saw.
handle_pin_ask 🔒
how_of 🔒
internal 🔒
pin_changed 🔒
Ends the asks for a pin that just changed, whichever way it did.
pin_now 🔒
The pin now (a key’s fingerprint, or an install’s label), and the install it is bound to.
publish_asks 🔒
Tells every window the asks now waiting.
register
stale 🔒