pub struct App {
pub client_id: String,
pub client_secret: String,
pub default_user: String,
pub redirect_uri: String,
pub oauth2_tokens: BTreeMap<String, Token>,
pub oauth1_token: Option<Token>,
pub bearer_token: Option<Token>,
pub unnamed_oauth2_token: Option<Token>,
}Expand description
Credentials and tokens for a single registered X API application.
One App corresponds to one X API client (one client_id /
client_secret pair); it holds every OAuth2 user token authorized
against that app keyed by username, plus optional OAuth1 and bearer
tokens. The token store carries an arbitrary number of apps and a
default_app name; the --app NAME flag selects between them.
Fields§
§client_id: StringOAuth2 client ID issued by X for this app.
client_secret: StringOAuth2 client secret paired with Self::client_id.
default_user: StringDefault OAuth2 username for this app. When non-empty, lookups
without an explicit username prefer this entry over arbitrary-first.
redirect_uri: StringStored OAuth2 redirect URI override; empty means “fall through to
REDIRECT_URI env or the built-in default”.
oauth2_tokens: BTreeMap<String, Token>OAuth2 user tokens, keyed by username (the value returned by
/2/users/me, or the explicit name passed to xr auth oauth2 NAME).
oauth1_token: Option<Token>OAuth1 token for this app, if any.
bearer_token: Option<Token>Bearer token for this app, if any.
unnamed_oauth2_token: Option<Token>Salvage slot for an OAuth2 token whose /2/users/me lookup failed
during exchange. Lets the token-exchange path persist the access
token rather than discarding it when the username cannot be
resolved.