[OAuth2Provider] Add webAPI end point for user to remove OAuth2 token from My Account page
Review Request #7964 — Created Feb. 15, 2016 and discarded
A new webAPI end point is added for user to GET and DELETE a OAuth2 token given OAuth2 token ID. The webAPI is meant to be called from My Account for user to remove a OAuth2 token.
Command run: python ./tests/runtests.py reviewboard.webapi.tests.test_oauth2_token
Test GET for list of OAuth2 token
Test GET and DELETE for OAuth2 tokenThis a copy from test_api_token
Description | From | Last Updated | ||
---|---|---|---|---|
'json' imported but unused |
![]() |
|||
'ValidationError' imported but unused |
![]() |
|||
'ObjectDoesNotExist' imported but unused |
![]() |
|||
'_' imported but unused |
![]() |
|||
'webapi_response_errors' imported but unused |
![]() |
|||
'webapi_request_fields' imported but unused |
![]() |
|||
'webapi_login_required' imported but unused |
![]() |
|||
'NOT_LOGGED_IN' imported but unused |
![]() |
|||
'DOES_NOT_EXIST' imported but unused |
![]() |
|||
'PERMISSION_DENIED' imported but unused |
![]() |
|||
'INVALID_FORM_DATA' imported but unused |
![]() |
|||
'resources' imported but unused |
![]() |
|||
'Application' imported but unused |
![]() |
|||
'oauth2_token_item_mimetype' imported but unused |
![]() |
|||
Col: 1 E302 expected 2 blank lines, found 1 |
![]() |
|||
oauth2_provider is an outside module, so should belong in the same import group, in alphabetical order. |
|
|||
Same import group. |
|
|||
This seems to be missing a _get_queryset. It'd need one in order to limit results to the user, and to … |
|
|||
Blank line between these. |
|
|||
This is an outside module, so it should be part of the next import group. |
|
|||
Make sure things are in alphabetical order. |
|
|||
No need for parens. |
|
|||
Indented too far. |
|
|||
We don't put one argument per line. Ends up being pretty long this way. Same below. |
|
|||
Same line, no trailing comma, since this is a function call. |
|
|||
Blank line between these. |
|
|||
Same line, no comma. |
|
|||
Blank line between these. Same below. |
|
|||
Col: 18 E711 comparison to None should be 'if cond is None:' |
![]() |
|||
Col: 20 E711 comparison to None should be 'if cond is None:' |
![]() |
|||
Col: 24 E711 comparison to None should be 'if cond is None:' |
![]() |
|||
Col: 49 E128 continuation line under-indented for visual indent |
![]() |
|||
Col: 18 E711 comparison to None should be 'if cond is None:' |
![]() |
|||
Col: 20 E711 comparison to None should be 'if cond is None:' |
![]() |
|||
Col: 24 E711 comparison to None should be 'if cond is None:' |
![]() |
|||
Col: 49 E128 continuation line under-indented for visual indent |
![]() |
|||
There are no open issues |
- Change Summary:
-
Add UnitTest
- Testing Done:
-
~ I am still figuring out how to test an webAPI endpoint
~ Command run: python ./tests/runtests.py reviewboard.webapi.tests.test_oauth2_token
+ + Test GET for list of OAuth2 token
+ Test GET and DELETE for OAuth2 token + + This a copy from test_api_token
- Diff:
-
Revision 2 (+229 -23)

-
Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_oauth2_token.py reviewboard/webapi/resources/oauth2_token.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/user.py Ignored Files: reviewboard/static/rb/js/accountPrefsPage/views/oauth2TokensView.js reviewboard/static/rb/js/resources/models/oauth2TokenModel.js Tool: Pyflakes Processed Files: reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_oauth2_token.py reviewboard/webapi/resources/oauth2_token.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/user.py Ignored Files: reviewboard/static/rb/js/accountPrefsPage/views/oauth2TokensView.js reviewboard/static/rb/js/resources/models/oauth2TokenModel.js
-
-
-
- Change Summary:
-
Update reviewbot
- Diff:
-
Revision 3 (+231 -23)

-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_oauth2_token.py reviewboard/webapi/resources/oauth2_token.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/user.py Ignored Files: reviewboard/static/rb/js/accountPrefsPage/views/oauth2TokensView.js reviewboard/static/rb/js/resources/models/oauth2TokenModel.js Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_oauth2_token.py reviewboard/webapi/resources/oauth2_token.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/user.py Ignored Files: reviewboard/static/rb/js/accountPrefsPage/views/oauth2TokensView.js reviewboard/static/rb/js/resources/models/oauth2TokenModel.js
-
The first couple of files just remove stuff from prior changes. Instead, you should update the prior changes to remove the code there, so that each change is a cohesive unit.
-
oauth2_provider
is an outside module, so should belong in the same import group, in alphabetical order. -
-
This seems to be missing a
_get_queryset
. It'd need one in order to limit results to the user, and to do permission checking, like other resources that are children of the user resource. -
-
-
-
-
-
-
-
-
-
- Change Summary:
-
Update CR
- Diff:
-
Revision 4 (+284)

-
Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_oauth2_token.py reviewboard/webapi/resources/oauth2_token.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/user.py Ignored Files: reviewboard/static/rb/js/resources/models/oauth2TokenModel.js Tool: Pyflakes Processed Files: reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_oauth2_token.py reviewboard/webapi/resources/oauth2_token.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/user.py Ignored Files: reviewboard/static/rb/js/resources/models/oauth2TokenModel.js
-
-
-
-
- Change Summary:
-
Update pep8; Remove wip status
- Summary:
-
[OAuth2Provider] [WIP] Add webAPI end point for user to remove OAuth2 token from My Account page[OAuth2Provider] Add webAPI end point for user to remove OAuth2 token from My Account page
- Diff:
-
Revision 5 (+284)

-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_oauth2_token.py reviewboard/webapi/resources/oauth2_token.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/user.py Ignored Files: reviewboard/static/rb/js/resources/models/oauth2TokenModel.js Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_oauth2_token.py reviewboard/webapi/resources/oauth2_token.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/user.py Ignored Files: reviewboard/static/rb/js/resources/models/oauth2TokenModel.js
-
-
-
-
- Change Summary:
-
Update pep8; Not sure why the previous never commited
- Diff:
-
Revision 6 (+284)

-
Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_oauth2_token.py reviewboard/webapi/resources/oauth2_token.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/user.py Ignored Files: reviewboard/static/rb/js/resources/models/oauth2TokenModel.js Tool: Pyflakes Processed Files: reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_oauth2_token.py reviewboard/webapi/resources/oauth2_token.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/user.py Ignored Files: reviewboard/static/rb/js/resources/models/oauth2TokenModel.js