Support managing OAuth2 applications in the db

Review Request #8630 - Created Jan. 17, 2017 and submitted

Barret Rennie
Review Board
release-3.0.x
eb6e91b...
reviewboard

ReviewBoard now depends on django-oauth-toolkit to provide support as
an OAuth2 identity provider for OAuth2 client applications. This first
patch allows applications to be managed in the database by
administrators. We use our own custom application model to allow
applications to be limited to LocalSites, as well as for attaching
extra data fields to them.

This patch also provides help text for the application form fields, most
of which were missing them.

I was able to create an application in the database successfully.

  • 0
  • 0
  • 31
  • 29
  • 60
Description From Last Updated
Review Bot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/dependencies.py
        reviewboard/oauth/admin.py
        reviewboard/oauth/models.py
        reviewboard/settings.py
        reviewboard/oauth/forms.py
    
    Ignored Files:
        reviewboard/oauth/__init__.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/dependencies.py
        reviewboard/oauth/admin.py
        reviewboard/oauth/models.py
        reviewboard/settings.py
        reviewboard/oauth/forms.py
    
    Ignored Files:
        reviewboard/oauth/__init__.py
    
    
  2. reviewboard/settings.py (Diff revision 1)
     
     
     'django_reset' imported but unused
    
  3. reviewboard/settings.py (Diff revision 1)
     
     
     'from settings_local import *' used; unable to detect undefined names
    
  4. 
      
Barret Rennie
Review Bot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/dependencies.py
        reviewboard/oauth/admin.py
        reviewboard/oauth/models.py
        reviewboard/settings.py
        reviewboard/oauth/forms.py
    
    Ignored Files:
        reviewboard/oauth/__init__.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/dependencies.py
        reviewboard/oauth/admin.py
        reviewboard/oauth/models.py
        reviewboard/settings.py
        reviewboard/oauth/forms.py
    
    Ignored Files:
        reviewboard/oauth/__init__.py
    
    
  2. reviewboard/oauth/forms.py (Diff revision 2)
     
     
     'RelatedUserWidget' imported but unused
    
  3. reviewboard/settings.py (Diff revision 2)
     
     
     'django_reset' imported but unused
    
  4. reviewboard/settings.py (Diff revision 2)
     
     
     'from settings_local import *' used; unable to detect undefined names
    
  5. 
      
Barret Rennie
Review Bot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/dependencies.py
        reviewboard/oauth/admin.py
        reviewboard/oauth/models.py
        reviewboard/settings.py
        reviewboard/oauth/forms.py
    
    Ignored Files:
        reviewboard/oauth/__init__.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/dependencies.py
        reviewboard/oauth/admin.py
        reviewboard/oauth/models.py
        reviewboard/settings.py
        reviewboard/oauth/forms.py
    
    Ignored Files:
        reviewboard/oauth/__init__.py
    
    
  2. reviewboard/settings.py (Diff revision 3)
     
     
     'django_reset' imported but unused
    
  3. reviewboard/settings.py (Diff revision 3)
     
     
     'from settings_local import *' used; unable to detect undefined names
    
  4. 
      
David Trowbridge
  1. 
      
  2. reviewboard/dependencies.py (Diff revision 3)
     
     

    Do we need to limit the version here to ensure compatibility with Django 1.6.x?

    1. Indeed, we can't even use this package -- we have to use an older one.

  3. reviewboard/oauth/admin.py (Diff revision 3)
     
     

    Class docstring?

  4. reviewboard/oauth/forms.py (Diff revision 3)
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     

    This is kind of hard to read. Can we do all the help text on the next line and indented 4 spaces?

  5. reviewboard/oauth/models.py (Diff revision 3)
     
     
     
     
     

    d before o.

  6. reviewboard/oauth/models.py (Diff revision 3)
     
     

    We should have _('Local Site') as the first argument to this to provide a localizable name in the admin.

  7. reviewboard/oauth/models.py (Diff revision 3)
     
     

    Same here with localizable name.

  8. 
      
Barret Rennie
Review Bot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/oauth/forms.py
        reviewboard/dependencies.py
        reviewboard/oauth/admin.py
        reviewboard/oauth/models.py
        reviewboard/oauth/features.py
        reviewboard/features/checkers.py
        reviewboard/oauth/tests.py
    
    Ignored Files:
        reviewboard/templates/admin/oauth/application/change_list.html
        reviewboard/static/rb/css/pages/admin.less
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/oauth/forms.py
        reviewboard/dependencies.py
        reviewboard/oauth/admin.py
        reviewboard/oauth/models.py
        reviewboard/oauth/features.py
        reviewboard/features/checkers.py
        reviewboard/oauth/tests.py
    
    Ignored Files:
        reviewboard/templates/admin/oauth/application/change_list.html
        reviewboard/static/rb/css/pages/admin.less
    
    
  2. reviewboard/oauth/forms.py (Diff revision 4)
     
     
    Col: 80
     E501 line too long (88 > 79 characters)
    
  3. reviewboard/oauth/tests.py (Diff revision 4)
     
     
     'override_feature_check' imported but unused
    
  4. 
      
Barret Rennie
Review Bot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/oauth/forms.py
        reviewboard/dependencies.py
        reviewboard/oauth/admin.py
        reviewboard/oauth/models.py
        reviewboard/oauth/features.py
        reviewboard/features/checkers.py
    
    Ignored Files:
        reviewboard/templates/admin/oauth/application/change_list.html
        reviewboard/static/rb/css/pages/admin.less
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/oauth/forms.py
        reviewboard/dependencies.py
        reviewboard/oauth/admin.py
        reviewboard/oauth/models.py
        reviewboard/oauth/features.py
        reviewboard/features/checkers.py
    
    Ignored Files:
        reviewboard/templates/admin/oauth/application/change_list.html
        reviewboard/static/rb/css/pages/admin.less
    
    
  2. reviewboard/oauth/forms.py (Diff revision 5)
     
     
    Col: 80
     E501 line too long (88 > 79 characters)
    
  3. 
      
Barret Rennie
Review Bot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/oauth/forms.py
        reviewboard/dependencies.py
        reviewboard/oauth/admin.py
        reviewboard/oauth/models.py
        reviewboard/oauth/features.py
        reviewboard/features/checkers.py
    
    Ignored Files:
        reviewboard/templates/admin/oauth/application/change_list.html
        reviewboard/static/rb/css/pages/admin.less
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/oauth/forms.py
        reviewboard/dependencies.py
        reviewboard/oauth/admin.py
        reviewboard/oauth/models.py
        reviewboard/oauth/features.py
        reviewboard/features/checkers.py
    
    Ignored Files:
        reviewboard/templates/admin/oauth/application/change_list.html
        reviewboard/static/rb/css/pages/admin.less
    
    
  2. reviewboard/oauth/forms.py (Diff revision 6)
     
     
    Col: 80
     E501 line too long (88 > 79 characters)
    
  3. reviewboard/oauth/models.py (Diff revision 6)
     
     
    Col: 43
     W291 trailing whitespace
    
  4. 
      
Barret Rennie
Review Bot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/oauth/forms.py
        reviewboard/dependencies.py
        reviewboard/oauth/admin.py
        reviewboard/oauth/models.py
        reviewboard/oauth/features.py
        reviewboard/features/checkers.py
    
    Ignored Files:
        reviewboard/templates/admin/oauth/application/change_list.html
        reviewboard/static/rb/css/pages/admin.less
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/oauth/forms.py
        reviewboard/dependencies.py
        reviewboard/oauth/admin.py
        reviewboard/oauth/models.py
        reviewboard/oauth/features.py
        reviewboard/features/checkers.py
    
    Ignored Files:
        reviewboard/templates/admin/oauth/application/change_list.html
        reviewboard/static/rb/css/pages/admin.less
    
    
  2. reviewboard/oauth/forms.py (Diff revision 7)
     
     
    Col: 80
     E501 line too long (88 > 79 characters)
    
  3. 
      
Barret Rennie
Review Bot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/settings.py
        reviewboard/oauth/forms.py
        reviewboard/dependencies.py
        reviewboard/oauth/admin.py
        reviewboard/oauth/models.py
        reviewboard/oauth/features.py
        reviewboard/features/checkers.py
    
    Ignored Files:
        reviewboard/templates/admin/oauth/application/change_list.html
        reviewboard/oauth/__init__.py
        reviewboard/static/rb/css/pages/admin.less
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/settings.py
        reviewboard/oauth/forms.py
        reviewboard/dependencies.py
        reviewboard/oauth/admin.py
        reviewboard/oauth/models.py
        reviewboard/oauth/features.py
        reviewboard/features/checkers.py
    
    Ignored Files:
        reviewboard/templates/admin/oauth/application/change_list.html
        reviewboard/oauth/__init__.py
        reviewboard/static/rb/css/pages/admin.less
    
    
  2. reviewboard/oauth/forms.py (Diff revision 8)
     
     
    Col: 80
     E501 line too long (88 > 79 characters)
    
  3. reviewboard/oauth/models.py (Diff revision 8)
     
     
    Col: 1
     W391 blank line at end of file
    
  4. reviewboard/settings.py (Diff revision 8)
     
     
     'django_reset' imported but unused
    
  5. reviewboard/settings.py (Diff revision 8)
     
     
     'from settings_local import *' used; unable to detect undefined names
    
  6. 
      
Barret Rennie
Review Bot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/settings.py
        reviewboard/oauth/forms.py
        reviewboard/dependencies.py
        reviewboard/oauth/admin.py
        reviewboard/oauth/models.py
        reviewboard/oauth/features.py
        reviewboard/features/checkers.py
    
    Ignored Files:
        reviewboard/templates/admin/oauth/application/change_list.html
        reviewboard/oauth/__init__.py
        reviewboard/static/rb/css/pages/admin.less
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/settings.py
        reviewboard/oauth/forms.py
        reviewboard/dependencies.py
        reviewboard/oauth/admin.py
        reviewboard/oauth/models.py
        reviewboard/oauth/features.py
        reviewboard/features/checkers.py
    
    Ignored Files:
        reviewboard/templates/admin/oauth/application/change_list.html
        reviewboard/oauth/__init__.py
        reviewboard/static/rb/css/pages/admin.less
    
    
  2. reviewboard/oauth/forms.py (Diff revision 9)
     
     
    Col: 80
     E501 line too long (88 > 79 characters)
    
  3. reviewboard/settings.py (Diff revision 9)
     
     
     'django_reset' imported but unused
    
  4. reviewboard/settings.py (Diff revision 9)
     
     
     'from settings_local import *' used; unable to detect undefined names
    
  5. 
      
Barret Rennie
Review Bot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/settings.py
        reviewboard/dependencies.py
        reviewboard/oauth/admin.py
        reviewboard/oauth/models.py
        reviewboard/oauth/features.py
        reviewboard/oauth/forms.py
    
    Ignored Files:
        reviewboard/templates/admin/oauth/application/change_list.html
        reviewboard/oauth/__init__.py
        reviewboard/static/rb/css/pages/admin.less
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/settings.py
        reviewboard/dependencies.py
        reviewboard/oauth/admin.py
        reviewboard/oauth/models.py
        reviewboard/oauth/features.py
        reviewboard/oauth/forms.py
    
    Ignored Files:
        reviewboard/templates/admin/oauth/application/change_list.html
        reviewboard/oauth/__init__.py
        reviewboard/static/rb/css/pages/admin.less
    
    
  2. reviewboard/oauth/forms.py (Diff revision 10)
     
     
    Col: 80
     E501 line too long (88 > 79 characters)
    
  3. reviewboard/settings.py (Diff revision 10)
     
     
     'django_reset' imported but unused
    
  4. reviewboard/settings.py (Diff revision 10)
     
     
     'from settings_local import *' used; unable to detect undefined names
    
  5. 
      
David Trowbridge
  1. Because we're introducing a new app, we should simultaneously introduce an AppConfig for django 1.7+. The apps in djblets 0.10 have examples.

  2. reviewboard/oauth/forms.py (Diff revision 10)
     
     
     
     
     
     

    Formatting has to happen outside of _()

  3. reviewboard/oauth/forms.py (Diff revision 10)
     
     

    As of Django 1.7, this needs to define either fields or excludes. To match the behavior you have here, use fields = '__all__'

  4. reviewboard/oauth/models.py (Diff revision 10)
     
     

    Please add a Meta here that defines app_label, db_table, and has localized versions of verbose_name and verbose_name_plural

  5. reviewboard/static/rb/css/pages/admin.less (Diff revision 10)
     
     
     
     
     

    Should be indented 2 spaces.

  6. 
      
Barret Rennie
Review Bot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/settings.py
        reviewboard/dependencies.py
        reviewboard/oauth/__init__.py
        reviewboard/oauth/models.py
        reviewboard/oauth/features.py
        reviewboard/oauth/forms.py
        reviewboard/oauth/admin.py
    
    Ignored Files:
        reviewboard/templates/admin/oauth/application/change_list.html
        reviewboard/static/rb/css/pages/admin.less
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/settings.py
        reviewboard/dependencies.py
        reviewboard/oauth/__init__.py
        reviewboard/oauth/models.py
        reviewboard/oauth/features.py
        reviewboard/oauth/forms.py
        reviewboard/oauth/admin.py
    
    Ignored Files:
        reviewboard/templates/admin/oauth/application/change_list.html
        reviewboard/static/rb/css/pages/admin.less
    
    
  2. reviewboard/oauth/forms.py (Diff revision 11)
     
     
    Col: 80
     E501 line too long (88 > 79 characters)
    
  3. reviewboard/settings.py (Diff revision 11)
     
     
     'django_reset' imported but unused
    
  4. reviewboard/settings.py (Diff revision 11)
     
     
     'from settings_local import *' used; unable to detect undefined names
    
  5. 
      
Christian Hammond
  1. This looks great, Barret! Thanks, and sorry it took so long to get around to it.

    My comments just concern typos and very trivial things.

  2. reviewboard/oauth/forms.py (Diff revision 11)
     
     

    This must also return self.cleaned_data.

  3. reviewboard/oauth/forms.py (Diff revision 11)
     
     

    "but it" -> "but"

  4. reviewboard/oauth/forms.py (Diff revision 11)
     
     

    "the are" -> "they are"

  5. reviewboard/oauth/forms.py (Diff revision 11)
     
     

    "users' passwords"

  6. reviewboard/oauth/forms.py (Diff revision 11)
     
     
     
     

    Rather than space-separated, can we include a textarea and make it line-separated?

  7. reviewboard/oauth/forms.py (Diff revision 11)
     
     

    Probably want to say "unchecked" instead of "false", I would guess.

  8. reviewboard/oauth/models.py (Diff revision 11)
     
     

    "is a" -> "is"

  9. Blank line between these.

  10. Should include the name of the block. Makes it easier to see in larger templates.

  11. 
      
Barret Rennie
Review Bot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/settings.py
        reviewboard/dependencies.py
        reviewboard/oauth/__init__.py
        reviewboard/oauth/models.py
        reviewboard/oauth/features.py
        reviewboard/oauth/forms.py
        reviewboard/oauth/admin.py
        reviewboard/oauth/apps.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/settings.py
        reviewboard/dependencies.py
        reviewboard/oauth/__init__.py
        reviewboard/oauth/models.py
        reviewboard/oauth/features.py
        reviewboard/oauth/forms.py
        reviewboard/oauth/admin.py
        reviewboard/oauth/apps.py
    
    
  2. reviewboard/oauth/forms.py (Diff revision 12)
     
     
    Col: 80
     E501 line too long (88 > 79 characters)
    
  3. reviewboard/settings.py (Diff revision 12)
     
     
     'django_reset' imported but unused
    
  4. reviewboard/settings.py (Diff revision 12)
     
     
     'from settings_local import *' used; unable to detect undefined names
    
  5. 
      
Christian Hammond
  1. Trivial stuff. I'm happy after this.

  2. reviewboard/oauth/forms.py (Diff revision 12)
     
     
     

    Missing "Returns."

  3. reviewboard/oauth/forms.py (Diff revision 12)
     
     

    You can wrap before the <. It's valid.

  4. reviewboard/oauth/forms.py (Diff revision 12)
     
     

    Minor thing, but technically you should get cleaned_data from this, modify that, and return it directly, instead of using self.cleaned_data. In practice, it doesn't matter really, since it's set by the base Form.clean(), but worth doing.

  5. 
      
Barret Rennie
Review Bot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/settings.py
        reviewboard/dependencies.py
        reviewboard/oauth/__init__.py
        reviewboard/oauth/models.py
        reviewboard/oauth/features.py
        reviewboard/oauth/forms.py
        reviewboard/oauth/admin.py
        reviewboard/oauth/apps.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/settings.py
        reviewboard/dependencies.py
        reviewboard/oauth/__init__.py
        reviewboard/oauth/models.py
        reviewboard/oauth/features.py
        reviewboard/oauth/forms.py
        reviewboard/oauth/admin.py
        reviewboard/oauth/apps.py
    
    
  2. reviewboard/settings.py (Diff revision 13)
     
     
     'django_reset' imported but unused
    
  3. reviewboard/settings.py (Diff revision 13)
     
     
     'from settings_local import *' used; unable to detect undefined names
    
  4. 
      
David Trowbridge
  1. 
      
  2. reviewboard/oauth/apps.py (Diff revision 13)
     
     

    File doc comment?

  3. reviewboard/oauth/forms.py (Diff revision 13)
     
     
     

    This should use ugettext instead of ugettext_lazy.

  4. reviewboard/oauth/models.py (Diff revision 13)
     
     

    Localized field name?

  5. reviewboard/settings.py (Diff revision 13)
     
     
     
     

    Having random blank lines in the middle of this list when there aren't comments is weird. Can we clean that up?

  6. 
      
Barret Rennie
Review Bot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/settings.py
        reviewboard/dependencies.py
        reviewboard/oauth/__init__.py
        reviewboard/oauth/models.py
        reviewboard/oauth/features.py
        reviewboard/oauth/forms.py
        reviewboard/oauth/admin.py
        reviewboard/oauth/apps.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/settings.py
        reviewboard/dependencies.py
        reviewboard/oauth/__init__.py
        reviewboard/oauth/models.py
        reviewboard/oauth/features.py
        reviewboard/oauth/forms.py
        reviewboard/oauth/admin.py
        reviewboard/oauth/apps.py
    
    
  2. reviewboard/settings.py (Diff revision 14)
     
     
     'django_reset' imported but unused
    
  3. reviewboard/settings.py (Diff revision 14)
     
     
     'from settings_local import *' used; unable to detect undefined names
    
  4. 
      
David Trowbridge
  1. 
      
  2. reviewboard/oauth/apps.py (Diff revision 14)
     
     

    Blank line after this.

  3. 
      
Barret Rennie
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (9826566)
Loading...