Expand description
Connect with GitHub, desktop side.
The person’s grant to the AgentMux App is made, refreshed and ended through the
broker (muxbus::github_broker), which holds the App’s client secret. This module
is what the service-OAuth flow (oauth_client) and the token path (oauth_tokens)
lean on for a GitHub account:
- a brokered account is one made through the broker; its context says so
(
broker: true) and carries the GitHub user’s numeric id and login; - signed out of AgentMux Cloud there is no broker, so a connect falls back to the device flow with the App’s client id, and the account is not brokered: GitHub won’t refresh its token without the secret, so it asks to be connected again when the 8 hours are up.
Structs§
- Github
Connection - What the broker says about this AgentMux account’s GitHub connection (
github.connection).
Constants§
- PROVIDER
- The provider whose grant is brokered.
Functions§
- client_
id_ override - The AgentMux App’s public client id, for a build that doesn’t ship one yet (and for a developer’s own App). A shipped id replaces this when the App is registered.
- connection_
of - The broker’s word on this account’s GitHub connection, for Connectors.
- display_
name_ for - The label an account shows for who is connected.
- grant_
is_ gone - Whether a connection answer says the grant is gone: revoked on GitHub, blocked, or never made (or ended from another install). Only a clear answer counts; a failure to ask says nothing.
- grant_
json - A grant as a GitHub-shaped token response, so the flow’s last step stores it like any other: the expiry in seconds from now, the numeric id and login, and the marker that the account is brokered. A grant already expired (or about to) is one second from now, never 0: the blob reads 0 as “doesn’t expire”, so it would never be refreshed.
- identity_
in - The id and login in a token response made by
grant_json. - is_
brokered - Whether
accountwas connected through the broker. - owner_
of - Who a brokered account is: the GitHub user’s numeric id and login, as recorded at connect.
- refresh_
blob - A new blob for a brokered account’s refresh token. GitHub’s refresh tokens are single use, so the caller must store what this returns before anything else.
- refresh_
error_ for - What the desktop does about a broker failure during a refresh: the grant is gone (connect again) or it was only a bad moment (try later).
- revoke_
before_ delete - Before a brokered account is deleted: end its grant through the broker, so it
doesn’t live on at GitHub.
{ outcome: "revoked" | "failed", detail? }for the delete’s result, orNonewhen this isn’t a brokered account. - stamp_
context - What the account’s context records about who is connected, and how.
- sync_
connection connection_of, and the brokered accounts whose grant is gone ask to be connected again (the account’s card shows “Reconnect needed”): a grant revoked on GitHub shows as revoked. Nothing is cleared here: an account that works again is made valid by the refresh that proves it.- user_
of_ token - Who a GitHub token belongs to (
GET /user), for a grant the device flow made. - workflows_
allowed - Whether the person let
agentchange CI workflows: the account’s per-agent opt-in (workflows_agents, a list of agent slugs). Off for every agent until it is set.