Skip to content

Migrate code to latest RestSharp version #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 31, 2020

Conversation

haldyr
Copy link

@haldyr haldyr commented May 26, 2020

This PR is complementary to gitextensions/gitextensions#8123

OAuth2Authenticator is obsolete now, rewriten to new AuthenticatorBase. I looked to RestSharp repo before and after and my change should be 1:1 as before. I tested this change in GitExtensions with "Plugins > GitHub" and created token successfully.

ExecuteGetTaskAsync was renamed to ExecuteGetAsync.

OAuth2Authenticator is obsolete now
ExecuteGetTaskAsync was renamed to ExecuteGetAsync
@RussKie RussKie requested a review from pmiossec May 27, 2020 10:22
request.AddHeader("Authorization", "bearer " + AccessToken);
protected override Parameter GetAuthenticationParameter(string accessToken)
{
return new Parameter("Authorization", "bearer " + Token, ParameterType.HttpHeader);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question. Is there a reason to use Token instead of the parameter accessToken that seems to contains the same value?
If not, for readability, I would use accesToken instead...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it does the same thing and agree accessToken is more readable

@gerhardol gerhardol merged commit 3ebf19b into gitextensions:master May 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants