[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 |
reviewbot | |
'ValidationError' imported but unused |
reviewbot | |
'ObjectDoesNotExist' imported but unused |
reviewbot | |
'_' imported but unused |
reviewbot | |
'webapi_response_errors' imported but unused |
reviewbot | |
'webapi_request_fields' imported but unused |
reviewbot | |
'webapi_login_required' imported but unused |
reviewbot | |
'NOT_LOGGED_IN' imported but unused |
reviewbot | |
'DOES_NOT_EXIST' imported but unused |
reviewbot | |
'PERMISSION_DENIED' imported but unused |
reviewbot | |
'INVALID_FORM_DATA' imported but unused |
reviewbot | |
'resources' imported but unused |
reviewbot | |
'Application' imported but unused |
reviewbot | |
'oauth2_token_item_mimetype' imported but unused |
reviewbot | |
Col: 1 E302 expected 2 blank lines, found 1 |
reviewbot | |
oauth2_provider is an outside module, so should belong in the same import group, in alphabetical order. |
chipx86 | |
Same import group. |
chipx86 | |
This seems to be missing a _get_queryset. It'd need one in order to limit results to the user, and to … |
chipx86 | |
Blank line between these. |
chipx86 | |
This is an outside module, so it should be part of the next import group. |
chipx86 | |
Make sure things are in alphabetical order. |
chipx86 | |
No need for parens. |
chipx86 | |
Indented too far. |
chipx86 | |
We don't put one argument per line. Ends up being pretty long this way. Same below. |
chipx86 | |
Same line, no trailing comma, since this is a function call. |
chipx86 | |
Blank line between these. |
chipx86 | |
Same line, no comma. |
chipx86 | |
Blank line between these. Same below. |
chipx86 | |
Col: 18 E711 comparison to None should be 'if cond is None:' |
reviewbot | |
Col: 20 E711 comparison to None should be 'if cond is None:' |
reviewbot | |
Col: 24 E711 comparison to None should be 'if cond is None:' |
reviewbot | |
Col: 49 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 18 E711 comparison to None should be 'if cond is None:' |
reviewbot | |
Col: 20 E711 comparison to None should be 'if cond is None:' |
reviewbot | |
Col: 24 E711 comparison to None should be 'if cond is None:' |
reviewbot | |
Col: 49 E128 continuation line under-indented for visual indent |
reviewbot |
- 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