Skip to main content

Module signin_ops

Module signin_ops 

Source
Expand description

identity.signin.* (spec §4.4, D6): signing in an account on this machine for an agent somewhere else. The provider’s own login runs here, under an account directory srv mints; the caller gets the link and the session, and later the account’s id and email, and never a token or a path. The caller shows the link where the person is reading, and the credentials stay on this machine. A session belongs to the caller that started it, as the transport proved it (slug@machine): another caller can’t read it or finish it.

Structs§

Login 🔒
A provider this op can sign in. Its login command is a frontend catalog entry, so the ones whose command is known here are listed. A person who signs in on another machine can’t be sent back to a callback on this one, so a provider whose browser flow ends in one (codex) uses the device code flow instead: a link and a one-time code, nothing to hand back.
SessionParams 🔒
StartParams 🔒

Constants§

DEFAULT_PROVIDER 🔒
FINISH_WAIT 🔒
LINK_WAIT 🔒
How long start waits for the CLI to print its link, and finish for the sign-in to end.
LOGINS 🔒
MAX_OWNED 🔒
Sessions this machine remembers a caller for; the oldest go first.
POLL_EVERY 🔒

Statics§

OWNERS 🔒
Who started each session (and in which session manager), so only that caller reads or finishes it.

Functions§

bad 🔒
failed 🔒
finish 🔒
Wait for the sign-in to end: the login finishes on its own once the person has authorized in a browser, or takes the code they were shown (code) when the browser can’t finish it.
login_for 🔒
manager_key 🔒
Identifies the session manager that holds a session: one per srv.
notice 🔒
Show a sign-in link as a notice here, because the person is on this machine: route on the machine of the agent that asked sends it to the one that has a window focused.
owned_by 🔒
poll_until 🔒
Poll until done says stop or wait passes; the last status seen.
remember 🔒
start 🔒
Start signing in an account on this machine, and give back the link for the person.
view 🔒
The session’s state as the caller sees it. An account’s id and email appear once it is signed in.