[OAuth2Provider] Added API and resource in front end to manage OAuth2 client apps

Review Request #7993 — Created Feb. 23, 2016 and discarded

Information

Review Board
master

Reviewers

This patch add full API support to get lists of OAuth2 client app,
get, update or delete a single app instance or create a new one.
User can also operate those operation through the webUI at My account
page.

Ran python ./tests/runtests.py reviewboard.webapi.tests.test_oauth2_client_app

Test DELETE, GET, PUT on single item
Test GET, POST on list endpoint

Description From Last Updated

These should probably be rolled up into the change introducing this code. Same with all other relevant code.

chipx86chipx86

Should be "number".

chipx86chipx86

Blank line between these.

chipx86chipx86

Should be "string".

chipx86chipx86

No trailing comma.

chipx86chipx86

Should be rolled up into the change that introduces this.

chipx86chipx86

No trailing comma.

chipx86chipx86

No need for this. Instead, pass a this parameter to ready, and you'll be able to use this within the …

chipx86chipx86

Space before {.

chipx86chipx86

Please make sure you're following the proper styles and types for all these.

chipx86chipx86

You can't call gettext() on a variable. Only on literal strings. The saveButtonText and title values passed in must use …

chipx86chipx86

Blank line between these.

chipx86chipx86

Space before ( and after ).

chipx86chipx86

No trailing comma.

chipx86chipx86

Can't call gettext() on a variable.

chipx86chipx86

You can just bind to this._cancel.

chipx86chipx86

Should be more descriptive, like _onConfirmCancelClicked. Also, callback handlers should go after any other private functions.

chipx86chipx86

Multi-line comments must be in the form of: /* * line * line */ Also, these are wrapping too early.

chipx86chipx86

Indentation is wrong on the secnod line. Must indent only 4 spaces. Same below.

chipx86chipx86

Should be _$clientIdField. No capital C.

chipx86chipx86

This is too long. Instead, wrap like: this._$authorizationGrantTypeField = this._$selectAUthorizationGrantType.bindProperty( ...);

chipx86chipx86

Space before (.

chipx86chipx86

Should be something like _onSaveAppClicked.

chipx86chipx86

Blank line between these.

chipx86chipx86

This should all be done directly in render.

chipx86chipx86

This should probably be rolled back into the change introducing this.

chipx86chipx86

No trailing comma.

chipx86chipx86

No trailing comma.

chipx86chipx86

No trailing comma.

chipx86chipx86

Col: 80 E501 line too long (84 > 79 characters)

reviewbotreviewbot

Should all be in the same import group, in alphabetical order.

chipx86chipx86

These should not be in the same import group.

chipx86chipx86

'webapi_check_local_site' imported but unused

reviewbotreviewbot

Blank line between these.

chipx86chipx86

Col: 80 E501 line too long (92 > 79 characters)

reviewbotreviewbot

We probably want a has_list_access_permissions that prevents anyone but this user from accessing these apps.

chipx86chipx86

This should go into more detail about how to use this resource. This will be directly used in our online …

chipx86chipx86

Col: 27 E251 unexpected spaces around keyword / parameter equals

reviewbotreviewbot

No comma, since this is a function call.

chipx86chipx86

"client" This should also go into further details on the kind of updates that are allowed.

chipx86chipx86

Col: 80 E501 line too long (81 > 79 characters)

reviewbotreviewbot

Each keyword argument should actually be a keyword argument on the function, defaulting to None.

chipx86chipx86

Col: 80 E501 line too long (80 > 79 characters)

reviewbotreviewbot

Missing docs.

chipx86chipx86

Blank line between these.

chipx86chipx86

Each keyword argument should actually be a keyword argument on the function.

chipx86chipx86

Blank line between these.

chipx86chipx86

Blank line between these.

chipx86chipx86

Blank line between these.

chipx86chipx86

'timezone' imported but unused

reviewbotreviewbot

Col: 80 E501 line too long (80 > 79 characters)

reviewbotreviewbot

Col: 80 E501 line too long (80 > 79 characters)

reviewbotreviewbot

Col: 80 E501 line too long (85 > 79 characters)

reviewbotreviewbot

Col: 80 E501 line too long (86 > 79 characters)

reviewbotreviewbot

Col: 80 E501 line too long (80 > 79 characters)

reviewbotreviewbot

Col: 80 E501 line too long (83 > 79 characters)

reviewbotreviewbot

Col: 80 E501 line too long (86 > 79 characters)

reviewbotreviewbot

Col: 5 E303 too many blank lines (2)

reviewbotreviewbot

Col: 69 W292 no newline at end of file

reviewbotreviewbot

Col: 80 E501 line too long (80 > 79 characters)

reviewbotreviewbot

Col: 80 E501 line too long (80 > 79 characters)

reviewbotreviewbot

Col: 80 E501 line too long (80 > 79 characters)

reviewbotreviewbot
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/user.py
        reviewboard/webapi/resources/__init__.py
        reviewboard/accounts/forms/pages.py
        reviewboard/webapi/resources/oauth2_client_app.py
    
    Ignored Files:
        reviewboard/templates/accounts/oauth2_client_application.html
        reviewboard/static/rb/js/resources/models/oauth2ClientAppModel.js
        reviewboard/static/rb/js/accountPrefsPage/views/oauth2ClientAppsView.js
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/user.py
        reviewboard/webapi/resources/__init__.py
        reviewboard/accounts/forms/pages.py
        reviewboard/webapi/resources/oauth2_client_app.py
    
    Ignored Files:
        reviewboard/templates/accounts/oauth2_client_application.html
        reviewboard/static/rb/js/resources/models/oauth2ClientAppModel.js
        reviewboard/static/rb/js/accountPrefsPage/views/oauth2ClientAppsView.js
    
    
  2. Show all issues
    Col: 80
     E501 line too long (84 > 79 characters)
    
  3. Show all issues
     'webapi_check_local_site' imported but unused
    
  4. Show all issues
    Col: 80
     E501 line too long (92 > 79 characters)
    
  5. Show all issues
    Col: 27
     E251 unexpected spaces around keyword / parameter equals
    
  6. Show all issues
    Col: 80
     E501 line too long (81 > 79 characters)
    
  7. Show all issues
    Col: 80
     E501 line too long (80 > 79 characters)
    
  8. 
      
chipx86
  1. 
      
  2. reviewboard/accounts/forms/pages.py (Diff revision 1)
     
     
     
    Show all issues

    These should probably be rolled up into the change introducing this code. Same with all other relevant code.

  3. Show all issues

    Should be "number".

  4. Show all issues

    Blank line between these.

  5. Show all issues

    Should be "string".

  6. Show all issues

    No trailing comma.

  7. Show all issues

    Should be rolled up into the change that introduces this.

  8. Show all issues

    No trailing comma.

  9. Show all issues

    No need for this. Instead, pass a this parameter to ready, and you'll be able to use this within the callback function.

    Like:

    this.model.resource.ready({
        ready: function() {
            ...
        }
    }, this);
    
  10. Show all issues

    Space before {.

  11. Show all issues

    Please make sure you're following the proper styles and types for all these.

  12. Show all issues

    You can't call gettext() on a variable. Only on literal strings. The saveButtonText and title values passed in must use gettext().

  13. Show all issues

    Blank line between these.

  14. Show all issues

    Space before ( and after ).

  15. Show all issues

    No trailing comma.

  16. Show all issues

    Can't call gettext() on a variable.

  17. Show all issues

    You can just bind to this._cancel.

  18. Show all issues

    Should be more descriptive, like _onConfirmCancelClicked.

    Also, callback handlers should go after any other private functions.

  19. Show all issues

    Multi-line comments must be in the form of:

    /*
     * line
     * line
     */
    

    Also, these are wrapping too early.

  20. Show all issues

    Indentation is wrong on the secnod line. Must indent only 4 spaces.

    Same below.

  21. Show all issues

    Should be _$clientIdField. No capital C.

  22. Show all issues

    This is too long. Instead, wrap like:

    this._$authorizationGrantTypeField =
        this._$selectAUthorizationGrantType.bindProperty(
            ...);
    
  23. Show all issues

    Space before (.

  24. Show all issues

    Should be something like _onSaveAppClicked.

  25. Show all issues

    Blank line between these.

  26. Show all issues

    This should all be done directly in render.

  27. Show all issues

    This should probably be rolled back into the change introducing this.

  28. Show all issues

    No trailing comma.

  29. Show all issues

    No trailing comma.

  30. Show all issues

    No trailing comma.

  31. reviewboard/webapi/resources/oauth2_client_app.py (Diff revision 1)
     
     
     
     
     
     
     
    Show all issues

    Should all be in the same import group, in alphabetical order.

  32. Show all issues

    These should not be in the same import group.

  33. Show all issues

    Blank line between these.

  34. reviewboard/webapi/resources/oauth2_client_app.py (Diff revision 1)
     
     
     
     
     
     
     
     
     
    Show all issues

    We probably want a has_list_access_permissions that prevents anyone but this user from accessing these apps.

  35. Show all issues

    This should go into more detail about how to use this resource. This will be directly used in our online docs.

  36. Show all issues

    No comma, since this is a function call.

  37. Show all issues

    "client"

    This should also go into further details on the kind of updates that are allowed.

  38. reviewboard/webapi/resources/oauth2_client_app.py (Diff revision 1)
     
     
     
     
     
     
     
    Show all issues

    Each keyword argument should actually be a keyword argument on the function, defaulting to None.

  39. Show all issues

    Missing docs.

  40. Show all issues

    Blank line between these.

  41. Show all issues

    Each keyword argument should actually be a keyword argument on the function.

    1. Using kwargs seem much easier to maintain since we only need to pass **kwargs

  42. Show all issues

    Blank line between these.

  43. Show all issues

    Blank line between these.

  44. Show all issues

    Blank line between these.

  45. 
      
LE
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/tests/urls.py
        reviewboard/webapi/resources/__init__.py
        reviewboard/webapi/resources/oauth2_client_app.py
        reviewboard/webapi/resources/oauth2_token.py
        reviewboard/webapi/tests/test_oauth2_client_app.py
        reviewboard/webapi/tests/mimetypes.py
        reviewboard/webapi/resources/user.py
    
    Ignored Files:
        reviewboard/static/rb/js/resources/models/oauth2ClientAppModel.js
        reviewboard/static/rb/js/accountPrefsPage/views/oauth2ClientAppsView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/tests/urls.py
        reviewboard/webapi/resources/__init__.py
        reviewboard/webapi/resources/oauth2_client_app.py
        reviewboard/webapi/resources/oauth2_token.py
        reviewboard/webapi/tests/test_oauth2_client_app.py
        reviewboard/webapi/tests/mimetypes.py
        reviewboard/webapi/resources/user.py
    
    Ignored Files:
        reviewboard/static/rb/js/resources/models/oauth2ClientAppModel.js
        reviewboard/static/rb/js/accountPrefsPage/views/oauth2ClientAppsView.js
    
    
  2. Show all issues
     'timezone' imported but unused
    
  3. Show all issues
    Col: 80
     E501 line too long (80 > 79 characters)
    
  4. Show all issues
    Col: 80
     E501 line too long (80 > 79 characters)
    
  5. Show all issues
    Col: 80
     E501 line too long (85 > 79 characters)
    
  6. Show all issues
    Col: 80
     E501 line too long (86 > 79 characters)
    
  7. Show all issues
    Col: 80
     E501 line too long (80 > 79 characters)
    
  8. Show all issues
    Col: 80
     E501 line too long (83 > 79 characters)
    
  9. Show all issues
    Col: 80
     E501 line too long (86 > 79 characters)
    
  10. Show all issues
    Col: 5
     E303 too many blank lines (2)
    
  11. Show all issues
    Col: 69
     W292 no newline at end of file
    
  12. 
      
LE
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/tests/urls.py
        reviewboard/webapi/resources/__init__.py
        reviewboard/webapi/resources/oauth2_client_app.py
        reviewboard/webapi/resources/oauth2_token.py
        reviewboard/webapi/tests/test_oauth2_client_app.py
        reviewboard/webapi/tests/mimetypes.py
        reviewboard/webapi/resources/user.py
    
    Ignored Files:
        reviewboard/static/rb/js/resources/models/oauth2ClientAppModel.js
        reviewboard/static/rb/js/accountPrefsPage/views/oauth2ClientAppsView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/tests/urls.py
        reviewboard/webapi/resources/__init__.py
        reviewboard/webapi/resources/oauth2_client_app.py
        reviewboard/webapi/resources/oauth2_token.py
        reviewboard/webapi/tests/test_oauth2_client_app.py
        reviewboard/webapi/tests/mimetypes.py
        reviewboard/webapi/resources/user.py
    
    Ignored Files:
        reviewboard/static/rb/js/resources/models/oauth2ClientAppModel.js
        reviewboard/static/rb/js/accountPrefsPage/views/oauth2ClientAppsView.js
    
    
  2. Show all issues
    Col: 80
     E501 line too long (80 > 79 characters)
    
  3. Show all issues
    Col: 80
     E501 line too long (80 > 79 characters)
    
  4. Show all issues
    Col: 80
     E501 line too long (80 > 79 characters)
    
  5. 
      
brennie
Review request changed
Status:
Discarded