Skip to main content

Module browser

Module browser 

Source
Expand description

The browser flow: GitHub’s authorize page, then a one-shot listener on 127.0.0.1 for its redirect to /callback. For an OAuth App with a loopback callback GitHub accepts any port, so the listener takes a free one. The listener uses std::net: it reads one request line on loopback, which needs no HTTP server dependency.

Structs§

Authorize
What the authorize URL carries.

Enums§

Callback
What the browser’s request means.

Constants§

AUTHORIZE_PATH
CALLBACK_PATH

Functions§

authorize_url
GitHub’s authorize page. prompt=select_account lets a person with several GitHub accounts choose one.
page
The small page the browser shows after its redirect.
parse_callback
Reads GET /callback?code=…&state=… against the expected state.
request_target
The request target of an HTTP request line, for GET only.