Skip to main content

Module linked_accounts

Module linked_accounts 

Source
Expand description

Accounts elsewhere a person links to who they are in a workspace: their Discord account in a workspace bridged to a Discord server, say.

A connector keeps the workspace’s record (the bridged server) and publishes actions on it that any member may ask the workspace’s host to run for themselves (tilo_actions::MEMBER_OWN_TAG), which the profile card and Settings use the same way for every service:

  • a read, READ_ACTION, answering a Reading: whether the workspace is connected to the service at all, the reader’s linked account if any, and the actions below;
  • the connect action, when the host offers signing in with the service, answering a LinkStart: the service’s consent page, which sends the person back to the workspace’s host and from there to Tilo with a one-time link token;
  • the offer read and the accept action, which take such a token (from the consent page’s return, or from a button the service’s side handed out): the read answers the account it offers (OfferReading), the accept links it;
  • the unlink action.

The workspace’s host runs them: the connector’s code stays there, and the page or shell only asks, through a host’s WorkspaceRecordActions. WorkspaceAccounts asks the workspace’s connectors (connector_apps) for the read and keeps what it learns as LinkedAccounts; a host lends it to the panels that show them as LinkedAccounts.

Structs§

AccountName
How a service names an account: its unique name, and the name it shows when that is another.
LinkStart
What the connect action answers: the service’s consent page to go to.
LinkedAccount
One service the workspace is connected to, and the person’s account there.
LinkedAccounts
A host’s LinkedAccountsHost, as it lends it to a panel. The default has none: no service, and asking does nothing.
LinkingRecheck
Asks again while a panel shows the accounts:
OfferReading
What the offer read answers: the account a link token offers.
ProfileLink
A linked account as the person’s profile names it to everyone: the service, the handle there, and the account’s picture when the service has one for it.
Reading
A connector’s answer to READ_ACTION.
WorkspaceAccounts
Linked accounts read from a workspace’s records by its host, through a WorkspaceRecordActions. A link token the page came with is kept here, on this device, until it is used up or declined.

Enums§

LinkState
Where a person’s account with one service stands.

Constants§

LINKING_RECHECK
How often a panel waiting on the workspace’s host asks again.
OFFER_TRIES
How many times a link token’s offer is asked for before the panel says why it found none. Coming back from a consent page, the workspace’s host records the offer a moment after the page arrives.
READ_ACTION
The read action a connector’s workspace record publishes, answering a Reading for the person who reads it.
UNANSWERED_RETRIES
How many times a shown panel that knows no service yet asks again, at LINKING_RECHECK doubling each time, before it waits to be opened anew.

Traits§

LinkedAccountsHost
What shows and changes a person’s linked accounts in a workspace. Asking never waits: what comes of it shows in Self::accounts once the workspace’s host answered, and Self::revision moves.
WorkspaceRecordActions
How a host asks the workspace’s host to run an action of a workspace record for the person, on the web and natively alike.

Functions§

connector_apps
Of workspace_apps, the apps whose workspace record the workspace holds, those that may publish the read (READ_ACTION): connectors, which bridge a service elsewhere and so run on the workspace’s host (its secret store, its worker), never in the person’s desktop. An app the desktop runs itself (runs_here) publishes no reading, and asking its record would only have the host open it to answer that it has no such action.
service_icon
The mark a connected service’s buttons carry, by its connector’s app id: Discord’s own, a link for any other.
service_name_icon
The glyph of a service by the name a profile gives it (“Discord”).

Type Aliases§

ActionAnswer
The answer to one action the workspace’s host ran.