[Approved] RFR: Query GitHub for current user when using PAT
Robin Westberg
rwestberg at openjdk.org
Wed Nov 20 12:48:04 UTC 2019
On Tue, 19 Nov 2019 14:22:58 GMT, Erik Helin <ehelin at openjdk.org> wrote:
> Hi all,
>
> please review this patch that queries GitHub for the current user when using a PAT as credentials with `GitHubHost.java`. The reason for this is that some credentials manager, in particular Git Credential Manager on Windows, always seems to return "PersonalAccessToken" as the username when calling `git credential fill`. The fix is simple, just query the [/user](https://developer.github.com/v3/users/#get-the-authenticated-user) endoint instead of [/users](https://developer.github.com/v3/users/#get-a-single-user).
>
> Thanks,
> Erik
>
> ## Testing
> - Manual testing with `git pr` and PAT on Linux x64 _with_ a bogus username in credential store.
>
> ----------------
>
> Commits:
> - 6a472c74: Query GitHub for current user when using PAT
>
> Changes: https://git.openjdk.java.net/skara/pull/258/files
> Webrev: https://webrevs.openjdk.java.net/skara/258/webrev.00
> Stats: 8 lines in 1 file changed: 7 ins; 0 del; 1 mod
> Patch: https://git.openjdk.java.net/skara/pull/258.diff
> Fetch: git fetch https://git.openjdk.java.net/skara pull/258/head:pull/258
Looks good!
----------------
Approved by rwestberg (Reviewer).
PR: https://git.openjdk.java.net/skara/pull/258
More information about the skara-dev
mailing list