-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Update OAuth Token operations to new APIs #2116
Conversation
Per ['Deprecating OAuth Application API'](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/) the HTTP API endpoints called by CheckApplicationAuthentication, ResetApplicationAuthentication and RevokeApplicationAuthentication are being deprecated. This PR updates those APIs to call the new HTTP API endpoints as documented at the above link. * Details Amend CheckApplicationAuthentication, ResetApplicationAuthentication and RevokeApplicationAuthentication to create an object containing the OAuth access token and to call the single arg version of ApiUrls.ApplicationAuthorization. The object is used as the request body. Amend CheckApplicationAuthentication to use POST. Amend ResetApplicationAuthentication to use PATCH. Remove the two arg version of ApiUrls.ApplicationAuthorization as it is no longer called. Amend the single arg version to use the new API path. Amend unit tests to account for the above changes.
Codecov Report
@@ Coverage Diff @@
## master #2116 +/- ##
==========================================
+ Coverage 66.96% 66.98% +0.01%
==========================================
Files 542 542
Lines 14228 14239 +11
==========================================
+ Hits 9528 9538 +10
- Misses 4700 4701 +1
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick PR @MGudgin!
Just one thing about asserting the change works as expected...
Add a check to the unit tests to verify that the request payload contains an access_token field with the expected value.
Thanks for this @MGudgin! Feel free to open other issues or PRs if you wanted to improve this area. |
release_notes: In preparation for the Deprecating OAuth Application API brownout and eventual removal on July 1 2020 we have updated the client internals to ensure we are calling the supported endpoint well in advance |
Per 'Deprecating OAuth Application API'
the HTTP API endpoints called by CheckApplicationAuthentication,
ResetApplicationAuthentication and RevokeApplicationAuthentication are
being deprecated.
This PR updates those APIs to call the new HTTP API endpoints as
documented at the above link.
Details
Amend CheckApplicationAuthentication, ResetApplicationAuthentication and
RevokeApplicationAuthentication to create an object containing the OAuth
access token and to call the single arg version of
ApiUrls.ApplicationAuthorization. The object is used as the request
body.
Amend CheckApplicationAuthentication to use POST.
Amend ResetApplicationAuthentication to use PATCH.
Remove the two arg version of ApiUrls.ApplicationAuthorization as it is
no longer called. Amend the single arg version to use the new API path.
Amend unit tests to account for the above changes.