Expand description
The one-trip first connect with GitHub, desktop side: the relay half.
GitHub’s install page takes no redirect_uri, so after the person installs the App and
authorizes it, GitHub sends the browser to the App’s first callback URL: the cloud relay’s hosted
page /github-callback. The page hands {code, installation_id, setup_action} to the relay under
the SHA-256 of the install state the broker issued; this module registers that trip before the
browser opens and polls for the outcome. The code goes to the broker, which holds the App’s
client secret and checks the state is one this account was issued; nothing here reads it.
The poll key is the hash, never the state itself, so a poll address in a log is no use to anyone.
Enums§
- Polled
- What the relay answered to a poll.
Constants§
- CALLBACK_
PATH - Where the relay’s hosted page is, and where GitHub is told to send the browser.
Functions§
- callback_
uri - The address the install page’s callback lands on.
- parse_
poll - Reads a poll’s answer. Anything the relay should not send is read as “ask again”, never as a code.
- poll_
once - Ask the relay once. A network error or a server error reads as “not yet”: the caller asks again.
- register
- Tell the relay a trip is coming, before the browser opens (a flow nobody registered is refused).
- relay_
key - The relay’s key for a trip: the SHA-256 hex of the install
state.