Skip to main content

Module tokens

Module tokens 

Source
Expand description

Where an account token lands on the machine that will be the account.

didbot register and didbot operate both end with a session for the account they created, and didbot-oauth reads one back through env::ACCOUNT_TOKEN_FILE. One file per account, holding the token and nothing else, so the path is the whole hand-off.

Behind the tokens feature, which the crates that store one turn on. The didbot dispatcher links this crate for the flag grammar and the verb table, and a router that can reach a credential writer is a reach nothing asks it for.

Constants§

SERVICE
The directory under the state base that a host’s daemon owns.

Functions§

account_token_file
The file the token for the account named name is kept in, under state.
default_state_dir
The state directory a process with no super::env::STATE uses.
hand_off
The one line a command prints about a stored token: how to hand it to didbot-oauth.
state_dir
The state directory: super::env::STATE when set, else $XDG_STATE_HOME/didbot/agentd, else ~/.local/state/didbot/agentd, and the current directory for a process with none of them.
store_account_token
Writes token for name under state, readable by this user alone, and returns the file’s path.