Add support for GitHub enterprise-managed user accounts
Add support for GitHub enterprise-manage users (EMU) to the GitHub host provider.
Accounts in an 'EMU' enterprise/business are siloed from the regular, public GitHub.com accounts. EMU accounts are identified by the _shortcode suffix, where the shortcode is a moniker for the enterprise/business, for example alice_contoso.
When asked to recall credentials for the GitHub.com host we now attempt to filter stored accounts by the shortcode, given information provided in WWW-Authenticate headers from upcoming versions of Git that support these headers (as of https://github.com/gitgitgadget/git/commit/92c56da09683fa3331668adec073b6769da8f0b7).
The format of the header is:
WWW-Authenticate: Basic realm="GitHub" [domain_hint="X"] [enterprise_hint="Y"]
..where X is the shortcode, and Y is the enterprise name.
If multiple accounts are available for the given 'domain' then we present an account selection prompt. Users can avoid this prompt in the case of multiple user accounts by specifying the desired account in the remote URL (e.g. https://[email protected]/mona/test to always use the alice account).
Note that GitHub.com does not yet return such WWW-Authenticate headers, except always Basic realm="GitHub", so this may be subject to fixes later. In the case of realm="GitHub", i.e., public accounts, there is no change.