I found myself duplicating the logic in GitHub.credentials(), clearly this logic should be generalized.
<rdar://problem/74801487>
Created attachment 421693 [details] Patch
rs=me
Created attachment 421702 [details] Patch for landing
Committed r273585: <https://commits.webkit.org/r273585> All reviewed patches have been landed. Closing bug and clearing flags on attachment 421702 [details].